From 79889e9944e2bcd99485e054a03c1f05e25b0c48 Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Fri, 27 Jan 2023 20:25:51 -0500 Subject: [PATCH] Attempting to fix a crash on NX due to incorrect(?) gl calls --- source/gl_draw.c | 2 ++ source/gl_screen.c | 29 +++++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/source/gl_draw.c b/source/gl_draw.c index 1086225..a233f6f 100644 --- a/source/gl_draw.c +++ b/source/gl_draw.c @@ -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 } diff --git a/source/gl_screen.c b/source/gl_screen.c index 7b6d625..ed8a2c0 100644 --- a/source/gl_screen.c +++ b/source/gl_screen.c @@ -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);