mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
Fix crosshair_scale
The crosshair_scale cvar was broken a long time ago at Icculus Q2 or even back at it. The fix is easy... This is part of issue #87.
This commit is contained in:
parent
72a22b8915
commit
f2e53e657b
1 changed files with 35 additions and 39 deletions
|
@ -1550,45 +1550,6 @@ SCR_UpdateScreen(void)
|
|||
GLimp_EndFrame();
|
||||
}
|
||||
|
||||
void
|
||||
SCR_DrawCrosshair(void)
|
||||
{
|
||||
if (!crosshair->value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (crosshair->modified)
|
||||
{
|
||||
crosshair->modified = false;
|
||||
SCR_TouchPics();
|
||||
}
|
||||
|
||||
if (crosshair_scale->modified)
|
||||
{
|
||||
crosshair_scale->modified = false;
|
||||
|
||||
if (crosshair_scale->value > 5)
|
||||
{
|
||||
Cvar_SetValue("crosshair_scale", 5);
|
||||
}
|
||||
|
||||
else if (crosshair_scale->value < 0.25)
|
||||
{
|
||||
Cvar_SetValue("crosshair_scale", 0.25);
|
||||
}
|
||||
}
|
||||
|
||||
if (!crosshair_pic[0])
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Draw_Pic(scr_vrect.x + ((scr_vrect.width - crosshair_width) >> 1),
|
||||
scr_vrect.y + ((scr_vrect.height - crosshair_height) >> 1),
|
||||
crosshair_pic);
|
||||
}
|
||||
|
||||
float
|
||||
SCR_GetScale(void)
|
||||
{
|
||||
|
@ -1607,6 +1568,41 @@ SCR_GetScale(void)
|
|||
return i;
|
||||
}
|
||||
|
||||
void
|
||||
SCR_DrawCrosshair(void)
|
||||
{
|
||||
float scale;
|
||||
|
||||
if (!crosshair->value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (crosshair->modified)
|
||||
{
|
||||
crosshair->modified = false;
|
||||
SCR_TouchPics();
|
||||
}
|
||||
|
||||
if (!crosshair_pic[0])
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (crosshair_scale->value < 0)
|
||||
{
|
||||
scale = SCR_GetScale();
|
||||
}
|
||||
else
|
||||
{
|
||||
scale = crosshair_scale->value;
|
||||
}
|
||||
|
||||
Draw_PicScaled(scr_vrect.x + ((scr_vrect.width - crosshair_width) >> 1),
|
||||
scr_vrect.y + ((scr_vrect.height - crosshair_height) >> 1),
|
||||
crosshair_pic, scale);
|
||||
}
|
||||
|
||||
float
|
||||
SCR_GetHUDScale(void)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue