Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

ui_atoms.c File Reference

#include "ui_local.h"

Include dependency graph for ui_atoms.c:

Include dependency graph

Go to the source code of this file.

Functions

void QDECL Com_Error (int level, const char *error,...)
void QDECL Com_Printf (const char *msg,...)
void NeedCDAction (qboolean result)
void NeedCDKeyAction (qboolean result)
void UI_AdjustFrom640 (float *x, float *y, float *w, float *h)
char * UI_Argv (int arg)
void UI_Cache_f ()
void UI_CalcPostGameStats ()
float UI_ClampCvar (float min, float max, float value)
void UI_ClearScores ()
qboolean UI_ConsoleCommand (int realTime)
qboolean UI_CursorInRect (int x, int y, int width, int height)
char * UI_Cvar_VariableString (const char *var_name)
void UI_DrawHandlePic (float x, float y, float w, float h, qhandle_t hShader)
void UI_DrawNamedPic (float x, float y, float width, float height, const char *picname)
void UI_DrawRect (float x, float y, float width, float height, const float *color)
void UI_DrawSides (float x, float y, float w, float h)
void UI_DrawTextBox (int x, int y, int width, int lines)
void UI_DrawTopBottom (float x, float y, float w, float h)
void UI_FillRect (float x, float y, float width, float height, const float *color)
void UI_LoadBestScores (const char *map, int game)
void UI_SetBestScores (postGameInfo_t *newInfo, qboolean postGame)
void UI_SetColor (const float *rgba)
void UI_Shutdown (void)
void UI_StartDemoLoop (void)
void UI_UpdateScreen (void)

Variables

qboolean m_entersound
qboolean newUI = qfalse


Function Documentation

void QDECL Com_Error int  level,
const char *  error,
  ...
 

Definition at line 35 of file ui_atoms.c.

References error(), QDECL, trap_Error(), va(), va_end, va_list, va_start, and vsprintf().

00035                                                           {
00036     va_list     argptr;
00037     char        text[1024];
00038 
00039     va_start (argptr, error);
00040     vsprintf (text, error, argptr);
00041     va_end (argptr);
00042 
00043     trap_Error( va("%s", text) );
00044 }

Here is the call graph for this function:

void QDECL Com_Printf const char *  msg,
  ...
 

Definition at line 46 of file ui_atoms.c.

References QDECL, trap_Print(), va(), va_end, va_list, va_start, and vsprintf().

00046                                               {
00047     va_list     argptr;
00048     char        text[1024];
00049 
00050     va_start (argptr, msg);
00051     vsprintf (text, msg, argptr);
00052     va_end (argptr);
00053 
00054     trap_Print( va("%s", text) );
00055 }

Here is the call graph for this function:

void NeedCDAction qboolean  result  )  [static]
 

Definition at line 85 of file ui_atoms.c.

References EXEC_APPEND, and trap_Cmd_ExecuteText().

00085                                             {
00086     if ( !result ) {
00087         trap_Cmd_ExecuteText( EXEC_APPEND, "quit\n" );
00088     }
00089 }

Here is the call graph for this function:

void NeedCDKeyAction qboolean  result  )  [static]
 

Definition at line 93 of file ui_atoms.c.

References EXEC_APPEND, and trap_Cmd_ExecuteText().

00093                                                {
00094     if ( !result ) {
00095         trap_Cmd_ExecuteText( EXEC_APPEND, "quit\n" );
00096     }
00097 }

Here is the call graph for this function:

void UI_AdjustFrom640 float *  x,
float *  y,
float *  w,
float *  h
 

Definition at line 399 of file ui_atoms.c.

References uiStatic_t::bias, displayContextDef_t::bias, h(), uiStatic_t::scale, uiInfo_t::uiDC, uiInfo, uis, w, x, displayContextDef_t::xscale, y, and displayContextDef_t::yscale.

