From 6e0ed3e930c451de2b11bcbf004d8bcd96be088c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 28 Aug 2018 22:58:21 +0200 Subject: [PATCH] - crossfade wipe is working again. The other two types still need work. --- src/d_main.cpp | 5 ++--- src/f_wipe.cpp | 12 ++++++------ src/v_video.h | 5 +++++ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index 980deaaa96..6f5259fbb1 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -889,11 +889,11 @@ void D_Display () screen->End2D(); auto wipend = screen->WipeEndScreen (); auto wiper = Wiper::Create(wipe_type); + wiper->SetTextures(wipe, wipend); wipestart = I_msTime(); NetUpdate(); // send out any new accumulation - /* do { do @@ -903,14 +903,13 @@ void D_Display () diff = (nowtime - wipestart) * 40 / 1000; // Using 35 here feels too slow. } while (diff < 1); wipestart = nowtime; - done = screen->WipeDo (1); screen->Begin2D(); + done = wiper->Run(1); C_DrawConsole (); // console and M_Drawer (); // menu are drawn even on top of wipes screen->End2DAndUpdate (); NetUpdate (); // [RH] not sure this is needed anymore } while (!done); - */ delete wiper; I_FreezeTime(false); GSnd->SetSfxPaused(false, 1); diff --git a/src/f_wipe.cpp b/src/f_wipe.cpp index 3104e1a3a9..52c63f7666 100644 --- a/src/f_wipe.cpp +++ b/src/f_wipe.cpp @@ -238,8 +238,8 @@ Wiper::~Wiper() bool Wiper_Crossfade::Run(int ticks) { Clock += ticks; - screen->DrawTexture(startScreen, 0, 0, TAG_DONE); - screen->DrawTexture(endScreen, 0, 0, DTA_Alpha, clamp(Clock / 32.f, 0.f, 1.f), TAG_DONE); + screen->DrawTexture(startScreen, 0, 0, DTA_FlipY, screen->RenderTextureIsFlipped(), TAG_DONE); + screen->DrawTexture(endScreen, 0, 0, DTA_FlipY, screen->RenderTextureIsFlipped(), DTA_Alpha, clamp(Clock / 32.f, 0.f, 1.f), TAG_DONE); return Clock >= 32; } @@ -274,7 +274,7 @@ Wiper_Melt::Wiper_Melt() bool Wiper_Melt::Run(int ticks) { bool done; - screen->DrawTexture(endScreen, 0, 0, TAG_DONE); + screen->DrawTexture(endScreen, 0, 0, DTA_FlipY, screen->RenderTextureIsFlipped(), DTA_Color, PalEntry(255, 255, 0, 0), TAG_DONE); // Copy the old screen in vertical strips on top of the new one. while (ticks--) @@ -319,7 +319,7 @@ bool Wiper_Melt::Run(int ticks) rect.bottom = w - dpt.y; if (rect.bottom > rect.top) { - screen->DrawTexture(startScreen, 0, rect.top, DTA_ClipLeft, rect.left, DTA_ClipRight, rect.right, TAG_DONE); + screen->DrawTexture(startScreen, 0, rect.top, DTA_FlipY, screen->RenderTextureIsFlipped(), DTA_ClipLeft, rect.left, DTA_ClipRight, rect.right, TAG_DONE); } } } @@ -388,8 +388,8 @@ bool Wiper_Burn::Run(int ticks) } } - screen->DrawTexture(startScreen, 0, 0, TAG_DONE); - screen->DrawTexture(endScreen, 0, 0, DTA_Burn, true, TAG_DONE); + screen->DrawTexture(startScreen, 0, 0, DTA_FlipY, screen->RenderTextureIsFlipped(), TAG_DONE); + screen->DrawTexture(endScreen, 0, 0, DTA_FlipY, screen->RenderTextureIsFlipped(), DTA_Burn, true, DTA_LegacyRenderStyle, STYLE_Translucent, TAG_DONE); // The fire may not always stabilize, so the wipe is forced to end // after an arbitrary maximum time. diff --git a/src/v_video.h b/src/v_video.h index 8fe4a2b2f4..72ae6e0a5c 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -459,6 +459,11 @@ public: // Returns true if Begin2D has been called and 2D drawing is now active bool HasBegun2D() { return isIn2D; } + // This is overridable in case Vulkan does it differently. + virtual bool RenderTextureIsFlipped() const + { + return true; + } // Report a game restart void InitPalette();