#include <GameClient.h>
Inherits SubsystemInterface, and Snapshot.
Inherited by W3DGameClient.
Public Member Functions | |
| GameClient () | |
| virtual | ~GameClient () |
| virtual void | init (void) |
| Initialize resources. | |
| virtual void | update (void) |
| Updates the GUI, display, audio, etc. | |
| virtual void | reset (void) |
| reset system | |
| virtual void | setFrame (UnsignedInt frame) |
| Set the GameClient's internal frame number. | |
| virtual void | registerDrawable (Drawable *draw) |
| Given a drawable, register it with the GameClient and give it a unique ID. | |
| void | addDrawableToLookupTable (Drawable *draw) |
| add drawable ID to hash lookup table | |
| void | removeDrawableFromLookupTable (Drawable *draw) |
| remove drawable ID from hash lookup table | |
| virtual Drawable * | findDrawableByID (const DrawableID id) |
| Given an ID, return the associated drawable. | |
| void | setDrawableIDCounter (DrawableID nextDrawableID) |
| DrawableID | getDrawableIDCounter (void) |
| virtual Drawable * | firstDrawable (void) |
| virtual GameMessage::Type | evaluateContextCommand (Drawable *draw, const Coord3D *pos, CommandTranslator::CommandEvaluateType cmdType) |
| void | addTextBearingDrawable (Drawable *tbd) |
| void | flushTextBearingDrawables (void) |
| void | updateFakeDrawables (void) |
| virtual void | removeFromRayEffects (Drawable *draw) |
| remove the drawable from the ray effect system if present | |
| virtual void | getRayEffectData (Drawable *draw, RayEffectData *effectData) |
| get ray effect data for a drawable | |
| virtual void | createRayEffectByTemplate (const Coord3D *start, const Coord3D *end, const ThingTemplate *tmpl)=0 |
| create effect needing start and end location | |
| virtual void | addScorch (const Coord3D *pos, Real radius, Scorches type)=0 |
| virtual Bool | loadMap (AsciiString mapName) |
| load a map into our scene | |
| virtual void | unloadMap (AsciiString mapName) |
| unload the specified map from our scene | |
| virtual void | iterateDrawablesInRegion (Region3D *region, GameClientFuncPtr userFunc, void *userData) |
| Calls userFunc for each drawable contained within the region. | |
| virtual Drawable * | friend_createDrawable (const ThingTemplate *thing, DrawableStatus statusBits=DRAWABLE_STATUS_NONE)=0 |
| virtual void | destroyDrawable (Drawable *draw) |
| Destroy the given drawable. | |
| virtual void | setTimeOfDay (TimeOfDay tod) |
| Tell all the drawables what time of day it is now. | |
| virtual void | selectDrawablesInGroup (Int group) |
| select all drawables belong to the specifies group | |
| virtual void | assignSelectedDrawablesToGroup (Int group) |
| assign all selected drawables to the specified group | |
| virtual UnsignedInt | getFrame (void) |
| Returns the current simulation frame number. | |
| virtual void | setTeamColor (Int red, Int green, Int blue)=0 |
| virtual void | adjustLOD (Int adj)=0 |
| virtual void | releaseShadows (void) |
| frees all shadow resources used by this module - used by Options screen. | |
| virtual void | allocateShadows (void) |
| create shadow resources if not already present. Used by Options screen. | |
| virtual void | preloadAssets (TimeOfDay timeOfDay) |
| preload assets | |
| virtual Drawable * | getDrawableList (void) |
| void | resetRenderedObjectCount () |
| UnsignedInt | getRenderedObjectCount () const |
| void | incrementRenderedObjectCount () |
| virtual void | notifyTerrainObjectMoved (Object *obj)=0 |
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) |
Public Member Functions inherited from Snapshot | |
| Snapshot (void) | |
| ~Snapshot (void) | |
Protected Types | |
| enum | { MAX_CLIENT_TRANSLATORS = 32 } |
Protected Member Functions | |
| virtual void | crc (Xfer *xfer) |
| virtual void | xfer (Xfer *xfer) |
| virtual void | loadPostProcess (void) |
| DrawableID | allocDrawableID (void) |
| Returns a new unique drawable id. | |
Protected Attributes | |
| UnsignedInt | m_frame |
| Simulation frame number from server. | |
| Drawable * | m_drawableList |
| All of the drawables in the world. | |
| DrawablePtrVector | m_drawableVector |
| DrawableID | m_nextDrawableID |
| For allocating drawable id's. | |
| TranslatorID | m_translators [MAX_CLIENT_TRANSLATORS] |
| translators we have used | |
| UnsignedInt | m_numTranslators |
| number of translators in m_translators[] | |
| CommandTranslator * | m_commandTranslator |
| the command translator on the message stream | |
Protected Attributes inherited from SubsystemInterface | |
| AsciiString | m_name |
The GameClient class is used to instantiate a singleton which implements the interface to all GameClient operations such as Drawable access and user-interface functions.
Definition at line 85 of file GameClient.h.
|
protected |
| Enumerator | |
|---|---|
| MAX_CLIENT_TRANSLATORS | |
Definition at line 174 of file GameClient.h.
| GameClient::GameClient | ( | ) |
Definition at line 98 of file GameClient.cpp.
|
virtual |
Definition at line 125 of file GameClient.cpp.
| void GameClient::addDrawableToLookupTable | ( | Drawable * | draw | ) |
add drawable ID to hash lookup table
Add drawable to lookup table for fast id searching
Definition at line 857 of file GameClient.cpp.
Implemented in W3DGameClient.
| void GameClient::addTextBearingDrawable | ( | Drawable * | tbd | ) |
Definition at line 989 of file GameClient.cpp.
|
pure virtual |
Implemented in W3DGameClient.
|
virtual |
create shadow resources if not already present. Used by Options screen.
create shadow resources if not already present. Used by Options screen.
Definition at line 1048 of file GameClient.cpp.
|
protected |
Returns a new unique drawable id.
Return a new unique object id.
Definition at line 486 of file GameClient.cpp.
|
virtual |
assign all selected drawables to the specified group
Definition at line 928 of file GameClient.cpp.
|
protectedvirtual |
|
pure virtual |
create effect needing start and end location
Implemented in W3DGameClient.
|
virtual |
Destroy the given drawable.
Destroy the drawable immediately.
Definition at line 823 of file GameClient.cpp.
|
virtual |
Definition at line 1009 of file GameClient.cpp.
|
inlinevirtual |
Given an ID, return the associated drawable.
Given an object id, return the associated object. This method is the primary interface for accessing objects, and should be used instead of pointers to "attach" objects to each other.
Definition at line 239 of file GameClient.h.
|
inlinevirtual |
Definition at line 110 of file GameClient.h.
| void GameClient::flushTextBearingDrawables | ( | void | ) |
Definition at line 995 of file GameClient.cpp.
|
pure virtual |
Implemented in W3DGameClient.
|
inline |
Definition at line 108 of file GameClient.h.
|
inlinevirtual |
Definition at line 149 of file GameClient.h.
|
inlinevirtual |
Returns the current simulation frame number.
Definition at line 138 of file GameClient.h.
|
virtual |
get ray effect data for a drawable
Get the ray effect data for a drawable
Definition at line 1023 of file GameClient.cpp.
|
inline |
Definition at line 152 of file GameClient.h.
|
inline |
Definition at line 153 of file GameClient.h.
|
virtual |
Initialize resources.
Initialize resources for the game client
Implements SubsystemInterface.
Reimplemented in W3DGameClient.
Definition at line 249 of file GameClient.cpp.
|
virtual |
Calls userFunc for each drawable contained within the region.
Call the given callback function for each object contained within the given region.
Definition at line 781 of file GameClient.cpp.
|
virtual |
load a map into our scene
Load a map into the game interface
Definition at line 892 of file GameClient.cpp.
|
protectedvirtual |
|
pure virtual |
Implemented in W3DGameClient.
|
virtual |
preload assets
Preload assets for the currently loaded map. Those assets include all the damage states for every building loaded, as well as any faction units/structures we can build and all their damage states
Definition at line 1060 of file GameClient.cpp.
|
virtual |
Given a drawable, register it with the GameClient and give it a unique ID.
Given a drawable, register it with the GameClient and give it a unique ID.
Definition at line 497 of file GameClient.cpp.
|
virtual |
frees all shadow resources used by this module - used by Options screen.
frees all shadow resources used by this module - used by Options screen.
Definition at line 1040 of file GameClient.cpp.
| void GameClient::removeDrawableFromLookupTable | ( | Drawable * | draw | ) |
remove drawable ID from hash lookup table
Remove drawable from lookup table of fast id searching
Definition at line 877 of file GameClient.cpp.
|
virtual |
remove the drawable from the ray effect system if present
remove the drawble from the ray effects sytem if present
Definition at line 1032 of file GameClient.cpp.
|
virtual |
reset system
Reset the game client for a new game
Implements SubsystemInterface.
Reimplemented in W3DGameClient.
Definition at line 450 of file GameClient.cpp.
|
inline |
Definition at line 151 of file GameClient.h.
|
virtual |
select all drawables belong to the specifies group
Definition at line 951 of file GameClient.cpp.
|
inline |
Definition at line 107 of file GameClient.h.
|
inlinevirtual |
Set the GameClient's internal frame number.
Definition at line 99 of file GameClient.h.
Implemented in W3DGameClient.
|
virtual |
Tell all the drawables what time of day it is now.
Reimplemented in W3DGameClient.
Definition at line 915 of file GameClient.cpp.
|
virtual |
unload the specified map from our scene
Unload a map from the game interface
Definition at line 907 of file GameClient.cpp.
|
virtual |
Updates the GUI, display, audio, etc.
Redraw all views, update the GUI, play sound effects, etc.
Implements SubsystemInterface.
Reimplemented in W3DGameClient.
Definition at line 513 of file GameClient.cpp.
| void GameClient::updateFakeDrawables | ( | void | ) |
Helper function to update fake GLA structures to become visible to certain players. We should only call this during critical moments, such as changing teams, changing to observer, etc.
Definition at line 803 of file GameClient.cpp.
|
protectedvirtual |
Xfer method for Game Client Version History: 1: Initial 2: Adding mission briefing history 3: Added block markers around drawable data, no version checking is done and therefore this version breaks compatibility with previous versions. (CBD)
Implements Snapshot.
Definition at line 1362 of file GameClient.cpp.
|
protected |
the command translator on the message stream
Definition at line 177 of file GameClient.h.
|
protected |
All of the drawables in the world.
Definition at line 167 of file GameClient.h.
|
protected |
Definition at line 169 of file GameClient.h.
|
protected |
Simulation frame number from server.
Definition at line 165 of file GameClient.h.
|
protected |
For allocating drawable id's.
Definition at line 171 of file GameClient.h.
|
protected |
number of translators in m_translators[]
Definition at line 176 of file GameClient.h.
|
protected |
translators we have used
Definition at line 175 of file GameClient.h.