2009-10-15 Vladimir Serbinenko <phcoder@gmail.com>

* loader/i386/pc/xnu.c (grub_xnu_set_video): Fix loading splash image.
This commit is contained in:
phcoder 2009-10-15 12:40:13 +00:00
parent cd2851b3dd
commit 44998e5893
2 changed files with 31 additions and 23 deletions

View file

@ -1,3 +1,7 @@
2009-10-15 Vladimir Serbinenko <phcoder@gmail.com>
* loader/i386/pc/xnu.c (grub_xnu_set_video): Fix loading splash image.
2009-10-15 Vladimir Serbinenko <phcoder@gmail.com> 2009-10-15 Vladimir Serbinenko <phcoder@gmail.com>
* commands/xnu_uuid.c (grub_cmd_xnu_uuid): Remove duplicated bitwise * commands/xnu_uuid.c (grub_cmd_xnu_uuid): Remove duplicated bitwise

View file

@ -43,7 +43,6 @@ grub_xnu_set_video (struct grub_xnu_boot_params *params)
{ {
struct grub_video_mode_info mode_info; struct grub_video_mode_info mode_info;
int ret; int ret;
int x,y;
char *tmp, *modevar; char *tmp, *modevar;
void *framebuffer; void *framebuffer;
grub_err_t err; grub_err_t err;
@ -66,32 +65,37 @@ grub_xnu_set_video (struct grub_xnu_boot_params *params)
if (err) if (err)
return err; return err;
if (grub_xnu_bitmap)
{
int x, y;
x = mode_info.width - grub_xnu_bitmap->mode_info.width;
x /= 2;
y = mode_info.height - grub_xnu_bitmap->mode_info.height;
y /= 2;
err = grub_video_blit_bitmap (grub_xnu_bitmap,
GRUB_VIDEO_BLIT_REPLACE,
x > 0 ? x : 0,
y > 0 ? y : 0,
x < 0 ? -x : 0,
y < 0 ? -y : 0,
min (grub_xnu_bitmap->mode_info.width,
mode_info.width),
min (grub_xnu_bitmap->mode_info.height,
mode_info.height));
if (err)
{
grub_print_error ();
grub_errno = GRUB_ERR_NONE;
grub_xnu_bitmap = 0;
}
err = GRUB_ERR_NONE;
}
ret = grub_video_get_info_and_fini (&mode_info, &framebuffer); ret = grub_video_get_info_and_fini (&mode_info, &framebuffer);
if (ret) if (ret)
return grub_error (GRUB_ERR_IO, "couldn't retrieve video parameters"); return grub_error (GRUB_ERR_IO, "couldn't retrieve video parameters");
err = GRUB_ERR_NONE;
x = mode_info.width - grub_xnu_bitmap->mode_info.width;
x /= 2;
y = mode_info.height - grub_xnu_bitmap->mode_info.height;
y /= 2;
err = grub_video_blit_bitmap (grub_xnu_bitmap,
GRUB_VIDEO_BLIT_REPLACE,
x > 0 ? x : 0,
y > 0 ? y : 0,
x < 0 ? -x : 0,
y < 0 ? -y : 0,
min (grub_xnu_bitmap->mode_info.width,
mode_info.width),
min (grub_xnu_bitmap->mode_info.height,
mode_info.height));
if (err)
{
grub_print_error ();
grub_errno = GRUB_ERR_NONE;
grub_xnu_bitmap = 0;
}
params->lfb_width = mode_info.width; params->lfb_width = mode_info.width;
params->lfb_height = mode_info.height; params->lfb_height = mode_info.height;
params->lfb_depth = mode_info.bpp; params->lfb_depth = mode_info.bpp;