Esempio n. 1
0
void Game::reset()
{
	memset(inputs, 0, sizeof(inputs));
	StopLoopSounds();
	StopScripts();
	
	game.pause(false);
	game.setmode(GM_INTRO, 0, true);
	console.SetVisible(false);
}
Esempio n. 2
0
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;
}
Esempio n. 3
0
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();
}
Esempio n. 4
0
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();
}
Esempio n. 5
0
void DBusInterface::showDebugConsole()
{
    DebugConsole *console = new DebugConsole;
    console->show();
}