]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2009-10-15 Vladimir Serbinenko <phcoder@gmail.com>
authorphcoder <phcoder@localhost>
Thu, 15 Oct 2009 12:40:13 +0000 (12:40 +0000)
committerphcoder <phcoder@localhost>
Thu, 15 Oct 2009 12:40:13 +0000 (12:40 +0000)
* loader/i386/pc/xnu.c (grub_xnu_set_video): Fix loading splash image.

ChangeLog
loader/i386/pc/xnu.c

index 78a02e5920f87aacb971b30546f88636988a5540..b0864a9b90d42a4c8a41e3e6fd06a6d0260f0c96 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
        * commands/xnu_uuid.c (grub_cmd_xnu_uuid): Remove duplicated bitwise
index 69a9405c682533828600c7edd5b72947b5946659..ebb176bb41951ecbe20d465493903ef9bb5e00c9 100644 (file)
@@ -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;