Merge pull request #32 from ScatterBox/main

This commit is contained in:
Ian 2023-01-27 16:10:33 -05:00 committed by GitHub
commit f3a84eb9c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 2 deletions

View File

@ -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) 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; glpic_t *gl;
int i;
if (alpha <= 1.0) { if (alpha <= 1.0) {
glEnable (GL_BLEND); 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) void Draw_StretchPic (int x, int y, qpic_t *pic, int x_value, int y_value)
{ {
glpic_t *gl; glpic_t *gl;
int i;
if (scrap_dirty) if (scrap_dirty)
Scrap_Upload (); Scrap_Upload ();
gl = (glpic_t *)pic->data; 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 = (glpic_t *)pic->data;
GL_Bind (gl->gltexture); GL_Bind (gl->gltexture);
glBegin (GL_QUADS); 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); glTexCoord2f (gl->sl, gl->tl);
glVertex2f (x, y); glVertex2f (x, y);
glTexCoord2f (gl->sh, gl->tl); 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); glVertex2f (x+width, y+height);
glTexCoord2f (gl->sl, gl->th); glTexCoord2f (gl->sl, gl->th);
glVertex2f (x, y+height); glVertex2f (x, y+height);
#endif
glEnd (); glEnd ();
if (alpha <= 1.0) if (alpha <= 1.0)

View File

@ -1511,7 +1511,13 @@ void SCR_DrawCrosshair (void)
else if (crosshair.value && cl.stats[STAT_ZOOM] != 1 && cl.stats[STAT_ZOOM] != 2) 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); 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) { 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); Draw_AlphaStretchPic (0, 0, vid.width, vid.height, 1, sniper_scope);
#endif
} }
if (Hitmark_Time > sv.time) { if (Hitmark_Time > sv.time) {
Draw_Pic ((vid.width/2 - hitmark->width)/2,vid.height/2 + (vid.height/2 - hitmark->height)/2, hitmark); Draw_Pic ((vid.width/2 - hitmark->width)/2,vid.height/2 + (vid.height/2 - hitmark->height)/2, hitmark);