mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-14 17:01:07 +00:00
OpenGL Screen Fading Fix
Screen Wipes now work as they did in 2.0.x.
This commit is contained in:
parent
d75d7cd09a
commit
fc12fc7cd4
6 changed files with 22 additions and 34 deletions
|
@ -268,10 +268,6 @@ static void D_Display(void)
|
|||
&& wipedefs[wipedefindex] != UINT8_MAX)
|
||||
{
|
||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
||||
#ifdef HWRENDER
|
||||
if(rendermode != render_soft)
|
||||
HWR_PrepFadeToBlack();
|
||||
#endif
|
||||
F_WipeEndScreen();
|
||||
F_RunWipe(wipedefs[wipedefindex], gamestate != GS_TIMEATTACK);
|
||||
}
|
||||
|
|
|
@ -288,8 +288,7 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu)
|
|||
if (drawMenu)
|
||||
M_Drawer(); // menu is drawn even on top of wipes
|
||||
|
||||
if (rendermode == render_soft)
|
||||
I_FinishUpdate(); // page flip or blit buffer
|
||||
I_FinishUpdate(); // page flip or blit buffer
|
||||
|
||||
if (moviemode)
|
||||
M_SaveFrame();
|
||||
|
|
|
@ -5347,24 +5347,6 @@ void HWR_EndScreenWipe(void)
|
|||
HWD.pfnEndScreenWipe();
|
||||
}
|
||||
|
||||
// Prepare the screen for fading to black.
|
||||
void HWR_PrepFadeToBlack(void)
|
||||
{
|
||||
FOutVector v[4];
|
||||
INT32 flags;
|
||||
FSurfaceInfo Surf;
|
||||
|
||||
v[0].x = v[2].y = v[3].x = v[3].y = -1.0f;
|
||||
v[0].y = v[1].x = v[1].y = v[2].x = 1.0f;
|
||||
v[0].z = v[1].z = v[2].z = v[3].z = 1.0f;
|
||||
|
||||
flags = PF_Modulated | PF_Clip | PF_NoZClip | PF_NoDepthTest | PF_NoTexture;
|
||||
Surf.FlatColor.s.red = Surf.FlatColor.s.green = Surf.FlatColor.s.blue = 0x00;
|
||||
Surf.FlatColor.s.alpha = 0xff;
|
||||
|
||||
HWD.pfnDrawPolygon(&Surf, v, 4, flags);
|
||||
}
|
||||
|
||||
void HWR_DrawIntermissionBG(void)
|
||||
{
|
||||
HWD.pfnDrawIntermissionBG();
|
||||
|
@ -5372,14 +5354,15 @@ void HWR_DrawIntermissionBG(void)
|
|||
|
||||
void HWR_DoScreenWipe(void)
|
||||
{
|
||||
HWRWipeCounter -= 0.035f;
|
||||
|
||||
//CONS_Debug(DBG_RENDER, "In HWR_DoScreenWipe(). Alpha =%f\n", HWRWipeCounter);
|
||||
|
||||
HWD.pfnDoScreenWipe(HWRWipeCounter);
|
||||
|
||||
I_OsPolling();
|
||||
I_FinishUpdate();
|
||||
// This works for all the cases in vanilla until fade masks get done
|
||||
HWRWipeCounter -= 0.05f; // Go less opaque after
|
||||
|
||||
if (HWRWipeCounter < 0)
|
||||
HWRWipeCounter = 0;
|
||||
}
|
||||
|
||||
#endif // HWRENDER
|
||||
|
|
|
@ -64,7 +64,6 @@ void HWR_DoPostProcessor(player_t *player);
|
|||
void HWR_StartScreenWipe(void);
|
||||
void HWR_EndScreenWipe(void);
|
||||
void HWR_DoScreenWipe(void);
|
||||
void HWR_PrepFadeToBlack(void);
|
||||
void HWR_DrawIntermissionBG(void);
|
||||
|
||||
// This stuff is put here so MD2's can use them
|
||||
|
|
|
@ -2016,6 +2016,8 @@ EXPORT void HWRAPI(StartScreenWipe) (void)
|
|||
#ifndef KOS_GL_COMPATIBILITY
|
||||
pglCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, texsize, texsize, 0);
|
||||
#endif
|
||||
|
||||
tex_downloaded = 0; // 0 so it knows it doesn't have any of the cached patches downloaded right now
|
||||
}
|
||||
|
||||
// Create Screen to fade to
|
||||
|
@ -2043,6 +2045,8 @@ EXPORT void HWRAPI(EndScreenWipe)(void)
|
|||
#ifndef KOS_GL_COMPATIBILITY
|
||||
pglCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, texsize, texsize, 0);
|
||||
#endif
|
||||
|
||||
tex_downloaded = 0; // 0 so it knows it doesn't have any of the cached patches downloaded right now
|
||||
}
|
||||
|
||||
|
||||
|
@ -2060,7 +2064,7 @@ EXPORT void HWRAPI(DrawIntermissionBG)(void)
|
|||
xfix = 1/((float)(texsize)/((float)((screen_width))));
|
||||
yfix = 1/((float)(texsize)/((float)((screen_height))));
|
||||
|
||||
//pglClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
|
||||
pglClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
pglBindTexture(GL_TEXTURE_2D, screentexture);
|
||||
pglBegin(GL_QUADS);
|
||||
|
@ -2083,6 +2087,8 @@ EXPORT void HWRAPI(DrawIntermissionBG)(void)
|
|||
pglVertex3f(1.0f, -1.0f, 1.0f);
|
||||
|
||||
pglEnd();
|
||||
|
||||
tex_downloaded = 0; // 0 so it knows it doesn't have any of the cached patches downloaded right now
|
||||
}
|
||||
|
||||
// Do screen fades!
|
||||
|
@ -2102,6 +2108,8 @@ EXPORT void HWRAPI(DoScreenWipe)(float alpha)
|
|||
|
||||
pglClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
SetBlend(PF_Modulated|PF_NoDepthTest|PF_Clip|PF_NoZClip);
|
||||
|
||||
// Draw the screen on bottom to fade to
|
||||
pglBindTexture(GL_TEXTURE_2D, endScreenWipe);
|
||||
pglBegin(GL_QUADS);
|
||||
|
@ -2124,6 +2132,8 @@ EXPORT void HWRAPI(DoScreenWipe)(float alpha)
|
|||
pglVertex3f(1.0f, -1.0f, 1.0f);
|
||||
pglEnd();
|
||||
|
||||
SetBlend(PF_Modulated|PF_Translucent|PF_NoDepthTest|PF_Clip|PF_NoZClip);
|
||||
|
||||
// Draw the screen on top that fades.
|
||||
pglBindTexture(GL_TEXTURE_2D, startScreenWipe);
|
||||
pglBegin(GL_QUADS);
|
||||
|
@ -2146,6 +2156,8 @@ EXPORT void HWRAPI(DoScreenWipe)(float alpha)
|
|||
pglVertex3f(1.0f, -1.0f, 1.0f);
|
||||
|
||||
pglEnd();
|
||||
|
||||
tex_downloaded = 0; // 0 so it knows it doesn't have any of the cached patches downloaded right now
|
||||
}
|
||||
|
||||
|
||||
|
@ -2174,6 +2186,8 @@ EXPORT void HWRAPI(MakeScreenTexture) (void)
|
|||
#ifndef KOS_GL_COMPATIBILITY
|
||||
pglCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, texsize, texsize, 0);
|
||||
#endif
|
||||
|
||||
tex_downloaded = 0; // 0 so it knows it doesn't have any of the cached patches downloaded right now
|
||||
}
|
||||
|
||||
#endif //HWRENDER
|
||||
|
|
|
@ -2435,10 +2435,7 @@ noscript:
|
|||
{
|
||||
F_WipeStartScreen();
|
||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
||||
#ifdef HWRENDER
|
||||
if(rendermode != render_soft)
|
||||
HWR_PrepFadeToBlack();
|
||||
#endif
|
||||
|
||||
F_WipeEndScreen();
|
||||
F_RunWipe(wipedefs[wipe_level_toblack], false);
|
||||
|
||||
|
|
Loading…
Reference in a new issue