Skip to content

Commit

Permalink
Call R_RegisterShaderNoMip for the crosshair
Browse files Browse the repository at this point in the history
This prevents the crosshair texture from being altered by the texture quality settings
  • Loading branch information
smallmodel committed Dec 2, 2024
1 parent ba74943 commit 499fe44
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions code/cgame/cg_drawtools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1294,6 +1294,9 @@ void CG_DrawCrosshair()
return;
}

// Fixed in OPM: R_RegisterShaderNoMip
// Use R_RegisterShaderNoMip, as it's UI stuff

if (cgs.gametype != GT_FFA) {
AngleVectorsLeft(cg.refdefViewAngles, forward, NULL, NULL);

Expand Down Expand Up @@ -1321,23 +1324,23 @@ void CG_DrawCrosshair()
|| ((myFlags & EF_AXIS) && (friendEnt->currentState.eFlags & EF_AXIS))) {
// friend
if (cg.snap->ps.stats[STAT_CROSSHAIR]) {
shader = cgi.R_RegisterShader(cg_crosshair_friend->string);
shader = cgi.R_RegisterShaderNoMip(cg_crosshair_friend->string);
}
} else {
// enemy
if (cg.snap->ps.stats[STAT_CROSSHAIR]) {
shader = cgi.R_RegisterShader(cg_crosshair->string);
shader = cgi.R_RegisterShaderNoMip(cg_crosshair->string);
}
}
} else {
if (cg.snap->ps.stats[STAT_CROSSHAIR]) {
shader = cgi.R_RegisterShader(cg_crosshair->string);
shader = cgi.R_RegisterShaderNoMip(cg_crosshair->string);
}
}
} else {
// FFA
if (cg.snap->ps.stats[STAT_CROSSHAIR]) {
shader = cgi.R_RegisterShader(cg_crosshair->string);
shader = cgi.R_RegisterShaderNoMip(cg_crosshair->string);
}
}

Expand Down

0 comments on commit 499fe44

Please sign in to comment.