mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-18 02:50:33 +00:00
engine: client: simplify drawing loading or paused bar, fix position with hud_scale active
This commit is contained in:
parent
39fd30a472
commit
6282acc825
@ -938,31 +938,21 @@ CL_DrawLoading
|
|||||||
draw loading progress bar
|
draw loading progress bar
|
||||||
=============
|
=============
|
||||||
*/
|
*/
|
||||||
static void CL_DrawLoadingOrPaused( qboolean paused, float percent )
|
static void CL_DrawLoadingOrPaused( int tex )
|
||||||
{
|
{
|
||||||
float x, y, width, height;
|
float x, y, width, height;
|
||||||
int iWidth, iHeight;
|
int iWidth, iHeight;
|
||||||
|
|
||||||
R_GetTextureParms( &iWidth, &iHeight, paused ? cls.pauseIcon : cls.loadingBar );
|
R_GetTextureParms( &iWidth, &iHeight, tex );
|
||||||
x = ( clgame.scrInfo.iWidth - width ) / 2.0f;;
|
x = ( clgame.scrInfo.iWidth - iWidth ) / 2.0f;
|
||||||
y = ( clgame.scrInfo.iHeight - height ) / 2.0f;
|
y = ( clgame.scrInfo.iHeight - iHeight ) / 2.0f;
|
||||||
width = iWidth;
|
width = iWidth;
|
||||||
height = iHeight;
|
height = iHeight;
|
||||||
|
|
||||||
SPR_AdjustSize( &x, &y, &width, &height );
|
SPR_AdjustSize( &x, &y, &width, &height );
|
||||||
|
ref.dllFuncs.Color4ub( 255, 255, 255, 255 );
|
||||||
if( !paused )
|
ref.dllFuncs.GL_SetRenderMode( kRenderTransTexture );
|
||||||
{
|
ref.dllFuncs.R_DrawStretchPic( x, y, width, height, 0, 0, 1, 1, tex );
|
||||||
ref.dllFuncs.Color4ub( 255, 255, 255, 255 );
|
|
||||||
ref.dllFuncs.GL_SetRenderMode( kRenderTransTexture );
|
|
||||||
ref.dllFuncs.R_DrawStretchPic( x, y, width, height, 0, 0, 1, 1, cls.loadingBar );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ref.dllFuncs.Color4ub( 255, 255, 255, 255 );
|
|
||||||
ref.dllFuncs.GL_SetRenderMode( kRenderTransTexture );
|
|
||||||
ref.dllFuncs.R_DrawStretchPic( x, y, width, height, 0, 0, 1, 1, cls.pauseIcon );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CL_DrawHUD( int state )
|
void CL_DrawHUD( int state )
|
||||||
@ -988,15 +978,15 @@ void CL_DrawHUD( int state )
|
|||||||
CL_DrawCrosshair ();
|
CL_DrawCrosshair ();
|
||||||
CL_DrawCenterPrint ();
|
CL_DrawCenterPrint ();
|
||||||
clgame.dllFuncs.pfnRedraw( cl.time, cl.intermission );
|
clgame.dllFuncs.pfnRedraw( cl.time, cl.intermission );
|
||||||
CL_DrawLoadingOrPaused( true, 0.0f );
|
CL_DrawLoadingOrPaused( cls.pauseIcon );
|
||||||
break;
|
break;
|
||||||
case CL_LOADING:
|
case CL_LOADING:
|
||||||
CL_DrawLoadingOrPaused( false, scr_loading->value );
|
CL_DrawLoadingOrPaused( cls.loadingBar );
|
||||||
break;
|
break;
|
||||||
case CL_CHANGELEVEL:
|
case CL_CHANGELEVEL:
|
||||||
if( cls.draw_changelevel )
|
if( cls.draw_changelevel )
|
||||||
{
|
{
|
||||||
CL_DrawLoadingOrPaused( false, 100.0f );
|
CL_DrawLoadingOrPaused( cls.loadingBar );
|
||||||
cls.draw_changelevel = false;
|
cls.draw_changelevel = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user