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. |
#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().
enum NOTICE_TYPE |
The different categories of notices.
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.
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. |
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.
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. |
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.
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.
type | The category of the message to remove. The value should be specified from NOTICE_TYPE. |
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.
index | The order index of the notice to remove. |
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.
time | The current common game time to compare against the expiration time of the notices. |
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: