From cccfe5312872f77f2340ecf5f783e00d99f34c1e Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Fri, 27 Jan 2023 16:08:52 -0500 Subject: [PATCH] Fixed sniper scope on Vita --- source/gl_draw.c | 15 +++++++++++++-- source/gl_screen.c | 6 ++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/source/gl_draw.c b/source/gl_draw.c index de5acca..1086225 100644 --- a/source/gl_draw.c +++ b/source/gl_draw.c @@ -750,7 +750,6 @@ void Draw_ColorPic (int x, int y, qpic_t *pic, float r, float g, float b, float void Draw_ColorStretchPic (int x, int y, int width, int height, qpic_t *pic, float r, float g, float b, float alpha) { glpic_t *gl; - int i; if (alpha <= 1.0) { glEnable (GL_BLEND); @@ -803,7 +802,7 @@ Draw_StretchPic void Draw_StretchPic (int x, int y, qpic_t *pic, int x_value, int y_value) { glpic_t *gl; - int i; + if (scrap_dirty) Scrap_Upload (); gl = (glpic_t *)pic->data; @@ -881,6 +880,17 @@ void Draw_AlphaStretchPic (int x, int y, int width, int height, float alpha, qpi gl = (glpic_t *)pic->data; GL_Bind (gl->gltexture); glBegin (GL_QUADS); + +#ifdef VITA + glTexCoord2f (0, 0); + glVertex2f (x, y); + glTexCoord2f (1, 0); + glVertex2f (x+width, y); + glTexCoord2f (1, 1); + glVertex2f (x+width, y+height); + glTexCoord2f (0, 1); + glVertex2f (x, y+height); +#else glTexCoord2f (gl->sl, gl->tl); glVertex2f (x, y); glTexCoord2f (gl->sh, gl->tl); @@ -889,6 +899,7 @@ void Draw_AlphaStretchPic (int x, int y, int width, int height, float alpha, qpi glVertex2f (x+width, y+height); glTexCoord2f (gl->sl, gl->th); glVertex2f (x, y+height); +#endif glEnd (); if (alpha <= 1.0) diff --git a/source/gl_screen.c b/source/gl_screen.c index f1f3567..7b6d625 100644 --- a/source/gl_screen.c +++ b/source/gl_screen.c @@ -1511,7 +1511,13 @@ void SCR_DrawCrosshair (void) else if (crosshair.value && cl.stats[STAT_ZOOM] != 1 && cl.stats[STAT_ZOOM] != 2) Draw_CharacterRGBA ((vid.width - 8)/4/* + crosshair_x*/, (vid.height - 8)*3/4/* + crosshair_y*/, '.', 255, col, col, 0.7); 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); + #endif } if (Hitmark_Time > sv.time) { Draw_Pic ((vid.width/2 - hitmark->width)/2,vid.height/2 + (vid.height/2 - hitmark->height)/2, hitmark);