From: Matthijs Kooijman Date: Mon, 11 Jun 2007 08:04:53 +0000 (+0200) Subject: * Ifdef away most of InputTask to make it compile. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=54095309978b21c4dc407e7b5d8aca4ad5c1bee3;p=matthijs%2FABM2.git * Ifdef away most of InputTask to make it compile. --- diff --git a/ABM2/Engine/InputTask.cpp b/ABM2/Engine/InputTask.cpp index 5fd261d..ed50c77 100755 --- a/ABM2/Engine/InputTask.cpp +++ b/ABM2/Engine/InputTask.cpp @@ -11,7 +11,7 @@ #pragma comment (lib, "dinput8.lib") #pragma comment (lib, "dxguid.lib") -#endif WIN32 +#endif // WIN32 ////////////////////////////////////////////////////////////////////// // Construction/Destruction @@ -27,9 +27,9 @@ int CInputTask::dY=0; unsigned int CInputTask::buttons=0; unsigned int CInputTask::oldButtons=0; -#ifdef WIN32 CInputTask::CInputTask() { +#ifdef WIN32 din = NULL; dinkeyboard = NULL; memset(keys, 0, 256); @@ -47,21 +47,26 @@ CInputTask::CInputTask() // set the control you will have over the keyboard dinkeyboard->SetCooperativeLevel(hWnd, DISCL_NONEXCLUSIVE | DISCL_FOREGROUND); +#endif // WIN32 } CInputTask::~CInputTask() { +#ifdef WIN32 if (dinkeyboard != NULL) { dinkeyboard->Unacquire(); dinkeyboard->Release(); } if (din != NULL) din->Release(); +#endif // WIN32 } bool CInputTask::Start() { +#ifdef WIN32 dinkeyboard->Acquire(); +#endif // WIN32 // keys=SDL_GetKeyState(&keyCount); @@ -73,10 +78,12 @@ bool CInputTask::Start() void CInputTask::Update() { +#ifdef WIN32 dinkeyboard->Acquire(); memcpy(oldKeys, keys, 256*sizeof(BYTE)); dinkeyboard->GetDeviceState(256, (LPVOID)keys); +#endif // WIN32 // SDL_PumpEvents(); // oldButtons=buttons; // buttons=SDL_GetRelativeMouseState(&dX,&dY); @@ -91,4 +98,3 @@ void CInputTask::Stop() memset(keys, 0, 256); memset(oldKeys, 0, 256); } -#endif // WIN32 diff --git a/ABM2/Makefile b/ABM2/Makefile index d420363..b3c5f6e 100644 --- a/ABM2/Makefile +++ b/ABM2/Makefile @@ -1,5 +1,5 @@ CFLAGS:=-I. -OBJS:=main.o Engine/Log.o SchemeReader.o Engine/Settings.o Engine/mmanager.o Engine/Kernel.o Engine/ProfileLogHandler.o Engine/VideoUpdate.o Engine/GlobalTimer.o Engine/SoundTask.o Engine/profiler.o Playground.o +OBJS:=main.o Engine/Log.o SchemeReader.o Engine/Settings.o Engine/mmanager.o Engine/Kernel.o Engine/ProfileLogHandler.o Engine/VideoUpdate.o Engine/GlobalTimer.o Engine/SoundTask.o Engine/profiler.o Playground.o Engine/InputTask.o all: $(OBJS)