Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
GameEngine Class Referenceabstract

#include <GameEngine.h>

Inherits SubsystemInterface.

Inherited by Win32GameEngine.

Public Member Functions

 GameEngine (void)
 
virtual ~GameEngine ()
 
virtual void init (void)
 Init engine by creating client and logic.
 
virtual void init (int argc, char *argv[])
 Init engine by creating client and logic.
 
virtual void reset (void)
 reset system to starting state
 
virtual void update (void)
 per frame update
 
virtual void execute (void)
 
virtual void setFramesPerSecondLimit (Int fps)
 Set the maximum rate engine updates are allowed to occur.
 
virtual Int getFramesPerSecondLimit (void)
 Get maxFPS. Not inline since it is called from another lib.
 
virtual void setQuitting (Bool quitting)
 set quitting status
 
virtual Bool getQuitting (void)
 is app getting ready to quit.
 
virtual Bool isMultiplayerSession (void)
 
virtual void serviceWindowsOS (void)
 
virtual Bool isActive (void)
 service the native OS
 
virtual void setIsActive (Bool isActive)
 
- Public Member Functions inherited from SubsystemInterface
 SubsystemInterface ()
 
virtual ~SubsystemInterface ()
 
virtual void postProcessLoad ()
 
virtual void draw (void)
 
void UPDATE (void)
 
void DRAW (void)
 
AsciiString getName (void)
 
void setName (AsciiString name)
 

Protected Member Functions

virtual FileSystemcreateFileSystem (void)
 Factory for FileSystem classes.
 
virtual LocalFileSystemcreateLocalFileSystem (void)=0
 Factory for LocalFileSystem classes.
 
virtual ArchiveFileSystemcreateArchiveFileSystem (void)=0
 Factory for ArchiveFileSystem classes.
 
virtual GameLogiccreateGameLogic (void)=0
 Factory for GameLogic classes.
 
virtual GameClientcreateGameClient (void)=0
 Factory for GameClient classes.
 
virtual MessageStreamcreateMessageStream (void)
 Factory for the message stream.
 
virtual ModuleFactorycreateModuleFactory (void)=0
 Factory for modules.
 
virtual ThingFactorycreateThingFactory (void)=0
 Factory for the thing factory.
 
virtual FunctionLexiconcreateFunctionLexicon (void)=0
 Factory for Function Lexicon.
 
virtual RadarcreateRadar (void)=0
 Factory for radar.
 
virtual WebBrowsercreateWebBrowser (void)=0
 Factory for embedded browser.
 
virtual ParticleSystemManagercreateParticleSystemManager (void)=0
 
virtual AudioManagercreateAudioManager (void)=0
 Factory for Audio Manager.
 

Protected Attributes

Int m_maxFPS
 Maximum frames per second allowed.
 
Bool m_quitting
 true when we need to quit the game
 
Bool m_isActive
 app has OS focus.
 
- Protected Attributes inherited from SubsystemInterface
AsciiString m_name
 

Detailed Description

The implementation of the game engine

Definition at line 61 of file GameEngine.h.

Constructor & Destructor Documentation

◆ GameEngine()

GameEngine::GameEngine ( void )

Definition at line 183 of file GameEngine.cpp.

◆ ~GameEngine()

GameEngine::~GameEngine ( )
virtual

Definition at line 197 of file GameEngine.cpp.

Member Function Documentation

◆ createArchiveFileSystem()

virtual ArchiveFileSystem * GameEngine::createArchiveFileSystem ( void )
protectedpure virtual

Factory for ArchiveFileSystem classes.

Implemented in Win32GameEngine.

◆ createAudioManager()

virtual AudioManager * GameEngine::createAudioManager ( void )
protectedpure virtual

Factory for Audio Manager.

Implemented in Win32GameEngine.

◆ createFileSystem()

FileSystem * GameEngine::createFileSystem ( void )
protectedvirtual

Factory for FileSystem classes.

Definition at line 923 of file GameEngine.cpp.

◆ createFunctionLexicon()

virtual FunctionLexicon * GameEngine::createFunctionLexicon ( void )
protectedpure virtual

Factory for Function Lexicon.

Implemented in Win32GameEngine.

◆ createGameClient()

virtual GameClient * GameEngine::createGameClient ( void )
protectedpure virtual

Factory for GameClient classes.

Implemented in Win32GameEngine.

◆ createGameLogic()

virtual GameLogic * GameEngine::createGameLogic ( void )
protectedpure virtual

Factory for GameLogic classes.

Implemented in Win32GameEngine.

◆ createLocalFileSystem()

virtual LocalFileSystem * GameEngine::createLocalFileSystem ( void )
protectedpure virtual

Factory for LocalFileSystem classes.

Implemented in Win32GameEngine.

◆ createMessageStream()

MessageStream * GameEngine::createMessageStream ( void )
protectedvirtual

Factory for the message stream.


Factory for the message stream

Definition at line 915 of file GameEngine.cpp.

◆ createModuleFactory()

virtual ModuleFactory * GameEngine::createModuleFactory ( void )
protectedpure virtual

Factory for modules.

Implemented in Win32GameEngine.

◆ createParticleSystemManager()

virtual ParticleSystemManager * GameEngine::createParticleSystemManager ( void )
protectedpure virtual

Implemented in Win32GameEngine.

◆ createRadar()

virtual Radar * GameEngine::createRadar ( void )
protectedpure virtual

Factory for radar.

Implemented in Win32GameEngine.

◆ createThingFactory()

virtual ThingFactory * GameEngine::createThingFactory ( void )
protectedpure virtual

Factory for the thing factory.

Implemented in Win32GameEngine.

◆ createWebBrowser()

virtual WebBrowser * GameEngine::createWebBrowser ( void )
protectedpure virtual

Factory for embedded browser.

Implemented in Win32GameEngine.

◆ execute()

void GameEngine::execute ( void )
virtual

The "main loop" of the game engine. It will not return until the game exits.


The "main loop" of the game engine. It will not return until the game exits.

Definition at line 789 of file GameEngine.cpp.

◆ getFramesPerSecondLimit()

Int GameEngine::getFramesPerSecondLimit ( void )
virtual

Get maxFPS. Not inline since it is called from another lib.

Definition at line 177 of file GameEngine.cpp.

◆ getQuitting()

Bool GameEngine::getQuitting ( void )
inlinevirtual

is app getting ready to quit.

Definition at line 108 of file GameEngine.h.

◆ init() [1/2]

void GameEngine::init ( int argc,
char * argv[] )
virtual

Init engine by creating client and logic.

Todo
: I changed this to take argc & argv so we can parse those after the GDF is loaded. We need to rethink this immediately as it is a nasty hack

Definition at line 251 of file GameEngine.cpp.

◆ init() [2/2]

void GameEngine::init ( void )
virtual

Init engine by creating client and logic.


Initialize the game engine by initializing the GameLogic and GameClient.

Implements SubsystemInterface.

Reimplemented in Win32GameEngine.

Definition at line 250 of file GameEngine.cpp.

◆ isActive()

virtual Bool GameEngine::isActive ( void )
inlinevirtual

service the native OS

returns whether app has OS focus.

Definition at line 83 of file GameEngine.h.

◆ isMultiplayerSession()

Bool GameEngine::isMultiplayerSession ( void )
virtual

Definition at line 929 of file GameEngine.cpp.

◆ reset()

void GameEngine::reset ( void )
virtual

reset system to starting state


Reset all necessary parts of the game engine to be ready to accept new game data

Implements SubsystemInterface.

Reimplemented in Win32GameEngine.

Definition at line 709 of file GameEngine.cpp.

◆ serviceWindowsOS()

virtual void GameEngine::serviceWindowsOS ( void )
inlinevirtual

Reimplemented in Win32GameEngine.

Definition at line 82 of file GameEngine.h.

◆ setFramesPerSecondLimit()

void GameEngine::setFramesPerSecondLimit ( Int fps)
virtual

Set the maximum rate engine updates are allowed to occur.

Definition at line 241 of file GameEngine.cpp.

◆ setIsActive()

virtual void GameEngine::setIsActive ( Bool isActive)
inlinevirtual

Definition at line 84 of file GameEngine.h.

◆ setQuitting()

void GameEngine::setQuitting ( Bool quitting)
inlinevirtual

set quitting status

Definition at line 107 of file GameEngine.h.

◆ update()

void GameEngine::update ( void )
virtual

per frame update



Update the game engine by updating the GameClient and GameLogic singletons.

Todo
Allow the client to run as fast as possible, but limit the execution of TheNetwork and TheGameLogic to a fixed framerate.
Todo
Move audio init, update, etc, into GameClient update

Implements SubsystemInterface.

Reimplemented in Win32GameEngine.

Definition at line 746 of file GameEngine.cpp.

Member Data Documentation

◆ m_isActive

Bool GameEngine::m_isActive
protected

app has OS focus.

Definition at line 104 of file GameEngine.h.

◆ m_maxFPS

Int GameEngine::m_maxFPS
protected

Maximum frames per second allowed.

Definition at line 102 of file GameEngine.h.

◆ m_quitting

Bool GameEngine::m_quitting
protected

true when we need to quit the game

Definition at line 103 of file GameEngine.h.


The documentation for this class was generated from the following files: