#include <W3DRadar.h>
Inherits Radar.
Public Member Functions | |
| W3DRadar (void) | |
| ~W3DRadar (void) | |
| virtual void | init (void) |
| subsystem init | |
| virtual void | update (void) |
| subsystem update | |
| virtual void | reset (void) |
| subsystem reset | |
| virtual void | newMap (TerrainLogic *terrain) |
| reset radar for new map | |
| void | draw (Int pixelX, Int pixelY, Int width, Int height) |
| draw the radar | |
| virtual void | clearShroud () |
| empty the entire shroud | |
| virtual void | setShroudLevel (Int x, Int y, CellShroudStatus setting) |
| set the shroud level at shroud cell x,y | |
| virtual void | refreshTerrain (TerrainLogic *terrain) |
| refresh the water values for the radar | |
Public Member Functions inherited from Radar | |
| Radar (void) | |
| virtual | ~Radar (void) |
| Bool | isRadarWindow (GameWindow *window) |
| Bool | radarToWorld (const ICoord2D *radar, Coord3D *world) |
| radar point to world point on terrain | |
| Bool | radarToWorld2D (const ICoord2D *radar, Coord3D *world) |
| radar point to world point (x,y only!) | |
| Bool | worldToRadar (const Coord3D *world, ICoord2D *radar) |
| translate world point to radar (x,y) | |
| Bool | localPixelToRadar (const ICoord2D *pixel, ICoord2D *radar) |
| translate pixel (with UL of radar being (0,0)) to logical radar coords | |
| Bool | screenPixelToWorld (const ICoord2D *pixel, Coord3D *world) |
| translate pixel (with UL of the screen being (0,0)) to world position in the world | |
| Object * | objectUnderRadarPixel (const ICoord2D *pixel) |
| return the object (if any) represented by the pixel coords passed in | |
| void | findDrawPositions (Int startX, Int startY, Int width, Int height, ICoord2D *ul, ICoord2D *lr) |
| make translation for screen area of radar square to scaled aspect ratio preserving points inside the radar area | |
| Bool | isPriorityVisible (RadarPriorityType priority) const |
| is the priority passed in a "visible" one on the radar | |
| void | createEvent (const Coord3D *world, RadarEventType type, Real secondsToLive=4.0f) |
| create radar event at location in world | |
| void | createPlayerEvent (Player *player, const Coord3D *world, RadarEventType type, Real secondsToLive=4.0f) |
| create radar event using player colors | |
| Bool | getLastEventLoc (Coord3D *eventPos) |
| get last event loc (if any) | |
| void | tryUnderAttackEvent (const Object *obj) |
| try to make an "under attack" event if it's the proper time | |
| void | tryInfiltrationEvent (const Object *obj) |
| try to make an "infiltration" event if it's the proper time | |
| Bool | tryEvent (RadarEventType event, const Coord3D *pos) |
| try to make a "stealth" event | |
| void | addObject (Object *obj) |
| add object to radar | |
| void | removeObject (Object *obj) |
| remove object from radar | |
| void | examineObject (Object *obj) |
| re-examine object and resort if needed | |
| void | hide (Bool hide) |
| hide/unhide the radar | |
| Bool | isRadarHidden (void) |
| is radar hidden | |
| void | forceOn (Bool force) |
| force the radar to be on | |
| Bool | isRadarForced (void) |
| is radar forced on? | |
| virtual void | queueTerrainRefresh (void) |
| queue a refresh of the terran at the next available time | |
Public Member Functions inherited from Snapshot | |
| Snapshot (void) | |
| ~Snapshot (void) | |
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 | |
| void | drawSingleBeaconEvent (Int pixelX, Int pixelY, Int width, Int height, Int index) |
| void | drawSingleGenericEvent (Int pixelX, Int pixelY, Int width, Int height, Int index) |
| void | initializeTextureFormats (void) |
| find format to use for the radar texture | |
| void | deleteResources (void) |
| delete resources used | |
| void | drawEvents (Int pixelX, Int pixelY, Int width, Int height) |
| draw all of the radar events | |
| void | drawHeroIcon (Int pixelX, Int pixelY, Int width, Int height, const Coord3D *pos) |
| void | drawViewBox (Int pixelX, Int pixelY, Int width, Int height) |
| draw view box | |
| void | buildTerrainTexture (TerrainLogic *terrain) |
| create the terrain texture of the radar | |
| void | drawIcons (Int pixelX, Int pixelY, Int width, Int height) |
| draw all of the radar icons | |
| void | renderObjectList (const RadarObject *listHead, TextureClass *texture, Bool calcHero=FALSE) |
| render an object list to the texture | |
| void | interpolateColorForHeight (RGBColor *color, Real height, Real hiZ, Real midZ, Real loZ) |
| "shade" color according to height value | |
| void | reconstructViewBox (void) |
| remake the view box | |
| void | radarToPixel (const ICoord2D *radar, ICoord2D *pixel, Int radarUpperLeftX, Int radarUpperLeftY, Int radarWidth, Int radarHeight) |
| convert radar coord to pixel location | |
Protected Member Functions inherited from Radar | |
| virtual void | crc (Xfer *xfer) |
| virtual void | xfer (Xfer *xfer) |
| virtual void | loadPostProcess (void) |
| void | internalCreateEvent (const Coord3D *world, RadarEventType type, Real secondsToLive, const RGBAColorInt *color1, const RGBAColorInt *color2) |
| internal method for creating a radar event with specific colors | |
| void | deleteListResources (void) |
| delete list radar resources used | |
| Bool | deleteFromList (Object *obj, RadarObject **list) |
| try to remove object from specific list | |
| Real | getTerrainAverageZ () const |
| Real | getWaterAverageZ () const |
| const RadarObject * | getObjectList () const |
| const RadarObject * | getLocalObjectList () const |
| void | clearAllEvents (void) |
| remove all radar events in progress | |
| Object * | searchListForRadarLocationMatch (RadarObject *listHead, ICoord2D *radarMatch) |
Protected Attributes | |
| WW3DFormat | m_terrainTextureFormat |
| format to use for terrain texture | |
| Image * | m_terrainImage |
| terrain image abstraction for drawing | |
| TextureClass * | m_terrainTexture |
| terrain background texture | |
| WW3DFormat | m_overlayTextureFormat |
| format to use for overlay texture | |
| Image * | m_overlayImage |
| overlay image abstraction for drawing | |
| TextureClass * | m_overlayTexture |
| overlay texture | |
| WW3DFormat | m_shroudTextureFormat |
| format to use for shroud texture | |
| Image * | m_shroudImage |
| shroud image abstraction for drawing | |
| TextureClass * | m_shroudTexture |
| shroud texture | |
| Int | m_textureWidth |
| width for all radar textures | |
| Int | m_textureHeight |
| height for all radar textures | |
| Bool | m_reconstructViewBox |
| true when we need to reconstruct the box | |
| Real | m_viewAngle |
| camera angle used for the view box we have | |
| Real | m_viewZoom |
| camera zoom used for the view box we have | |
| ICoord2D | m_viewBox [4] |
| radar cell points for the 4 corners of view box | |
| std::list< const Coord3D * > | m_cachedHeroPosList |
Protected Attributes inherited from Radar | |
| Bool | m_radarHidden |
| true when radar is not visible | |
| Bool | m_radarForceOn |
| true when radar is forced to be on | |
| RadarObject * | m_objectList |
| list of objects in the radar | |
| RadarObject * | m_localObjectList |
| Real | m_terrainAverageZ |
| average Z for terrain samples | |
| Real | m_waterAverageZ |
| average Z for water samples | |
| Real | m_xSample |
| Real | m_ySample |
| RadarEvent | m_event [MAX_RADAR_EVENTS] |
| our radar events | |
| Int | m_nextFreeRadarEvent |
| index into m_event for where to store the next event | |
| Int | m_lastRadarEvent |
| index of the most recent radar event | |
| GameWindow * | m_radarWindow |
| window we display the radar in | |
| Region3D | m_mapExtent |
| extents of the current map | |
| UnsignedInt | m_queueTerrainRefreshFrame |
| frame we requested the last terrain refresh on | |
Protected Attributes inherited from SubsystemInterface | |
| AsciiString | m_name |
Additional Inherited Members | |
Protected Types inherited from Radar | |
| enum | { MAX_RADAR_EVENTS = 64 } |
W3D radar class. This has the device specific implementation of the radar such as the drawing routines
Definition at line 50 of file W3DRadar.h.
| W3DRadar::W3DRadar | ( | void | ) |
Definition at line 823 of file W3DRadar.cpp.
| W3DRadar::~W3DRadar | ( | void | ) |
Definition at line 856 of file W3DRadar.cpp.
|
protected |
create the terrain texture of the radar
Definition at line 1021 of file W3DRadar.cpp.
|
virtual |
|
protected |
delete resources used
Delete resources used specifically in this W3D radar implemetation
Definition at line 140 of file W3DRadar.cpp.
draw the radar
Actually draw the radar at the screen coordinates provided NOTE about how drawing works: The radar images are computed at samples across the map and are built into a "square" texture area. At the time of drawing and computing radar<->world coords we consider the "ratio" of width to height of the map dimensions so that when we draw we preserve the aspect ratio of the map and don't squish it in any direction that would cause the map to be distorted. Extra blank space is drawn around the radar images to keep the whole radar area covered when the map displayed is "long" or "tall"
Implements Radar.
Definition at line 1350 of file W3DRadar.cpp.
|
protected |
Draw a hero icon at a position, given radar box upper left location and dimensions.
Definition at line 254 of file W3DRadar.cpp.
|
protected |
< spin around this many angles going from big to small
Definition at line 371 of file W3DRadar.cpp.
|
protected |
< spin around this many angles going from big to small
Definition at line 470 of file W3DRadar.cpp.
draw view box
Draw a "box" into the texture passed in that represents the viewable area for the tactical display into the game world
Definition at line 284 of file W3DRadar.cpp.
|
virtual |
subsystem init
Radar initialization
Reimplemented from Radar.
Definition at line 867 of file W3DRadar.cpp.
|
protected |
find format to use for the radar texture
Find the texture format we're going to use for the radar. The texture format must be supported by the hardware. The "more preferred" formats appear at the top of the format tables in order from most preferred to least preferred
Definition at line 103 of file W3DRadar.cpp.
|
protected |
"shade" color according to height value
Shade the color passed in using the height parameter to lighten and darken it. Colors will be interpolated using the value "height" across the range from loZ to hiZ. The midZ is the "middle" point, height values above it will be lightened, while lower ones are darkened.
Definition at line 750 of file W3DRadar.cpp.
|
virtual |
reset radar for new map
Reset the radar for the new map data being given to it
Reimplemented from Radar.
Definition at line 1001 of file W3DRadar.cpp.
|
protected |
convert radar coord to pixel location
Convert radar position to actual pixel coord
Definition at line 235 of file W3DRadar.cpp.
|
protected |
remake the view box
Reconstruct the view box given the current camera settings
Definition at line 178 of file W3DRadar.cpp.
|
virtual |
refresh the water values for the radar
Reimplemented from Radar.
Definition at line 1446 of file W3DRadar.cpp.
|
protected |
render an object list to the texture
Render an object list into the texture passed in
Definition at line 620 of file W3DRadar.cpp.
|
virtual |
subsystem reset
Reset the radar to the initial empty state ready for new data
Reimplemented from Radar.
Definition at line 958 of file W3DRadar.cpp.
|
virtual |
set the shroud level at shroud cell x,y
<
Implements Radar.
Definition at line 1276 of file W3DRadar.cpp.
|
virtual |
|
protected |
Definition at line 121 of file W3DRadar.h.
|
protected |
overlay image abstraction for drawing
Definition at line 99 of file W3DRadar.h.
|
protected |
overlay texture
Definition at line 100 of file W3DRadar.h.
|
protected |
format to use for overlay texture
Definition at line 98 of file W3DRadar.h.
|
protected |
true when we need to reconstruct the box
Definition at line 116 of file W3DRadar.h.
|
protected |
shroud image abstraction for drawing
Definition at line 103 of file W3DRadar.h.
|
protected |
shroud texture
Definition at line 104 of file W3DRadar.h.
|
protected |
format to use for shroud texture
Definition at line 102 of file W3DRadar.h.
|
protected |
terrain image abstraction for drawing
Definition at line 95 of file W3DRadar.h.
|
protected |
terrain background texture
Definition at line 96 of file W3DRadar.h.
|
protected |
format to use for terrain texture
Definition at line 94 of file W3DRadar.h.
|
protected |
height for all radar textures
Definition at line 107 of file W3DRadar.h.
|
protected |
width for all radar textures
Definition at line 106 of file W3DRadar.h.
|
protected |
camera angle used for the view box we have
Definition at line 117 of file W3DRadar.h.
|
protected |
radar cell points for the 4 corners of view box
Definition at line 119 of file W3DRadar.h.
|
protected |
camera zoom used for the view box we have
Definition at line 118 of file W3DRadar.h.