Browse files

Added ticks back in to app. It's now deprecated.

  • Loading branch information...
1 parent c51f300 commit 702e52d10769d29d150e5e2da7cecfc57b77f646 @Blaizer Blaizer committed Apr 3, 2012
Showing with 11 additions and 2 deletions.
  1. +6 −1 lib/SDLx/Controller.pm
  2. +2 −1 lib/pods/SDL/Deprecated.pod
  3. +3 −0 t/sdlx_controller.t
View
7 lib/SDLx/Controller.pm
@@ -313,7 +313,7 @@ sub event {
$_event{ $ref};
}
-# replacements for SDLx::App->get_ticks() and delay()
+# replacements for SDLx::App::get_ticks() and SDLx::App::delay()
sub time {
my ($self, $arg) = @_;
my $ref = refaddr $self;
@@ -325,6 +325,11 @@ sub sleep {
return Time::HiRes::sleep( $_[1] );
}
+# deprecated
+sub ticks {
+ return SDL::get_ticks();
+}
+
1;
__END__
View
3 lib/pods/SDL/Deprecated.pod
@@ -27,7 +27,8 @@ so they're not listed here.
The OpenGL method C<attribute> is now called C<gl_attribute>.
-C<ticks> and C<delay> have been removed and replaced with SDLx::Controller's C<time> and C<sleep>.
+C<delay> has been removed and replaced with SDLx::Controller's C<sleep>. C<ticks> has been deprecated, but left in
+for backcompat.
=item SDLx::Controller
View
3 t/sdlx_controller.t
@@ -209,4 +209,7 @@ is($show_inc, 30, 'called our show handlers exactly 30 times');
ok( $app->stopped, 'stopped is true after the app is stopped' );
ok( !$app->paused, 'paused is false. none of that' );
+# deprecated
+cmp_ok( $app->ticks, '>', 0, 'ticks is deprecated but still works' );
+
done_testing;

0 comments on commit 702e52d

Please sign in to comment.