In-game Notice Display

Displays notices to update the player on key events happening in the game. More...


Files

file  notice.c
 Implementaion of the in-game notice display.
file  notice.h
 Interface to the in-game notice display.

Defines

#define NOTICE_NOEXPIRATION   0xFFFFFFFF
 An expiration time used to indicate that a message does not expire and will be displayed until explicitly removed.

Enumerations

enum  NOTICE_TYPE {
  NOTICE_KILL, NOTICE_LOCALKILL, NOTICE_TEAMKILL, NOTICE_LOCALTEAMKILL,
  NOTICE_REDFLAGHELD, NOTICE_BLUEFLAGHELD, NOTICE_REDFLAGCAP, NOTICE_BLUEFLAGCAP,
  NOTICE_MAXTYPE
}
 The different categories of notices. More...

Functions

void AddNotice (Uint32 expiryTime, Uint8 type, rtsa_char *format,...)
 Adds a new notice to the display.
void AddScoreNotice (int killerId, int killedId, int score)
 Adds a notice about a player shooting another.
void RemoveAllNotices ()
 Remove all notices from the system and the display.
void RemoveNotice (Uint8 type)
 Removes a notice of the specified type.
static void RemoveOneNotice (int index)
 Removes a specific notice from the display.
void UpdateNotices (Uint32 time)
 Update all visible notices by removing any expired notices and placing notices at their proper location when notices are added or removed.

Detailed Description

Displays notices to update the player on key events happening in the game.


Define Documentation

#define NOTICE_NOEXPIRATION   0xFFFFFFFF

An expiration time used to indicate that a message does not expire and will be displayed until explicitly removed.

Definition at line 80 of file notice.h.

Referenced by AddNotice(), and RemoveOneNotice().


Enumeration Type Documentation

enum NOTICE_TYPE

The different categories of notices.

Todo:
Decide if this many types are needed; maybe consolidate a few.
Enumerator:
NOTICE_KILL  A notice about a player destroying a tank of the opposing team.
NOTICE_LOCALKILL  Notice that the local player has destroyed a tank of the opposing team.
NOTICE_TEAMKILL  A notice about a player destroying a tank on the same team.
NOTICE_LOCALTEAMKILL  Notice that the local player has destroyed a tank on his/her team.
NOTICE_REDFLAGHELD  Indication that the red team's flag is held by a blue team player.
NOTICE_BLUEFLAGHELD  Indication that the blue team's flag is held by a red team player.
NOTICE_REDFLAGCAP  A notice that the red team's flag has been captured by the blue team.
NOTICE_BLUEFLAGCAP  A notice that the blue team's flag has been captured by the red team.
NOTICE_MAXTYPE 

Definition at line 40 of file notice.h.


Function Documentation

void AddNotice ( Uint32  expiryTime,
Uint8  type,
rtsa_char format,
  ... 
)

Adds a new notice to the display.

New notices are added to the bottom of the visible notices, with non-expiring notices added ahead of any expiring notices.

Parameters:
expiryTime The common game time when the message should be removed from the display. If the message should persist until explicitly removed, the value NOTICE_NOEXPIRATION should be used.
type The category for the message. It should be a value specified from NOTICE_TYPE.
format A printf() style formatting string used to generate the text that is renderd for the notice.
... Any variable inputs, printf() style.
Author:
Jeff Jackowski

Definition at line 124 of file notice.c.

References AddRenderItem(), ClearRenderItem(), COLOR_BLACK, colorFmtInd, dInfo, Notice_t::expiryTime, FALSE, FONT_SCORE, LAYER_TEXT, RenderItem_t::loc, MAX_NOTICES, NOTICE_MAXTYPE, NOTICE_NOEXPIRATION, notimeouts, order, DisplayInfo_t::pw, Notice_t::text, TextRenderStringV(), timeouts, TRUE, and Notice_t::type.

Referenced by AddScoreNotice().

Here is the call graph for this function:

void AddScoreNotice ( int  killerId,
int  killedId,
int  score 
)

Adds a notice about a player shooting another.

Internally determines if the local player did the shooting and if the player shot is on the same team to select the correct message.

Parameters:
killerId The ID of the player that shot another player.
killedId The ID of the player that was shot.
score The new score of the player that shot another.
Author:
Jeff Jackowski

Definition at line 185 of file notice.c.

References AddNotice(), frameTime, localPlayer, MAX_PLAYERS, Player_t::name, NOTICE_KILL, NOTICE_LOCALKILL, NOTICE_LOCALTEAMKILL, NOTICE_TEAMKILL, Player_t::pid, players, STRING_KILL, STRING_LOCALKILL, STRING_LOCALTEAMKILLED, STRING_LOCALTEAMKILLER, STRING_TEAMKILL, strings, and Player_t::team.

Referenced by HandleScoreUpdate().

Here is the call graph for this function:

void RemoveAllNotices (  ) 

Remove all notices from the system and the display.

Author:
Jeff Jackowski

Definition at line 232 of file notice.c.

References ClearRenderItem(), RenderItem_t::data, notimeouts, order, RemoveRenderItem(), Notice_t::text, and timeouts.

Referenced by GameUninit().

Here is the call graph for this function:

void RemoveNotice ( Uint8  type  ) 

Removes a notice of the specified type.

Safe to use if the notice type is not currently present.

Parameters:
type The category of the message to remove. The value should be specified from NOTICE_TYPE.
Author:
Jeff Jackowski

Definition at line 220 of file notice.c.

References notimeouts, order, RemoveOneNotice(), and timeouts.

Here is the call graph for this function:

static void RemoveOneNotice ( int  index  )  [static]

Removes a specific notice from the display.

For internal use only.

Parameters:
index The order index of the notice to remove.
Author:
Jeff Jackowski

Definition at line 98 of file notice.c.

References ClearRenderItem(), RenderItem_t::data, Notice_t::expiryTime, RenderItem_t::loc, MAX_NOTICES, NOTICE_NOEXPIRATION, notimeouts, order, RemoveRenderItem(), Notice_t::text, and timeouts.

Referenced by RemoveNotice(), and UpdateNotices().

Here is the call graph for this function:

void UpdateNotices ( Uint32  time  ) 

Update all visible notices by removing any expired notices and placing notices at their proper location when notices are added or removed.

Parameters:
time The current common game time to compare against the expiration time of the notices.
Author:
Jeff Jackowski

Definition at line 247 of file notice.c.

References dInfo, Notice_t::expiryTime, FALSE, RenderItem_t::loc, notimeouts, order, PlaceRenderItem(), DisplayInfo_t::pw, RemoveOneNotice(), SPACING, Notice_t::text, timeouts, TOP_MARGIN, and TRUE.

Here is the call graph for this function:


Generated on Mon May 28 04:41:43 2007 for Retro Tank Super Attack by  doxygen 1.5.2