From f75ba7d8e844533b1bb5fa976be4e2d7130ddbe4 Mon Sep 17 00:00:00 2001 From: Shpoike Date: Mon, 26 Aug 2024 20:27:35 +0100 Subject: [PATCH] Fix gl_screenangle with postproc. --- engine/gl/gl_draw.c | 6 ++++-- engine/gl/gl_rmain.c | 5 ++++- engine/gl/glquake.h | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/engine/gl/gl_draw.c b/engine/gl/gl_draw.c index e407b9d4d..aa251235c 100644 --- a/engine/gl/gl_draw.c +++ b/engine/gl/gl_draw.c @@ -623,13 +623,15 @@ GL_Set2D Setup as if the screen was 320*200 ================ */ -void GL_Set2D (qboolean flipped) +void GL_Set2D (unsigned int flags) { extern cvar_t gl_screenangle; float rad, ang; float tmp[16], tmp2[16]; float w = vid.width, h = vid.height; qboolean fbo = !!*r_refdef.rt_destcolour[0].texname; + qboolean flipped = flags&1; + qboolean norotate = flags&2; if (vid.framebuffer) { @@ -657,7 +659,7 @@ void GL_Set2D (qboolean flipped) ang = (gl_screenangle.value>0?(gl_screenangle.value+45):(gl_screenangle.value-45))/90; ang = (int)ang * 90; - if (ang && !fbo) + if (ang && !fbo && !norotate) { /*more expensive maths*/ rad = (ang * M_PI) / 180; diff --git a/engine/gl/gl_rmain.c b/engine/gl/gl_rmain.c index a62b67e6d..ef3ec43a1 100644 --- a/engine/gl/gl_rmain.c +++ b/engine/gl/gl_rmain.c @@ -2336,7 +2336,7 @@ void GLR_RenderView (void) GLBE_FBO_Pop(oldfbo); GLBE_RenderToTextureUpdate2d(false); - GL_Set2D (false); + GL_Set2D (2); // SCENE POST PROCESSING @@ -2368,6 +2368,9 @@ void GLR_RenderView (void) if (gl_motionblur.value>0 && gl_motionblur.value < 1 && qglCopyTexImage2D) R_RenderMotionBlur(); + if (gl_screenangle.value) + GL_Set2D (false); //make sure any hud stuff is rotated properly. + checkglerror(); } diff --git a/engine/gl/glquake.h b/engine/gl/glquake.h index 463927be9..cd4c2dfb1 100644 --- a/engine/gl/glquake.h +++ b/engine/gl/glquake.h @@ -355,7 +355,7 @@ void GL_ForceDepthWritable(void); // #ifdef GLQUAKE texid_tf GL_LoadPicTexture (qpic_t *pic); -void GL_Set2D (qboolean flipped); +void GL_Set2D (unsigned int flags); #endif //