Skip to content

Commit

Permalink
Merged experimental into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Kartik Thakore committed May 16, 2012
2 parents 7e80853 + c13693c commit 3512b1b
Show file tree
Hide file tree
Showing 48 changed files with 2,051 additions and 854 deletions.
2 changes: 1 addition & 1 deletion Build.PL
Expand Up @@ -606,7 +606,7 @@ my $build = $package->new(
#create_readme => 1, ### make sense only if there is some POD doc in the file specified by dist_version_from
meta_merge => {
resources => {
bugtracker => 'http://sdlperl.ath.cx/projects/SDLPerl',
bugtracker => 'http://github.com/PerlGameDev/SDL/issues',
repository => 'http://github.com/PerlGameDev/SDL'
}
},
Expand Down
31 changes: 31 additions & 0 deletions CHANGELOG
Expand Up @@ -2,6 +2,37 @@ Revision history for Perl extension SDL_perl.

Versioning rule: public releases are even numbers, dev releases are odd. (same like perl dist)

* 2.537_03 Apr 12 2012
- SDLx::App made the docs a lot better [Blaizer]
- SDLx::App changed around shortcut names in the constructor [Blaizer]
- SDLx::App added and improved parameters of the constructor, see docs [Blaizer]
- SDLx::App updated methods resize, title, icon, error, show_cursor, grab_input [Blaizer]
- SDLx::App fullscreen method works better [Blaizer]
- SDLx::App new init method does our initializing right [Blaizer]
- SDLx::App new set_video_mode method does set_video_mode for SDLx::App [Blaizer]
- SDLx::App new screen_size method returns the user's screen size [Blaizer]
- SDLx::App warp method renamed to warp_cursor, attribute renamed to gl_attribute [Blaizer]
- SDLx::App fix to return the user's resolution to normal when a fullscreen app closes [FROGGS]
- SDLx::App removed delay method and deprecated get_ticks [Blaizer]
- SDLx::Controller removed eoq, its action is on by default and implemented by stop_handler [Blaizer]
- SDLx::Controller made the docs a lot better, even proofread them [Blaizer]
- SDLx::Controller pause works by stopping the app [Blaizer]
- SDLx::Controller added stopped and paused methods to tell what the app is doing [Blaizer]
- SDLx::Controller added max_t param, by default slows down apps going at less than 10 FPS [Blaizer]
- SDLx::Controller added time and sleep methods to replace get_ticks and delay [Blaizer]
- SDLx::Controller added some tests for pausing and events [Blaizer]
- SDLx::Controller removed current_time parameter [Blaizer]

* 2.537_02 Feb 13 2012
- t/core_cd.t: gnu hurd 0.3 handles devices like cdrom strange (skipping tests) [FROGGS]
- t/sdlx_fps.t: seems better to try to get 5 fps (slow vm's) [FROGGS]
- SDLx::Controller::Interface: weaken tests [FROGGS]
- SDL::Mixer::Channels: skipping callback test [FROGGS]
- SDL::Version: we can now compare SDL::Version objects like: $version >= 1.2.10 [FROGGS]
- SDLx::App::DESTROY: fixed function name for set_video_mode [FROGGS]
- SDLx::App: fix for issue 144, setting original screen res when app ends [FROGGS]
- t/sdlx_controller_interface.t: adding delay so that slow machines doesnt get a hickup [FROGGS]

* 2.536 Jan 04 2011
- using INT2PTR to convert stored pointers to right size and hide warnings [FROGGS]
- SDL::Mixer::Channels: using malloc instead of safemalloc [FROGGS]
Expand Down
8 changes: 0 additions & 8 deletions examples/SDLx/SDLx_C_Interface.pl
Expand Up @@ -34,14 +34,6 @@
$app->draw_rect( [ 100 - $state->x, $state->y, 2, 2 ], 0xFF0FFF );
};

#an event handler to exit
my $event = sub {
$_[1]->stop if $_[0]->type == SDL_QUIT;
};


$app->add_event_handler($event);

#clear the screen
$app->add_show_handler( sub { $app->draw_rect( [ 0, 0, $app->w, $app->h ], 0x000000 ) } );

Expand Down
1 change: 0 additions & 1 deletion examples/SDLx/SDLx_Sound.pl
Expand Up @@ -44,7 +44,6 @@
# pause or resume on keydown
$app->add_event_handler( sub{
my $e = $_[0];
$_[1]->stop() if $e->type == SDL_QUIT;
if( $e->type == SDL_KEYDOWN )
{
print "Ai\n";
Expand Down
2 changes: 0 additions & 2 deletions examples/SDLx/SDLx_controller_two_squares.pl
Expand Up @@ -101,8 +101,6 @@ sub on_event {
$ball->{x_vel} += $ball->{vel} if $key == SDLK_LEFT;
$ball->{x_vel} -= $ball->{vel} if $key == SDLK_RIGHT;

} elsif ( $event->type == SDL_QUIT ) {
$_[0]->stop;
}

}
Expand Down
2 changes: 1 addition & 1 deletion examples/SDLx/SDLx_text.pl
Expand Up @@ -5,7 +5,7 @@
use SDLx::App;
use SDLx::Text;

my $app = SDLx::App->new( eoq => 1 );
my $app = SDLx::App->new();

my $text = SDLx::Text->new;

Expand Down
2 changes: 1 addition & 1 deletion examples/SDLx/SDLx_text_shadow.pl
Expand Up @@ -7,7 +7,7 @@
use SDLx::App;
use SDLx::Text;

my $app = SDLx::App->new( eoq => 1 );
my $app = SDLx::App->new();

my $normal = SDLx::Text->new;
my $shadow = SDLx::Text->new( shadow => 1 );
Expand Down
2 changes: 1 addition & 1 deletion examples/SDLx/SDLx_text_styles.pl
Expand Up @@ -5,7 +5,7 @@
use SDLx::App;
use SDLx::Text;

my $app = SDLx::App->new( eoq => 1 );
my $app = SDLx::App->new();

my $text = SDLx::Text->new;

Expand Down
2 changes: 1 addition & 1 deletion examples/SDLx/SDLx_text_wordwrap.pl
Expand Up @@ -5,7 +5,7 @@
use SDLx::App;
use SDLx::Text;

my $app = SDLx::App->new( eoq => 1 );
my $app = SDLx::App->new();

my $text = SDLx::Text->new( word_wrap => 450 );

Expand Down
2 changes: 1 addition & 1 deletion examples/SDLx/SDLx_text_zoom.pl
Expand Up @@ -7,7 +7,7 @@
use SDLx::App;
use SDLx::Text;

my $app = SDLx::App->new( eoq => 1, width => 400, height => 100 );
my $app = SDLx::App->new( width => 400, height => 100 );

my $text = SDLx::Text->new;

Expand Down
12 changes: 4 additions & 8 deletions examples/SDLx/app.pl
Expand Up @@ -7,15 +7,11 @@
height => 480,
);

sub draw_lines {
$app->draw_line( [ rand $app->w, rand $app->h ], [ rand $app->w, rand $app->h ], 0xFFFFFFFF );
$app->update();
}


sub draw_lines { $app->draw_line( [ 0, 0 ], [ rand( $app->w ), rand( $app->h ) ], 0xFFFFFFFF ); $app->update(); }

sub event_handle { my $e = shift; $_[0]->stop if ( $e->type == SDL_QUIT ); }

$app->add_event_handler( \&event_handle );
$app->add_show_handler( \&draw_lines );

$app->run();


2 changes: 1 addition & 1 deletion examples/SDLx/music.pl
Expand Up @@ -4,4 +4,4 @@
$music->data( sam => "test/data/sample.wav" );
$sam = $music->data("sam");
$music->play($sam);
while ( $music->playing ) { print "playing\n" }
while ( $music->playing ) { print "playing\n"; sleep 1; }
4 changes: 1 addition & 3 deletions examples/SDLx/pong.pl
Expand Up @@ -29,7 +29,7 @@
y => 0,
w => 20,
h => 80,
vel => 250,
vel => 130,
y_vel => 0,
};

Expand Down Expand Up @@ -143,8 +143,6 @@ sub on_event {
my $key = $event->key_sym;
$paddle->{y_vel} += $paddle->{vel} if $key == SDLK_UP;
$paddle->{y_vel} -= $paddle->{vel} if $key == SDLK_DOWN;
} elsif ( $event->type == SDL_QUIT ) {
exit;
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/SDL.pm
Expand Up @@ -54,7 +54,7 @@ our %EXPORT_TAGS = (
defaults => $SDL::Constants::EXPORT_TAGS{'SDL/defaults'}
);

our $VERSION = '2.536';
our $VERSION = '2.537_02';
$VERSION = eval $VERSION;

print "$VERSION" if ( defined( $ARGV[0] ) && ( $ARGV[0] eq '--SDLperl' ) );
Expand Down
7 changes: 5 additions & 2 deletions lib/SDL/Constants.pm
Expand Up @@ -1030,6 +1030,11 @@ use constant {
KMOD_META => ( KMOD_LMETA | KMOD_RMETA ),
}; # SDL::Events/keymod
use constant {
SDL_DEFAULT_REPEAT_DELAY => 500,
SDL_DEFAULT_REPEAT_INTERVAL => 30,
}; # SDL::Events/repeat
use constant {
SMOOTHING_OFF => 0,
SMOOTHING_ON => 1,
Expand Down Expand Up @@ -1217,8 +1222,6 @@ use constant {
FPS_LOWER_LIMIT => 1,
FPS_DEFAULT => 30,
SDL_ALL_HOTKEYS => 0xFFFFFFFF,
SDL_DEFAULT_REPEAT_DELAY => 500,
SDL_DEFAULT_REPEAT_INTERVAL => 30,
};
use constant {
Expand Down
3 changes: 2 additions & 1 deletion lib/SDL/Event.pm
Expand Up @@ -24,7 +24,8 @@ our %EXPORT_TAGS = (
app => $SDL::Constants::EXPORT_TAGS{'SDL::Events/app'},
button => $SDL::Constants::EXPORT_TAGS{'SDL::Events/button'},
keysym => $SDL::Constants::EXPORT_TAGS{'SDL::Events/keysym'},
keymod => $SDL::Constants::EXPORT_TAGS{'SDL::Events/keymod'}
keymod => $SDL::Constants::EXPORT_TAGS{'SDL::Events/keymod'},
repeat => $SDL::Constants::EXPORT_TAGS{'SDL::Events/repeat'}
);

1;
3 changes: 2 additions & 1 deletion lib/SDL/Events.pm
Expand Up @@ -24,7 +24,8 @@ our %EXPORT_TAGS = (
app => $SDL::Constants::EXPORT_TAGS{'SDL::Events/app'},
button => $SDL::Constants::EXPORT_TAGS{'SDL::Events/button'},
keysym => $SDL::Constants::EXPORT_TAGS{'SDL::Events/keysym'},
keymod => $SDL::Constants::EXPORT_TAGS{'SDL::Events/keymod'}
keymod => $SDL::Constants::EXPORT_TAGS{'SDL::Events/keymod'},
repeat => $SDL::Constants::EXPORT_TAGS{'SDL::Events/repeat'}
);

1;
2 changes: 2 additions & 0 deletions lib/SDL/GFX/ImageFilter.pm
Expand Up @@ -19,4 +19,6 @@ our %EXPORT_TAGS = (
smoothing => $SDL::Constants::EXPORT_TAGS{'SDL::GFX/smoothing'}
);

MMX_on();

1;
13 changes: 13 additions & 0 deletions lib/SDL/Version.pm
Expand Up @@ -8,6 +8,19 @@ our @ISA = qw(Exporter DynaLoader);
use SDL::Internal::Loader;
internal_load_dlls(__PACKAGE__);

use overload '<=>' => \&my_cmp,
'""' => \&stringify;

bootstrap SDL::Version;

sub stringify {
my $self = shift;
return sprintf "%s%s%s", chr($self->major), chr($self->minor), chr($self->patch);
}

sub my_cmp {
my ($left, $right) = @_;
return "$left" cmp "$right";
}

1;

0 comments on commit 3512b1b

Please sign in to comment.