Browse Source

Fix loading screen glitches

pull/5459/head
Gleb Mazovetskiy 3 years ago
parent
commit
37ec8d030f
  1. 10
      Source/diablo.cpp
  2. 11
      Source/interfac.cpp

10
Source/diablo.cpp

@ -704,8 +704,16 @@ void GameEventHandler(const SDL_Event &event, uint16_t modState)
LastMouseButtonAction = MouseActionType::None;
sgbMouseDown = CLICK_NONE;
ShowProgress(GetCustomEvent(event.type));
RedrawEverything();
DrawAndBlit();
if (!HeadlessMode) {
while (IsRedrawEverything()) {
// In direct rendering mode with double/triple buffering, we need
// to prepare all buffers before fading in.
DrawAndBlit();
}
}
LoadPWaterPalette();
if (gbRunGame)
PaletteFadeIn(8);

11
Source/interfac.cpp

@ -467,6 +467,17 @@ void ShowProgress(interface_mode uMsg)
if (!HeadlessMode) {
assert(ghMainWnd);
if (RenderDirectlyToOutputSurface && PalSurface != nullptr) {
// Ensure that all back buffers have the full progress bar.
const void *initialPixels = PalSurface->pixels;
do {
DrawCutsceneForeground();
if (DiabloUiSurface() == PalSurface)
BltFast(nullptr, nullptr);
RenderPresent();
} while (PalSurface->pixels != initialPixels);
}
PaletteFadeOut(8);
}

Loading…
Cancel
Save