SBSPSS/source/system/gstate.cpp
2000-09-11 23:41:29 +00:00

97 lines
2.3 KiB
C++

/*=========================================================================
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->think();
}
/*****************************************************************************/
/*****************************************************************************/
/*****************************************************************************/
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 */