RenderItem_t Struct Reference
[Render System]

The fundamental unit for a visible rectangular region. More...

#include <render.h>

Collaboration diagram for RenderItem_t:

Collaboration graph
[legend]

Data Fields

union {
   struct {
      Bool   dirty: 1
 Flag that indicates the item has changed since last drawn and the change is visible.
      Bool   enableDraw: 1
 Flag that indicates the item should be drawn; this flag is not cleared in Render().
      Bool   placed: 1
 Flag that indicates the item was placed with PlaceRenderItem() since the last frame was rendered.
      Bool   transparent: 1
 Flag that indicates the item has transparency.
      Bool   visible: 1
 Flag that indicates the item is within the viewable area.
   } 
   Uint32   flags
 A set of bit flags used to hold render state information.
}; 
void * data
 A pointer to application defined data.
SDL_Rect loc
 The logical (world) location of the item relative to the layer.
RenderItemnext
 A pointer to the next item in the list of all visible items.
Layerparent
 The owning layer of this item.
SDL_Rect physDest
 The destination coordinates on the physical display.
Sint16 physLocX
 The physical display location where the item is placed.
Sint16 physLocY
RenderItemprev
 A pointer to the previous item in the list of all visible items.
SDL_Rect prevStates [2]
 Stores physical coordinates of previously visible locations.
Sint16 rectIndex [2]
 The index of the rect in the update list which contains this item.
ItemRenderer renderer
 The function which renders the item.
SDL_Rect src
 The region of the item that must be rendered in the next frame.

Detailed Description

The fundamental unit for a visible rectangular region.

Each RenderItem can only be used with one Layer.

Author:
Jeff Jackowski

Definition at line 262 of file render.h.


Field Documentation

union { ... }

void* RenderItem_t::data

A pointer to application defined data.

Definition at line 282 of file render.h.

Referenced by AddPlayer(), BfldErrUninit(), GameInit(), GameUninit(), GenericSurfaceRenderer(), GraphicReset(), ObstacleInit(), RemoveAllNotices(), RemoveOneNotice(), RemovePlayer(), SetupMenu(), SolidFillRenderer(), SplashUninit(), and TextRenderStringV().

Bool RenderItem_t::dirty

Flag that indicates the item has changed since last drawn and the change is visible.

For internal use only.

Definition at line 321 of file render.h.

Referenced by ClearRenderItem().

Bool RenderItem_t::enableDraw

Flag that indicates the item should be drawn; this flag is not cleared in Render().

Definition at line 344 of file render.h.

Referenced by AddRenderItem(), ClearRenderItem(), DisablePlayerLabels(), EnablePlayerLabels(), PlacePlayerLabel(), TeamSelUninit(), and TeamSelUpdate().

Uint32 RenderItem_t::flags

A set of bit flags used to hold render state information.

Definition at line 314 of file render.h.

SDL_Rect RenderItem_t::loc

The logical (world) location of the item relative to the layer.

The rendering system will not set or change the value of loc.

Definition at line 287 of file render.h.

Referenced by AddNotice(), AddPlayer(), AddRenderItem(), BfldErrResize(), ClearRenderItem(), GameInit(), GameRun(), GraphicReset(), main(), MenuRun(), MoveShell(), MoveTank(), NetStatInit(), NetStatUpdate(), ObstacleInit(), PlaceMarkers(), PlacePlayerLabel(), ReadPlayer(), RemoveOneNotice(), RenderLatency(), RenderLocalAddr(), RenderScore(), RenderTSync(), SetupMenu(), SpawnTank(), SplashResize(), TeamSelInit(), TeamSelUpdate(), TextRenderStringV(), TextSetup(), and UpdateNotices().

RenderItem* RenderItem_t::next

A pointer to the next item in the list of all visible items.

Definition at line 274 of file render.h.

Referenced by AddRenderItem(), ObstacleInit(), and RemoveRenderItem().

Layer* RenderItem_t::parent

The owning layer of this item.

Definition at line 270 of file render.h.

Referenced by AddRenderItem(), ObstacleInit(), PlacePlayerLabel(), and RemoveRenderItem().

SDL_Rect RenderItem_t::physDest

The destination coordinates on the physical display.

This value is clipped to the display and to the union of region that has changed and regions that require an update because of other items changing. At the time renderer is called, src will contain the item relative coordinates of what must be drawn onto the rectangle in physDest.

Definition at line 302 of file render.h.

Referenced by ClearRenderItem(), GenericSurfaceRenderer(), PlacePlayerLabel(), and SolidFillRenderer().

Sint16 RenderItem_t::physLocX

The physical display location where the item is placed.

The width and height are no different than the size of the item as stored in loc.

Warning:
This location (upper left) is not clipped to the display area by PlaceRenderItem(). Doing so would complicate figuring out the item relative coordinates for src in the rendering process.

Definition at line 354 of file render.h.

Referenced by DrawTank(), and main().

Sint16 RenderItem_t::physLocY

Definition at line 354 of file render.h.

Referenced by DrawTank(), main(), and PlacePlayerLabel().

Bool RenderItem_t::placed

Flag that indicates the item was placed with PlaceRenderItem() since the last frame was rendered.

This helps avoid duplicating calculations during rendering.

For internal use only.

Definition at line 339 of file render.h.

Referenced by RotateTank().

RenderItem* RenderItem_t::prev

A pointer to the previous item in the list of all visible items.

Definition at line 278 of file render.h.

Referenced by AddRenderItem(), ObstacleInit(), and RemoveRenderItem().

SDL_Rect RenderItem_t::prevStates[2]

Stores physical coordinates of previously visible locations.

Index zero stores the location for the last frame, index one stores the frame before the last, ect . . . The width field must be zero if the item was not visible in the corresponding frame.

Definition at line 309 of file render.h.

Referenced by ClearRenderItem().

Sint16 RenderItem_t::rectIndex[2]

The index of the rect in the update list which contains this item.

This is used to prevent confusion and multiple renderings of the item in the case that there are overlapping rects in the update list.

Definition at line 360 of file render.h.

ItemRenderer RenderItem_t::renderer

The function which renders the item.

Definition at line 266 of file render.h.

Referenced by AddPlayer(), AddRenderItem(), BfldErrInit(), BfldErrUninit(), EnablePlayerLabels(), GameInit(), GameRun(), GameUninit(), GraphicReset(), NetStatInit(), ObstacleInit(), PlacePlayerLabel(), RemovePlayer(), SetupMenu(), SplashInit(), SplashUninit(), TeamSelInit(), TextRenderStringV(), and TextSetup().

SDL_Rect RenderItem_t::src

The region of the item that must be rendered in the next frame.

The rendering system will change the value of src to clip it to the viewable area and to extend it if needed to draw over an area made dirty by another update.

Definition at line 294 of file render.h.

Referenced by AddRenderItem(), and GenericSurfaceRenderer().

Bool RenderItem_t::transparent

Flag that indicates the item has transparency.

Warning:
Not yet implemented; all items are assumed to have transparency. Implementing this could achive a performance bonus for opaque items.

Definition at line 328 of file render.h.

Bool RenderItem_t::visible

Flag that indicates the item is within the viewable area.

Definition at line 332 of file render.h.

Referenced by ClearRenderItem().


The documentation for this struct was generated from the following file:
Generated on Mon May 28 04:41:44 2007 for Retro Tank Super Attack by  doxygen 1.5.2