mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 09:13:01 +00:00
[FREELDR:UI] Clean-up when uninitializing the UI.
- If the started OS loader failed and we are back to the OS selection menu, re-initialize the UI as the loader may have messed up the display in the meantime. - Tear down allocated off-screen back-buffer when uninitializing the TUI. - Clear up the screen when initializing the direct-UI.
This commit is contained in:
parent
e2daca3f60
commit
313e6b6cbb
5 changed files with 30 additions and 6 deletions
|
@ -401,6 +401,13 @@ VOID RunLoader(VOID)
|
||||||
|
|
||||||
/* Load the chosen operating system */
|
/* Load the chosen operating system */
|
||||||
LoadOperatingSystem(&OperatingSystemList[SelectedOperatingSystem]);
|
LoadOperatingSystem(&OperatingSystemList[SelectedOperatingSystem]);
|
||||||
|
|
||||||
|
/* If we get there, the OS loader failed. As it may have
|
||||||
|
* messed up the display, re-initialize the UI. */
|
||||||
|
#ifndef _M_ARM
|
||||||
|
UiVtbl.UnInitialize();
|
||||||
|
#endif
|
||||||
|
UiInitialize(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
Reboot:
|
Reboot:
|
||||||
|
|
|
@ -19,7 +19,9 @@ typedef struct _PALETTE_ENTRY
|
||||||
// extern PVOID VideoOffScreenBuffer;
|
// extern PVOID VideoOffScreenBuffer;
|
||||||
|
|
||||||
PVOID VideoAllocateOffScreenBuffer(VOID); // Returns a pointer to an off-screen buffer sufficient for the current video mode
|
PVOID VideoAllocateOffScreenBuffer(VOID); // Returns a pointer to an off-screen buffer sufficient for the current video mode
|
||||||
VOID VideoCopyOffScreenBufferToVRAM(VOID);
|
|
||||||
|
VOID VideoFreeOffScreenBuffer(VOID);
|
||||||
|
VOID VideoCopyOffScreenBufferToVRAM(VOID);
|
||||||
|
|
||||||
VOID VideoSavePaletteState(PPALETTE_ENTRY Palette, ULONG ColorCount);
|
VOID VideoSavePaletteState(PPALETTE_ENTRY Palette, ULONG ColorCount);
|
||||||
VOID VideoRestorePaletteState(PPALETTE_ENTRY Palette, ULONG ColorCount);
|
VOID VideoRestorePaletteState(PPALETTE_ENTRY Palette, ULONG ColorCount);
|
||||||
|
|
|
@ -34,6 +34,9 @@ UiInitialize(IN BOOLEAN ShowUi)
|
||||||
/* Set mode and query size */
|
/* Set mode and query size */
|
||||||
MachVideoSetDisplayMode(NULL, TRUE);
|
MachVideoSetDisplayMode(NULL, TRUE);
|
||||||
MachVideoGetDisplaySize(&UiScreenWidth, &UiScreenHeight, &Depth);
|
MachVideoGetDisplaySize(&UiScreenWidth, &UiScreenHeight, &Depth);
|
||||||
|
|
||||||
|
/* Clear the screen */
|
||||||
|
UiDrawBackdrop();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -210,6 +210,10 @@ BOOLEAN TuiInitialize(VOID)
|
||||||
|
|
||||||
VOID TuiUnInitialize(VOID)
|
VOID TuiUnInitialize(VOID)
|
||||||
{
|
{
|
||||||
|
/* Do nothing if already uninitialized */
|
||||||
|
if (!TextVideoBuffer)
|
||||||
|
return;
|
||||||
|
|
||||||
if (UiUseSpecialEffects)
|
if (UiUseSpecialEffects)
|
||||||
{
|
{
|
||||||
TuiFadeOut();
|
TuiFadeOut();
|
||||||
|
@ -219,6 +223,9 @@ VOID TuiUnInitialize(VOID)
|
||||||
MachVideoSetDisplayMode(NULL, FALSE);
|
MachVideoSetDisplayMode(NULL, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VideoFreeOffScreenBuffer();
|
||||||
|
TextVideoBuffer = NULL;
|
||||||
|
|
||||||
MachVideoClearScreen(ATTR(COLOR_GRAY, COLOR_BLACK));
|
MachVideoClearScreen(ATTR(COLOR_GRAY, COLOR_BLACK));
|
||||||
MachVideoSetTextCursorPosition(0, 0);
|
MachVideoSetTextCursorPosition(0, 0);
|
||||||
MachVideoHideShowTextCursor(TRUE);
|
MachVideoHideShowTextCursor(TRUE);
|
||||||
|
|
|
@ -18,11 +18,7 @@ PVOID VideoAllocateOffScreenBuffer(VOID)
|
||||||
{
|
{
|
||||||
ULONG BufferSize;
|
ULONG BufferSize;
|
||||||
|
|
||||||
if (VideoOffScreenBuffer != NULL)
|
VideoFreeOffScreenBuffer();
|
||||||
{
|
|
||||||
MmFreeMemory(VideoOffScreenBuffer);
|
|
||||||
VideoOffScreenBuffer = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
BufferSize = MachVideoGetBufferSize();
|
BufferSize = MachVideoGetBufferSize();
|
||||||
|
|
||||||
|
@ -31,6 +27,15 @@ PVOID VideoAllocateOffScreenBuffer(VOID)
|
||||||
return VideoOffScreenBuffer;
|
return VideoOffScreenBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VOID VideoFreeOffScreenBuffer(VOID)
|
||||||
|
{
|
||||||
|
if (!VideoOffScreenBuffer)
|
||||||
|
return;
|
||||||
|
|
||||||
|
MmFreeMemory(VideoOffScreenBuffer);
|
||||||
|
VideoOffScreenBuffer = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
VOID VideoCopyOffScreenBufferToVRAM(VOID)
|
VOID VideoCopyOffScreenBufferToVRAM(VOID)
|
||||||
{
|
{
|
||||||
MachVideoCopyOffScreenBufferToVRAM(VideoOffScreenBuffer);
|
MachVideoCopyOffScreenBufferToVRAM(VideoOffScreenBuffer);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue