diff options
author | Ben Millwood <thebenmachine@gmail.com> | 2009-10-03 13:06:39 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:16:28 +0000 |
commit | 11e37d5354d6945e2a4cbdc73ba650c78ade89a5 (patch) | |
tree | 087b29b098bb5d2ae2faa78d6d228054b5f89328 /src/cgame | |
parent | b8ba914fd60591858ab6e6177ba23d37e8cd2898 (diff) |
* Get rid of uselessly-named itemDef_t->special and replace with
feederID or window.borderSize where applicable.
Diffstat (limited to 'src/cgame')
-rw-r--r-- | src/cgame/cg_draw.c | 63 | ||||
-rw-r--r-- | src/cgame/cg_local.h | 2 | ||||
-rw-r--r-- | src/cgame/cg_main.c | 2 |
3 files changed, 42 insertions, 25 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index 144e6983..c28758d1 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -239,18 +239,21 @@ void CG_DrawField( float x, float y, int width, float cw, float ch, int value ) static void CG_DrawProgressBar( rectDef_t *rect, vec4_t color, float scale, int align, int textalign, int textStyle, - int special, float progress ) + float borderSize, float progress ) { - float rimWidth = rect->h / 20.0f; + float rimWidth; float doneWidth, leftWidth; float tx, ty; char textBuffer[ 8 ]; - if( rimWidth < 0.6f ) - rimWidth = 0.6f; - - if( special >= 0.0f ) - rimWidth = special; + if( borderSize >= 0.0f ) + rimWidth = borderSize; + else + { + rimWidth = rect->h / 20.0f; + if( rimWidth < 0.6f ) + rimWidth = 0.6f; + } if( progress < 0.0f ) progress = 0.0f; @@ -1033,9 +1036,11 @@ static void CG_DrawProgressLabel( rectDef_t *rect, float text_x, float text_y, v } static void CG_DrawMediaProgress( rectDef_t *rect, vec4_t color, float scale, - int align, int textalign, int textStyle, int special ) + int align, int textalign, int textStyle, + float borderSize ) { - CG_DrawProgressBar( rect, color, scale, align, textalign, textStyle, special, cg.mediaFraction ); + CG_DrawProgressBar( rect, color, scale, align, textalign, textStyle, + borderSize, cg.mediaFraction ); } static void CG_DrawMediaProgressLabel( rectDef_t *rect, float text_x, float text_y, @@ -1045,10 +1050,12 @@ static void CG_DrawMediaProgressLabel( rectDef_t *rect, float text_x, float text "Map and Textures", cg.mediaFraction ); } -static void CG_DrawBuildablesProgress( rectDef_t *rect, vec4_t color, float scale, - int align, int textalign, int textStyle, int special ) +static void CG_DrawBuildablesProgress( rectDef_t *rect, vec4_t color, + float scale, int align, int textalign, + int textStyle, float borderSize ) { - CG_DrawProgressBar( rect, color, scale, align, textalign, textStyle, special, cg.buildablesFraction ); + CG_DrawProgressBar( rect, color, scale, align, textalign, textStyle, + borderSize, cg.buildablesFraction ); } static void CG_DrawBuildablesProgressLabel( rectDef_t *rect, float text_x, float text_y, @@ -1058,10 +1065,12 @@ static void CG_DrawBuildablesProgressLabel( rectDef_t *rect, float text_x, float "Buildable Models", cg.buildablesFraction ); } -static void CG_DrawCharModelProgress( rectDef_t *rect, vec4_t color, float scale, - int align, int textalign, int textStyle, int special ) +static void CG_DrawCharModelProgress( rectDef_t *rect, vec4_t color, + float scale, int align, int textalign, + int textStyle, float borderSize ) { - CG_DrawProgressBar( rect, color, scale, align, textalign, textStyle, special, cg.charModelFraction ); + CG_DrawProgressBar( rect, color, scale, align, textalign, textStyle, + borderSize, cg.charModelFraction ); } static void CG_DrawCharModelProgressLabel( rectDef_t *rect, float text_x, float text_y, @@ -1072,12 +1081,16 @@ static void CG_DrawCharModelProgressLabel( rectDef_t *rect, float text_x, float } static void CG_DrawOverallProgress( rectDef_t *rect, vec4_t color, float scale, - int align, int textalign, int textStyle, int special ) + int align, int textalign, int textStyle, + float borderSize ) { float total; - total = ( cg.charModelFraction + cg.buildablesFraction + cg.mediaFraction ) / 3.0f; - CG_DrawProgressBar( rect, color, scale, align, textalign, textStyle, special, total ); + total = cg.charModelFraction + cg.buildablesFraction + cg.mediaFraction; + total /= 3.0f; + + CG_DrawProgressBar( rect, color, scale, align, textalign, textStyle, + borderSize, total ); } static void CG_DrawLevelShot( rectDef_t *rect ) @@ -2283,7 +2296,7 @@ Draw an owner drawn item */ void CG_OwnerDraw( float x, float y, float w, float h, float text_x, float text_y, int ownerDraw, int ownerDrawFlags, - int align, int textalign, int textvalign, float special, + int align, int textalign, int textvalign, float borderSize, float scale, vec4_t foreColor, vec4_t backColor, qhandle_t shader, int textStyle ) { @@ -2405,25 +2418,29 @@ void CG_OwnerDraw( float x, float y, float w, float h, float text_x, CG_DrawLevelShot( &rect ); break; case CG_LOAD_MEDIA: - CG_DrawMediaProgress( &rect, foreColor, scale, align, textalign, textStyle, special ); + CG_DrawMediaProgress( &rect, foreColor, scale, align, textalign, textStyle, + borderSize ); break; case CG_LOAD_MEDIA_LABEL: CG_DrawMediaProgressLabel( &rect, text_x, text_y, foreColor, scale, textalign, textvalign ); break; case CG_LOAD_BUILDABLES: - CG_DrawBuildablesProgress( &rect, foreColor, scale, align, textalign, textStyle, special ); + CG_DrawBuildablesProgress( &rect, foreColor, scale, align, textalign, + textStyle, borderSize ); break; case CG_LOAD_BUILDABLES_LABEL: CG_DrawBuildablesProgressLabel( &rect, text_x, text_y, foreColor, scale, textalign, textvalign ); break; case CG_LOAD_CHARMODEL: - CG_DrawCharModelProgress( &rect, foreColor, scale, align, textalign, textStyle, special ); + CG_DrawCharModelProgress( &rect, foreColor, scale, align, textalign, + textStyle, borderSize ); break; case CG_LOAD_CHARMODEL_LABEL: CG_DrawCharModelProgressLabel( &rect, text_x, text_y, foreColor, scale, textalign, textvalign ); break; case CG_LOAD_OVERALL: - CG_DrawOverallProgress( &rect, foreColor, scale, align, textalign, textStyle, special ); + CG_DrawOverallProgress( &rect, foreColor, scale, align, textalign, textStyle, + borderSize ); break; case CG_LOAD_LEVELNAME: CG_DrawLevelName( &rect, text_x, text_y, foreColor, scale, textalign, textvalign, textStyle ); diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index f1e0ada0..c1e5dada 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -1630,7 +1630,7 @@ void CG_DrawActive( stereoFrame_t stereoView ); void CG_OwnerDraw( float x, float y, float w, float h, float text_x, float text_y, int ownerDraw, int ownerDrawFlags, int align, int textalign, int textvalign, - float special, float scale, vec4_t foreColor, + float borderSize, float scale, vec4_t foreColor, vec4_t backColor, qhandle_t shader, int textStyle ); float CG_GetValue(int ownerDraw); void CG_RunMenuScript(char **args); diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index eb9f2c73..44edf153 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -1347,7 +1347,7 @@ void CG_LoadMenus( const char *menuFile ) -static qboolean CG_OwnerDrawHandleKey( int ownerDraw, int flags, float *special, int key ) +static qboolean CG_OwnerDrawHandleKey( int ownerDraw, int key ) { return qfalse; } |