1
0
Fork 0
forked from fte/fteqw

Fix gl_screenangle with postproc.

This commit is contained in:
Shpoike 2024-08-26 20:27:35 +01:00
parent 62b1e27620
commit f75ba7d8e8
3 changed files with 9 additions and 4 deletions

View file

@ -623,13 +623,15 @@ GL_Set2D
Setup as if the screen was 320*200 Setup as if the screen was 320*200
================ ================
*/ */
void GL_Set2D (qboolean flipped) void GL_Set2D (unsigned int flags)
{ {
extern cvar_t gl_screenangle; extern cvar_t gl_screenangle;
float rad, ang; float rad, ang;
float tmp[16], tmp2[16]; float tmp[16], tmp2[16];
float w = vid.width, h = vid.height; float w = vid.width, h = vid.height;
qboolean fbo = !!*r_refdef.rt_destcolour[0].texname; qboolean fbo = !!*r_refdef.rt_destcolour[0].texname;
qboolean flipped = flags&1;
qboolean norotate = flags&2;
if (vid.framebuffer) 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 = (gl_screenangle.value>0?(gl_screenangle.value+45):(gl_screenangle.value-45))/90;
ang = (int)ang * 90; ang = (int)ang * 90;
if (ang && !fbo) if (ang && !fbo && !norotate)
{ /*more expensive maths*/ { /*more expensive maths*/
rad = (ang * M_PI) / 180; rad = (ang * M_PI) / 180;

View file

@ -2336,7 +2336,7 @@ void GLR_RenderView (void)
GLBE_FBO_Pop(oldfbo); GLBE_FBO_Pop(oldfbo);
GLBE_RenderToTextureUpdate2d(false); GLBE_RenderToTextureUpdate2d(false);
GL_Set2D (false); GL_Set2D (2);
// SCENE POST PROCESSING // SCENE POST PROCESSING
@ -2368,6 +2368,9 @@ void GLR_RenderView (void)
if (gl_motionblur.value>0 && gl_motionblur.value < 1 && qglCopyTexImage2D) if (gl_motionblur.value>0 && gl_motionblur.value < 1 && qglCopyTexImage2D)
R_RenderMotionBlur(); R_RenderMotionBlur();
if (gl_screenangle.value)
GL_Set2D (false); //make sure any hud stuff is rotated properly.
checkglerror(); checkglerror();
} }

View file

@ -355,7 +355,7 @@ void GL_ForceDepthWritable(void);
// //
#ifdef GLQUAKE #ifdef GLQUAKE
texid_tf GL_LoadPicTexture (qpic_t *pic); texid_tf GL_LoadPicTexture (qpic_t *pic);
void GL_Set2D (qboolean flipped); void GL_Set2D (unsigned int flags);
#endif #endif
// //