Browse Source

When needed, clear buffer before rendering menu

pull/736/head
Anders Jenbo 6 years ago
parent
commit
7a90b9102a
  1. 1
      SourceX/DiabloUI/credits.cpp
  2. 6
      SourceX/DiabloUI/diabloui.cpp
  3. 1
      SourceX/DiabloUI/diabloui.h
  4. 1
      SourceX/DiabloUI/mainmenu.cpp
  5. 1
      SourceX/DiabloUI/progress.cpp
  6. 1
      SourceX/DiabloUI/selconn.cpp
  7. 1
      SourceX/DiabloUI/selgame.cpp
  8. 1
      SourceX/DiabloUI/selhero.cpp
  9. 1
      SourceX/DiabloUI/selok.cpp
  10. 1
      SourceX/DiabloUI/selyesno.cpp

1
SourceX/DiabloUI/credits.cpp

@ -208,6 +208,7 @@ void CreditsRenderer::Render()
return;
prev_offset_y_ = offset_y;
SDL_FillRect(GetOutputSurface(), NULL, 0x000000);
DrawArt(PANEL_LEFT + 0, 0, &ArtBackground);
if (font == NULL)
return;

6
SourceX/DiabloUI/diabloui.cpp

@ -606,6 +606,12 @@ void DrawSelector(const SDL_Rect &rect)
DrawArt(rect.x + rect.w - art->w(), y, art, frame);
}
void UiClearScreen()
{
if (SCREEN_WIDTH > 640) // Background size
SDL_FillRect(GetOutputSurface(), NULL, 0x000000);
}
void UiPollAndRender()
{
SDL_Event event;

1
SourceX/DiabloUI/diabloui.h

@ -56,6 +56,7 @@ void UiFocusNavigationEsc();
void UiFocusNavigationYesNo();
void UiInitList(int min, int max, void (*fnFocus)(int value), void (*fnSelect)(int value), void (*fnEsc)(), UiItem *items, int size, bool wraps = false, bool (*fnYesNo)() = NULL);
void UiInitScrollBar(UiScrollBar *ui_sb, std::size_t viewport_size, const std::size_t *current_offset);
void UiClearScreen();
void UiPollAndRender();
void UiRenderItems(UiItem *items, std::size_t size);

1
SourceX/DiabloUI/mainmenu.cpp

@ -70,6 +70,7 @@ BOOL UiMainMenuDialog(char *name, int *pdwResult, void (*fnSound)(char *file), i
mainmenu_restart_repintro(); // for automatic starts
while (MainMenuResult == 0) {
UiClearScreen();
UiPollAndRender();
if (!gbSpawned && SDL_GetTicks() >= dwAttractTicks) {
MainMenuResult = MAINMENU_ATTRACT_MODE;

1
SourceX/DiabloUI/progress.cpp

@ -66,6 +66,7 @@ void progress_Free()
void progress_Render(BYTE progress)
{
SDL_FillRect(GetOutputSurface(), NULL, 0x000000);
DrawArt(0, 0, &ArtBackground);
int x = GetCenterOffset(280);

1
SourceX/DiabloUI/selconn.cpp

@ -116,6 +116,7 @@ int UiSelectProvider(
selconn_ReturnValue = true;
selconn_EndMenu = false;
while (!selconn_EndMenu) {
UiClearScreen();
UiPollAndRender();
}
selconn_Free();

1
SourceX/DiabloUI/selgame.cpp

@ -285,6 +285,7 @@ int UiSelectGame(int a1, _SNETPROGRAMDATA *client_info, _SNETPLAYERDATA *user_in
selgame_endMenu = false;
while (!selgame_endMenu) {
UiClearScreen();
UiPollAndRender();
}
selgame_Free();

1
SourceX/DiabloUI/selhero.cpp

@ -367,6 +367,7 @@ BOOL UiSelHeroDialog(
selhero_endMenu = false;
while (!selhero_endMenu && !selhero_navigateYesNo) {
UiClearScreen();
UiRenderItems(SELHERO_DIALOG, size(SELHERO_DIALOG));
UiPollAndRender();
}

1
SourceX/DiabloUI/selok.cpp

@ -75,6 +75,7 @@ void UiSelOkDialog(const char *title, const char *body, bool background)
selok_endMenu = false;
while (!selok_endMenu) {
UiClearScreen();
UiRenderItems(items, itemCnt);
UiPollAndRender();
}

1
SourceX/DiabloUI/selyesno.cpp

@ -55,6 +55,7 @@ bool UiSelHeroYesNoDialog(const char *title, const char *body)
selyesno_value = true;
selyesno_endMenu = false;
while (!selyesno_endMenu) {
UiClearScreen();
UiRenderItems(SELYESNO_DIALOG, size(SELYESNO_DIALOG));
UiPollAndRender();
}

Loading…
Cancel
Save