Browse Source

Fix flashing menu transitions

Fixes #591
pull/596/head
Anders Jenbo 6 years ago
parent
commit
3ad7e21e71
  1. 1
      SourceX/DiabloUI/credits.cpp
  2. 9
      SourceX/DiabloUI/diabloui.cpp
  3. 1
      SourceX/DiabloUI/mainmenu.cpp
  4. 1
      SourceX/DiabloUI/progress.cpp
  5. 1
      SourceX/DiabloUI/selconn.cpp
  6. 4
      SourceX/DiabloUI/selgame.cpp
  7. 4
      SourceX/DiabloUI/selhero.cpp
  8. 2
      SourceX/DiabloUI/selok.cpp
  9. 2
      SourceX/DiabloUI/selyesno.cpp
  10. 1
      SourceX/DiabloUI/title.cpp

1
SourceX/DiabloUI/credits.cpp

@ -275,7 +275,6 @@ BOOL UiCreditsDialog(int a1)
UiHandleEvents(&event);
}
} while (!endMenu && !credits_renderer.Finished());
BlackPalette();
return true;
}

9
SourceX/DiabloUI/diabloui.cpp

@ -564,15 +564,18 @@ int GetCenterOffset(int w, int bw)
void LoadBackgroundArt(const char *pszFile)
{
SDL_Color pPal[256];
fadeTc = 0;
fadeValue = 0;
LoadArt(pszFile, &ArtBackground, 1, pPal);
if (ArtBackground.surface == nullptr)
return;
LoadPalInMem(pPal);
ApplyGamma(logical_palette, orig_palette, 256);
fadeTc = 0;
fadeValue = 0;
BlackPalette();
SDL_FillRect(GetOutputSurface(), NULL, 0x000000);
RenderPresent();
}
void UiFadeIn()

1
SourceX/DiabloUI/mainmenu.cpp

@ -72,7 +72,6 @@ BOOL UiMainMenuDialog(char *name, int *pdwResult, void (*fnSound)(char *file), i
}
}
BlackPalette();
mainmenu_Free();
if (gbSpawned && MainMenuResult == MAINMENU_REPLAY_INTRO) {

1
SourceX/DiabloUI/progress.cpp

@ -128,7 +128,6 @@ BOOL UiProgressDialog(HWND window, char *msg, int enable, int (*fnfunc)(), int r
UiHandleEvents(&event);
}
}
BlackPalette();
progress_Free();
return progress == 100;

1
SourceX/DiabloUI/selconn.cpp

@ -118,7 +118,6 @@ int UiSelectProvider(
while (!selconn_EndMenu) {
UiPollAndRender();
}
BlackPalette();
selconn_Free();
return selconn_ReturnValue;

4
SourceX/DiabloUI/selgame.cpp

@ -176,7 +176,6 @@ bool IsDifficultyAllowed(int value)
}
selgame_Free();
BlackPalette();
if (value == 1)
UiSelOkDialog(title, "Your character must reach level 20 before you can enter a multiplayer game of Nightmare difficulty.", false);
@ -235,7 +234,6 @@ void selgame_Password_Select(int value)
selgame_endMenu = true;
} else {
selgame_Free();
BlackPalette();
UiSelOkDialog("Multi Player Game", SDL_GetError(), false);
LoadBackgroundArt("ui_art\\selgame.pcx");
selgame_Password_Init(selgame_selectedGame);
@ -251,7 +249,6 @@ void selgame_Password_Select(int value)
selgame_endMenu = true;
} else {
selgame_Free();
BlackPalette();
UiSelOkDialog("Multi Player Game", SDL_GetError(), false);
LoadBackgroundArt("ui_art\\selgame.pcx");
selgame_Password_Init(0);
@ -275,7 +272,6 @@ int UiSelectGame(int a1, _SNETPROGRAMDATA *client_info, _SNETPLAYERDATA *user_in
while (!selgame_endMenu) {
UiPollAndRender();
}
BlackPalette();
selgame_Free();
return selgame_enteringGame;

4
SourceX/DiabloUI/selhero.cpp

@ -240,7 +240,6 @@ void selhero_ClassSelector_Select(int value)
{
if (gbSpawned && (value == 1 || value == 2)) {
selhero_Free();
BlackPalette();
UiSelOkDialog(nullptr, "The Rogue and Sorcerer are only available in the full retail version of Diablo. Visit https://www.gog.com/game/diablo to purchase.", false);
LoadBackgroundArt("ui_art\\selhero.pcx");
selhero_List_Select(selhero_SaveCount);
@ -273,7 +272,6 @@ void selhero_Name_Select(int value)
if (!UiValidPlayerName(selhero_heroInfo.name)) {
selhero_Free();
BlackPalette();
UiSelOkDialog(title, "Invalid name. A name cannot contain spaces, reserved characters, or reserved words.\n", false);
LoadBackgroundArt("ui_art\\selhero.pcx");
} else {
@ -281,7 +279,6 @@ void selhero_Name_Select(int value)
for (std::size_t i = 0; i < selhero_SaveCount; i++) {
if (strcasecmp(selhero_heros[i].name, selhero_heroInfo.name) == 0) {
selhero_Free();
BlackPalette();
char dialogText[256];
sprintf(dialogText, "Character already exists. Do you want to overwrite \"%s\"?", selhero_heroInfo.name);
overwrite = UiSelHeroYesNoDialog(title, dialogText);
@ -370,7 +367,6 @@ BOOL UiSelHeroDialog(
UiRenderItems(SELHERO_DIALOG, size(SELHERO_DIALOG));
UiPollAndRender();
}
BlackPalette();
selhero_Free();
if (selhero_navigateYesNo) {

2
SourceX/DiabloUI/selok.cpp

@ -79,8 +79,6 @@ void UiSelOkDialog(const char *title, const char *body, bool background)
UiPollAndRender();
}
BlackPalette();
selok_Free();
}
} // namespace dvl

2
SourceX/DiabloUI/selyesno.cpp

@ -59,8 +59,6 @@ bool UiSelHeroYesNoDialog(const char *title, const char *body)
UiPollAndRender();
}
BlackPalette();
selyesno_Free();
return selyesno_value;

1
SourceX/DiabloUI/title.cpp

@ -54,7 +54,6 @@ void UiTitleDialog()
UiHandleEvents(&event);
}
}
BlackPalette();
title_Free();
}

Loading…
Cancel
Save