[NTOS:INBV] Refactor boot screen code and resources (#1649)

* [NTOS:INBV] Move typedefs to the only single file where they are used.

* [NTOS:INBV] Refactor code & resources

Remove garbage

* [NTOS:INBV] Reduce fade time and remove wait for animation.
This commit is contained in:
Yaroslav Kibysh 2019-08-20 02:52:25 +03:00 committed by Timo Kreuzer
parent b99272702c
commit 238ea69ca0
19 changed files with 67 additions and 52 deletions

View File

@ -32,6 +32,27 @@
*/
// #define REACTOS_SKUS
typedef struct _INBV_PROGRESS_STATE
{
ULONG Floor;
ULONG Ceiling;
ULONG Bias;
} INBV_PROGRESS_STATE;
typedef struct _BT_PROGRESS_INDICATOR
{
ULONG Count;
ULONG Expected;
ULONG Percentage;
} BT_PROGRESS_INDICATOR, *PBT_PROGRESS_INDICATOR;
typedef enum _ROT_BAR_TYPE
{
RB_UNSPECIFIED,
RB_SQUARE_CELLS,
RB_PROGRESS_BAR
} ROT_BAR_TYPE;
/*
* Screen resolution (for default VGA)
*/
@ -155,8 +176,8 @@ typedef struct tagRGBQUAD
static RGBQUAD MainPalette[16];
#define PALETTE_FADE_STEPS 15
#define PALETTE_FADE_TIME (20 * 1000) /* 20 ms */
#define PALETTE_FADE_STEPS 12
#define PALETTE_FADE_TIME (15 * 1000) /* 15 ms */
/** From bootvid/precomp.h **/
//
@ -1062,7 +1083,7 @@ VOID
NTAPI
DisplayBootBitmap(IN BOOLEAN TextMode)
{
PVOID Header = NULL, Footer = NULL, Screen = NULL;
PVOID BootCopy = NULL, BootProgress = NULL, BootLogo = NULL, Header = NULL, Footer = NULL;
#ifdef INBV_ROTBAR_IMPLEMENTED
UCHAR Buffer[24 * 9];
@ -1155,8 +1176,8 @@ DisplayBootBitmap(IN BOOLEAN TextMode)
*/
MmChangeKernelResourceSectionProtection(MM_READWRITE);
/* Load the standard boot screen */
Screen = InbvGetResourceAddress(IDB_BOOT_SCREEN);
/* Load boot screen logo */
BootLogo = InbvGetResourceAddress(IDB_LOGO_DEFAULT);
#ifdef REACTOS_SKUS
Text = NULL;
@ -1197,15 +1218,19 @@ DisplayBootBitmap(IN BOOLEAN TextMode)
#endif
/* Make sure we have a logo */
if (Screen)
if (BootLogo)
{
/* Save the main image palette for implementing the fade-in effect */
PBITMAPINFOHEADER BitmapInfoHeader = Screen;
LPRGBQUAD Palette = (LPRGBQUAD)((PUCHAR)Screen + BitmapInfoHeader->biSize);
PBITMAPINFOHEADER BitmapInfoHeader = BootLogo;
LPRGBQUAD Palette = (LPRGBQUAD)((PUCHAR)BootLogo + BitmapInfoHeader->biSize);
RtlCopyMemory(MainPalette, Palette, sizeof(MainPalette));
/* Blit the background */
BitBltPalette(Screen, TRUE, 0, 0);
/* Draw the logo at the center of the screen */
BitBltAligned(BootLogo,
TRUE,
AL_HORIZONTAL_CENTER,
AL_VERTICAL_CENTER,
0, 0, 0, 34);
#ifdef INBV_ROTBAR_IMPLEMENTED
/* Choose progress bar */
@ -1230,6 +1255,22 @@ DisplayBootBitmap(IN BOOLEAN TextMode)
#endif
}
/* Load and draw progress bar bitmap */
BootProgress = InbvGetResourceAddress(IDB_PROGRESS_BAR);
BitBltAligned(BootProgress,
TRUE,
AL_HORIZONTAL_CENTER,
AL_VERTICAL_CENTER,
0, 118, 0, 0);
/* Load and draw copyright text bitmap */
BootCopy = InbvGetResourceAddress(IDB_COPYRIGHT);
BitBltAligned(BootCopy,
TRUE,
AL_HORIZONTAL_LEFT,
AL_VERTICAL_BOTTOM,
22, 0, 0, 20);
#ifdef REACTOS_SKUS
/* Draw the SKU text if it exits */
if (Text) BitBltPalette(Text, TRUE, 180, 121);
@ -1309,14 +1350,6 @@ DisplayBootBitmap(IN BOOLEAN TextMode)
RotBarSelection = TempRotBarSelection;
InbvRotBarInit();
InbvReleaseLock();
// FIXME: This was added to allow animation start before the processor hangs
if (TempRotBarSelection != RB_UNSPECIFIED)
{
LARGE_INTEGER Delay;
Delay.QuadPart = -3000000; // 300 ms
KeDelayExecutionThread(KernelMode, FALSE, &Delay);
}
}
#endif
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 226 B

After

Width:  |  Height:  |  Size: 226 B

View File

Before

Width:  |  Height:  |  Size: 226 B

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 386 B

After

Width:  |  Height:  |  Size: 386 B

View File

Before

Width:  |  Height:  |  Size: 490 B

After

Width:  |  Height:  |  Size: 490 B

View File

Before

Width:  |  Height:  |  Size: 730 B

After

Width:  |  Height:  |  Size: 730 B

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

Before

Width:  |  Height:  |  Size: 848 B

After

Width:  |  Height:  |  Size: 848 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 B

View File

Before

Width:  |  Height:  |  Size: 886 B

After

Width:  |  Height:  |  Size: 886 B

View File

@ -1,26 +1,5 @@
#pragma once
typedef struct _INBV_PROGRESS_STATE
{
ULONG Floor;
ULONG Ceiling;
ULONG Bias;
} INBV_PROGRESS_STATE;
typedef struct _BT_PROGRESS_INDICATOR
{
ULONG Count;
ULONG Expected;
ULONG Percentage;
} BT_PROGRESS_INDICATOR, *PBT_PROGRESS_INDICATOR;
typedef enum _ROT_BAR_TYPE
{
RB_UNSPECIFIED,
RB_SQUARE_CELLS,
RB_PROGRESS_BAR
} ROT_BAR_TYPE;
INIT_FUNCTION
VOID
NTAPI

View File

@ -40,5 +40,7 @@
/* ReactOS additions */
#define IDB_ROTATING_LINE 19
#define IDB_PROGRESS_BAR 20
#define IDB_COPYRIGHT 21
#define IDB_MAX_RESOURCE IDB_ROTATING_LINE
#define IDB_MAX_RESOURCE IDB_COPYRIGHT

View File

@ -28,17 +28,18 @@
#include <bugcodes.rc>
IDB_BOOT_SCREEN BITMAP "inbv/logo/1.bmp"
IDB_HIBERNATE_BAR BITMAP "inbv/logo/2.bmp"
IDB_SHUTDOWN_MSG BITMAP "inbv/logo/3.bmp"
IDB_BAR_DEFAULT BITMAP "inbv/logo/4.bmp"
IDB_LOGO_DEFAULT BITMAP "inbv/logo/5.bmp"
IDB_WKSTA_HEADER BITMAP "inbv/logo/6.bmp"
IDB_WKSTA_FOOTER BITMAP "inbv/logo/7.bmp"
IDB_BAR_WKSTA BITMAP "inbv/logo/8.bmp"
IDB_SERVER_LOGO BITMAP "inbv/logo/5.bmp"
IDB_SERVER_HEADER BITMAP "inbv/logo/14.bmp"
IDB_SERVER_FOOTER BITMAP "inbv/logo/15.bmp"
IDB_HIBERNATE_BAR BITMAP "inbv/resources/hibernate.bmp"
IDB_SHUTDOWN_MSG BITMAP "inbv/resources/shutdown.bmp"
IDB_BAR_DEFAULT BITMAP "inbv/resources/barserver.bmp"
IDB_LOGO_DEFAULT BITMAP "inbv/resources/logo.bmp"
IDB_WKSTA_HEADER BITMAP "inbv/resources/hwksta.bmp"
IDB_WKSTA_FOOTER BITMAP "inbv/resources/fwksta.bmp"
IDB_BAR_WKSTA BITMAP "inbv/resources/barwksta.bmp"
IDB_SERVER_LOGO BITMAP "inbv/resources/logo.bmp"
IDB_SERVER_HEADER BITMAP "inbv/resources/hserver.bmp"
IDB_SERVER_FOOTER BITMAP "inbv/resources/fserver.bmp"
/* ReactOS additions */
IDB_ROTATING_LINE BITMAP "inbv/logo/line.bmp"
IDB_ROTATING_LINE BITMAP "inbv/resources/line.bmp"
IDB_PROGRESS_BAR BITMAP "inbv/resources/progress.bmp"
IDB_COPYRIGHT BITMAP "inbv/resources/copyright.bmp"