Attempting to fix a crash on NX due to incorrect(?) gl calls

This commit is contained in:
Tyler Young 2023-01-27 20:25:51 -05:00
parent cccfe53128
commit 79889e9944
2 changed files with 29 additions and 2 deletions

View file

@ -563,6 +563,7 @@ This is the same as Draw_Character, but with RGBA color codes.
*/
void Draw_CharacterRGBA(int x, int y, int num, float r, float g, float b, float a)
{
#ifdef VITA
int row, col;
float frow, fcol, size;
@ -604,6 +605,7 @@ void Draw_CharacterRGBA(int x, int y, int num, float r, float g, float b, float
glEnable(GL_ALPHA_TEST);
glDisable (GL_BLEND);
glColor4f (1,1,1,1);
#endif
}

View file

@ -1481,7 +1481,11 @@ void SCR_DrawCrosshair (void)
if (cl.stats[STAT_ACTIVEWEAPON] == W_M2)
{
#ifdef VITA
Draw_CharacterRGBA ((vid.width)/4-4, (vid.height)*3/4, 'O', 255, col, col, 0.7);
#else
Draw_Character ((vid.width)/4-4, (vid.height)*3/4, 'O');
#endif
}
else if (crosshair.value == 1 && cl.stats[STAT_ZOOM] != 1 && cl.stats[STAT_ZOOM] != 2 && cl.stats[STAT_ACTIVEWEAPON] != W_PANZER)
{
@ -1494,26 +1498,47 @@ void SCR_DrawCrosshair (void)
x_value = ((vid.width - 8)/4) - crosshair_offset_step;
y_value = (vid.height - 8)*3/4;
#ifdef VITA
Draw_CharacterRGBA (x_value, y_value, 158, 255, col, col, 0.7);
#else
Draw_Character (x_value, y_value, 158);
#endif
x_value = ((vid.width - 8)/4) + crosshair_offset_step;
y_value = (vid.height - 8)*3/4;
#ifdef VITA
Draw_CharacterRGBA (x_value, y_value, 158, 255, col, col, 0.7);
#else
Draw_Character (x_value, y_value, 158);
#endif
x_value = ((vid.width - 8)/4);
y_value = (vid.height - 8)*3/4 - crosshair_offset_step;
#ifdef VITA
Draw_CharacterRGBA (x_value, y_value, 157, 255, col, col, 0.7);
#else
Draw_Character (x_value, y_value, 157);
#endif
x_value = ((vid.width - 8)/4);
y_value = (vid.height - 8)*3/4 + crosshair_offset_step;
#ifdef VITA
Draw_CharacterRGBA (x_value, y_value, 157, 255, col, col, 0.7);
#else
Draw_Character (x_value, y_value, 157);
#endif
}
else if (crosshair.value && cl.stats[STAT_ZOOM] != 1 && cl.stats[STAT_ZOOM] != 2)
{
#ifdef VITA
Draw_CharacterRGBA ((vid.width - 8)/4/* + crosshair_x*/, (vid.height - 8)*3/4/* + crosshair_y*/, '.', 255, col, col, 0.7);
#else
Draw_Character ((vid.width - 8)/4/* + crosshair_x*/, (vid.height - 8)*3/4/* + crosshair_y*/, '.');
#endif
}
if (cl.stats[STAT_ZOOM] == 2) {
#ifdef VITA
GL_SetCanvas(CANVAS_DEFAULT);
//Draw_StretchPic (0, 0, sniper_scope, vid.width, vid.height);
Draw_AlphaStretchPic (0, 0, vid.width, vid.height, 255, sniper_scope);
#else
Draw_AlphaStretchPic (0, 0, vid.width, vid.height, 1, sniper_scope);