From 84fc21612503a1092c4aea5186273ce6322502e4 Mon Sep 17 00:00:00 2001 From: Simon Date: Sun, 24 Nov 2019 23:26:11 +0000 Subject: [PATCH] Fixed alpha on vignette Also improved location of inventory and other items --- Projects/Android/jni/quake2/src/client/cl_inv.c | 2 +- .../Android/jni/quake2/src/client/cl_scrn.c | 10 +++++----- .../Android/jni/quake2/src/ref_gl/gl_draw.c | 17 +++++++++++------ 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/Projects/Android/jni/quake2/src/client/cl_inv.c b/Projects/Android/jni/quake2/src/client/cl_inv.c index f76ddfb..b585749 100644 --- a/Projects/Android/jni/quake2/src/client/cl_inv.c +++ b/Projects/Android/jni/quake2/src/client/cl_inv.c @@ -103,7 +103,7 @@ void CL_DrawInventory (float separation) top = 0; x = (viddef.width-256)/2; - y = (viddef.height-240)/2; + y = viddef.height/2; // repaint everything next frame SCR_DirtyScreen (); diff --git a/Projects/Android/jni/quake2/src/client/cl_scrn.c b/Projects/Android/jni/quake2/src/client/cl_scrn.c index 1cb24f2..9684162 100644 --- a/Projects/Android/jni/quake2/src/client/cl_scrn.c +++ b/Projects/Android/jni/quake2/src/client/cl_scrn.c @@ -278,7 +278,7 @@ void SCR_DrawCenterString (void) start = scr_centerstring; if (scr_center_lines <= 4) - y = viddef.height*0.35; + y = viddef.height*0.4; else y = 48; @@ -1060,7 +1060,7 @@ void SCR_ExecuteLayoutString (char *s,float separation) if (!strcmp(token, "yt")) { token = COM_Parse (&s); - y = atoi(token); + y = viddef.height/3 + atoi(token); continue; } if (!strcmp(token, "yb")) @@ -1072,7 +1072,7 @@ void SCR_ExecuteLayoutString (char *s,float separation) if (!strcmp(token, "yv")) { token = COM_Parse (&s); - y = viddef.height/2 - 120 + atoi(token); + y = viddef.height/2 + atoi(token); continue; } @@ -1098,7 +1098,7 @@ void SCR_ExecuteLayoutString (char *s,float separation) token = COM_Parse (&s); x = viddef.width/2 - 160 + atoi(token); token = COM_Parse (&s); - y = viddef.height/2 - 120 + atoi(token); + y = viddef.height/2 + atoi(token); SCR_AddDirtyPoint (x+offset_stereo, y); SCR_AddDirtyPoint (x+offset_stereo+159, y+31); @@ -1137,7 +1137,7 @@ void SCR_ExecuteLayoutString (char *s,float separation) token = COM_Parse (&s); x = viddef.width/2 - 160 + atoi(token); token = COM_Parse (&s); - y = viddef.height/2 - 120 + atoi(token); + y = viddef.height/2 + atoi(token); SCR_AddDirtyPoint (x+offset_stereo, y); SCR_AddDirtyPoint (x+offset_stereo+159, y+31); diff --git a/Projects/Android/jni/quake2/src/ref_gl/gl_draw.c b/Projects/Android/jni/quake2/src/ref_gl/gl_draw.c index 23cee9b..f889227 100644 --- a/Projects/Android/jni/quake2/src/ref_gl/gl_draw.c +++ b/Projects/Android/jni/quake2/src/ref_gl/gl_draw.c @@ -146,10 +146,14 @@ void Draw_StretchPic (int x, int y, int w, int h, char *pic) if (scrap_dirty) Scrap_Upload (); - if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( gl_config.renderer & GL_RENDERER_RENDITION ) ) && !gl->has_alpha) - qglDisable (GL_ALPHA_TEST); - else - qglEnable (GL_ALPHA_TEST); // make sure alpha is enabled + qglDisable (GL_ALPHA_TEST); + + if (gl->has_alpha) + { + glEnable(GL_BLEND); + glDisable(GL_ALPHA_TEST); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + } GL_Bind (gl->texnum); qglBegin (GL_QUADS); @@ -163,8 +167,9 @@ void Draw_StretchPic (int x, int y, int w, int h, char *pic) qglVertex2f (x, y+h); qglEnd (); - if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( gl_config.renderer & GL_RENDERER_RENDITION ) ) && !gl->has_alpha) - qglEnable (GL_ALPHA_TEST); + //Restore + glDisable( GL_BLEND ); + glEnable( GL_ALPHA_TEST ); }