X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=ABM2%2FEngine%2FInputTask.h;h=6f8cb43f1e36cc670e08ccde68f1308c20a2da28;hb=c061b990133dad2567d2dbb029e4b17c912ad857;hp=e3363f6137fd0d791d33f76bc098587664135cf9;hpb=0835c5605c80efd286ccb7eff92fffc07689f359;p=matthijs%2FABM2.git diff --git a/ABM2/Engine/InputTask.h b/ABM2/Engine/InputTask.h index e3363f6..6f8cb43 100755 --- a/ABM2/Engine/InputTask.h +++ b/ABM2/Engine/InputTask.h @@ -10,29 +10,32 @@ #endif // _MSC_VER > 1000 #include "engine.h" +#include "Amaltheia/Input.h" +#ifdef WIN32 #define DIRECTINPUT_VERSION 0x0800 #include +#endif // WIN32 class CInputTask : public ITask { public: - CInputTask(); + CInputTask(CKernel* kernel); virtual ~CInputTask(); bool Start(); void Update(); void Stop(); - - static BYTE keys[256], oldKeys[256]; + /* XXX: Yuck, static crapjes */ + static BYTE *keys, *oldKeys; //static CMMPointer > oldKeys; - //static int keyCount; + static int keyCount; static int dX,dY; static unsigned int buttons; static unsigned int oldButtons; - static bool inline curKey(int index) { return (keys[index] & 0x80) != 0; } - static bool inline oldKey(int index) { return (oldKeys[index] & 0x80) != 0; } + static bool inline curKey(int index) { return (keys[index]) != 0; } + static bool inline oldKey(int index) { return (oldKeys[index]) != 0; } //some helper functions to make certain things easier //static bool inline keyDown(int index) { return ( curKey(index))&&(!oldKey(index)); } @@ -50,9 +53,11 @@ public: //static bool inline mouseStillUp(int button) { return (!curMouse(button))&&(!oldMouse(button)); } AUTO_SIZE; +#ifdef WIN32 private: LPDIRECTINPUT8 din; // the pointer to our DirectInput interface LPDIRECTINPUTDEVICE8 dinkeyboard; // the pointer to the keyboard device +#endif }; #endif // !defined(AFX_KEYBOARDTASK_H__4953EF06_7C18_4433_B590_47E045E43576__INCLUDED_)