summaryrefslogtreecommitdiff
path: root/src/cgame/cg_buildable.c
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2009-10-16 22:20:49 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:16:52 +0000
commit9a60b0c6c2252e95caa35e4b00b310b5e628371b (patch)
treee698b603ca92b2093b06071be602c734b40d1fec /src/cgame/cg_buildable.c
parentdb2626a08e4d39c58890ba7e3f7c4470e7c0b38b (diff)
* (bug #4265) Fix CG_WorldToScreen to accomdate cg_viewsize
* (bug #4265) Clip health bars to the cg_viewsize viewport
Diffstat (limited to 'src/cgame/cg_buildable.c')
-rw-r--r--src/cgame/cg_buildable.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c
index db6eb539..8a5bb858 100644
--- a/src/cgame/cg_buildable.c
+++ b/src/cgame/cg_buildable.c
@@ -973,6 +973,7 @@ static void CG_BuildableStatusDisplay( centity_t *cent )
float picY = y;
float scale;
float subH, subY;
+ float clipX, clipY, clipW, clipH;
vec4_t frameColor;
// this is fudged to get the width/height in the cfg to be more realistic
@@ -990,6 +991,12 @@ static void CG_BuildableStatusDisplay( centity_t *cent )
subH = picH - ( picH * bs->verticalMargin );
subY = picY + ( picH * 0.5f ) - ( subH * 0.5f );
+ clipW = ( 640.0f * cg_viewsize.integer ) / 100.0f;
+ clipH = ( 480.0f * cg_viewsize.integer ) / 100.0f;
+ clipX = 320.0f - ( clipW * 0.5f );
+ clipY = 240.0f - ( clipH * 0.5f );
+ CG_SetClipRegion( clipX, clipY, clipW, clipH );
+
if( bs->frameShader )
{
Vector4Copy( bs->backColor, frameColor );
@@ -1083,7 +1090,9 @@ static void CG_BuildableStatusDisplay( centity_t *cent )
CG_DrawField( nX, subY, 4, subH, subH, healthPoints );
}
+
trap_R_SetColor( NULL );
+ CG_ClearClipRegion( );
}
}