Group :: Jogos/Arcade
RPM: frozen-bubble
Main Changelog Spec Patches Sources Download Gear Bugs e FR Repocop
Patch: frozen-bubble-1.0.0-alt-SDL2.patch
Download
Download
--- frozen-bubble-1.0.0/frozen-bubble- 2003-02-17 02:45:27 +0300
+++ frozen-bubble-1.0.0/frozen-bubble 2004-11-24 01:42:48 +0300
@@ -48,7 +48,7 @@ use vars qw($TARGET_ANIM_SPEED $BUBBLE_S
use Data::Dumper;
-use SDL;
+use SDL 2.1;
use SDL::App;
use SDL::Surface;
use SDL::Event;
@@ -56,6 +56,8 @@ use SDL::Cursor;
use SDL::Font;
use SDL::Mixer;
+*SDL_TEXTWIDTH = \&SDL::SFont::SDL_TEXTWIDTH;
+
use fb_stuff;
use fbsyms;
use FBLE;
@@ -179,7 +181,7 @@ sub play_music($;$) {
$elem or return -1;
-f $elem or return 0;
$mus = SDL::Music->new($elem);
- if ($mus->{-data}) {
+ if ($$mus) {
print STDERR "[Playlist] playing `$elem'\n";
$mixer->play_music($mus, 0);
return 1;
@@ -191,9 +193,9 @@ sub play_music($;$) {
while ($tryanother->() == 0) {};
} else {
$mus = SDL::Music->new("$FPATH$musics{$name}");
- $mus->{-data} or print STDERR "Warning, could not create new music from `$FPATH$musics{$name}' (reason: ", $app->error, ").\n";
+ $$mus or print STDERR "Warning, could not create new music from `$FPATH$musics{$name}' (reason: ", $app->error, ").\n";
if ($pos) {
- fb_c_stuff::fade_in_music_position($mus->{-data}, -1, 500, $pos);
+ fb_c_stuff::fade_in_music_position($$mus, -1, 500, $pos);
} else {
$mixer->play_music($mus, -1);
}
@@ -212,7 +214,7 @@ sub init_sound() {
foreach (@sounds) {
my $sound_path = "$FPATH/snd/$_.wav";
$sound{$_} = SDL::Sound->new($sound_path);
- if ($sound{$_}{-data}) {
+ if (${$sound{$_}}) {
$sound{$_}->volume(80);
} else {
print STDERR "Warning, could not create new sound from `$sound_path'.\n";
@@ -307,7 +309,7 @@ sub switch_image_on_background($$$;$) {
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";
+ $$img or die "FATAL: Couldn't load `$file' into a SDL::Surface.\n";
add_default_rect($img);
return $img;
}
@@ -1473,7 +1475,7 @@ sub display_highscores() {
}
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($$app, ${$background->display_format}, $high_posx, $high_posy, $$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 +1644,7 @@ sub new_game() {
$background->blit($apprects{main}, $app, $apprects{main});
$app->flip;
} else {
- fb_c_stuff::effect($app->{-surface}, $background->display_format->{-surface});
+ fb_c_stuff::effect($$app, ${$background->display_format});
}
$display_on_app_disabled = 0;
--- frozen-bubble-1.0.0/c_stuff/lib/FBLE.pm- 2003-02-17 02:14:28 +0300
+++ frozen-bubble-1.0.0/c_stuff/lib/FBLE.pm 2004-11-24 01:40:06 +0300
@@ -34,7 +34,7 @@
package FBLE;
use POSIX;
-use SDL;
+use SDL 2.1;
use SDL::App;
use SDL::Surface;
use SDL::Event;
@@ -42,6 +42,8 @@ use SDL::Cursor;
use SDL::Font;
use SDL::Mixer;
+*SDL_TEXTWIDTH = \&SDL::SFont::SDL_TEXTWIDTH;
+
use fb_stuff;
use fbsyms;
@@ -1094,11 +1096,11 @@ sub display_levelset_screenshot {
$rect{screenshot} = SDL::Rect->new(-x => $POS_1P{p1}{left_limit} - 40, '-y' => 0,
-width => $POS_1P{p1}{right_limit} - $POS_1P{p1}{left_limit} + 80,
-height => $POS_1P{bottom_limit} - $POS_1P{init_top_limit} + 190);
- fb_c_stuff::shrink($app->{-surface},
- $file_browser_screenshots[$list_browser_highlight_offset]->display_format()->{-surface},
+ fb_c_stuff::shrink($$app,
+ ${$file_browser_screenshots[$list_browser_highlight_offset]->display_format()},
$rect{middle}->x + $rect{middle}->width - $rect{screenshot}->width/4 - 12,
$rect{middle}->y + $rect{middle}->height/2 - $rect{screenshot}->height/8 - 3,
- $rect{screenshot}{-rect}, 4);
+ ${$rect{screenshot}}, 4);
}