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-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-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-09-12 01:41:29 +02:00
|
|
|
inline static long int getTimeSinceLast() {return s_timeSinceLast;}
|
|
|
|
inline static long int getFramesSinceLast() {return (s_timeSinceLast>>12)+1;}
|
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();
|
|
|
|
static int s_timeSinceLast;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* __SYSTEM_GSTATE_H__ */
|
|
|
|
|
|
|
|
/*===========================================================================
|
|
|
|
end */
|