Referenced by _UI_DrawSides(), _UI_DrawTopBottom(), Main_MenuDraw(), Text_PaintChar(), UI_DrawHandlePic(), UI_DrawNamedPic(), UI_DrawPlayer(), UI_DrawRect(), UI_DrawSides(), UI_DrawTopBottom(), and UI_FillRect().

00399                                                                 {
00400     // expect valid pointers
00401 #if 0
00402     *x = *x * uiInfo.uiDC.scale + uiInfo.uiDC.bias;
00403     *y *= uiInfo.uiDC.scale;
00404     *w *= uiInfo.uiDC.scale;
00405     *h *= uiInfo.uiDC.scale;
00406 #endif
00407 
00408     *x *= uiInfo.uiDC.xscale;
00409     *y *= uiInfo.uiDC.yscale;
00410     *w *= uiInfo.uiDC.xscale;
00411     *h *= uiInfo.uiDC.yscale;
00412 
00413 }

Here is the call graph for this function:

char* UI_Argv int  arg  ) 
 

Definition at line 100 of file ui_atoms.c.

References buffer, and trap_Argv().

Referenced by UI_CalcPostGameStats(), UI_CinematicsMenu_f(), UI_ConsoleCommand(), and UI_SPPostgameMenu_f().

00100                          {
00101     static char buffer[MAX_STRING_CHARS];
00102 
00103     trap_Argv( arg, buffer, sizeof( buffer ) );
00104 
00105     return buffer;
00106 }

Here is the call graph for this function:

void UI_Cache_f void   )  [static]
 

Definition at line 214 of file ui_atoms.c.

References Display_CacheAll().

00214                          {
00215     Display_CacheAll();
00216 }

Here is the call graph for this function:

void UI_CalcPostGameStats  )  [static]
 

Definition at line 223 of file ui_atoms.c.

References postGameInfo_s::accuracy, postGameInfo_s::assists, atoi, postGameInfo_s::baseScore, postGameInfo_s::blueScore, postGameInfo_s::captures, Com_sprintf(), CS_SERVERINFO, postGameInfo_s::defends, postGameInfo_s::excellents, f, fileHandle_t, FS_READ, FS_WRITE, postGameInfo_s::gauntlets, postGameInfo_s::impressives, Info_ValueForKey(), vmCvar_t::integer, uiInfo_t::mapList, MAX_QPATH, memset(), uiInfo_t::newBestTime, uiInfo_t::newHighScoreTime, postGameInfo_s::perfects, postGameInfo_t, Q_strncpyz(), qboolean, qtrue, displayContextDef_t::realTime, postGameInfo_s::redScore, postGameInfo_s::score, postGameInfo_s::shutoutBonus, postGameInfo_s::skillBonus, postGameInfo_s::time, time(), postGameInfo_s::timeBonus, mapInfo::timeToBeat, trap_Cvar_Set(), trap_Cvar_VariableValue(), trap_FS_FCloseFile(), trap_FS_FOpenFile(), trap_FS_Read(), trap_FS_Write(), trap_GetConfigString(), UI_Argv(), ui_currentMap, UI_Cvar_VariableString(), UI_SetBestScores(), UI_ShowPostGame(), uiInfo_t::uiDC, and uiInfo.

Referenced by UI_ConsoleCommand().

