mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 10:12:58 +00:00
[NTOSKRNL]
Reintroduce the long-awaited boot-logo fading-in, removed since ReactOS 0.3.3 due to bootvid / inbv refactoring. Code taken from the old (ie. pre-ReactOS 0.3.3) bootvid. svn path=/trunk/; revision=57855
This commit is contained in:
parent
7b562bf5e5
commit
4c55745faf
1 changed files with 121 additions and 19 deletions
|
@ -24,6 +24,92 @@ ROT_BAR_TYPE RotBarSelection;
|
||||||
ULONG PltRotBarStatus;
|
ULONG PltRotBarStatus;
|
||||||
BT_PROGRESS_INDICATOR InbvProgressIndicator = {0, 25, 0};
|
BT_PROGRESS_INDICATOR InbvProgressIndicator = {0, 25, 0};
|
||||||
|
|
||||||
|
/* FADING FUNCTION ***********************************************************/
|
||||||
|
|
||||||
|
/** From include/psdk/wingdi.h **/
|
||||||
|
typedef struct tagRGBQUAD
|
||||||
|
{
|
||||||
|
UCHAR rgbBlue;
|
||||||
|
UCHAR rgbGreen;
|
||||||
|
UCHAR rgbRed;
|
||||||
|
UCHAR rgbReserved;
|
||||||
|
} RGBQUAD,*LPRGBQUAD;
|
||||||
|
/*******************************/
|
||||||
|
|
||||||
|
static RGBQUAD _MainPalette[16];
|
||||||
|
|
||||||
|
#define PALETTE_FADE_STEPS 15
|
||||||
|
#define PALETTE_FADE_TIME 20 * 10000 /* 20ms */
|
||||||
|
|
||||||
|
/** From bootvid/precomp.h **/
|
||||||
|
//
|
||||||
|
// Bitmap Header
|
||||||
|
//
|
||||||
|
typedef struct tagBITMAPINFOHEADER
|
||||||
|
{
|
||||||
|
ULONG biSize;
|
||||||
|
LONG biWidth;
|
||||||
|
LONG biHeight;
|
||||||
|
USHORT biPlanes;
|
||||||
|
USHORT biBitCount;
|
||||||
|
ULONG biCompression;
|
||||||
|
ULONG biSizeImage;
|
||||||
|
LONG biXPelsPerMeter;
|
||||||
|
LONG biYPelsPerMeter;
|
||||||
|
ULONG biClrUsed;
|
||||||
|
ULONG biClrImportant;
|
||||||
|
} BITMAPINFOHEADER, *PBITMAPINFOHEADER;
|
||||||
|
/****************************/
|
||||||
|
|
||||||
|
static VOID
|
||||||
|
NTAPI
|
||||||
|
BootImageFadeProc(VOID)
|
||||||
|
{
|
||||||
|
UCHAR PaletteBitmapBuffer[sizeof(BITMAPINFOHEADER) + sizeof(_MainPalette)];
|
||||||
|
PBITMAPINFOHEADER PaletteBitmap = (PBITMAPINFOHEADER)PaletteBitmapBuffer;
|
||||||
|
LPRGBQUAD Palette = (LPRGBQUAD)(PaletteBitmapBuffer + sizeof(BITMAPINFOHEADER));
|
||||||
|
|
||||||
|
ULONG Iteration, Index, ClrUsed;
|
||||||
|
LARGE_INTEGER Interval;
|
||||||
|
|
||||||
|
Interval.QuadPart = -PALETTE_FADE_TIME;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Build a bitmap containing the fade in palette. The palette entries
|
||||||
|
* are then processed in a loop and set using VidBitBlt function.
|
||||||
|
*/
|
||||||
|
ClrUsed = sizeof(_MainPalette) / sizeof(_MainPalette[0]);
|
||||||
|
RtlZeroMemory(PaletteBitmap, sizeof(BITMAPINFOHEADER));
|
||||||
|
PaletteBitmap->biSize = sizeof(BITMAPINFOHEADER);
|
||||||
|
PaletteBitmap->biBitCount = 4;
|
||||||
|
PaletteBitmap->biClrUsed = ClrUsed;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Main animation loop.
|
||||||
|
*/
|
||||||
|
for (Iteration = 0; Iteration <= PALETTE_FADE_STEPS; ++Iteration)
|
||||||
|
{
|
||||||
|
for (Index = 0; Index < ClrUsed; Index++)
|
||||||
|
{
|
||||||
|
Palette[Index].rgbRed =
|
||||||
|
_MainPalette[Index].rgbRed * Iteration / PALETTE_FADE_STEPS;
|
||||||
|
Palette[Index].rgbGreen =
|
||||||
|
_MainPalette[Index].rgbGreen * Iteration / PALETTE_FADE_STEPS;
|
||||||
|
Palette[Index].rgbBlue =
|
||||||
|
_MainPalette[Index].rgbBlue * Iteration / PALETTE_FADE_STEPS;
|
||||||
|
}
|
||||||
|
|
||||||
|
VidBitBlt(PaletteBitmapBuffer, 0, 0);
|
||||||
|
|
||||||
|
/* Wait for a bit. */
|
||||||
|
KeDelayExecutionThread(KernelMode, FALSE, &Interval);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Wait for a bit. */
|
||||||
|
KeDelayExecutionThread(KernelMode, FALSE, &Interval);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
PVOID
|
PVOID
|
||||||
|
@ -267,8 +353,7 @@ InbvDisplayString(IN PCHAR String)
|
||||||
if (InbvBootDriverInstalled) VidDisplayString((PUCHAR) String);
|
if (InbvBootDriverInstalled) VidDisplayString((PUCHAR) String);
|
||||||
|
|
||||||
/* Print the string on the EMS port */
|
/* Print the string on the EMS port */
|
||||||
HeadlessDispatch(
|
HeadlessDispatch(HeadlessCmdPutString,
|
||||||
HeadlessCmdPutString,
|
|
||||||
String,
|
String,
|
||||||
strlen(String) + sizeof(ANSI_NULL),
|
strlen(String) + sizeof(ANSI_NULL),
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -578,9 +663,12 @@ NTAPI
|
||||||
INIT_FUNCTION
|
INIT_FUNCTION
|
||||||
DisplayBootBitmap(IN BOOLEAN TextMode)
|
DisplayBootBitmap(IN BOOLEAN TextMode)
|
||||||
{
|
{
|
||||||
|
PBITMAPINFOHEADER BitmapInfoHeader;
|
||||||
|
LPRGBQUAD Palette;
|
||||||
|
|
||||||
PVOID Header, Band, Text, Screen;
|
PVOID Header, Band, Text, Screen;
|
||||||
ROT_BAR_TYPE TempRotBarSelection = RB_UNSPECIFIED;
|
ROT_BAR_TYPE TempRotBarSelection = RB_UNSPECIFIED;
|
||||||
UCHAR Buffer[64];
|
// UCHAR Buffer[64];
|
||||||
|
|
||||||
/* Check if the system thread has already been created */
|
/* Check if the system thread has already been created */
|
||||||
if (SysThreadCreated)
|
if (SysThreadCreated)
|
||||||
|
@ -672,12 +760,25 @@ DisplayBootBitmap(IN BOOLEAN TextMode)
|
||||||
/* Choose progress bar */
|
/* Choose progress bar */
|
||||||
TempRotBarSelection = RB_SQUARE_CELLS;
|
TempRotBarSelection = RB_SQUARE_CELLS;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Save the main image palette and replace it with black palette, so
|
||||||
|
* we can do fade in effect later.
|
||||||
|
*/
|
||||||
|
BitmapInfoHeader = (PBITMAPINFOHEADER)Screen;
|
||||||
|
Palette = (LPRGBQUAD)((PUCHAR)Screen + BitmapInfoHeader->biSize);
|
||||||
|
RtlCopyMemory(_MainPalette, Palette, sizeof(_MainPalette));
|
||||||
|
RtlZeroMemory(Palette, sizeof(_MainPalette));
|
||||||
|
|
||||||
/* Blit the background */
|
/* Blit the background */
|
||||||
InbvBitBlt(Screen, 0, 0);
|
InbvBitBlt(Screen, 0, 0);
|
||||||
|
|
||||||
/* Set progress bar coordinates and display it */
|
/* Set progress bar coordinates and display it */
|
||||||
InbvSetProgressBarCoordinates(257, 352);
|
InbvSetProgressBarCoordinates(257, 352);
|
||||||
|
|
||||||
|
/* Display the boot logo and fade it in */
|
||||||
|
BootImageFadeProc();
|
||||||
|
|
||||||
|
#if 0
|
||||||
/* Check for non-workstation products */
|
/* Check for non-workstation products */
|
||||||
if (SharedUserData->NtProductType != NtProductWinNt)
|
if (SharedUserData->NtProductType != NtProductWinNt)
|
||||||
{
|
{
|
||||||
|
@ -689,10 +790,11 @@ DisplayBootBitmap(IN BOOLEAN TextMode)
|
||||||
/* In setup mode, you haven't selected a SKU yet */
|
/* In setup mode, you haven't selected a SKU yet */
|
||||||
if (ExpInTextModeSetup) Text = NULL;
|
if (ExpInTextModeSetup) Text = NULL;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Draw the SKU text if it exits */
|
/* Draw the SKU text if it exits */
|
||||||
if (Text) InbvBitBlt(Text, 180, 121);
|
// if (Text) InbvBitBlt(Text, 180, 121);
|
||||||
|
|
||||||
/* Draw the progress bar bit */
|
/* Draw the progress bar bit */
|
||||||
// if (Bar) InbvBitBlt(Bar, 0, 0);
|
// if (Bar) InbvBitBlt(Bar, 0, 0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue