* Removed the Copyright image/rendering.
* Fixed the icons image, it was upside down. * Support the new 24 bit boot screen images in the boot_loader and the kernel. * Prepare the code for future indexed versions of the boot screen images. But the generate_boot_screen tool currently does not generate those. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24449 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 2.5 KiB |
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
+21291
-7844
File diff suppressed because it is too large
Load Diff
@@ -547,20 +547,21 @@ set_text_mode(void)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
blit32(const uint8 *data, uint16 width, uint16 height,
|
blit32(const uint8 *data, uint16 width, uint16 height, uint16 left, uint16 top)
|
||||||
const uint8 *palette, uint16 left, uint16 top)
|
|
||||||
{
|
{
|
||||||
uint32 *start = (uint32 *)(sFrameBuffer
|
uint32 *start = (uint32 *)(sFrameBuffer
|
||||||
+ gKernelArgs.frame_buffer.bytes_per_row * top + 4 * left);
|
+ gKernelArgs.frame_buffer.bytes_per_row * top + 4 * left);
|
||||||
|
|
||||||
for (int32 y = 0; y < height; y++) {
|
for (int32 y = 0; y < height; y++) {
|
||||||
|
const uint8* src = data;
|
||||||
|
uint32* dst = start;
|
||||||
for (int32 x = 0; x < width; x++) {
|
for (int32 x = 0; x < width; x++) {
|
||||||
uint16 color = data[y * width + x] * 3;
|
dst[0] = (src[0] << 16) | (src[1] << 8) | (src[2]);
|
||||||
|
dst++;
|
||||||
start[x] = (palette[color + 0] << 16) | (palette[color + 1] << 8)
|
src += 3;
|
||||||
| (palette[color + 2]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data += width * 3;
|
||||||
start = (uint32 *)((addr_t)start
|
start = (uint32 *)((addr_t)start
|
||||||
+ gKernelArgs.frame_buffer.bytes_per_row);
|
+ gKernelArgs.frame_buffer.bytes_per_row);
|
||||||
}
|
}
|
||||||
@@ -568,43 +569,46 @@ blit32(const uint8 *data, uint16 width, uint16 height,
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
blit24(const uint8 *data, uint16 width, uint16 height,
|
blit24(const uint8 *data, uint16 width, uint16 height, uint16 left, uint16 top)
|
||||||
const uint8 *palette, uint16 left, uint16 top)
|
|
||||||
{
|
{
|
||||||
uint8 *start = (uint8 *)sFrameBuffer
|
uint8 *start = (uint8 *)sFrameBuffer
|
||||||
+ gKernelArgs.frame_buffer.bytes_per_row * top + 3 * left;
|
+ gKernelArgs.frame_buffer.bytes_per_row * top + 3 * left;
|
||||||
|
|
||||||
for (int32 y = 0; y < height; y++) {
|
for (int32 y = 0; y < height; y++) {
|
||||||
|
const uint8* src = data;
|
||||||
|
uint8* dst = start;
|
||||||
for (int32 x = 0; x < width; x++) {
|
for (int32 x = 0; x < width; x++) {
|
||||||
uint16 color = data[y * width + x] * 3;
|
dst[0] = src[0];
|
||||||
uint32 index = x * 3;
|
dst[1] = src[1];
|
||||||
|
dst[2] = src[2];
|
||||||
start[index + 0] = palette[color + 2];
|
dst += 3;
|
||||||
start[index + 1] = palette[color + 1];
|
src += 3;
|
||||||
start[index + 2] = palette[color + 0];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data += width * 3;
|
||||||
start = start + gKernelArgs.frame_buffer.bytes_per_row;
|
start = start + gKernelArgs.frame_buffer.bytes_per_row;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
blit16(const uint8 *data, uint16 width, uint16 height,
|
blit16(const uint8 *data, uint16 width, uint16 height, uint16 left, uint16 top)
|
||||||
const uint8 *palette, uint16 left, uint16 top)
|
|
||||||
{
|
{
|
||||||
uint16 *start = (uint16 *)(sFrameBuffer
|
uint16 *start = (uint16 *)(sFrameBuffer
|
||||||
+ gKernelArgs.frame_buffer.bytes_per_row * top + 2 * left);
|
+ gKernelArgs.frame_buffer.bytes_per_row * top + 2 * left);
|
||||||
|
|
||||||
for (int32 y = 0; y < height; y++) {
|
for (int32 y = 0; y < height; y++) {
|
||||||
|
const uint8* src = data;
|
||||||
|
uint16* dst = start;
|
||||||
for (int32 x = 0; x < width; x++) {
|
for (int32 x = 0; x < width; x++) {
|
||||||
uint16 color = data[y * width + x] * 3;
|
dst[0] = ((src[2] >> 3) << 11)
|
||||||
|
| ((src[1] >> 2) << 5)
|
||||||
start[x] = ((palette[color + 0] >> 3) << 11)
|
| ((src[0] >> 3));
|
||||||
| ((palette[color + 1] >> 2) << 5)
|
dst++;
|
||||||
| ((palette[color + 2] >> 3));
|
src += 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data += width * 3;
|
||||||
start = (uint16 *)((addr_t)start
|
start = (uint16 *)((addr_t)start
|
||||||
+ gKernelArgs.frame_buffer.bytes_per_row);
|
+ gKernelArgs.frame_buffer.bytes_per_row);
|
||||||
}
|
}
|
||||||
@@ -612,21 +616,23 @@ blit16(const uint8 *data, uint16 width, uint16 height,
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
blit15(const uint8 *data, uint16 width, uint16 height,
|
blit15(const uint8 *data, uint16 width, uint16 height, uint16 left, uint16 top)
|
||||||
const uint8 *palette, uint16 left, uint16 top)
|
|
||||||
{
|
{
|
||||||
uint16 *start = (uint16 *)(sFrameBuffer
|
uint16 *start = (uint16 *)(sFrameBuffer
|
||||||
+ gKernelArgs.frame_buffer.bytes_per_row * top + 2 * left);
|
+ gKernelArgs.frame_buffer.bytes_per_row * top + 2 * left);
|
||||||
|
|
||||||
for (int32 y = 0; y < height; y++) {
|
for (int32 y = 0; y < height; y++) {
|
||||||
|
const uint8* src = data;
|
||||||
|
uint16* dst = start;
|
||||||
for (int32 x = 0; x < width; x++) {
|
for (int32 x = 0; x < width; x++) {
|
||||||
uint16 color = data[y * width + x] * 3;
|
dst[0] = ((src[2] >> 3) << 10)
|
||||||
|
| ((src[1] >> 3) << 5)
|
||||||
start[x] = ((palette[color + 0] >> 3) << 10)
|
| ((src[0] >> 3));
|
||||||
| ((palette[color + 1] >> 3) << 5)
|
dst++;
|
||||||
| ((palette[color + 2] >> 3));
|
src += 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data += width * 3;
|
||||||
start = (uint16 *)((addr_t)start
|
start = (uint16 *)((addr_t)start
|
||||||
+ gKernelArgs.frame_buffer.bytes_per_row);
|
+ gKernelArgs.frame_buffer.bytes_per_row);
|
||||||
}
|
}
|
||||||
@@ -637,6 +643,9 @@ static void
|
|||||||
blit8(const uint8 *data, uint16 width, uint16 height,
|
blit8(const uint8 *data, uint16 width, uint16 height,
|
||||||
const uint8 *palette, uint16 left, uint16 top)
|
const uint8 *palette, uint16 left, uint16 top)
|
||||||
{
|
{
|
||||||
|
if (!data || !palette)
|
||||||
|
return;
|
||||||
|
|
||||||
if (vesa_set_palette((const uint8 *)palette, 0, 256) != B_OK)
|
if (vesa_set_palette((const uint8 *)palette, 0, 256) != B_OK)
|
||||||
dprintf("set palette failed!\n");
|
dprintf("set palette failed!\n");
|
||||||
|
|
||||||
@@ -654,6 +663,8 @@ static void
|
|||||||
blit4(const uint8 *data, uint16 width, uint16 height,
|
blit4(const uint8 *data, uint16 width, uint16 height,
|
||||||
const uint8 *palette, uint16 left, uint16 top)
|
const uint8 *palette, uint16 left, uint16 top)
|
||||||
{
|
{
|
||||||
|
if (!data || !palette)
|
||||||
|
return;
|
||||||
// vga_set_palette((const uint8 *)kPalette16, 0, 16);
|
// vga_set_palette((const uint8 *)kPalette16, 0, 16);
|
||||||
// ToDo: no boot logo yet in VGA mode
|
// ToDo: no boot logo yet in VGA mode
|
||||||
#if 1
|
#if 1
|
||||||
@@ -700,22 +711,22 @@ blit4(const uint8 *data, uint16 width, uint16 height,
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
blit_8bit_image(const uint8 *data, uint16 width, uint16 height,
|
blit_image(const uint8 *data, const uint8* indexedData, uint16 width, uint16 height,
|
||||||
const uint8 *palette, uint16 left, uint16 top)
|
const uint8 *palette, uint16 left, uint16 top)
|
||||||
{
|
{
|
||||||
switch (gKernelArgs.frame_buffer.depth) {
|
switch (gKernelArgs.frame_buffer.depth) {
|
||||||
case 4:
|
case 4:
|
||||||
return blit4(data, width, height, palette, left, top);
|
return blit4(indexedData, width, height, palette, left, top);
|
||||||
case 8:
|
case 8:
|
||||||
return blit8(data, width, height, palette, left, top);
|
return blit8(indexedData, width, height, palette, left, top);
|
||||||
case 15:
|
case 15:
|
||||||
return blit15(data, width, height, palette, left, top);
|
return blit15(data, width, height, left, top);
|
||||||
case 16:
|
case 16:
|
||||||
return blit16(data, width, height, palette, left, top);
|
return blit16(data, width, height, left, top);
|
||||||
case 24:
|
case 24:
|
||||||
return blit24(data, width, height, palette, left, top);
|
return blit24(data, width, height, left, top);
|
||||||
case 32:
|
case 32:
|
||||||
return blit32(data, width, height, palette, left, top);
|
return blit32(data, width, height, left, top);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -786,22 +797,26 @@ fallback:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// clear the video memory
|
// clear the video memory
|
||||||
memset((void *)sFrameBuffer, 255,
|
memset((void *)sFrameBuffer, 0,
|
||||||
gKernelArgs.frame_buffer.physical_buffer.size);
|
gKernelArgs.frame_buffer.physical_buffer.size);
|
||||||
|
|
||||||
int x = gKernelArgs.frame_buffer.width / 2 - splashWidth / 2;
|
// TODO: support indexed versions of the images!
|
||||||
int y = gKernelArgs.frame_buffer.height / 2 - splashHeight / 2;
|
// TODO: support compressed RGB image data
|
||||||
blit_8bit_image(splashImage, splashWidth, splashHeight, splashPalette, x, y);
|
|
||||||
|
|
||||||
x = gKernelArgs.frame_buffer.width / 2 - iconsWidth / 2;
|
// render splash logo
|
||||||
y = y + splashHeight;
|
int x = gKernelArgs.frame_buffer.width / 2 - kSplashLogoWidth / 2;
|
||||||
uint16 iconsHalfHeight = iconsHeight / 2;
|
int y = gKernelArgs.frame_buffer.height / 2 - kSplashLogoHeight / 2;
|
||||||
const uint8* lowerHalfIconImage = iconsImage + iconsWidth * iconsHalfHeight;
|
blit_image(kSplashLogoImage, NULL, kSplashLogoWidth, kSplashLogoHeight,
|
||||||
blit_8bit_image(lowerHalfIconImage, iconsWidth, iconsHalfHeight, iconsPalette, x, y);
|
NULL, x, y);
|
||||||
|
|
||||||
x = gKernelArgs.frame_buffer.width / 2 - copyrightWidth / 2;
|
// render initial (grayed out) icons
|
||||||
y = gKernelArgs.frame_buffer.height - copyrightHeight - 5;
|
x = gKernelArgs.frame_buffer.width / 2 - kSplashIconsWidth / 2;
|
||||||
blit_8bit_image(copyrightImage, copyrightWidth, copyrightHeight, copyrightPalette, x, y);
|
y = y + kSplashLogoHeight;
|
||||||
|
uint16 iconsHalfHeight = kSplashIconsHeight / 2;
|
||||||
|
const uint8* lowerHalfIconImage = kSplashIconsImage
|
||||||
|
+ (kSplashIconsWidth * iconsHalfHeight) * 3;
|
||||||
|
blit_image(lowerHalfIconImage, NULL, kSplashIconsWidth, iconsHalfHeight,
|
||||||
|
NULL, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+161
-80
@@ -35,7 +35,7 @@ struct boot_splash_info {
|
|||||||
|
|
||||||
static struct boot_splash_info sBootSplash;
|
static struct boot_splash_info sBootSplash;
|
||||||
|
|
||||||
|
/*
|
||||||
static void
|
static void
|
||||||
boot_splash_fb_vga_set_palette(const uint8 *palette, int32 firstIndex,
|
boot_splash_fb_vga_set_palette(const uint8 *palette, int32 firstIndex,
|
||||||
int32 numEntries)
|
int32 numEntries)
|
||||||
@@ -55,6 +55,8 @@ static void
|
|||||||
boot_splash_fb_blit4(const uint8 *data, uint16 width,
|
boot_splash_fb_blit4(const uint8 *data, uint16 width,
|
||||||
uint16 height, const uint8 *palette, uint16 left, uint16 top)
|
uint16 height, const uint8 *palette, uint16 left, uint16 top)
|
||||||
{
|
{
|
||||||
|
if (!data || !palette)
|
||||||
|
return;
|
||||||
// ToDo: no blit yet in VGA mode
|
// ToDo: no blit yet in VGA mode
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,6 +65,9 @@ static void
|
|||||||
boot_splash_fb_blit8(const uint8 *data, uint16 width,
|
boot_splash_fb_blit8(const uint8 *data, uint16 width,
|
||||||
uint16 height, const uint8 *palette, uint16 left, uint16 top)
|
uint16 height, const uint8 *palette, uint16 left, uint16 top)
|
||||||
{
|
{
|
||||||
|
if (!data || !palette)
|
||||||
|
return;
|
||||||
|
|
||||||
boot_splash_fb_vga_set_palette(palette, 0, 256);
|
boot_splash_fb_vga_set_palette(palette, 0, 256);
|
||||||
|
|
||||||
addr_t start = sBootSplash.frame_buffer + sBootSplash.bytes_per_row * top
|
addr_t start = sBootSplash.frame_buffer + sBootSplash.bytes_per_row * top
|
||||||
@@ -76,117 +81,154 @@ boot_splash_fb_blit8(const uint8 *data, uint16 width,
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
boot_splash_fb_blit15(const uint8 *data, uint16 width,
|
boot_splash_fb_blit15(const uint8 *data, uint16 width, uint16 height,
|
||||||
uint16 height, const uint8 *palette, uint16 left, uint16 top)
|
uint16 left, uint16 top)
|
||||||
{
|
{
|
||||||
uint16 *start = (uint16 *)(sBootSplash.frame_buffer
|
uint16* start = (uint16*)(sBootSplash.frame_buffer
|
||||||
+ sBootSplash.bytes_per_row * top + 2 * left);
|
+ sBootSplash.bytes_per_row * top + 2 * left);
|
||||||
|
|
||||||
for (int32 y = 0; y < height; y++) {
|
for (int32 y = 0; y < height; y++) {
|
||||||
|
const uint8* src = data;
|
||||||
|
uint16* dst = start;
|
||||||
for (int32 x = 0; x < width; x++) {
|
for (int32 x = 0; x < width; x++) {
|
||||||
uint16 color = data[y * width + x] * 3;
|
dst[0] = ((src[2] >> 3) << 10)
|
||||||
|
| ((src[1] >> 3) << 5)
|
||||||
start[x] = ((palette[color + 0] >> 3) << 10)
|
| ((src[0] >> 3));
|
||||||
| ((palette[color + 1] >> 3) << 5)
|
dst++;
|
||||||
| ((palette[color + 2] >> 3));
|
src += 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
start = (uint16 *)((addr_t)start
|
data += width * 3;
|
||||||
+ sBootSplash.bytes_per_row);
|
start = (uint16*)((addr_t)start + sBootSplash.bytes_per_row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
boot_splash_fb_blit16(const uint8 *data, uint16 width,
|
boot_splash_fb_blit16(const uint8 *data, uint16 width, uint16 height,
|
||||||
uint16 height, const uint8 *palette, uint16 left, uint16 top)
|
uint16 left, uint16 top)
|
||||||
{
|
{
|
||||||
uint16 *start = (uint16 *)(sBootSplash.frame_buffer
|
uint16* start = (uint16*)(sBootSplash.frame_buffer
|
||||||
+ sBootSplash.bytes_per_row * top + 2 * left);
|
+ sBootSplash.bytes_per_row * top + 2 * left);
|
||||||
|
|
||||||
for (int32 y = 0; y < height; y++) {
|
for (int32 y = 0; y < height; y++) {
|
||||||
|
const uint8* src = data;
|
||||||
|
uint16* dst = start;
|
||||||
for (int32 x = 0; x < width; x++) {
|
for (int32 x = 0; x < width; x++) {
|
||||||
uint16 color = data[y * width + x] * 3;
|
dst[0] = ((src[2] >> 3) << 11)
|
||||||
|
| ((src[1] >> 2) << 5)
|
||||||
start[x] = ((palette[color + 0] >> 3) << 11)
|
| ((src[0] >> 3));
|
||||||
| ((palette[color + 1] >> 2) << 5)
|
dst++;
|
||||||
| ((palette[color + 2] >> 3));
|
src += 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
start = (uint16 *)((addr_t)start
|
data += width * 3;
|
||||||
+ sBootSplash.bytes_per_row);
|
start = (uint16*)((addr_t)start + sBootSplash.bytes_per_row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
boot_splash_fb_blit24(const uint8 *data, uint16 width,
|
boot_splash_fb_blit24(const uint8 *data, uint16 width, uint16 height,
|
||||||
uint16 height, const uint8 *palette, uint16 left, uint16 top)
|
uint16 left, uint16 top)
|
||||||
{
|
{
|
||||||
uint8 *start = (uint8 *)sBootSplash.frame_buffer
|
uint8* start = (uint8*)sBootSplash.frame_buffer
|
||||||
+ sBootSplash.bytes_per_row * top + 3 * left;
|
+ sBootSplash.bytes_per_row * top + 3 * left;
|
||||||
|
|
||||||
for (int32 y = 0; y < height; y++) {
|
for (int32 y = 0; y < height; y++) {
|
||||||
|
const uint8* src = data;
|
||||||
|
uint8* dst = start;
|
||||||
for (int32 x = 0; x < width; x++) {
|
for (int32 x = 0; x < width; x++) {
|
||||||
uint16 color = data[y * width + x] * 3;
|
dst[0] = src[2];
|
||||||
uint32 index = x * 3;
|
dst[1] = src[1];
|
||||||
|
dst[2] = src[0];
|
||||||
start[index + 0] = palette[color + 2];
|
dst += 3;
|
||||||
start[index + 1] = palette[color + 1];
|
src += 3;
|
||||||
start[index + 2] = palette[color + 0];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data += width * 3;
|
||||||
start = start + sBootSplash.bytes_per_row;
|
start = start + sBootSplash.bytes_per_row;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
boot_splash_fb_blit32(const uint8 *data, uint16 width,
|
boot_splash_fb_blit32(const uint8 *data, uint16 width, uint16 height,
|
||||||
uint16 height, const uint8 *palette, uint16 left, uint16 top)
|
uint16 left, uint16 top)
|
||||||
{
|
{
|
||||||
uint32 *start = (uint32 *)(sBootSplash.frame_buffer
|
uint32* start = (uint32*)(sBootSplash.frame_buffer
|
||||||
+ sBootSplash.bytes_per_row * top + 4 * left);
|
+ sBootSplash.bytes_per_row * top + 4 * left);
|
||||||
|
|
||||||
for (int32 y = 0; y < height; y++) {
|
for (int32 y = 0; y < height; y++) {
|
||||||
|
const uint8* src = data;
|
||||||
|
uint32* dst = start;
|
||||||
for (int32 x = 0; x < width; x++) {
|
for (int32 x = 0; x < width; x++) {
|
||||||
uint16 color = data[y * width + x] * 3;
|
dst[0] = (src[2] << 16) | (src[1] << 8) | (src[0]);
|
||||||
|
dst++;
|
||||||
start[x] = (palette[color + 0] << 16) | (palette[color + 1] << 8)
|
src += 3;
|
||||||
| (palette[color + 2]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
start = (uint32 *)((addr_t)start
|
data += width * 3;
|
||||||
+ sBootSplash.bytes_per_row);
|
start = (uint32*)((addr_t)start + sBootSplash.bytes_per_row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
boot_splash_fb_blit(const uint8 *data, uint16 width,
|
boot_splash_fb_blit(const uint8 *data, const uint8* indexedData, uint16 width,
|
||||||
uint16 height, const uint8 *palette, uint16 left, uint16 top)
|
uint16 height, const uint8 *palette, uint16 left, uint16 top)
|
||||||
{
|
{
|
||||||
switch (sBootSplash.depth) {
|
switch (sBootSplash.depth) {
|
||||||
case 4:
|
case 4:
|
||||||
boot_splash_fb_blit4(data, width, height, palette, left, top);
|
boot_splash_fb_blit4(indexedData, width, height, palette,
|
||||||
|
left, top);
|
||||||
return;
|
return;
|
||||||
case 8:
|
case 8:
|
||||||
boot_splash_fb_blit8(data, width, height, palette, left, top);
|
boot_splash_fb_blit8(indexedData, width, height, palette,
|
||||||
|
left, top);
|
||||||
return;
|
return;
|
||||||
case 15:
|
case 15:
|
||||||
boot_splash_fb_blit15(data, width, height, palette, left, top);
|
boot_splash_fb_blit15(data, width, height, left, top);
|
||||||
return;
|
return;
|
||||||
case 16:
|
case 16:
|
||||||
boot_splash_fb_blit16(data, width, height, palette, left, top);
|
boot_splash_fb_blit16(data, width, height, left, top);
|
||||||
return;
|
return;
|
||||||
case 24:
|
case 24:
|
||||||
boot_splash_fb_blit24(data, width, height, palette, left, top);
|
boot_splash_fb_blit24(data, width, height, left, top);
|
||||||
return;
|
return;
|
||||||
case 32:
|
case 32:
|
||||||
boot_splash_fb_blit32(data, width, height, palette, left, top);
|
boot_splash_fb_blit32(data, width, height, left, top);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
static void
|
||||||
|
boot_splash_fb_blit15_cropped(const uint8 *data, uint16 imageLeft,
|
||||||
|
uint16 imageTop, uint16 imageRight, uint16 imageBottom, uint16 imageWidth,
|
||||||
|
uint16 imageHeight, const uint8 *palette, uint16 left, uint16 top)
|
||||||
|
{
|
||||||
|
data += (imageWidth * imageTop + imageLeft) * 3;
|
||||||
|
uint16* start = (uint16*)(sBootSplash.frame_buffer
|
||||||
|
+ sBootSplash.bytes_per_row * (top + imageTop)
|
||||||
|
+ 2 * (left + imageLeft));
|
||||||
|
|
||||||
|
for (int32 y = imageTop; y < imageBottom; y++) {
|
||||||
|
const uint8* src = data;
|
||||||
|
uint16* dst = start;
|
||||||
|
for (int32 x = imageLeft; x < imageRight; x++) {
|
||||||
|
dst[0] = ((src[2] >> 3) << 10)
|
||||||
|
| ((src[1] >> 3) << 5)
|
||||||
|
| ((src[0] >> 3));
|
||||||
|
|
||||||
|
dst++;
|
||||||
|
src += 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
data += imageWidth * 3;
|
||||||
|
start = (uint16*)((addr_t)start + sBootSplash.bytes_per_row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -194,23 +236,52 @@ boot_splash_fb_blit16_cropped(const uint8 *data, uint16 imageLeft,
|
|||||||
uint16 imageTop, uint16 imageRight, uint16 imageBottom, uint16 imageWidth,
|
uint16 imageTop, uint16 imageRight, uint16 imageBottom, uint16 imageWidth,
|
||||||
uint16 imageHeight, const uint8 *palette, uint16 left, uint16 top)
|
uint16 imageHeight, const uint8 *palette, uint16 left, uint16 top)
|
||||||
{
|
{
|
||||||
int32 dataOffset = (imageWidth * imageTop) + imageLeft;
|
data += (imageWidth * imageTop + imageLeft) * 3;
|
||||||
|
uint16* start = (uint16*)(sBootSplash.frame_buffer
|
||||||
uint16 *start = (uint16 *)(sBootSplash.frame_buffer
|
+ sBootSplash.bytes_per_row * (top + imageTop)
|
||||||
+ sBootSplash.bytes_per_row * top + 2 * left);
|
+ 2 * (left + imageLeft));
|
||||||
|
|
||||||
for (int32 y = imageTop; y < imageBottom; y++) {
|
for (int32 y = imageTop; y < imageBottom; y++) {
|
||||||
|
const uint8* src = data;
|
||||||
|
uint16* dst = start;
|
||||||
for (int32 x = imageLeft; x < imageRight; x++) {
|
for (int32 x = imageLeft; x < imageRight; x++) {
|
||||||
uint16 color = data[(y * (imageWidth)) + x] * 3;
|
dst[0] = ((src[2] >> 3) << 11)
|
||||||
|
| ((src[1] >> 2) << 5)
|
||||||
|
| ((src[0] >> 3));
|
||||||
|
|
||||||
start[x] = ((palette[color + 0] >> 3) << 11)
|
dst++;
|
||||||
| ((palette[color + 1] >> 2) << 5)
|
src += 3;
|
||||||
| ((palette[color + 2] >> 3));
|
|
||||||
dataOffset += imageWidth;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data += imageWidth * 3;
|
||||||
|
start = (uint16*)((addr_t)start + sBootSplash.bytes_per_row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
start = (uint16 *)((addr_t)start + sBootSplash.bytes_per_row);
|
|
||||||
|
static void
|
||||||
|
boot_splash_fb_blit24_cropped(const uint8 *data, uint16 imageLeft,
|
||||||
|
uint16 imageTop, uint16 imageRight, uint16 imageBottom, uint16 imageWidth,
|
||||||
|
uint16 imageHeight, const uint8 *palette, uint16 left, uint16 top)
|
||||||
|
{
|
||||||
|
data += (imageWidth * imageTop + imageLeft) * 3;
|
||||||
|
uint8* start = (uint8*)(sBootSplash.frame_buffer
|
||||||
|
+ sBootSplash.bytes_per_row * (top + imageTop)
|
||||||
|
+ 3 * (left + imageLeft));
|
||||||
|
|
||||||
|
for (int32 y = imageTop; y < imageBottom; y++) {
|
||||||
|
const uint8* src = data;
|
||||||
|
uint8* dst = start;
|
||||||
|
for (int32 x = imageLeft; x < imageRight; x++) {
|
||||||
|
dst[0] = src[0];
|
||||||
|
dst[1] = src[1];
|
||||||
|
dst[2] = src[2];
|
||||||
|
dst += 3;
|
||||||
|
src += 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
data += imageWidth * 3;
|
||||||
|
start = (uint8*)((addr_t)start + sBootSplash.bytes_per_row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,48 +291,56 @@ boot_splash_fb_blit32_cropped(const uint8 *data, uint16 imageLeft,
|
|||||||
uint16 imageTop, uint16 imageRight, uint16 imageBottom, uint16 imageWidth,
|
uint16 imageTop, uint16 imageRight, uint16 imageBottom, uint16 imageWidth,
|
||||||
uint16 imageHeight, const uint8 *palette, uint16 left, uint16 top)
|
uint16 imageHeight, const uint8 *palette, uint16 left, uint16 top)
|
||||||
{
|
{
|
||||||
int32 dataOffset = (imageWidth * imageTop) + imageLeft;
|
data += (imageWidth * imageTop + imageLeft) * 3;
|
||||||
|
uint32* start = (uint32*)(sBootSplash.frame_buffer
|
||||||
uint32 *start = (uint32 *)(sBootSplash.frame_buffer
|
+ sBootSplash.bytes_per_row * (top + imageTop)
|
||||||
+ sBootSplash.bytes_per_row * top + 4 * left);
|
+ 4 * (left + imageLeft));
|
||||||
|
|
||||||
for (int32 y = imageTop; y < imageBottom; y++) {
|
for (int32 y = imageTop; y < imageBottom; y++) {
|
||||||
|
const uint8* src = data;
|
||||||
|
uint32* dst = start;
|
||||||
for (int32 x = imageLeft; x < imageRight; x++) {
|
for (int32 x = imageLeft; x < imageRight; x++) {
|
||||||
uint16 color = data[(y * (imageWidth)) + x] * 3;
|
dst[0] = (src[0] << 16) | (src[1] << 8) | (src[2]);
|
||||||
|
dst++;
|
||||||
start[x] = (palette[color + 0] << 16) | (palette[color + 1] << 8)
|
src += 3;
|
||||||
| (palette[color + 2]);
|
|
||||||
dataOffset += imageWidth;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data += imageWidth * 3;
|
||||||
start = (uint32 *)((addr_t)start + sBootSplash.bytes_per_row);
|
start = (uint32*)((addr_t)start + sBootSplash.bytes_per_row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
boot_splash_fb_blit_cropped(const uint8 *data, uint16 imageLeft,
|
boot_splash_fb_blit_cropped(const uint8* data, const uint8* indexedData,
|
||||||
uint16 imageTop, uint16 imageRight, uint16 imageBottom, uint16 imageWidth,
|
uint16 imageLeft, uint16 imageTop, uint16 imageRight, uint16 imageBottom,
|
||||||
uint16 imageHeight, const uint8 *palette, uint16 left, uint16 top)
|
uint16 imageWidth, uint16 imageHeight, const uint8 *palette,
|
||||||
|
uint16 left, uint16 top)
|
||||||
{
|
{
|
||||||
switch (sBootSplash.depth) {
|
switch (sBootSplash.depth) {
|
||||||
case 4:
|
case 4:
|
||||||
case 8:
|
case 8:
|
||||||
|
return;
|
||||||
case 15:
|
case 15:
|
||||||
|
boot_splash_fb_blit15_cropped(data, imageLeft, imageTop,
|
||||||
|
imageRight, imageBottom, imageWidth, imageHeight, palette,
|
||||||
|
left, top);
|
||||||
return;
|
return;
|
||||||
case 16:
|
case 16:
|
||||||
boot_splash_fb_blit16_cropped(data, imageLeft, imageTop,
|
boot_splash_fb_blit16_cropped(data, imageLeft, imageTop,
|
||||||
imageRight, imageBottom, imageWidth, imageHeight, palette,
|
imageRight, imageBottom, imageWidth, imageHeight, palette,
|
||||||
left, top);
|
left, top);
|
||||||
return;
|
return;
|
||||||
|
case 24:
|
||||||
|
boot_splash_fb_blit24_cropped(data, imageLeft, imageTop,
|
||||||
|
imageRight, imageBottom, imageWidth, imageHeight, palette,
|
||||||
|
left, top);
|
||||||
|
return;
|
||||||
case 32:
|
case 32:
|
||||||
boot_splash_fb_blit32_cropped(data, imageLeft, imageTop,
|
boot_splash_fb_blit32_cropped(data, imageLeft, imageTop,
|
||||||
imageRight, imageBottom, imageWidth, imageHeight, palette,
|
imageRight, imageBottom, imageWidth, imageHeight, palette,
|
||||||
left, top);
|
left, top);
|
||||||
return;
|
return;
|
||||||
case 24:
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -304,7 +383,7 @@ boot_splash_fb_init(struct kernel_args *args)
|
|||||||
{
|
{
|
||||||
TRACE("boot_splash_fb_init: enter\n");
|
TRACE("boot_splash_fb_init: enter\n");
|
||||||
|
|
||||||
if (!args->frame_buffer.enabled) {
|
if (!args->frame_buffer.enabled/* || sDebugScreenEnabled*/) {
|
||||||
sBootSplash.enabled = false;
|
sBootSplash.enabled = false;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
@@ -339,13 +418,15 @@ boot_splash_set_stage(int stage)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// TODO: Use placement info from images.h
|
// TODO: Use placement info from images.h
|
||||||
int x = sBootSplash.width / 2 - iconsWidth / 2;
|
int x = sBootSplash.width / 2 - kSplashIconsWidth / 2;
|
||||||
int y = sBootSplash.height / 2 - splashHeight / 2;
|
int y = sBootSplash.height / 2 - kSplashLogoHeight / 2;
|
||||||
y = y + splashHeight;
|
y = y + kSplashLogoHeight;
|
||||||
|
|
||||||
int stageLeftEdge = iconsWidth * stage / BOOT_SPLASH_STAGE_MAX;
|
int stageLeftEdge = kSplashIconsWidth * stage / BOOT_SPLASH_STAGE_MAX;
|
||||||
int stageRightEdge = iconsWidth * (stage + 1) / BOOT_SPLASH_STAGE_MAX;
|
int stageRightEdge = kSplashIconsWidth * (stage + 1)
|
||||||
boot_splash_fb_blit_cropped(iconsImage, stageLeftEdge, 0,
|
/ BOOT_SPLASH_STAGE_MAX;
|
||||||
stageRightEdge, 32, iconsWidth, iconsHeight, iconsPalette, x, y );
|
boot_splash_fb_blit_cropped(kSplashIconsImage, NULL, stageLeftEdge, 0,
|
||||||
|
stageRightEdge, kSplashIconsHeight / 2,
|
||||||
|
kSplashIconsWidth, kSplashIconsHeight, NULL, x, y );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -164,14 +164,14 @@ parseImage(const char* filename, const char* baseName)
|
|||||||
int
|
int
|
||||||
main(int argc, char* argv[])
|
main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
if (argc < 5) {
|
if (argc < 4) {
|
||||||
printf("Usage:\n");
|
printf("Usage:\n");
|
||||||
printf("\t%s <splash.png> <icons.png> <copyright.png> <images.h>\n",
|
printf("\t%s <splash.png> <icons.png> <images.h>\n",
|
||||||
argv[0]);
|
argv[0]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* headerFileName = argv[4];
|
const char* headerFileName = argv[3];
|
||||||
|
|
||||||
sOutput = fopen(headerFileName, "wb");
|
sOutput = fopen(headerFileName, "wb");
|
||||||
if (!sOutput)
|
if (!sOutput)
|
||||||
@@ -182,7 +182,6 @@ main(int argc, char* argv[])
|
|||||||
|
|
||||||
parseImage(argv[1], "kSplashLogo");
|
parseImage(argv[1], "kSplashLogo");
|
||||||
parseImage(argv[2], "kSplashIcons");
|
parseImage(argv[2], "kSplashIcons");
|
||||||
parseImage(argv[3], "kSplashCopyright");
|
|
||||||
|
|
||||||
fclose(sOutput);
|
fclose(sOutput);
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user