Skip to content

Commit

Permalink
Add workarounds for issues when using the widescreen cvars:
Browse files Browse the repository at this point in the history
	- workaround for playerTeleport effect when using cl_widescreenFOV
	- workaround for zoom mask when using cl_widescreenHUD
  • Loading branch information
Daggolin committed Sep 18, 2021
1 parent 461c3bd commit f6c9a95
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions code/client/cl_cgame.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,18 @@ intptr_t CL_CgameSystemCalls( intptr_t *args ) {
re.ClearScene();
return 0;
case CG_R_ADDREFENTITYTOSCENE:
#ifdef ELITEFORCE
if ( cl_widescreenFOV->integer )
{ // Ugly workaround for teleport sprite
static qhandle_t transportShader = -1;
refEntity_t *ent = VMA(1);
if ( transportShader == -1 ) transportShader = re.RegisterShader( "playerTeleport" );
if ( ent->customShader == transportShader && ent->reType == RT_SPRITE && ent->renderfx == RF_FIRST_PERSON )
{
ent->data.sprite.radius /= (cls.ws_xscale * cls.ws_yscale);
}
}
#endif
re.AddRefEntityToScene( VMA(1) );
return 0;
case CG_R_ADDPOLYTOSCENE:
Expand Down Expand Up @@ -624,7 +636,13 @@ intptr_t CL_CgameSystemCalls( intptr_t *args ) {
re.SetColor( VMA(1) );
return 0;
case CG_R_DRAWSTRETCHPIC:
#ifdef ELITEFORCE // Workaround for zoom_mask
static qhandle_t zoomShader = -1;
if ( zoomShader == -1 ) zoomShader = re.RegisterShader( "gfx/misc/zoom_mask2" );
if ( cl_widescreenHUD->integer && args[9] != zoomShader )
#else
if ( cl_widescreenHUD->integer )
#endif
re.DrawStretchPic( VMF(1) * cls.ws_xscale + cls.ws_xoffs, VMF(2) * cls.ws_yscale + cls.ws_yoffs, VMF(3) * cls.ws_xscale, VMF(4) * cls.ws_yscale, VMF(5), VMF(6), VMF(7), VMF(8), args[9] );
else
re.DrawStretchPic( VMF(1), VMF(2), VMF(3), VMF(4), VMF(5), VMF(6), VMF(7), VMF(8), args[9] );
Expand Down

0 comments on commit f6c9a95

Please sign in to comment.