00223                                    {
00224     char        map[MAX_QPATH];
00225     char        fileName[MAX_QPATH];
00226     char        info[MAX_INFO_STRING];
00227     fileHandle_t f;
00228     int size, game, time, adjustedTime;
00229     postGameInfo_t oldInfo;
00230     postGameInfo_t newInfo;
00231     qboolean newHigh = qfalse;
00232 
00233     trap_GetConfigString( CS_SERVERINFO, info, sizeof(info) );
00234     Q_strncpyz( map, Info_ValueForKey( info, "mapname" ), sizeof(map) );
00235     game = atoi(Info_ValueForKey(info, "g_gametype"));
00236 
00237     // compose file name
00238     Com_sprintf(fileName, MAX_QPATH, "games/%s_%i.game", map, game);
00239     // see if we have one already
00240     memset(&oldInfo, 0, sizeof(postGameInfo_t));
00241     if (trap_FS_FOpenFile(fileName, &f, FS_READ) >= 0) {
00242     // if so load it
00243         size = 0;
00244         trap_FS_Read(&size, sizeof(int), f);
00245         if (size == sizeof(postGameInfo_t)) {
00246             trap_FS_Read(&oldInfo, sizeof(postGameInfo_t), f);
00247         }
00248         trap_FS_FCloseFile(f);
00249     }                    
00250 
00251     newInfo.accuracy = atoi(UI_Argv(3));
00252     newInfo.impressives = atoi(UI_Argv(4));
00253     newInfo.excellents = atoi(UI_Argv(5));
00254     newInfo.defends = atoi(UI_Argv(6));
00255     newInfo.assists = atoi(UI_Argv(7));
00256     newInfo.gauntlets = atoi(UI_Argv(8));
00257     newInfo.baseScore = atoi(UI_Argv(9));
00258     newInfo.perfects = atoi(UI_Argv(10));
00259     newInfo.redScore = atoi(UI_Argv(11));
00260     newInfo.blueScore = atoi(UI_Argv(12));
00261     time = atoi(UI_Argv(13));
00262     newInfo.captures = atoi(UI_Argv(14));
00263 
00264     newInfo.time = (time - trap_Cvar_VariableValue("ui_matchStartTime")) / 1000;
00265     adjustedTime = uiInfo.mapList[ui_currentMap.integer].timeToBeat[game];
00266     if (newInfo.time < adjustedTime) { 
00267         newInfo.timeBonus = (adjustedTime - newInfo.time) * 10;
00268     } else {
00269         newInfo.timeBonus = 0;
00270     }
00271 
00272     if (newInfo.redScore > newInfo.blueScore && newInfo.blueScore <= 0) {
00273         newInfo.shutoutBonus = 100;
00274     } else {
00275         newInfo.shutoutBonus = 0;
00276     }
00277 
00278     newInfo.skillBonus = trap_Cvar_VariableValue("g_spSkill");
00279     if (newInfo.skillBonus <= 0) {
00280         newInfo.skillBonus = 1;
00281     }
00282     newInfo.score = newInfo.baseScore + newInfo.shutoutBonus + newInfo.timeBonus;
00283     newInfo.score *= newInfo.skillBonus;
00284 
00285     // see if the score is higher for this one
00286     newHigh = (newInfo.redScore > newInfo.blueScore && newInfo.score > oldInfo.score);
00287 
00288     if  (newHigh) {
00289         // if so write out the new one
00290         uiInfo.newHighScoreTime = uiInfo.uiDC.realTime + 20000;
00291         if (trap_FS_FOpenFile(fileName, &f, FS_WRITE) >= 0) {
00292             size = sizeof(postGameInfo_t);
00293             trap_FS_Write(&size, sizeof(int), f);
00294             trap_FS_Write(&newInfo, sizeof(postGameInfo_t), f);
00295             trap_FS_FCloseFile(f);
00296         }
00297     }
00298 
00299     if (newInfo.time < oldInfo.time) {
00300         uiInfo.newBestTime = uiInfo.uiDC.realTime + 20000;
00301     }
00302  
00303     // put back all the ui overrides
00304     trap_Cvar_Set("capturelimit", UI_Cvar_VariableString("ui_saveCaptureLimit"));
00305     trap_Cvar_Set("fraglimit", UI_Cvar_VariableString("ui_saveFragLimit"));
00306     trap_Cvar_Set("cg_drawTimer", UI_Cvar_VariableString("ui_drawTimer"));
00307     trap_Cvar_Set("g_doWarmup", UI_Cvar_VariableString("ui_doWarmup"));
00308     trap_Cvar_Set("g_Warmup", UI_Cvar_VariableString("ui_Warmup"));
00309     trap_Cvar_Set("sv_pure", UI_Cvar_VariableString("ui_pure"));
00310     trap_Cvar_Set("g_friendlyFire", UI_Cvar_VariableString("ui_friendlyFire"));
00311 
00312     UI_SetBestScores(&newInfo, qtrue);
00313     UI_ShowPostGame(newHigh);
00314 
00315 
00316 }

