diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/imbuf/intern/util.c | 2 | ||||
-rw-r--r-- | source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp | 1 | ||||
-rw-r--r-- | source/gameengine/Ketsji/BL_Texture.h | 8 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_BlenderMaterial.h | 3 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_Camera.cpp | 2 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_GameObject.cpp | 8 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 9 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_KetsjiEngine.h | 5 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_ParentActuator.cpp | 2 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_PythonInit.cpp | 9 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_PythonInit.h | 9 |
11 files changed, 46 insertions, 12 deletions
diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c index 4f6730db1f1..70a02d72b01 100644 --- a/source/blender/imbuf/intern/util.c +++ b/source/blender/imbuf/intern/util.c @@ -64,6 +64,7 @@ #ifdef WITH_FFMPEG #include <ffmpeg/avcodec.h> #include <ffmpeg/avformat.h> +#include <ffmpeg/avdevice.h> #if LIBAVFORMAT_VERSION_INT < (49 << 16) #define FFMPEG_OLD_FRAME_RATE 1 @@ -236,6 +237,7 @@ void do_init_ffmpeg() if (!ffmpeg_init) { ffmpeg_init = 1; av_register_all(); + avdevice_register_all(); } } diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index 9fbdc3fa1c9..2b3ef1b31e3 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -364,6 +364,7 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, initGameKeys(); initPythonConstraintBinding(); initMathutils(); + //initVideoTexture(); if (sceneconverter) { diff --git a/source/gameengine/Ketsji/BL_Texture.h b/source/gameengine/Ketsji/BL_Texture.h index 0d0c7a277f2..830ffceb0f7 100644 --- a/source/gameengine/Ketsji/BL_Texture.h +++ b/source/gameengine/Ketsji/BL_Texture.h @@ -59,6 +59,14 @@ public: void SetMapping(int mode); void DisableUnit(); void setTexEnv(BL_Material *mat, bool modulate=false); + unsigned int swapTexture (unsigned int newTex) { + // swap texture codes + unsigned int tmp = mTexture; + mTexture = newTex; + // return original texture code + return tmp; + } + }; #endif//__BL_TEXTURE_H__ diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h index 4ddf5a924df..b858fa3754c 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.h +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h @@ -67,6 +67,9 @@ public: MTFace* GetMTFace(void) const; unsigned int* GetMCol(void) const; + BL_Texture * getTex (unsigned int idx) { + return (idx < MAXTEX) ? mTextures + idx : NULL; + } // for ipos void UpdateIPO( diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index 3830d422138..53b3e348a36 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -793,7 +793,7 @@ KX_PYMETHODDEF_DOC(KX_Camera, setOnTop, { class KX_Scene* scene; - scene = PHY_GetActiveScene(); + scene = KX_GetActiveScene(); MT_assert(scene); scene->SetCameraOnTop(this); Py_Return; diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 739c122a5ef..a168beb9a70 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1027,7 +1027,7 @@ bool KX_GameObject::ConvertPythonVectorArgs(PyObject* args, PyObject* KX_GameObject::PyReplaceMesh(PyObject* self, PyObject* value) { - KX_Scene *scene = PHY_GetActiveScene(); + KX_Scene *scene = KX_GetActiveScene(); char* meshname; void* mesh_pt; @@ -1050,7 +1050,7 @@ PyObject* KX_GameObject::PyReplaceMesh(PyObject* self, PyObject* value) PyObject* KX_GameObject::PyEndObject(PyObject* self) { - KX_Scene *scene = PHY_GetActiveScene(); + KX_Scene *scene = KX_GetActiveScene(); scene->DelayedRemoveObject(this); Py_RETURN_NONE; @@ -1447,7 +1447,7 @@ PyObject* KX_GameObject::PySetParent(PyObject* self, PyObject* value) // The object we want to set as parent CValue *m_ob = (CValue*)value; KX_GameObject *obj = ((KX_GameObject*)m_ob); - KX_Scene *scene = PHY_GetActiveScene(); + KX_Scene *scene = KX_GetActiveScene(); this->SetParent(scene, obj); @@ -1456,7 +1456,7 @@ PyObject* KX_GameObject::PySetParent(PyObject* self, PyObject* value) PyObject* KX_GameObject::PyRemoveParent(PyObject* self) { - KX_Scene *scene = PHY_GetActiveScene(); + KX_Scene *scene = KX_GetActiveScene(); this->RemoveParent(scene); Py_RETURN_NONE; } diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index b1ab8e3e7de..8bcda4479e1 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -470,7 +470,7 @@ else m_logger->StartLog(tc_physics, m_kxsystem->GetTimeInSeconds(), true); // set Python hooks for each scene PHY_SetActiveEnvironment(scene->GetPhysicsEnvironment()); - PHY_SetActiveScene(scene); + KX_SetActiveScene(scene); scene->GetPhysicsEnvironment()->endFrame(); @@ -568,7 +568,7 @@ else // set Python hooks for each scene PHY_SetActiveEnvironment(scene->GetPhysicsEnvironment()); - PHY_SetActiveScene(scene); + KX_SetActiveScene(scene); m_logger->StartLog(tc_scenegraph, m_kxsystem->GetTimeInSeconds(), true); scene->UpdateParents(m_clockTime); @@ -1540,6 +1540,11 @@ double KX_KetsjiEngine::GetAnimFrameRate() return m_anim_framerate; } +double KX_KetsjiEngine::GetClockTime(void) const +{ + return m_clockTime; +} + void KX_KetsjiEngine::SetAnimFrameRate(double framerate) { m_anim_framerate = framerate; diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h index 1aa067a9962..4184202c518 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.h +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h @@ -254,6 +254,11 @@ public: bool GetUseFixedTime(void) const; /** + * Returns current render frame clock time + */ + double GetClockTime(void) const; + + /** * Returns the difference between the local time of the scene (when it * was running and not suspended) and the "curtime" */ diff --git a/source/gameengine/Ketsji/KX_ParentActuator.cpp b/source/gameengine/Ketsji/KX_ParentActuator.cpp index eb56e8de679..89549ca6b57 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.cpp +++ b/source/gameengine/Ketsji/KX_ParentActuator.cpp @@ -119,7 +119,7 @@ bool KX_ParentActuator::Update() return false; // do nothing on negative events KX_GameObject *obj = (KX_GameObject*) GetParent(); - KX_Scene *scene = PHY_GetActiveScene(); + KX_Scene *scene = KX_GetActiveScene(); switch (m_mode) { case KX_PARENT_SET: if (m_ob) diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index a30d9f4022d..0032d83c2ff 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1461,16 +1461,21 @@ PyObject* initMathutils() return Mathutils_Init("Mathutils"); // Use as a top level module in BGE } -void PHY_SetActiveScene(class KX_Scene* scene) +void KX_SetActiveScene(class KX_Scene* scene) { gp_KetsjiScene = scene; } -class KX_Scene* PHY_GetActiveScene() +class KX_Scene* KX_GetActiveScene() { return gp_KetsjiScene; } +class KX_KetsjiEngine* KX_GetActiveEngine() +{ + return gp_KetsjiEngine; +} + // utility function for loading and saving the globalDict int saveGamePythonConfig( char **marshal_buffer) { diff --git a/source/gameengine/Ketsji/KX_PythonInit.h b/source/gameengine/Ketsji/KX_PythonInit.h index 36e3db6ec35..57ee0be9400 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.h +++ b/source/gameengine/Ketsji/KX_PythonInit.h @@ -45,6 +45,7 @@ PyObject* initGameKeys(); PyObject* initRasterizer(class RAS_IRasterizer* rasty,class RAS_ICanvas* canvas); PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecurityLevel level); PyObject* initMathutils(); +PyObject* initVideoTexture(void); void exitGamePlayerPythonScripting(); PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLevel level); void exitGamePythonScripting(); @@ -54,8 +55,12 @@ void pathGamePythonConfig( char *path ); int saveGamePythonConfig( char **marshal_buffer); int loadGamePythonConfig(char *marshal_buffer, int marshal_length); -void PHY_SetActiveScene(class KX_Scene* scene); -class KX_Scene* PHY_GetActiveScene(); +class KX_KetsjiEngine; +class KX_Scene; + +void KX_SetActiveScene(class KX_Scene* scene); +class KX_Scene* KX_GetActiveScene(); +class KX_KetsjiEngine* KX_GetActiveEngine(); #include "MT_Vector3.h" void KX_RasterizerDrawDebugLine(const MT_Vector3& from,const MT_Vector3& to,const MT_Vector3& color); |