void Game::reset() { memset(inputs, 0, sizeof(inputs)); StopLoopSounds(); StopScripts(); game.pause(false); game.setmode(GM_INTRO, 0, true); console.SetVisible(false); }
KBOOL Kylin::ClGame::Initialize() { ////////////////////////////////////////////////////////////////////////// Ogre::Camera* pCam = OgreRoot::GetSingletonPtr()->CreateCamera("$MainCamera"); if (pCam) { pCam->setNearClipDistance(1.0f); OgreRoot::GetSingletonPtr()->CreateCameraControl(pCam); } //----------------------------------------------------- // 初始化UI Kylin::OgreRoot::GetSingletonPtr()->GetGuiManager()->InitShell(this); // 设置控制台命令接口 DebugConsole* pConsole = GET_GUI_PTR(DebugConsole); pConsole->SetHandler(KNEW UserCommandHandler()); //----------------------------------------------------- if (!GSGame::Initialize()) return false; return true; }
void Game::tick(void) { debug_clear(); if (game.paused) { tickfunctions[game.paused].OnTick(); } else { // record/playback replays Replay::run(); // run scripts RunScripts(); // call the tick function for the current game mode tickfunctions[game.mode].OnTick(); } DrawDebug(); console.Draw(); }
void Game::tick(void) { debug_clear(); if (game.paused) { tickfunctions[game.paused].OnTick(); } else { // run scripts RunScripts(); // call the tick function for the current game mode tickfunctions[game.mode].OnTick(); if (justpushed(ESCKEY) && (game.mode == GM_NORMAL || game.mode == GM_INVENTORY || game.mode == GM_MAP_SYSTEM || game.mode == GM_CREDITS)) { game.pause(GP_PAUSED); } } DrawDebug(); console.Draw(); }
void DBusInterface::showDebugConsole() { DebugConsole *console = new DebugConsole; console->show(); }