- BGE, Some sensors, stored the event manager in 2 places (became confusing to do...
authorCampbell Barton <ideasman42@gmail.com>
Sat, 22 Aug 2009 10:51:21 +0000 (10:51 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 22 Aug 2009 10:51:21 +0000 (10:51 +0000)
- Change compiler warnings for linux/scons/C++

config/linux2-config.py
source/gameengine/GameLogic/SCA_JoystickSensor.cpp
source/gameengine/GameLogic/SCA_JoystickSensor.h
source/gameengine/GameLogic/SCA_MouseSensor.cpp
source/gameengine/GameLogic/SCA_MouseSensor.h
source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp
source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h
source/gameengine/Ketsji/KX_TouchSensor.cpp
source/gameengine/Ketsji/KX_TouchSensor.h

index b0ff0b89d3ddf8b67820a74c026f8ec913ec3d4e..3e84070fabb1e6b344fbec604ed87146d2870826 100644 (file)
@@ -190,8 +190,9 @@ REL_CCFLAGS = ['-O2']
 ##ARFLAGSQUIET = ru
 ##
 C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement']
-
 CC_WARN = ['-Wall']
+CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
+
 
 ##FIX_STUBS_WARNINGS = -Wno-unused
 
index 336529667d7f8b5ab54e16f841add695e4a09237..81aa3020f495c990dd99428afb451753f7e14837 100644 (file)
@@ -49,7 +49,6 @@ SCA_JoystickSensor::SCA_JoystickSensor(class SCA_JoystickManager* eventmgr,
                                                                           int hat, int hatf, bool allevents,
                                                                           PyTypeObject* T )
                                                                           :SCA_ISensor(gameobj,eventmgr,T),
-                                                                          m_pJoystickMgr(eventmgr),
                                                                           m_axis(axis),
                                                                           m_axisf(axisf),
                                                                           m_button(button),
@@ -104,7 +103,7 @@ bool SCA_JoystickSensor::IsPositiveTrigger()
 
 bool SCA_JoystickSensor::Evaluate()
 {
-       SCA_Joystick *js = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
+       SCA_Joystick *js = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex);
        bool result = false;
        bool reset = m_reset && m_level;
        
@@ -404,7 +403,7 @@ const char SCA_JoystickSensor::GetAxisValue_doc[] =
 "\tReturns a list of the values for the current state of each axis.\n";
 PyObject* SCA_JoystickSensor::PyGetAxisValue( ) {
        ShowDeprecationWarning("getAxisValue()", "the axisPosition property");
-       SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
+       SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex);
        
        int axis_index= joy->GetNumberOfAxes();
        PyObject *list= PyList_New(axis_index);
@@ -479,7 +478,7 @@ const char SCA_JoystickSensor::GetButtonActiveList_doc[] =
 "getButtonActiveList\n"
 "\tReturns a list containing the indicies of the button currently pressed.\n";
 PyObject* SCA_JoystickSensor::PyGetButtonActiveList( ) {
-       SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
+       SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex);
        PyObject *ls = PyList_New(0);
        PyObject *value;
        int i;
@@ -501,7 +500,7 @@ const char SCA_JoystickSensor::GetButtonStatus_doc[] =
 "getButtonStatus(buttonIndex)\n"
 "\tReturns a bool of the current pressed state of the specified button.\n";
 PyObject* SCA_JoystickSensor::PyGetButtonStatus( PyObject* args ) {
-       SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
+       SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex);
        int index;
        
        if(!PyArg_ParseTuple(args, "i:getButtonStatus", &index)){
@@ -547,7 +546,7 @@ const char SCA_JoystickSensor::NumberOfAxes_doc[] =
 "\tReturns the number of axes .\n";
 PyObject* SCA_JoystickSensor::PyNumberOfAxes( ) {
        ShowDeprecationWarning("getNumAxes()", "the numAxis property");
-       SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
+       SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex);
        // when the joystick is null their is 0 exis still. dumb but scripters should use isConnected()
        return PyInt_FromLong( joy ? joy->GetNumberOfAxes() : 0 );
 }
@@ -558,7 +557,7 @@ const char SCA_JoystickSensor::NumberOfButtons_doc[] =
 "\tReturns the number of buttons .\n";
 PyObject* SCA_JoystickSensor::PyNumberOfButtons( ) {
        ShowDeprecationWarning("getNumButtons()", "the numButtons property");
-       SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
+       SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex);
        return PyInt_FromLong( joy ? joy->GetNumberOfButtons() : 0 );
 }
 
@@ -568,7 +567,7 @@ const char SCA_JoystickSensor::NumberOfHats_doc[] =
 "\tReturns the number of hats .\n";
 PyObject* SCA_JoystickSensor::PyNumberOfHats( ) {
        ShowDeprecationWarning("getNumHats()", "the numHats property");
-       SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
+       SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex);
        return PyInt_FromLong( joy ? joy->GetNumberOfHats() : 0 );
 }
 