Here is the call graph for this function:

float UI_ClampCvar float  min,
float  max,
float  value
 

Definition at line 67 of file ui_atoms.c.

References value.

Referenced by Controls_GetConfig().

00068 {
00069     if ( value < min ) return min;
00070     if ( value > max ) return max;
00071     return value;
00072 }

void UI_ClearScores  ) 
 

Definition at line 183 of file ui_atoms.c.

References count, f, fileHandle_t, FS_WRITE, i, memset(), postGameInfo_t, qfalse, strlen(), trap_FS_FCloseFile(), trap_FS_FOpenFile(), trap_FS_GetFileList(), trap_FS_Write(), UI_SetBestScores(), and va().

Referenced by UI_RunMenuScript().

00183                       {
00184     char    gameList[4096];
00185     char *gameFile;
00186     int     i, len, count, size;
00187     fileHandle_t f;
00188     postGameInfo_t newInfo;
00189 
00190     count = trap_FS_GetFileList( "games", "game", gameList, sizeof(gameList) );
00191 
00192     size = sizeof(postGameInfo_t);
00193     memset(&newInfo, 0, size);
00194 
00195     if (count > 0) {
00196         gameFile = gameList;
00197         for ( i = 0; i < count; i++ ) {
00198             len = strlen(gameFile);
00199             if (trap_FS_FOpenFile(va("games/%s",gameFile), &f, FS_WRITE) >= 0) {
00200                 trap_FS_Write(&size, sizeof(int), f);
00201                 trap_FS_Write(&newInfo, size, f);
00202                 trap_FS_FCloseFile(f);
00203             }
00204             gameFile += len + 1;
00205         }
00206     }
00207     
00208     UI_SetBestScores(&newInfo, qfalse);
00209 
00210 }

Here is the call graph for this function:

qboolean UI_ConsoleCommand int  realTime  ) 
 

Definition at line 324 of file ui_atoms.c.

References displayContextDef_t::frameTime, Menu_Cache(), Q_stricmp(), Q_strncpyz(), qboolean, qtrue, displayContextDef_t::realTime, trap_Argc(), trap_R_RemapShader(), UI_Argv(), UI_Cache_f(), UI_CalcPostGameStats(), UI_CDKeyMenu_f(), UI_CinematicsMenu_f(), UI_Load(), UI_Report(), UI_ShowPostGame(), UI_SPLevelMenu_f(), UI_SPPostgameMenu_f(), UI_SPUnlock_f(), UI_SPUnlockMedals_f(), UI_TeamOrdersMenu_f(), uiInfo_t::uiDC, and uiInfo.

Referenced by vmMain().

00324                                            {
00325     char    *cmd;
00326 
00327     uiInfo.uiDC.frameTime = realTime - uiInfo.uiDC.realTime;
00328     uiInfo.uiDC.realTime = realTime;
00329 
00330     cmd = UI_Argv( 0 );
00331 
00332     // ensure minimum menu data is available
00333     //Menu_Cache();
00334 
00335     if ( Q_stricmp (cmd, "ui_test") == 0 ) {
00336         UI_ShowPostGame(qtrue);
00337     }
00338 
00339     if ( Q_stricmp (cmd, "ui_report") == 0 ) {
00340         UI_Report();
00341         return qtrue;
00342     }
00343     
00344     if ( Q_stricmp (cmd, "ui_load") == 0 ) {
00345         UI_Load();
00346         return qtrue;
00347     }
00348 
00349     if ( Q_stricmp (cmd, "remapShader") == 0 ) {
00350         if (trap_Argc() == 4) {
00351             char shader1[MAX_QPATH];
00352             char shader2[MAX_QPATH];
00353             Q_strncpyz(shader1, UI_Argv(1), sizeof(shader1));
00354             Q_strncpyz(shader2, UI_Argv(2), sizeof(shader2));
00355             trap_R_RemapShader(shader1, shader2, UI_Argv(3));
00356             return qtrue;
00357         }
00358     }
00359 
00360     if ( Q_stricmp (cmd, "postgame") == 0 ) {
00361         UI_CalcPostGameStats();
00362         return qtrue;
00363     }
00364 
00365     if ( Q_stricmp (cmd, "ui_cache") == 0 ) {
00366         UI_Cache_f();
00367         return qtrue;
00368     }
00369 
00370     if ( Q_stricmp (cmd, "ui_teamOrders") == 0 ) {
00371         //UI_TeamOrdersMenu_f();
00372         return qtrue;
00373     }
00374 
00375 
00376     if ( Q_stricmp (cmd, "ui_cdkey") == 0 ) {
00377         //UI_CDKeyMenu_f();
00378         return qtrue;
00379     }
00380 
00381     return qfalse;
00382 }

Here is the call graph for this function:

qboolean UI_CursorInRect int  x,
int  y,
int  width,
int  height
 

Definition at line 511 of file ui_atoms.c.

References uiStatic_t::cursorx, displayContextDef_t::cursorx, uiStatic_t::cursory, displayContextDef_t::cursory, qboolean, uiInfo_t::uiDC, uiInfo, uis, width, x, and y.

Referenced by ScrollList_Key(), and UI_TeamOrdersMenu_Key().

00512 {
00513     if (uiInfo.uiDC.cursorx < x ||
00514         uiInfo.uiDC.cursory < y ||
00515         uiInfo.uiDC.cursorx > x+width ||
00516         uiInfo.uiDC.cursory > y+height)
00517         return qfalse;
00518 
00519     return qtrue;
00520 }

char* UI_Cvar_VariableString const char *  var_name  ) 
 

Definition at line 109 of file ui_atoms.c.

References buffer, and trap_Cvar_VariableStringBuffer().

Referenced by _UI_Init(), GraphicsOptions_SetMenuItems(), SpecifyLeague_MenuInit(), UI_CalcPostGameStats(), UI_ClanName_HandleKey(), UI_DrawClanCinematic(), UI_DrawClanLogo(), UI_DrawOpponent(), UI_DrawOpponentLogo(), UI_DrawOpponentLogoMetal(), UI_DrawOpponentLogoName(), UI_DrawPlayerLogo(), UI_DrawPlayerLogoMetal(), UI_DrawPlayerLogoName(), UI_DrawPlayerModel(), UI_DrawSelectedPlayer(), UI_DrawServerRefreshDate(), UI_DrawTeamName(), UI_HeadCountByTeam(), UI_Load(), UI_LoadNonIngame(), UI_NextOpponent(), UI_OpponentLeaderName(), UI_OwnerDrawWidth(), UI_PriorOpponent(), UI_RunMenuScript(), UI_StartServerRefresh(), UI_StartSkirmish(), UI_StopCinematic(), UI_TeamName_HandleKey(), and UI_Update().

00109                                                      {
00110     static char buffer[MAX_STRING_CHARS];
00111 
00112     trap_Cvar_VariableStringBuffer( var_name, buffer, sizeof( buffer ) );
00113 
00114     return buffer;
00115 }

Here is the call graph for this function:

void UI_DrawHandlePic float  x,
float  y,
float  w,
float  h,
qhandle_t  hShader
 

Definition at line 423 of file ui_atoms.c.

References h(), trap_R_DrawStretchPic(), UI_AdjustFrom640(), w, x, and y.

