diff options
Diffstat (limited to 'source/gameengine/Ketsji')
-rw-r--r-- | source/gameengine/Ketsji/KX_GameActuator.cpp | 12 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_GameActuator.h | 1 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_PythonInit.cpp | 1 |
3 files changed, 14 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_GameActuator.cpp b/source/gameengine/Ketsji/KX_GameActuator.cpp index a23af680104..f1bd253f8b3 100644 --- a/source/gameengine/Ketsji/KX_GameActuator.cpp +++ b/source/gameengine/Ketsji/KX_GameActuator.cpp @@ -41,6 +41,7 @@ #include "KX_Scene.h" #include "KX_KetsjiEngine.h" #include "KX_PythonInit.h" /* for config load/saving */ +#include "RAS_ICanvas.h" #include <stdio.h> #include <stdlib.h> @@ -204,6 +205,17 @@ bool KX_GameActuator::Update() break; #endif // WITH_PYTHON } + case KX_GAME_SCREENSHOT: + { + RAS_ICanvas *canvas = m_ketsjiengine->GetCanvas(); + if (canvas) { + canvas->MakeScreenShot(m_filename); + } + else { + printf("KX_GAME_SCREENSHOT error: Rasterizer not available"); + } + break; + } default: ; /* do nothing? this is an internal error !!! */ } diff --git a/source/gameengine/Ketsji/KX_GameActuator.h b/source/gameengine/Ketsji/KX_GameActuator.h index 0c1c4f0c277..57472836bb2 100644 --- a/source/gameengine/Ketsji/KX_GameActuator.h +++ b/source/gameengine/Ketsji/KX_GameActuator.h @@ -59,6 +59,7 @@ protected: KX_GAME_QUIT, KX_GAME_SAVECFG, KX_GAME_LOADCFG, + KX_GAME_SCREENSHOT, KX_GAME_MAX }; diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 2fef74ca33d..48d8be55120 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1804,6 +1804,7 @@ PyMODINIT_FUNC initGameLogicPythonBinding() KX_MACRO_addTypesToDict(d, KX_GAME_QUIT, KX_GameActuator::KX_GAME_QUIT); KX_MACRO_addTypesToDict(d, KX_GAME_SAVECFG, KX_GameActuator::KX_GAME_SAVECFG); KX_MACRO_addTypesToDict(d, KX_GAME_LOADCFG, KX_GameActuator::KX_GAME_LOADCFG); + KX_MACRO_addTypesToDict(d, KX_GAME_SCREENSHOT, KX_GameActuator::KX_GAME_SCREENSHOT); /* Scene Actuator Modes */ KX_MACRO_addTypesToDict(d, KX_SCENE_RESTART, KX_SceneActuator::KX_SCENE_RESTART); |