Changeset View
Changeset View
Standalone View
Standalone View
source/gameengine/GameLogic/SCA_GameActuator.cpp
- This file was moved from source/gameengine/Ketsji/KX_GameActuator.cpp.
| Show All 22 Lines | |||||
| * | * | ||||
| * The Original Code is: all of this file. | * The Original Code is: all of this file. | ||||
| * | * | ||||
| * Contributor(s): none yet. | * Contributor(s): none yet. | ||||
| * | * | ||||
| * ***** END GPL LICENSE BLOCK ***** | * ***** END GPL LICENSE BLOCK ***** | ||||
| */ | */ | ||||
| /** \file gameengine/Ketsji/KX_GameActuator.cpp | /** \file gameengine/GameLogic/SCA_GameActuator.cpp | ||||
| * \ingroup ketsji | * \ingroup gamelogic | ||||
| */ | */ | ||||
| #include <stddef.h> | |||||
| #include "SCA_IActuator.h" | #include "SCA_IActuator.h" | ||||
| #include "KX_GameActuator.h" | #include "SCA_GameActuator.h" | ||||
| //#include <iostream> | |||||
| #include "KX_Scene.h" | #include "KX_Scene.h" | ||||
| #include "KX_KetsjiEngine.h" | #include "KX_KetsjiEngine.h" | ||||
| #include "KX_PythonInit.h" /* for config load/saving */ | #include "KX_PythonInit.h" /* for config load/saving */ | ||||
| #include <stdio.h> | #include <stdio.h> | ||||
| #include <stdlib.h> | #include <stdlib.h> | ||||
| #include <stddef.h> | |||||
| /* ------------------------------------------------------------------------- */ | /* ------------------------------------------------------------------------- */ | ||||
| /* Native functions */ | /* Native functions */ | ||||
| /* ------------------------------------------------------------------------- */ | /* ------------------------------------------------------------------------- */ | ||||
| KX_GameActuator::KX_GameActuator(SCA_IObject *gameobj, | SCA_GameActuator::SCA_GameActuator(SCA_IObject *gameobj, | ||||
| int mode, | int mode, | ||||
| const STR_String& filename, | const STR_String& filename, | ||||
| const STR_String& loadinganimationname, | const STR_String& loadinganimationname, | ||||
| SCA_IScene* scene, | SCA_IScene* scene, | ||||
| KX_KetsjiEngine* ketsjiengine) | KX_KetsjiEngine* ketsjiengine) | ||||
| : SCA_IActuator(gameobj, KX_ACT_GAME) | : SCA_IActuator(gameobj, SCA_ACT_GAME) | ||||
| { | { | ||||
| m_mode = mode; | m_mode = mode; | ||||
| m_filename = filename; | m_filename = filename; | ||||
| m_loadinganimationname = loadinganimationname; | m_loadinganimationname = loadinganimationname; | ||||
| m_scene = scene; | m_scene = scene; | ||||
| m_ketsjiengine = ketsjiengine; | m_ketsjiengine = ketsjiengine; | ||||
| } /* End of constructor */ | } /* End of constructor */ | ||||
| KX_GameActuator::~KX_GameActuator() | SCA_GameActuator::~SCA_GameActuator() | ||||
| { | { | ||||
| // there's nothing to be done here, really.... | // there's nothing to be done here, really.... | ||||
| } /* end of destructor */ | } /* end of destructor */ | ||||
| CValue* KX_GameActuator::GetReplica() | CValue* SCA_GameActuator::GetReplica() | ||||
| { | { | ||||
| KX_GameActuator* replica = new KX_GameActuator(*this); | SCA_GameActuator* replica = new SCA_GameActuator(*this); | ||||
| replica->ProcessReplica(); | replica->ProcessReplica(); | ||||
| return replica; | return replica; | ||||
| } | } | ||||
| bool KX_GameActuator::Update() | bool SCA_GameActuator::Update() | ||||
| { | { | ||||
| // bool result = false; /*unused*/ | // bool result = false; /*unused*/ | ||||
| bool bNegativeEvent = IsNegativeEvent(); | bool bNegativeEvent = IsNegativeEvent(); | ||||
| RemoveAllEvents(); | RemoveAllEvents(); | ||||
| if (bNegativeEvent) | if (bNegativeEvent) | ||||
| return false; // do nothing on negative events | return false; // do nothing on negative events | ||||
| ▲ Show 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | |||||
| #ifdef WITH_PYTHON | #ifdef WITH_PYTHON | ||||
| /* ------------------------------------------------------------------------- */ | /* ------------------------------------------------------------------------- */ | ||||
| /* Python functions */ | /* Python functions */ | ||||
| /* ------------------------------------------------------------------------- */ | /* ------------------------------------------------------------------------- */ | ||||
| /* Integration hooks ------------------------------------------------------- */ | /* Integration hooks ------------------------------------------------------- */ | ||||
| PyTypeObject KX_GameActuator::Type = { | PyTypeObject SCA_GameActuator::Type = { | ||||
| PyVarObject_HEAD_INIT(NULL, 0) | PyVarObject_HEAD_INIT(NULL, 0) | ||||
| "KX_GameActuator", | "SCA_GameActuator", | ||||
| sizeof(PyObjectPlus_Proxy), | sizeof(PyObjectPlus_Proxy), | ||||
| 0, | 0, | ||||
| py_base_dealloc, | py_base_dealloc, | ||||
| 0, | 0, | ||||
| 0, | 0, | ||||
| 0, | 0, | ||||
| 0, | 0, | ||||
| py_base_repr, | py_base_repr, | ||||
| 0,0,0,0,0,0,0,0,0, | 0,0,0,0,0,0,0,0,0, | ||||
| Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, | Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, | ||||
| 0,0,0,0,0,0,0, | 0,0,0,0,0,0,0, | ||||
| Methods, | Methods, | ||||
| 0, | 0, | ||||
| 0, | 0, | ||||
| &SCA_IActuator::Type, | &SCA_IActuator::Type, | ||||
| 0,0,0,0,0,0, | 0,0,0,0,0,0, | ||||
| py_base_new | py_base_new | ||||
| }; | }; | ||||
| PyMethodDef KX_GameActuator::Methods[] = | PyMethodDef SCA_GameActuator::Methods[] = | ||||
| { | { | ||||
| {NULL,NULL} //Sentinel | {NULL,NULL} //Sentinel | ||||
| }; | }; | ||||
| PyAttributeDef KX_GameActuator::Attributes[] = { | PyAttributeDef SCA_GameActuator::Attributes[] = { | ||||
| KX_PYATTRIBUTE_STRING_RW("fileName",0,100,false,KX_GameActuator,m_filename), | KX_PYATTRIBUTE_STRING_RW("fileName",0,100,false,SCA_GameActuator,m_filename), | ||||
| KX_PYATTRIBUTE_INT_RW("mode", KX_GAME_NODEF+1, KX_GAME_MAX-1, true, KX_GameActuator, m_mode), | KX_PYATTRIBUTE_INT_RW("mode", KX_GAME_NODEF+1, KX_GAME_MAX-1, true, SCA_GameActuator, m_mode), | ||||
| { NULL } //Sentinel | { NULL } //Sentinel | ||||
| }; | }; | ||||
| #endif // WITH_PYTHON | #endif // WITH_PYTHON | ||||