Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-08-22 18:19:27 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-08-22 18:19:27 +0400
commitf08a4c9719ac3d745dfcbae3acc3ca48c38777ad (patch)
treeb2c43fa3dcdf6214892a760ae4767436af541486
parenta4f3f5c23c4201bc885310aa17226d2ee3922a2a (diff)
missed this in last commit. keyboard event manager was stored twice.
-rw-r--r--source/gameengine/GameLogic/SCA_KeyboardSensor.cpp15
-rw-r--r--source/gameengine/GameLogic/SCA_KeyboardSensor.h2
2 files changed, 7 insertions, 10 deletions
diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
index f8ee8ed8b41..a5581f0d987 100644
--- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
+++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
@@ -51,7 +51,6 @@ SCA_KeyboardSensor::SCA_KeyboardSensor(SCA_KeyboardManager* keybdmgr,
SCA_IObject* gameobj,
PyTypeObject* T )
:SCA_ISensor(gameobj,keybdmgr,T),
- m_pKeyboardMgr(keybdmgr),
m_hotkey(hotkey),
m_qual(qual),
m_qual2(qual2),
@@ -126,7 +125,7 @@ bool SCA_KeyboardSensor::Evaluate()
bool qual_change = false;
short int m_val_orig = m_val;
- SCA_IInputDevice* inputdev = m_pKeyboardMgr->GetInputDevice();
+ SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)m_eventmgr)->GetInputDevice();
// cerr << "SCA_KeyboardSensor::Eval event, sensing for "<< m_hotkey << " at device " << inputdev << "\n";
/* See if we need to do logging: togPropState exists and is
@@ -361,7 +360,7 @@ void SCA_KeyboardSensor::AddToTargetProp(int keyIndex)
*/
bool SCA_KeyboardSensor::IsShifted(void)
{
- SCA_IInputDevice* inputdev = m_pKeyboardMgr->GetInputDevice();
+ SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)m_eventmgr)->GetInputDevice();
if ( (inputdev->GetEventValue(SCA_IInputDevice::KX_RIGHTSHIFTKEY).m_status
== SCA_InputEvent::KX_ACTIVE)
@@ -380,7 +379,7 @@ bool SCA_KeyboardSensor::IsShifted(void)
void SCA_KeyboardSensor::LogKeystrokes(void)
{
- SCA_IInputDevice* inputdev = m_pKeyboardMgr->GetInputDevice();
+ SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)m_eventmgr)->GetInputDevice();
int num = inputdev->GetNumActiveEvents();
/* weird loop, this one... */
@@ -515,7 +514,7 @@ PyObject* SCA_KeyboardSensor::PyGetPressedKeys()
{
ShowDeprecationWarning("getPressedKeys()", "events");
- SCA_IInputDevice* inputdev = m_pKeyboardMgr->GetInputDevice();
+ SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)m_eventmgr)->GetInputDevice();
int num = inputdev->GetNumJustEvents();
PyObject* resultlist = PyList_New(num);
@@ -556,7 +555,7 @@ PyObject* SCA_KeyboardSensor::PyGetCurrentlyPressedKeys()
{
ShowDeprecationWarning("getCurrentlyPressedKeys()", "events");
- SCA_IInputDevice* inputdev = m_pKeyboardMgr->GetInputDevice();
+ SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)m_eventmgr)->GetInputDevice();
int num = inputdev->GetNumActiveEvents();
PyObject* resultlist = PyList_New(num);
@@ -605,7 +604,7 @@ KX_PYMETHODDEF_DOC_O(SCA_KeyboardSensor, getKeyStatus,
return NULL;
}
- SCA_IInputDevice* inputdev = m_pKeyboardMgr->GetInputDevice();
+ SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)m_eventmgr)->GetInputDevice();
const SCA_InputEvent & inevent = inputdev->GetEventValue((SCA_IInputDevice::KX_EnumInputs) keycode);
return PyInt_FromLong(inevent.m_status);
}
@@ -691,7 +690,7 @@ PyObject* SCA_KeyboardSensor::pyattr_get_events(void *self_v, const KX_PYATTRIBU
{
SCA_KeyboardSensor* self= static_cast<SCA_KeyboardSensor*>(self_v);
- SCA_IInputDevice* inputdev = self->m_pKeyboardMgr->GetInputDevice();
+ SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)self->m_eventmgr)->GetInputDevice();
PyObject* resultlist = PyList_New(0);
diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.h b/source/gameengine/GameLogic/SCA_KeyboardSensor.h
index 033225cd9be..13fcc21ab7b 100644
--- a/source/gameengine/GameLogic/SCA_KeyboardSensor.h
+++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.h
@@ -43,8 +43,6 @@
class SCA_KeyboardSensor : public SCA_ISensor
{
Py_Header;
- class SCA_KeyboardManager* m_pKeyboardMgr;
-
/**
* the key this sensor is sensing for