2000-08-29 21:54:22 +02:00
|
|
|
/*=========================================================================
|
|
|
|
|
|
|
|
gstate.h
|
|
|
|
|
|
|
|
Author: PKG
|
|
|
|
Created:
|
|
|
|
Project: PRLSR
|
|
|
|
Purpose:
|
|
|
|
|
|
|
|
Copyright (c) 2000 Climax Development Ltd
|
|
|
|
|
|
|
|
===========================================================================*/
|
|
|
|
|
|
|
|
#ifndef __SYSTEM_GSTATE_H__
|
|
|
|
#define __SYSTEM_GSTATE_H__
|
|
|
|
|
2000-09-12 01:41:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-12-20 23:46:12 +01:00
|
|
|
|
2000-09-12 01:41:29 +02:00
|
|
|
/*****************************************************************************/
|
2000-08-29 21:54:22 +02:00
|
|
|
class CScene
|
|
|
|
{
|
|
|
|
public:
|
2000-09-12 01:41:29 +02:00
|
|
|
CScene() {;}
|
|
|
|
virtual ~CScene() {;}
|
2000-08-29 21:54:22 +02:00
|
|
|
|
2000-09-12 01:41:29 +02:00
|
|
|
virtual void init()=0;
|
|
|
|
virtual void shutdown()=0;
|
|
|
|
virtual void render()=0;
|
2000-10-19 17:40:24 +02:00
|
|
|
virtual void think(int _frames)=0;
|
2000-10-26 18:50:54 +02:00
|
|
|
virtual int readyToShutdown()=0;
|
2000-09-12 01:41:29 +02:00
|
|
|
virtual char *getSceneName()=0;
|
2000-08-29 21:54:22 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
class GameState
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static void initialise();
|
|
|
|
static void think();
|
|
|
|
static void render();
|
|
|
|
|
|
|
|
static void setNextScene( CScene *_nextScene );
|
|
|
|
|
2000-12-20 23:46:12 +01:00
|
|
|
inline static long int getFramesSinceLast() {return s_framesSinceLast;}
|
2000-08-29 21:54:22 +02:00
|
|
|
|
|
|
|
static void setTimeSpeed( int speed );
|
|
|
|
|
|
|
|
static CScene * getCurrentScene();
|
2000-10-26 16:57:09 +02:00
|
|
|
static CScene * getPendingScene();
|
2000-08-29 21:54:22 +02:00
|
|
|
|
|
|
|
#if defined(__TERRITORY_USA__) || defined(__TERRITORY_JAP__)
|
|
|
|
static int getOneSecondInFrames() {return 60;}
|
|
|
|
#else
|
|
|
|
static int getOneSecondInFrames() {return 50;}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Try and instantiate a GameState and you will fail miserably :)
|
|
|
|
GameState();
|
|
|
|
|
|
|
|
static void updateTimer();
|
2000-12-20 23:46:12 +01:00
|
|
|
static int s_framesSinceLast;
|
2000-08-29 21:54:22 +02:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* __SYSTEM_GSTATE_H__ */
|
|
|
|
|
|
|
|
/*===========================================================================
|
|
|
|
end */
|