From 44998e589332535da3ae656285347ce1427da8eb Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 15 Oct 2009 12:40:13 +0000 Subject: [PATCH] 2009-10-15 Vladimir Serbinenko * loader/i386/pc/xnu.c (grub_xnu_set_video): Fix loading splash image. --- ChangeLog | 4 ++++ loader/i386/pc/xnu.c | 50 ++++++++++++++++++++++++-------------------- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index 78a02e592..b0864a9b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-10-15 Vladimir Serbinenko + + * loader/i386/pc/xnu.c (grub_xnu_set_video): Fix loading splash image. + 2009-10-15 Vladimir Serbinenko * commands/xnu_uuid.c (grub_cmd_xnu_uuid): Remove duplicated bitwise diff --git a/loader/i386/pc/xnu.c b/loader/i386/pc/xnu.c index 69a9405c6..ebb176bb4 100644 --- a/loader/i386/pc/xnu.c +++ b/loader/i386/pc/xnu.c @@ -43,7 +43,6 @@ grub_xnu_set_video (struct grub_xnu_boot_params *params) { struct grub_video_mode_info mode_info; int ret; - int x,y; char *tmp, *modevar; void *framebuffer; grub_err_t err; @@ -66,32 +65,37 @@ grub_xnu_set_video (struct grub_xnu_boot_params *params) if (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); if (ret) 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_height = mode_info.height; params->lfb_depth = mode_info.bpp;