--- /tmp/frozen-bubble	2004-09-09 14:56:46.149367064 +0200
+++ frozen-bubble	2004-09-09 14:59:52.712568609 +0200
@@ -304,10 +304,28 @@
     return $save;
 }
 
+sub surf {
+    my ($surface) = @_;
+    if (ref($surface) eq 'HASH') {
+        return $surface->{-surface};
+    } else {
+        return $$surface;
+    }
+}
+
+sub rect {
+    my ($rect) = @_;
+    if (ref($rect) eq 'HASH') {
+        return $rect->{-rect};
+    } else {
+        return $$rect;
+    }
+}
+
 sub add_image($) {
     my $file = "$FPATH/gfx/$_[0]";
     my $img = SDL::Surface->new(-name => $file);
-    $img->{-surface} or die "FATAL: Couldn't load `$file' into a SDL::Surface.\n";
+    surf($img) or die "FATAL: Couldn't load `$file' into a SDL::Surface.\n";
     add_default_rect($img);
     return $img;
 }
@@ -1473,7 +1491,7 @@
 	}
 
 	put_image($imgbin{hiscore_frame}, $high_posx - 7, $high_posy - 6);
-	fb_c_stuff::shrink($app->{-surface}, $background->display_format->{-surface}, $high_posx, $high_posy, $high_rect->{-rect}, 4);
+	fb_c_stuff::shrink(surf($app), surf($background->display_format), $high_posx, $high_posy, rect($high_rect), 4);
 	$centered_print->($high_posx, $high_posy,    $high->{name});
 	$centered_print->($high_posx, $high_posy+20, $high->{level} eq 'WON' ? "WON!" : "LVL-".$high->{level});
 	my $min = int($high->{time}/60);
@@ -1642,7 +1660,7 @@
 	$background->blit($apprects{main}, $app, $apprects{main});
 	$app->flip;
     } else {
-	fb_c_stuff::effect($app->{-surface}, $background->display_format->{-surface});
+	fb_c_stuff::effect(surf($app), surf($background->display_format));
     }
 
     $display_on_app_disabled = 0;
