From 7b2567924b9b86961cd4c07b76653f49939cab1c Mon Sep 17 00:00:00 2001 From: Kester Maddock Date: Sat, 16 Oct 2004 11:41:50 +0000 Subject: Switch fixed time system. Logic updates should now happen at 30Hz, physics at 60Hz. (By default, use Python to set.) Some actuators still run at framerate (IPO, Action) for nice smooth animation, and an excuse to buy high end hardware. Keyboard sensors can now hook escape key. Ctrl-Break can be used from within blender if you've forgotten an end game actuator. Fixed a stupid bug preventing some actuators working (like TrackTo). --- source/gameengine/GamePlayer/common/GPC_KeyboardDevice.cpp | 7 ++++++- source/gameengine/GamePlayer/common/GPC_KeyboardDevice.h | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'source/gameengine/GamePlayer') diff --git a/source/gameengine/GamePlayer/common/GPC_KeyboardDevice.cpp b/source/gameengine/GamePlayer/common/GPC_KeyboardDevice.cpp index 71e20bfe35d..6b6f619f820 100644 --- a/source/gameengine/GamePlayer/common/GPC_KeyboardDevice.cpp +++ b/source/gameengine/GamePlayer/common/GPC_KeyboardDevice.cpp @@ -81,7 +81,7 @@ bool GPC_KeyboardDevice::ConvertEvent(int incode, int val) if (val > 0) { - if (kxevent == SCA_IInputDevice::KX_ESCKEY && val != 0) + if (kxevent == SCA_IInputDevice::KX_ESCKEY && val != 0 && !m_hookesc) result = true; // todo: convert val ?? @@ -125,3 +125,8 @@ bool GPC_KeyboardDevice::ConvertEvent(int incode, int val) } return result; } + +void GPC_KeyboardDevice::HookEscape() +{ + m_hookesc = true; +} diff --git a/source/gameengine/GamePlayer/common/GPC_KeyboardDevice.h b/source/gameengine/GamePlayer/common/GPC_KeyboardDevice.h index 678200b62d9..da3dc2398dd 100644 --- a/source/gameengine/GamePlayer/common/GPC_KeyboardDevice.h +++ b/source/gameengine/GamePlayer/common/GPC_KeyboardDevice.h @@ -58,9 +58,11 @@ protected: * System dependent keyboard codes are stored as ints. */ std::map m_reverseKeyTranslateTable; + bool m_hookesc; public: GPC_KeyboardDevice() + : m_hookesc(false) { } @@ -81,6 +83,8 @@ public: } virtual bool ConvertEvent(int incode, int val); + + virtual void HookEscape(); }; #endif // _GPC_KEYBOARDDEVICE_H -- cgit v1.2.3