diff -ur xmoto-0.5.2/src/Input.cpp xmoto-0.5.2-matrix/src/Input.cpp --- xmoto-0.5.2/src/Input.cpp 2008-12-15 21:29:39.000000000 +0100 +++ xmoto-0.5.2-matrix/src/Input.cpp 2009-08-27 19:48:40.000000000 +0200 @@ -308,6 +308,10 @@ m_switchFavorite = XMKey(SDLK_F3, KMOD_NONE); m_restartLevel = XMKey(SDLK_RETURN, KMOD_NONE); m_showConsole = XMKey(SDLK_WORLD_18, KMOD_NONE); + + /* matrix mod by [exa] */ + m_matrixMore = XMKey(SDLK_F4, KMOD_NONE); + m_matrixLess = XMKey(SDLK_F6, KMOD_NONE); } /*=========================================================================== diff -ur xmoto-0.5.2/src/Input.h xmoto-0.5.2-matrix/src/Input.h --- xmoto-0.5.2/src/Input.h 2008-12-15 21:29:39.000000000 +0100 +++ xmoto-0.5.2-matrix/src/Input.h 2009-08-27 19:51:08.000000000 +0200 @@ -132,6 +132,11 @@ XMKey m_switchFavorite; XMKey m_restartLevel; XMKey m_showConsole; + + /* matrix mod by [exa] */ + public: + XMKey m_matrixMore; + XMKey m_matrixLess; }; diff -ur xmoto-0.5.2/src/states/StateScene.cpp xmoto-0.5.2-matrix/src/states/StateScene.cpp --- xmoto-0.5.2/src/states/StateScene.cpp 2009-01-13 23:10:37.000000000 +0100 +++ xmoto-0.5.2-matrix/src/states/StateScene.cpp 2009-08-27 20:22:41.000000000 +0200 @@ -19,6 +19,7 @@ =============================================================================*/ #include "StateScene.h" +#include "SysMessage.h" #include "../PhysSettings.h" #include "../xmscene/Camera.h" #include "../XMSession.h" @@ -59,6 +60,8 @@ m_cameraAnim = NULL; m_universe = NULL; + m_matrix = 1; + m_benchmarkNbFrame = 0; m_benchmarkStartTime = GameApp::getXMTime(); @@ -168,24 +171,25 @@ try { int nPhysSteps = 0; + float matrixed_slice=100.0/m_matrix; if(isLockedScene() == false) { // don't update if that's not required // don't do this infinitely, maximum miss 10 frames, then give up // in videoRecording mode, don't try to do more to allow to record at a good framerate - while (( m_fLastPhysTime + (PHYS_STEP_SIZE)/100.0 <= GameApp::getXMTime()) && nPhysSteps < 10 && (XMSession::instance()->enableVideoRecording() == false || nPhysSteps == 0)) { + while (( m_fLastPhysTime + (PHYS_STEP_SIZE)/matrixed_slice <= GameApp::getXMTime()) && nPhysSteps < 10 && (XMSession::instance()->enableVideoRecording() == false || nPhysSteps == 0)) { if(m_universe != NULL) { for(unsigned int i=0; igetScenes().size(); i++) { m_universe->getScenes()[i]->updateLevel(PHYS_STEP_SIZE, m_universe->getCurrentReplay(), m_universe->getCurrentReplay()); } } - m_fLastPhysTime += PHYS_STEP_SIZE/100.0; + m_fLastPhysTime += PHYS_STEP_SIZE/matrixed_slice; nPhysSteps++; } // if the delay is too long, reinitialize - if(m_fLastPhysTime + PHYS_STEP_SIZE/100.0 < GameApp::getXMTime()) { + if(m_fLastPhysTime + PHYS_STEP_SIZE/matrixed_slice < GameApp::getXMTime()) { m_fLastPhysTime = GameApp::getXMTime(); } @@ -301,6 +305,25 @@ } } + /* matrix mod by [exa] */ + + else if(i_type == INPUT_DOWN && i_xmkey == InputHandler::instance()->m_matrixLess) { + char buf[256]; + m_matrix -= 1; + if (m_matrix<1) m_matrix=1; + sprintf(buf,"Matrix Lowered to 1:%d",m_matrix); + SysMessage::instance()->displayText(buf); + } + else if(i_type == INPUT_DOWN && i_xmkey == InputHandler::instance()->m_matrixMore) { + char buf[256]; + m_matrix += 1; + if (m_matrix>20) m_matrix=20; + sprintf(buf,"Matrix Increased to 1:%d",m_matrix); + SysMessage::instance()->displayText(buf); + } + + /* end of matrix mod */ + else if(i_type == INPUT_DOWN && i_xmkey == InputHandler::instance()->getSwitchBlacklist()) { if(m_universe != NULL) { if(m_universe->getScenes().size() > 0) { // just blacklist the first world diff -ur xmoto-0.5.2/src/states/StateScene.h xmoto-0.5.2-matrix/src/states/StateScene.h --- xmoto-0.5.2/src/states/StateScene.h 2008-11-23 10:30:46.000000000 +0100 +++ xmoto-0.5.2-matrix/src/states/StateScene.h 2009-08-27 20:05:00.000000000 +0200 @@ -79,6 +79,9 @@ Universe* m_universe; + /* matrix mod by [exa] */ + int m_matrix; + int m_benchmarkNbFrame; float m_benchmarkStartTime;