Ticket #1999: bootsplash.diff
File bootsplash.diff, 3.7 KB (added by , 16 years ago) |
---|
-
src/system/kernel/boot_splash.cpp
189 189 if (sInfo == NULL || stage < 0 || stage >= BOOT_SPLASH_STAGE_MAX) 190 190 return; 191 191 192 // TODO: Use placement info from images.h193 i nt x = sInfo->width / 2 - kSplashIconsWidth / 2;194 int y = sInfo->height / 2 - kSplashLogoHeight / 2;195 y = y + kSplashLogoHeight;192 int maxWidth = kSplashLogoWidth; 193 if (maxWidth < kSplashIconsWidth) { 194 maxWidth = kSplashIconsWidth; 195 } 196 196 197 int x = sInfo->width * kSplashHorizontalPos / 100 - maxWidth / 2; 198 int y = sInfo->height * kSplashVerticalPos / 100 - kSplashIconsHeight / 2; 199 200 /* make sure the logo and icons are all within the framebuffer */ 201 202 if (x < 0) { 203 x = 0; 204 } 205 206 x = x + ( maxWidth - kSplashIconsWidth ) / 2; 207 208 if (x + maxWidth > sInfo->width) { 209 x = (sInfo->width - maxWidth) + (maxWidth - kSplashIconsWidth) / 2; 210 } 211 212 if (y < kSplashLogoHeight) { 213 y = kSplashLogoHeight; 214 } else if (y + kSplashIconsHeight > sInfo->height) { 215 y = sInfo->height - kSplashIconsHeight ; 216 } 217 218 219 220 197 221 int stageLeftEdge = kSplashIconsWidth * stage / BOOT_SPLASH_STAGE_MAX; 198 222 int stageRightEdge = kSplashIconsWidth * (stage + 1) 199 223 / BOOT_SPLASH_STAGE_MAX; -
src/system/boot/platform/bios_ia32/video.cpp
861 861 // TODO: support compressed RGB image data 862 862 863 863 // render splash logo 864 int x = gKernelArgs.frame_buffer.width / 2 - kSplashLogoWidth / 2; 865 int y = gKernelArgs.frame_buffer.height / 2 - kSplashLogoHeight / 2; 864 int x = gKernelArgs.frame_buffer.width * kSplashHorizontalPos / 100 - kSplashLogoWidth / 2; 865 int y = gKernelArgs.frame_buffer.height * kSplashVerticalPos / 100 - kSplashIconsHeight / 2 - kSplashLogoHeight; 866 867 int maxWidth = kSplashLogoWidth; 868 if (maxWidth < kSplashIconsWidth) { 869 maxWidth = kSplashIconsWidth; 870 } 871 872 if (x < maxWidth - kSplashLogoWidth) { 873 x = maxWidth - kSplashLogoWidth; 874 } 875 876 if (y < 0) { 877 y = 0; 878 } 879 880 // in case some theme features larger icons than logo.. 881 x = x + ( maxWidth - kSplashLogoWidth ) / 2; 882 883 if (x + maxWidth >= gKernelArgs.frame_buffer.width) { 884 x = (gKernelArgs.frame_buffer.width - maxWidth) + (maxWidth - kSplashLogoWidth) / 2; 885 } 886 887 if (y + kSplashLogoHeight + kSplashIconsHeight >= gKernelArgs.frame_buffer.height) { 888 y = gKernelArgs.frame_buffer.height - kSplashLogoHeight - kSplashIconsHeight; 889 } 890 866 891 blit_image(kSplashLogoImage, NULL, kSplashLogoWidth, kSplashLogoHeight, 867 892 NULL, x, y); 868 893 869 894 // render initial (grayed out) icons 870 x = gKernelArgs.frame_buffer.width / 2 - kSplashIconsWidth/ 2;895 x = x + (maxWidth - kSplashIconsWidth) / 2; 871 896 y = y + kSplashLogoHeight; 872 897 uint16 iconsHalfHeight = kSplashIconsHeight / 2; 873 898 const uint8* lowerHalfIconImage = kSplashIconsImage -
headers/private/kernel/boot/images.h
1 1 // This file was generated by the generate_boot_screen build tool. 2 2 3 static const int16 kSplashVerticalPos = 50; 4 static const int16 kSplashHorizontalPos = 50; 5 3 6 static const uint16 kSplashLogoWidth = 397; 4 7 static const uint16 kSplashLogoHeight = 90; 5 8 static const uint8 kSplashLogoImage[] = { … … 21346 21349 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 21347 21350 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 21348 21351 }; 21349