Referenced by _UI_Refresh(), Bitmap_Draw(), Crosshair_Draw(), PlayerSettings_DrawEffects(), RadioButton_Draw(), Slider_Draw(), StartServer_LevelshotDraw(), UI_DrawCenteredPic(), UI_DrawClanCinematic(), UI_DrawClanLogo(), UI_DrawConnectScreen(), UI_DrawCrosshair(), UI_DrawEffects(), UI_DrawMapPreview(), UI_DrawNetMapPreview(), UI_DrawOpponentLogo(), UI_DrawOpponentLogoMetal(), UI_DrawOpponentLogoName(), UI_DrawPlayerLogo(), UI_DrawPlayerLogoMetal(), UI_DrawPlayerLogoName(), UI_DrawTierMap(), UI_Refresh(), and UI_SPLevelMenu_MenuDraw().

00423                                                                                {
00424     float   s0;
00425     float   s1;
00426     float   t0;
00427     float   t1;
00428 
00429     if( w < 0 ) {   // flip about vertical
00430         w  = -w;
00431         s0 = 1;
00432         s1 = 0;
00433     }
00434     else {
00435         s0 = 0;
00436         s1 = 1;
00437     }
00438 
00439     if( h < 0 ) {   // flip about horizontal
00440         h  = -h;
00441         t0 = 1;
00442         t1 = 0;
00443     }
00444     else {
00445         t0 = 0;
00446         t1 = 1;
00447     }
00448     
00449     UI_AdjustFrom640( &x, &y, &w, &h );
00450     trap_R_DrawStretchPic( x, y, w, h, s0, t0, s1, t1, hShader );
00451 }

Here is the call graph for this function:

void UI_DrawNamedPic float  x,
float  y,
float  width,
float  height,
const char *  picname
 

Definition at line 415 of file ui_atoms.c.

References height, qhandle_t, trap_R_DrawStretchPic(), trap_R_RegisterShaderNoMip(), UI_AdjustFrom640(), width, x, and y.

Referenced by ConfirmMenu_Draw(), MessageMenu_Draw(), Reset_MenuDraw(), UI_AddBotsMenu_Draw(), and UI_SPPostgameMenu_DrawAwardsMedals().

00415                                                                                          {
00416     qhandle_t   hShader;
00417 
00418     hShader = trap_R_RegisterShaderNoMip( picname );
00419     UI_AdjustFrom640( &x, &y, &width, &height );
00420     trap_R_DrawStretchPic( x, y, width, height, 0, 0, 1, 1, hShader );
00421 }

Here is the call graph for this function:

void UI_DrawRect float  x,
float  y,
float  width,
float  height,
const float *  color
 

Definition at line 487 of file ui_atoms.c.

References height, NULL, trap_R_DrawStretchPic(), trap_R_SetColor(), UI_AdjustFrom640(), UI_DrawSides(), UI_DrawTopBottom(), uis, uiStatic_t::whiteShader, width, x, and y.

Referenced by Menu_Draw(), and UI_DrawTextBox().

00487                                                                                     {
00488     trap_R_SetColor( color );
00489 
00490   UI_DrawTopBottom(x, y, width, height);
00491   UI_DrawSides(x, y, width, height);
00492 
00493     trap_R_SetColor( NULL );
00494 }

Here is the call graph for this function:

void UI_DrawSides float  x,
float  y,
float  w,
float  h
 

Definition at line 469 of file ui_atoms.c.

References h(), trap_R_DrawStretchPic(), UI_AdjustFrom640(), uiInfo_t::uiDC, uiInfo, w, displayContextDef_t::whiteShader, x, and y.

Referenced by UI_DrawRect().

00469                                                       {
00470     UI_AdjustFrom640( &x, &y, &w, &h );
00471     trap_R_DrawStretchPic( x, y, 1, h, 0, 0, 0, 0, uiInfo.uiDC.whiteShader );
00472     trap_R_DrawStretchPic( x + w - 1, y, 1, h, 0, 0, 0, 0, uiInfo.uiDC.whiteShader );
00473 }

Here is the call graph for this function:

void UI_DrawTextBox int  x,
int  y,
int  width,
int  lines
 

Definition at line 505 of file ui_atoms.c.

References BIGCHAR_HEIGHT, BIGCHAR_WIDTH, colorBlack, colorWhite, UI_DrawRect(), UI_FillRect(), width, x, and y.

00506 {
00507     UI_FillRect( x + BIGCHAR_WIDTH/2, y + BIGCHAR_HEIGHT/2, ( width + 1 ) * BIGCHAR_WIDTH, ( lines + 1 ) * BIGCHAR_HEIGHT, colorBlack );
00508     UI_DrawRect( x + BIGCHAR_WIDTH/2, y + BIGCHAR_HEIGHT/2, ( width + 1 ) * BIGCHAR_WIDTH, ( lines + 1 ) * BIGCHAR_HEIGHT, colorWhite );
00509 }

Here is the call graph for this function:

void UI_DrawTopBottom float  x,
float  y,
float  w,
float  h
 

Definition at line 475 of file ui_atoms.c.

References h(), trap_R_DrawStretchPic(), UI_AdjustFrom640(), uiInfo_t::uiDC, uiInfo, w, displayContextDef_t::whiteShader, x, and y.

Referenced by UI_DrawRect().

00475                                                           {
00476     UI_AdjustFrom640( &x, &y, &w, &h );
00477     trap_R_DrawStretchPic( x, y, w, 1, 0, 0, 0, 0, uiInfo.uiDC.whiteShader );
00478     trap_R_DrawStretchPic( x, y + h - 1, w, 1, 0, 0, 0, 0, uiInfo.uiDC.whiteShader );
00479 }

Here is the call graph for this function:

void UI_FillRect float  x,
float  y,
float  width,
float  height,
const float *  color
 

Definition at line 460 of file ui_atoms.c.

References height, NULL, trap_R_DrawStretchPic(), trap_R_SetColor(), UI_AdjustFrom640(), uiInfo_t::uiDC, uiInfo, uis, uiStatic_t::whiteShader, displayContextDef_t::whiteShader, width, x, and y.

Referenced by Controls_DrawKeyBinding(), Crosshair_Draw(), MenuField_Draw(), PlayerName_Draw(), RadioButton_Draw(), ScrollList_Draw(), ServerOptions_LevelshotDraw(), SpinControl_Draw(), StartServer_LevelshotDraw(), UI_CDKeyMenu_DrawKey(), UI_DrawTextBox(), UI_SaveConfigMenu_SavenameDraw(), and UI_SPLevelMenu_MenuDraw().

00460                                                                                     {
00461     trap_R_SetColor( color );
00462 
00463     UI_AdjustFrom640( &x, &y, &width, &height );
00464     trap_R_DrawStretchPic( x, y, width, height, 0, 0, 0, 0, uiInfo.uiDC.whiteShader );
00465 
00466     trap_R_SetColor( NULL );
00467 }

Here is the call graph for this function:

void UI_LoadBestScores const char *  map,
int  game
 

Definition at line 154 of file ui_atoms.c.

References Com_sprintf(), uiInfo_t::demoAvailable, f, fileHandle_t, FS_READ, MAX_QPATH, memset(), postGameInfo_t, qfalse, trap_Cvar_VariableValue(), trap_FS_FCloseFile(), trap_FS_FOpenFile(), trap_FS_Read(), UI_SetBestScores(), and uiInfo.

Referenced by _UI_Init(), UI_FeederSelection(), UI_GameType_HandleKey(), and UI_RunMenuScript().

00154                                                   {
00155     char        fileName[MAX_QPATH];
00156     fileHandle_t f;
00157     postGameInfo_t newInfo;
00158     memset(&newInfo, 0, sizeof(postGameInfo_t));
00159     Com_sprintf(fileName, MAX_QPATH, "games/%s_%i.game", map, game);
00160     if (trap_FS_FOpenFile(fileName, &f, FS_READ) >= 0) {
00161         int size = 0;
00162         trap_FS_Read(&size, sizeof(int), f);
00163         if (size == sizeof(postGameInfo_t)) {
00164             trap_FS_Read(&newInfo, sizeof(postGameInfo_t), f);
00165         }
00166         trap_FS_FCloseFile(f);
00167     }
00168     UI_SetBestScores(&newInfo, qfalse);
00169 
00170     Com_sprintf(fileName, MAX_QPATH, "demos/%s_%d.dm_%d", map, game, (int)trap_Cvar_VariableValue("protocol"));
00171     uiInfo.demoAvailable = qfalse;
00172     if (trap_FS_FOpenFile(fileName, &f, FS_READ) >= 0) {
00173         uiInfo.demoAvailable = qtrue;
00174         trap_FS_FCloseFile(f);
00175     } 
00176 }

Here is the call graph for this function:

void UI_SetBestScores postGameInfo_t newInfo,
qboolean  postGame
 

Definition at line 119 of file ui_atoms.c.

References postGameInfo_s::accuracy, postGameInfo_s::assists, postGameInfo_s::baseScore, postGameInfo_s::blueScore, postGameInfo_s::captures, postGameInfo_s::defends, postGameInfo_s::excellents, postGameInfo_s::gauntlets, postGameInfo_s::impressives, postGameInfo_s::perfects, postGameInfo_t, postGameInfo_s::redScore, postGameInfo_s::score, postGameInfo_s::shutoutBonus, postGameInfo_s::skillBonus, postGameInfo_s::time, postGameInfo_s::timeBonus, trap_Cvar_Set(), and va().

Referenced by UI_CalcPostGameStats(), UI_ClearScores(), and UI_LoadBestScores().

00119                                                                   {
00120     trap_Cvar_Set("ui_scoreAccuracy",     va("%i%%", newInfo->accuracy));
00121     trap_Cvar_Set("ui_scoreImpressives",    va("%i", newInfo->impressives));
00122     trap_Cvar_Set("ui_scoreExcellents",     va("%i", newInfo->excellents));
00123     trap_Cvar_Set("ui_scoreDefends",            va("%i", newInfo->defends));
00124     trap_Cvar_Set("ui_scoreAssists",            va("%i", newInfo->assists));
00125     trap_Cvar_Set("ui_scoreGauntlets",      va("%i", newInfo->gauntlets));
00126     trap_Cvar_Set("ui_scoreScore",              va("%i", newInfo->score));
00127     trap_Cvar_Set("ui_scorePerfect",            va("%i", newInfo->perfects));
00128     trap_Cvar_Set("ui_scoreTeam",                   va("%i to %i", newInfo->redScore, newInfo->blueScore));
00129     trap_Cvar_Set("ui_scoreBase",                   va("%i", newInfo->baseScore));
00130     trap_Cvar_Set("ui_scoreTimeBonus",      va("%i", newInfo->timeBonus));
00131     trap_Cvar_Set("ui_scoreSkillBonus",     va("%i", newInfo->skillBonus));
00132     trap_Cvar_Set("ui_scoreShutoutBonus",   va("%i", newInfo->shutoutBonus));
00133     trap_Cvar_Set("ui_scoreTime",                   va("%02i:%02i", newInfo->time / 60, newInfo->time % 60));
00134     trap_Cvar_Set("ui_scoreCaptures",       va("%i", newInfo->captures));
00135   if (postGame) {
00136         trap_Cvar_Set("ui_scoreAccuracy2",     va("%i%%", newInfo->accuracy));
00137         trap_Cvar_Set("ui_scoreImpressives2",   va("%i", newInfo->impressives));
00138         trap_Cvar_Set("ui_scoreExcellents2",    va("%i", newInfo->excellents));
00139         trap_Cvar_Set("ui_scoreDefends2",           va("%i", newInfo->defends));
00140         trap_Cvar_Set("ui_scoreAssists2",           va("%i", newInfo->assists));
00141         trap_Cvar_Set("ui_scoreGauntlets2",         va("%i", newInfo->gauntlets));
00142         trap_Cvar_Set("ui_scoreScore2",                 va("%i", newInfo->score));
00143         trap_Cvar_Set("ui_scorePerfect2",