@@ -577,7 +576,7 @@ const char SCA_JoystickSensor::Connected_doc[] =
 "\tReturns True if a joystick is connected at this joysticks index.\n";
 PyObject* SCA_JoystickSensor::PyConnected( ) {
        ShowDeprecationWarning("getConnected()", "the connected property");
-       SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex);
+       SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex);
        return PyBool_FromLong( joy ? joy->Connected() : 0 );
 }
 
@@ -585,7 +584,7 @@ PyObject* SCA_JoystickSensor::PyConnected( ) {
 PyObject* SCA_JoystickSensor::pyattr_get_axis_values(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
 {
        SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
-       SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex);
+       SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
        
        int axis_index= joy->GetNumberOfAxes();
        PyObject *list= PyList_New(axis_index);
@@ -600,7 +599,7 @@ PyObject* SCA_JoystickSensor::pyattr_get_axis_values(void *self_v, const KX_PYAT
 PyObject* SCA_JoystickSensor::pyattr_get_axis_single(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
 {
        SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
-       SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex);
+       SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
        
        if(self->m_joymode != KX_JOYSENSORMODE_AXIS_SINGLE) {
                PyErr_SetString(PyExc_TypeError, "val = sensor.axisSingle: Joystick Sensor, not 'Single Axis' type");
@@ -613,7 +612,7 @@ PyObject* SCA_JoystickSensor::pyattr_get_axis_single(void *self_v, const KX_PYAT
 PyObject* SCA_JoystickSensor::pyattr_get_hat_values(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
 {
        SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
-       SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex);
+       SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
        
        int hat_index= joy->GetNumberOfHats();
        PyObject *list= PyList_New(hat_index);
@@ -628,7 +627,7 @@ PyObject* SCA_JoystickSensor::pyattr_get_hat_values(void *self_v, const KX_PYATT
 PyObject* SCA_JoystickSensor::pyattr_get_hat_single(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
 {
        SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
-       SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex);
+       SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
        
        return PyInt_FromLong(joy->GetHat(self->m_hat-1));
 }
@@ -636,27 +635,27 @@ PyObject* SCA_JoystickSensor::pyattr_get_hat_single(void *self_v, const KX_PYATT
 PyObject* SCA_JoystickSensor::pyattr_get_num_axis(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
 {
        SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
-       SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex);
+       SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
        return PyInt_FromLong( joy ? joy->GetNumberOfAxes() : 0 );
 }
 
 PyObject* SCA_JoystickSensor::pyattr_get_num_buttons(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
 {
        SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
-       SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex);
+       SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
        return PyInt_FromLong( joy ? joy->GetNumberOfButtons() : 0 );
 }
 
 PyObject* SCA_JoystickSensor::pyattr_get_num_hats(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
 {
        SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
-       SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex);
+       SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
        return PyInt_FromLong( joy ? joy->GetNumberOfHats() : 0 );
 }
 
 PyObject* SCA_JoystickSensor::pyattr_get_connected(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
 {
        SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
-       SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex);
+       SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex);
        return PyBool_FromLong( joy ? joy->Connected() : 0 );
 }
index e6a1d2eef32e25bc8edb9cafabe3844e9136fed7..f5ff25c73dc4c43e59b7a7b9275414b84606934d 100644 (file)
@@ -35,7 +35,6 @@
 class SCA_JoystickSensor :public SCA_ISensor
 {
        Py_Header;
-       class SCA_JoystickManager*      m_pJoystickMgr;
        
        /**
         * Axis 1-JOYAXIS_MAX, MUST be followed by m_axisf
index c5e1c3c0441f9086bc8412ea844f2e45b699c567..1a0a3939d54fe2c6e8d6048815d65e1397642f3e 100644 (file)
@@ -52,7 +52,6 @@ SCA_MouseSensor::SCA_MouseSensor(SCA_MouseManager* eventmgr,
                                                                 SCA_IObject* gameobj, 
                                                                 PyTypeObject* T)
     : SCA_ISensor(gameobj,eventmgr, T),
-       m_pMouseMgr(eventmgr),
        m_x(startx),
        m_y(starty)
 {
@@ -148,7 +147,7 @@ bool SCA_MouseSensor::Evaluate()
 {
        bool result = false;
        bool reset = m_reset && m_level;
-       SCA_IInputDevice* mousedev = m_pMouseMgr->GetInputDevice();
+       SCA_IInputDevice* mousedev = ((SCA_MouseManager *)m_eventmgr)->GetInputDevice();
 
        m_reset = false;
        switch (m_mousemode) {
@@ -283,7 +282,7 @@ KX_PYMETHODDEF_DOC_O(SCA_MouseSensor, getButtonStatus,
                        return NULL;
                }
                
-               SCA_IInputDevice* mousedev = m_pMouseMgr->GetInputDevice();
+               SCA_IInputDevice* mousedev = ((SCA_MouseManager *)m_eventmgr)->GetInputDevice();
                const SCA_InputEvent& event = mousedev->GetEventValue((SCA_IInputDevice::KX_EnumInputs) button);
                return PyInt_FromLong(event.m_status);
        }
index 6d6302b514ab413ffe6a6ddc3a2d89c9376b01aa..14d3ace5408b1e23fe37a089388e915622d4ff54 100644 (file)
@@ -39,7 +39,6 @@
 class SCA_MouseSensor : public SCA_ISensor
 {
        Py_Header;
-       class SCA_MouseManager* m_pMouseMgr;
        
        /**
         * Use SCA_IInputDevice values to encode the mouse mode for now.
index 8ddcd87b66ff6a9cbe36ad7a2807f22ac9cae78b..014670dd76d5813c392b5c4baa0a42ec020d570a 100644 (file)
@@ -54,7 +54,6 @@ KX_NetworkMessageSensor::KX_NetworkMessageSensor(
        PyTypeObject* T
 ) :
     SCA_ISensor(gameobj,eventmgr,T),
-    m_Networkeventmgr(eventmgr),
     m_NetworkScene(NetworkScene),
     m_subject(subject),
     m_frame_message_count (0),
index 53183f3382681c5c32ca3768d9dd3049c1cd47df..dd207230e0c76dd027234bea6aa137119b6267fb 100644 (file)
@@ -39,7 +39,6 @@ class KX_NetworkMessageSensor : public SCA_ISensor
 {
        // note: Py_Header MUST BE the first listed here
        Py_Header;
-       KX_NetworkEventManager *m_Networkeventmgr;
        NG_NetworkScene        *m_NetworkScene;
 
        // The subject we filter on.
index c06acd4a873f2175efe76f75587903431e313573..5b23a9d0e3e7b3336e0e60436aacf23255ee7656 100644 (file)
@@ -101,8 +101,7 @@ KX_TouchSensor::KX_TouchSensor(SCA_EventManager* eventmgr,KX_GameObject* gameobj
 :SCA_ISensor(gameobj,eventmgr,T),
 m_touchedpropname(touchedpropname),
 m_bFindMaterial(bFindMaterial),
-m_bTouchPulse(bTouchPulse),
-m_eventmgr(eventmgr)
+m_bTouchPulse(bTouchPulse)
 /*m_sumoObj(sumoObj),*/
 {
 //     KX_TouchEventManager* touchmgr = (KX_TouchEventManager*) eventmgr;
index 476c63e89dbc064f0b84bf866d244d5112dc05f3..7ec8d1277aaecdd0f2c83bf2e2a73d4bcbdaa2ac 100644 (file)
@@ -58,7 +58,6 @@ protected:
        STR_String                              m_touchedpropname;      
        bool                                    m_bFindMaterial;
        bool                                    m_bTouchPulse;          /* changes in the colliding objects trigger pulses */
-       class SCA_EventManager* m_eventmgr;
        
        class PHY_IPhysicsController*   m_physCtrl;