mirror of
https://github.com/w23/xash3d-fwgs
synced 2024-12-16 06:00:33 +01:00
engine: client: fix #79
This commit is contained in:
parent
936b491248
commit
3f48bce7da
@ -890,6 +890,7 @@ Render crosshair
|
|||||||
void CL_DrawCrosshair( void )
|
void CL_DrawCrosshair( void )
|
||||||
{
|
{
|
||||||
int x, y, width, height;
|
int x, y, width, height;
|
||||||
|
float xscale, yscale;
|
||||||
|
|
||||||
if( !clgame.ds.pCrosshair || !cl_crosshair->value )
|
if( !clgame.ds.pCrosshair || !cl_crosshair->value )
|
||||||
return;
|
return;
|
||||||
@ -922,16 +923,21 @@ void CL_DrawCrosshair( void )
|
|||||||
y += ( clgame.viewport[3] >> 1 ) * screen[1] + 0.5f;
|
y += ( clgame.viewport[3] >> 1 ) * screen[1] + 0.5f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// back to logical sizes
|
||||||
|
xscale = (float)clgame.scrInfo.iWidth / refState.width;
|
||||||
|
yscale = (float)clgame.scrInfo.iHeight / refState.height;
|
||||||
|
|
||||||
|
x *= xscale;
|
||||||
|
y *= yscale;
|
||||||
|
|
||||||
// move at center the screen
|
// move at center the screen
|
||||||
x -= 0.5f * width;
|
x -= 0.5f * width;
|
||||||
y -= 0.5f * height;
|
y -= 0.5f * height;
|
||||||
|
|
||||||
clgame.ds.pSprite = clgame.ds.pCrosshair;
|
clgame.ds.pSprite = clgame.ds.pCrosshair;
|
||||||
*(int *)clgame.ds.spriteColor = *(int *)clgame.ds.rgbaCrosshair;
|
Vector4Copy( clgame.ds.rgbaCrosshair, clgame.ds.spriteColor );
|
||||||
|
|
||||||
SPR_EnableScissor( x, y, width, height );
|
|
||||||
pfnSPR_DrawHoles( 0, x, y, &clgame.ds.rcCrosshair );
|
pfnSPR_DrawHoles( 0, x, y, &clgame.ds.rcCrosshair );
|
||||||
SPR_DisableScissor();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user