Skip to content

Commit

Permalink
fix uninitialized disk type
Browse files Browse the repository at this point in the history
Signed-off-by: Sergey Isakov <[email protected]>
  • Loading branch information
SergeySlice committed Apr 6, 2020
1 parent a092a31 commit 0a3f4c3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
18 changes: 10 additions & 8 deletions rEFIt_UEFI/entry_scan/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,26 +138,28 @@ EG_IMAGE* ScanVolumeDefaultIcon(REFIT_VOLUME *Volume, IN UINT8 OSType, IN EFI_DE
break;
}
#if USE_XTHEME
IconX = &ThemeX.GetIcon(IconNum);
if (IconX->isEmpty()) {
IconX = &ThemeX.GetIcon(BUILTIN_ICON_VOL_INTERNAL);
}
break;
case DISK_KIND_EXTERNAL:
IconX = &ThemeX.GetIcon(BUILTIN_ICON_VOL_EXTERNAL);
IconNum = BUILTIN_ICON_VOL_EXTERNAL;
break;
case DISK_KIND_OPTICAL:
IconX = &ThemeX.GetIcon(BUILTIN_ICON_VOL_OPTICAL);
IconNum = BUILTIN_ICON_VOL_OPTICAL;
break;
case DISK_KIND_FIREWIRE:
IconX = &ThemeX.GetIcon(BUILTIN_ICON_VOL_FIREWIRE);
IconNum = BUILTIN_ICON_VOL_FIREWIRE;
break;
case DISK_KIND_BOOTER:
IconX = &ThemeX.GetIcon(BUILTIN_ICON_VOL_BOOTER);
IconNum = BUILTIN_ICON_VOL_BOOTER;
break;
default:
IconNum = BUILTIN_ICON_VOL_INTERNAL;
break;
}
IconX = &ThemeX.GetIcon(IconNum);
if (IconX->isEmpty()) {
IconX = &ThemeX.GetIcon(BUILTIN_ICON_VOL_INTERNAL); //including embedded which is really present
}

return *IconX;
#else
return BuiltinIcon(IconNum);
Expand Down
6 changes: 4 additions & 2 deletions rEFIt_UEFI/gui/REFIT_MENU_SCREEN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1153,12 +1153,14 @@ UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN MENU_STYLE_FUNC StyleFunc, IN OUT INT
SetNextScreenMode(1);
egGetScreenSize(&UGAWidth, &UGAHeight); //before init theme
InitTheme(FALSE, NULL);
MenuExit = MENU_EXIT_ESCAPE; //to redraw screen
break;
case SCAN_F10:
egScreenShot();
break;
case SCAN_F11:
ResetNvram ();
ResetNvram();
MenuExit = MENU_EXIT_ESCAPE; //to redraw screen
break;
case SCAN_F12:
MenuExit = MENU_EXIT_EJECT;
Expand Down Expand Up @@ -1547,7 +1549,7 @@ INTN REFIT_MENU_SCREEN::DrawTextXY(IN const XStringW& Text, IN INTN XPos, IN INT
return TextWidth2;
}

void REFIT_MENU_SCREEN::EraseTextXY()
void REFIT_MENU_SCREEN::EraseTextXY() //used on boot screen
{
OldTextBufferImage.Draw(OldTextBufferRect.XPos, OldTextBufferRect.YPos);
}
Expand Down

0 comments on commit 0a3f4c3

Please sign in to comment.