This commit is contained in:
parent
e9f123dec7
commit
74ac11a27f
40 changed files with 6829 additions and 0 deletions
97
source/system/gstate.cpp
Normal file
97
source/system/gstate.cpp
Normal file
|
@ -0,0 +1,97 @@
|
|||
/*=========================================================================
|
||||
|
||||
gstate.cpp
|
||||
|
||||
Author: PKG
|
||||
Created:
|
||||
Project: PRLSR
|
||||
Purpose:
|
||||
|
||||
Copyright (c) 2000 Climax Development Ltd
|
||||
|
||||
===========================================================================*/
|
||||
|
||||
|
||||
#include "system\global.h"
|
||||
#include "system\gstate.h"
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
static CScene *s_currentScene;
|
||||
static CScene *s_pendingScene;
|
||||
|
||||
int GameState::s_timeSinceLast;
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
void GameState::initialise()
|
||||
{
|
||||
s_currentScene=NULL;
|
||||
s_pendingScene=NULL;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
void GameState::think()
|
||||
{
|
||||
updateTimer();
|
||||
|
||||
if( s_pendingScene )
|
||||
{
|
||||
if( !s_currentScene)
|
||||
{
|
||||
if( s_currentScene )
|
||||
{
|
||||
s_currentScene->Shutdown();
|
||||
}
|
||||
|
||||
s_currentScene=s_pendingScene;
|
||||
s_pendingScene=NULL;
|
||||
|
||||
s_currentScene->Init();
|
||||
}
|
||||
}
|
||||
ASSERT(s_currentScene);
|
||||
s_currentScene->Control();
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
void GameState::render()
|
||||
{
|
||||
ASSERT(s_currentScene);
|
||||
s_currentScene->Render();
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
void GameState::setNextScene( CScene *_nextScene )
|
||||
{
|
||||
ASSERT(!s_pendingScene);
|
||||
|
||||
s_pendingScene=_nextScene;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
CScene * GameState::getCurrentScene()
|
||||
{
|
||||
return s_currentScene;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void GameState::updateTimer()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
end */
|
Loading…
Add table
Add a link
Reference in a new issue