diff options
author | Daniel Stokes <kupomail@gmail.com> | 2011-09-26 08:52:30 +0400 |
---|---|---|
committer | Daniel Stokes <kupomail@gmail.com> | 2011-09-26 08:52:30 +0400 |
commit | 5dd02ad3e6a1f58344bd088431f024c7591e1c2e (patch) | |
tree | 22a34fa955124983ba9d53bf59f8fea484fe8dc4 /source/gameengine/GamePlayer/ghost/GPG_Application.cpp | |
parent | c7ffdb06aa0632b312fab29857ba0856d40dfc6a (diff) | |
parent | a932f93098ae64edbfd79ff3debe9712a55f2421 (diff) |
Merge from trunk r40540
Diffstat (limited to 'source/gameengine/GamePlayer/ghost/GPG_Application.cpp')
-rw-r--r-- | source/gameengine/GamePlayer/ghost/GPG_Application.cpp | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp index 05ca53c06aa..1f366d7452b 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp @@ -139,7 +139,7 @@ GPG_Application::GPG_Application(GHOST_ISystem* system) GPG_Application::~GPG_Application(void) { - if(m_pyGlobalDictString) { + if(m_pyGlobalDictString) { delete [] m_pyGlobalDictString; m_pyGlobalDictString = 0; m_pyGlobalDictString_Length = 0; @@ -151,7 +151,7 @@ GPG_Application::~GPG_Application(void) -bool GPG_Application::SetGameEngineData(struct Main* maggie, Scene *scene, int argc, char **argv) +bool GPG_Application::SetGameEngineData(struct Main* maggie, Scene *scene, GlobalSettings *gs, int argc, char **argv) { bool result = false; @@ -168,6 +168,9 @@ bool GPG_Application::SetGameEngineData(struct Main* maggie, Scene *scene, int a m_argc= argc; m_argv= argv; + /* Global Settings */ + m_globalSettings= gs; + return result; } @@ -192,7 +195,7 @@ static LRESULT CALLBACK screenSaverWindowProc(HWND hwnd, UINT uMsg, WPARAM wPara LONG dx = scr_save_mouse_pos.x - pt.x; LONG dy = scr_save_mouse_pos.y - pt.y; if (abs(dx) > SCR_SAVE_MOUSE_MOVE_THRESHOLD - || abs(dy) > SCR_SAVE_MOUSE_MOVE_THRESHOLD) + || abs(dy) > SCR_SAVE_MOUSE_MOVE_THRESHOLD) { close = TRUE; } @@ -514,6 +517,12 @@ int GPG_Application::getExitRequested(void) } +GlobalSettings* GPG_Application::getGlobalSettings(void) +{ + return m_ketsjiengine->GetGlobalSettings(); +} + + const STR_String& GPG_Application::getExitString(void) { @@ -548,13 +557,14 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode) bool frameRate = (SYS_GetCommandLineInt(syshandle, "show_framerate", 0) != 0); bool useLists = (SYS_GetCommandLineInt(syshandle, "displaylists", gm->flag & GAME_DISPLAY_LISTS) != 0); bool nodepwarnings = (SYS_GetCommandLineInt(syshandle, "ignore_deprecation_warnings", 1) != 0); + bool restrictAnimFPS = gm->flag & GAME_RESTRICT_ANIM_UPDATES; if(GLEW_ARB_multitexture && GLEW_VERSION_1_1) m_blendermat = (SYS_GetCommandLineInt(syshandle, "blender_material", 1) != 0); if(GPU_glsl_support()) m_blenderglslmat = (SYS_GetCommandLineInt(syshandle, "blender_glsl_material", 1) != 0); - else if(gm->matmode == GAME_MAT_GLSL) + else if(m_globalSettings->matmode == GAME_MAT_GLSL) m_blendermat = false; // create the canvas, rasterizer and rendertools @@ -629,6 +639,10 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode) m_ketsjiengine->SetUseFixedTime(fixed_framerate); m_ketsjiengine->SetTimingDisplay(frameRate, profile, properties); + m_ketsjiengine->SetRestrictAnimationFPS(restrictAnimFPS); + + //set the global settings (carried over if restart/load new files) + m_ketsjiengine->SetGlobalSettings(m_globalSettings); m_engineInitialized = true; } @@ -686,9 +700,9 @@ bool GPG_Application::startEngine(void) // if (always_use_expand_framing) // sceneconverter->SetAlwaysUseExpandFraming(true); - if(m_blendermat && (m_startScene->gm.matmode != GAME_MAT_TEXFACE)) + if(m_blendermat && (m_globalSettings->matmode != GAME_MAT_TEXFACE)) m_sceneconverter->SetMaterials(true); - if(m_blenderglslmat && (m_startScene->gm.matmode == GAME_MAT_GLSL)) + if(m_blenderglslmat && (m_globalSettings->matmode == GAME_MAT_GLSL)) m_sceneconverter->SetGLSLMaterials(true); KX_Scene* startscene = new KX_Scene(m_keyboard, |