Permalink
Browse files

redid perltidy

  • Loading branch information...
1 parent 369c9c8 commit 91586c22bf917cfa10d4bf7c0d30c3c83e8c58a4 Tobias Leich committed Jul 22, 2010
Showing with 12,982 additions and 12,796 deletions.
  1. +496 −496 Build.PL
  2. +14 −18 examples/GFX/script_roto.pl
  3. +96 −93 examples/SDLx/SDLx_controller_two_squares.pl
  4. +15 −18 examples/SDLx/SDLx_sprite.pl
  5. +12 −16 examples/SDLx/SDLx_sprite_animated.pl
  6. +134 −130 examples/SDLx/pong.pl
  7. +155 −149 examples/adventure/adventure.pl
  8. +5 −5 examples/cookbook/1.pl
  9. +81 −77 examples/cookbook/openglapp.pl
  10. +48 −51 examples/cookbook/pdl.pl
  11. +99 −93 examples/cookbook/pogl_sdl_texture.pl
  12. +42 −44 examples/pixel_operations/fast_pixel_write.pl
  13. +35 −35 examples/pixel_operations/sols/ch02.pl
  14. +27 −27 examples/pixel_operations/starry.pl
  15. +42 −45 examples/pixel_operations/tie_matrix.pl
  16. +107 −108 inc/My/Builder.pm
  17. +41 −38 inc/My/Builder/Darwin.pm
  18. +3 −3 inc/My/Builder/Windows.pm
  19. +12 −12 lib/SDL.pm
  20. +3 −3 lib/SDL/Audio.pm
  21. +3 −3 lib/SDL/AudioCVT.pm
  22. +3 −3 lib/SDL/AudioSpec.pm
  23. +16 −16 lib/SDL/CD.pm
  24. +4 −4 lib/SDL/CDROM.pm
  25. +4 −4 lib/SDL/CDTrack.pm
  26. +8 −8 lib/SDL/Color.pm
  27. +4 −4 lib/SDL/Config.pm
  28. +1,086 −1,086 lib/SDL/Constants.pm
  29. +10 −10 lib/SDL/Event.pm
  30. +10 −10 lib/SDL/Events.pm
  31. +2 −2 lib/SDL/GFX.pm
  32. +2 −2 lib/SDL/GFX/BlitFunc.pm
  33. +2 −2 lib/SDL/GFX/FPSManager.pm
  34. +2 −2 lib/SDL/GFX/Framerate.pm
  35. +2 −2 lib/SDL/GFX/ImageFilter.pm
  36. +2 −2 lib/SDL/GFX/Primitives.pm
  37. +2 −2 lib/SDL/GFX/Rotozoom.pm
  38. +2 −2 lib/SDL/Image.pm
  39. +16 −16 lib/SDL/Internal/Loader.pm
  40. +27 −26 lib/SDL/MPEG.pm
  41. +9 −9 lib/SDL/Mixer.pm
  42. +9 −9 lib/SDL/Mixer/Channels.pm
  43. +9 −9 lib/SDL/Mixer/Effects.pm
  44. +9 −9 lib/SDL/Mixer/Groups.pm
  45. +9 −9 lib/SDL/Mixer/MixChunk.pm
  46. +9 −9 lib/SDL/Mixer/MixMusic.pm
  47. +9 −9 lib/SDL/Mixer/Music.pm
  48. +9 −9 lib/SDL/Mixer/Samples.pm
  49. +2 −2 lib/SDL/Net.pm
  50. +8 −8 lib/SDL/Overlay.pm
  51. +8 −8 lib/SDL/Palette.pm
  52. +3 −3 lib/SDL/Pango.pm
  53. +3 −3 lib/SDL/Pango/Context.pm
  54. +8 −8 lib/SDL/PixelFormat.pm
  55. +2 −2 lib/SDL/RWOps.pm
  56. +8 −8 lib/SDL/Rect.pm
  57. +38 −38 lib/SDL/SMPEG.pm
  58. +8 −8 lib/SDL/Surface.pm
  59. +3 −3 lib/SDL/TTF.pm
  60. +3 −3 lib/SDL/TTF/Font.pm
  61. +68 −68 lib/SDL/TTFont.pm
  62. +4 −4 lib/SDL/Tutorial.pm
  63. +30 −30 lib/SDL/Tutorial/Animation.pm
  64. +915 −915 lib/SDL/Tutorial/LunarLander.pm
  65. +8 −8 lib/SDL/Video.pm
  66. +8 −8 lib/SDL/VideoInfo.pm
  67. +144 −147 lib/SDLx/App.pm
  68. +60 −60 lib/SDLx/Controller.pm
  69. +41 −40 lib/SDLx/Controller/Timer.pm
  70. +29 −30 lib/SDLx/FPS.pm
  71. +500 −489 lib/SDLx/Rect.pm
  72. +4 −4 lib/SDLx/SFont.pm
  73. +174 −169 lib/SDLx/Sprite.pm
  74. +110 −110 lib/SDLx/Sprite/Animated.pm
  75. +195 −193 lib/SDLx/Surface.pm
  76. +16 −16 lib/SDLx/Surface/TiedMatrix.pm
  77. +15 −15 lib/SDLx/Surface/TiedMatrixRow.pm
  78. +78 −0 perltidyrc
  79. +2 −1 scripts/MultiThreadPOC.pl
  80. +420 −420 scripts/OpenGL/Constants.pm
  81. +261 −261 scripts/SDL/Constants.pm
  82. +61 −57 scripts/SDLpp.pl
  83. +175 −169 scripts/auto_constants.pl
  84. +101 −102 scripts/const.pl
  85. +11 −11 scripts/gl_const.pl
  86. +11 −11 scripts/sdl_const.pl
  87. +54 −54 t/00-load.t
  88. +8 −4 t/config.t
  89. +59 −65 t/core.t
  90. +42 −36 t/core_audio.t
  91. +27 −25 t/core_audiospec.t
  92. +79 −77 t/core_cd.t
  93. +8 −7 t/core_error.t
  94. +270 −268 t/core_events.t
  95. +25 −25 t/core_joystick.t
  96. +14 −14 t/core_mouse.t
  97. +31 −31 t/core_multi.t
  98. +8 −6 t/core_overlay.t
  99. +18 −23 t/core_palette.t
  100. +24 −24 t/core_rwops.t
  101. +17 −14 t/core_surface.t
  102. +18 −17 t/core_timer.t
  103. +6 −12 t/core_version.t
  104. +285 −314 t/core_video.t
  105. +11 −16 t/core_video_convert_surface.t
  106. +9 −9 t/extendingrect.t
  107. +1 −1 t/gfx.t
  108. +11 −8 t/gfx_fpsmanager.t
  109. +11 −8 t/gfx_framerate.t
  110. +67 −67 t/gfx_imagefilter.t
  111. +359 −303 t/gfx_primitives.t
  112. +275 −229 t/gfx_primitives2.t
  113. +62 −70 t/gfx_rotozoom.t
  114. +144 −165 t/image.t
  115. +61 −63 t/image_xpm_array.t
  116. +43 −42 t/intergation1.t
  117. +46 −42 t/lib/SDL/TestTool.pm
  118. +44 −46 t/mixer.t
  119. +74 −90 t/mixer_channels.t
  120. +114 −138 t/mixer_effects.t
  121. +50 −63 t/mixer_groups.t
  122. +27 −25 t/mixer_mixchunk.t
  123. +30 −28 t/mixer_mixmusic.t
  124. +90 −104 t/mixer_music.t
  125. +55 −60 t/mixer_samples.t
  126. +25 −23 t/mpegpm.t
  127. +33 −37 t/pango.t
  128. +34 −37 t/sdlgamerect.t
  129. +58 −54 t/sdlx_app.t
  130. +20 −17 t/sdlx_sfont.t
  131. +14 −14 t/sdlx_sprite.t
  132. +26 −32 t/sdlx_sprite_animated.t
  133. +42 −40 t/sdlx_surface.t
  134. +26 −24 t/smpeg.t
  135. +222 −258 t/ttf.t
  136. +16 −20 t/ttf_font.t
  137. +1 −1 t_backcompat/64encode.pl
  138. +12 −12 t_backcompat/Font.pm
  139. +11 −10 t_backcompat/MoP/Build.PL
  140. +23 −23 t_backcompat/MoP/lib/SDL/Tutorial/MoP.pm
  141. +7 −7 t_backcompat/MoP/lib/SDL/Tutorial/MoP/Base.pm
  142. +20 −20 t_backcompat/MoP/lib/SDL/Tutorial/MoP/Controller/CPUSpinner.pm
  143. +93 −92 t_backcompat/MoP/lib/SDL/Tutorial/MoP/Controller/Game.pm
  144. +59 −56 t_backcompat/MoP/lib/SDL/Tutorial/MoP/Controller/Keyboard.pm
  145. +25 −24 t_backcompat/MoP/lib/SDL/Tutorial/MoP/EventManager.pm
  146. +93 −92 t_backcompat/MoP/lib/SDL/Tutorial/MoP/Model/Map.pm
  147. +24 −24 t_backcompat/MoP/lib/SDL/Tutorial/MoP/Models.pm
  148. +112 −115 t_backcompat/MoP/lib/SDL/Tutorial/MoP/View.pm
  149. +48 −49 t_backcompat/MoP/lib/SDL/Tutorial/MoP/View/Map.pm
  150. +49 −46 t_backcompat/OpenGL/test1.pl
  151. +80 −75 t_backcompat/OpenGL/test2.pl
  152. +34 −33 t_backcompat/OpenGL/test3.pl
  153. +81 −76 t_backcompat/OpenGL/test4.pl
  154. +91 −87 t_backcompat/OpenGL/test5.pl
  155. +67 −63 t_backcompat/OpenGL/tutorial/lesson02.pl
  156. +71 −67 t_backcompat/OpenGL/tutorial/lesson03.pl
  157. +79 −74 t_backcompat/OpenGL/tutorial/lesson04.pl
  158. +145 −140 t_backcompat/OpenGL/tutorial/lesson05.pl
  159. +254 −246 t_backcompat/OpenGL/tutorial/lesson06.pl
  160. +295 −279 t_backcompat/OpenGL/tutorial/lesson07.pl
  161. +307 −289 t_backcompat/OpenGL/tutorial/lesson08.pl
  162. +291 −285 t_backcompat/OpenGL/tutorial/lesson18.pl
  163. +33 −30 t_backcompat/Timer.pm
  164. +34 −33 t_backcompat/checkkeys.pl
  165. +22 −22 t_backcompat/core_event_filter.pl
  166. +5 −4 t_backcompat/fontpm.t
  167. +30 −28 t_backcompat/graywin.pl
  168. +21 −21 t_backcompat/loopwave.pl
  169. +8 −8 t_backcompat/palettepm.t
  170. +5 −5 t_backcompat/soundpm.t
  171. +33 −30 t_backcompat/testcolor.pl
  172. +32 −28 t_backcompat/testcolor.spl
  173. +48 −47 t_backcompat/testfonttool.pl
  174. +193 −199 t_backcompat/testgfxprim.pl
  175. +148 −146 t_backcompat/testgfxroto.pl
  176. +17 −17 t_backcompat/testgraphictool.pl
  177. +182 −156 t_backcompat/testjoystick.pl
  178. +103 −97 t_backcompat/testsprite.pl
  179. +11 −13 t_backcompat/testtimer.pl
  180. +24 −23 t_backcompat/toolfontpm.t
  181. +3 −3 t_backcompat/toolgraphicpm.t
  182. +25 −24 t_backcompat/ttfontpm.t
  183. +1 −1 t_backcompat/wave.pl
  184. +13 −15 test/checkkeys.pl
  185. +17 −18 test/graywin.pl
  186. +42 −39 test/testmenu.pl
  187. +23 −22 tools/GFX_headers_digest.pl
  188. +8 −8 tools/make_XS_stub.pl
  189. +14 −14 tools/nopaste.pl
  190. +15 −15 tools/smokeNsend.pl
  191. +62 −55 tools/smolder_smoke_signal
  192. +2 −2 xt/02_perlcritic.t
  193. +10 −10 xt/05_manifest.t
  194. +24 −23 xt/06_surfaceML.t
  195. +4 −3 xt/07_core_memleak.t
  196. +9 −17 xt/constantspm.t
  197. +15 −15 xt/net.t
View
Oops, something went wrong.
@@ -11,40 +11,36 @@
my $display = SDL::Video::set_video_mode( 640, 480, 32, SDL_SWSURFACE );
my $pixel = SDL::Video::map_RGB( $display->format, 0, 0, 0 );
-SDL::Video::fill_rect(
- $display,
- SDL::Rect->new( 0, 0, $display->w, $display->h ), $pixel
-);
+SDL::Video::fill_rect( $display,
+ SDL::Rect->new( 0, 0, $display->w, $display->h ), $pixel );
croak SDL::get_error if !$display;
my $src = SDL::Video::load_BMP('test/data/picture.bmp');
my $temp_surf;
sub draw {
- SDL::Video::fill_rect(
- $display,
- SDL::Rect->new( 0, 0, $display->w, $display->h ), $pixel
- );
+ SDL::Video::fill_rect( $display,
+ SDL::Rect->new( 0, 0, $display->w, $display->h ), $pixel );
- my $surface = $_[0];
- SDL::Video::blit_surface(
- $surface, SDL::Rect->new( 0, 0, $surface->w, $surface->h ),
- $display, SDL::Rect->new( 0, 0, $display->w, $display->w )
- );
+ my $surface = $_[0];
+ SDL::Video::blit_surface(
+ $surface, SDL::Rect->new( 0, 0, $surface->w, $surface->h ),
+ $display, SDL::Rect->new( 0, 0, $display->w, $display->w )
+ );
- SDL::Video::update_rect( $display, 0, 0, 640, 480 );
+ SDL::Video::update_rect( $display, 0, 0, 640, 480 );
- SDL::delay( $_[1] ) if $_[1];
+ SDL::delay( $_[1] ) if $_[1];
}
# Note: new surface should be less than 16384 in width and height
foreach ( 1 .. 360 ) {
- $temp_surf = SDL::GFX::Rotozoom::surface( $src, $_, $_ / 180, 1 );
- croak SDL::get_error if !$temp_surf;
- draw( $temp_surf, 2 );
+ $temp_surf = SDL::GFX::Rotozoom::surface( $src, $_, $_ / 180, 1 );
+ croak SDL::get_error if !$temp_surf;
+ draw( $temp_surf, 2 );
}
$temp_surf = SDL::GFX::Rotozoom::surface_xy( $src, 1, 1, 1, 1 );
@@ -16,124 +16,127 @@
my $app = init();
my $ball = {
- x => 0,
- y => 0,
- w => 20,
- h => 20,
- vel => 200,
- x_vel => 0,
- y_vel => 0,
+ x => 0,
+ y => 0,
+ w => 20,
+ h => 20,
+ vel => 200,
+ x_vel => 0,
+ y_vel => 0,
};
my $r_ball = {
- x => 0,
- y => 0,
- w => 20,
- h => 20,
- radians => 0,
- rot_vel => 50,
- radius => 100,
- c_x => $app->w / 2,
- c_y => $app->h / 2,
+ x => 0,
+ y => 0,
+ w => 20,
+ h => 20,
+ radians => 0,
+ rot_vel => 50,
+ radius => 100,
+ c_x => $app->w / 2,
+ c_y => $app->h / 2,
};
sub init {
- # Initing video
- # Die here if we cannot make video init
- croak 'Cannot init ' . SDL::get_error()
- if ( SDL::init(SDL_INIT_VIDEO) == -1 );
+ # Initing video
+ # Die here if we cannot make video init
+ croak 'Cannot init ' . SDL::get_error()
+ if ( SDL::init(SDL_INIT_VIDEO) == -1 );
- # Create our display window
- # This is our actual SDL application window
- my $a = SDL::Video::set_video_mode(
- 800, 600, 32,
- SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_HWACCEL
- );
+ # Create our display window
+ # This is our actual SDL application window
+ my $a = SDL::Video::set_video_mode( 800, 600, 32,
+ SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_HWACCEL );
- croak 'Cannot init video mode 800x600x32: ' . SDL::get_error()
- unless $a;
+ croak 'Cannot init video mode 800x600x32: ' . SDL::get_error()
+ unless $a;
- return $a;
+ return $a;
}
my $game = SDLx::Controller->new();
sub on_move {
- my $dt = shift;
- $dt = $dt / 1000;
- $ball->{x} += $ball->{x_vel} * $dt;
+ my $dt = shift;
+ $dt = $dt / 1000;
+ $ball->{x} += $ball->{x_vel} * $dt;
- $ball->{y} += $ball->{y_vel} * $dt;
+ $ball->{y} += $ball->{y_vel} * $dt;
- # Period = $r_ball->{vel}
- # cc_speed = 2 * pi * r / T
- $r_ball->{radians} += $r_ball->{rot_vel} * $dt;
- $r_ball->{x} = $r_ball->{c_x} + sin( $r_ball->{radians} * pi / 180 ) * $r_ball->{radius};
- $r_ball->{y} = $r_ball->{c_y} + cos( $r_ball->{radians} * pi / 180 ) * $r_ball->{radius};
+ # Period = $r_ball->{vel}
+ # cc_speed = 2 * pi * r / T
+ $r_ball->{radians} += $r_ball->{rot_vel} * $dt;
+ $r_ball->{x} =
+ $r_ball->{c_x} + sin( $r_ball->{radians} * pi / 180 ) * $r_ball->{radius};
+ $r_ball->{y} =
+ $r_ball->{c_y} + cos( $r_ball->{radians} * pi / 180 ) * $r_ball->{radius};
- return 1;
+ return 1;
}
sub on_event {
- my $event = shift;
-
- if ( $event->type == SDL_KEYDOWN ) {
- my $key = $event->key_sym;
- if ( $key == SDLK_PRINT ) {
- my $screen_shot_index = 1;
- map { $screen_shot_index = $1 + 1 if $_ =~ /Shot(\d+)\.bmp/ && $1 >= $screen_shot_index }
- <Shot*\.bmp>;
- SDL::Video::save_BMP(
- $app,
- sprintf( "Shot%04d.bmp", $screen_shot_index )
- );
- }
- $ball->{y_vel} -= $ball->{vel} if $key == SDLK_UP;
- $ball->{y_vel} += $ball->{vel} if $key == SDLK_DOWN;
- $ball->{x_vel} -= $ball->{vel} if $key == SDLK_LEFT;
- $ball->{x_vel} += $ball->{vel} if $key == SDLK_RIGHT;
- $r_ball->{rot_vel} += 50 if $key == SDLK_SPACE;
-
- } elsif ( $event->type == SDL_KEYUP ) {
- my $key = $event->key_sym;
- $ball->{y_vel} += $ball->{vel} if $key == SDLK_UP;
- $ball->{y_vel} -= $ball->{vel} if $key == SDLK_DOWN;
- $ball->{x_vel} += $ball->{vel} if $key == SDLK_LEFT;
- $ball->{x_vel} -= $ball->{vel} if $key == SDLK_RIGHT;
-
- } elsif ( $event->type == SDL_QUIT ) {
- return 0;
- }
-
- return 1;
+ my $event = shift;
+
+ if ( $event->type == SDL_KEYDOWN ) {
+ my $key = $event->key_sym;
+ if ( $key == SDLK_PRINT ) {
+ my $screen_shot_index = 1;
+ map {
+ $screen_shot_index = $1 + 1
+ if $_ =~ /Shot(\d+)\.bmp/
+ && $1 >= $screen_shot_index
+ } <Shot*\.bmp>;
+ SDL::Video::save_BMP( $app,
+ sprintf( "Shot%04d.bmp", $screen_shot_index ) );
+ }
+ $ball->{y_vel} -= $ball->{vel} if $key == SDLK_UP;
+ $ball->{y_vel} += $ball->{vel} if $key == SDLK_DOWN;
+ $ball->{x_vel} -= $ball->{vel} if $key == SDLK_LEFT;
+ $ball->{x_vel} += $ball->{vel} if $key == SDLK_RIGHT;
+ $r_ball->{rot_vel} += 50 if $key == SDLK_SPACE;
+
+ }
+ elsif ( $event->type == SDL_KEYUP ) {
+ my $key = $event->key_sym;
+ $ball->{y_vel} += $ball->{vel} if $key == SDLK_UP;
+ $ball->{y_vel} -= $ball->{vel} if $key == SDLK_DOWN;
+ $ball->{x_vel} += $ball->{vel} if $key == SDLK_LEFT;
+ $ball->{x_vel} -= $ball->{vel} if $key == SDLK_RIGHT;
+
+ }
+ elsif ( $event->type == SDL_QUIT ) {
+ return 0;
+ }
+
+ return 1;
}
sub on_show {
- SDL::Video::fill_rect(
- $app,
- SDL::Rect->new( 0, 0, $app->w, $app->h ),
- SDL::Video::map_RGB( $app->format, 0, 0, 0 )
- );
-
- SDL::Video::fill_rect(
- $app,
- SDL::Rect->new( $ball->{x}, $ball->{y}, $ball->{w}, $ball->{h} ),
- SDL::Video::map_RGB( $app->format, 0, 0, 255 )
- );
-
- SDL::Video::fill_rect(
- $app,
- SDL::Rect->new(
- $r_ball->{x}, $r_ball->{y}, $r_ball->{w}, $r_ball->{h}
- ),
- SDL::Video::map_RGB( $app->format, 255, 0, 0 )
- );
-
- SDL::Video::flip($app);
-
- return 0;
+ SDL::Video::fill_rect(
+ $app,
+ SDL::Rect->new( 0, 0, $app->w, $app->h ),
+ SDL::Video::map_RGB( $app->format, 0, 0, 0 )
+ );
+
+ SDL::Video::fill_rect(
+ $app,
+ SDL::Rect->new( $ball->{x}, $ball->{y}, $ball->{w}, $ball->{h} ),
+ SDL::Video::map_RGB( $app->format, 0, 0, 255 )
+ );
+
+ SDL::Video::fill_rect(
+ $app,
+ SDL::Rect->new(
+ $r_ball->{x}, $r_ball->{y}, $r_ball->{w}, $r_ball->{h}
+ ),
+ SDL::Video::map_RGB( $app->format, 255, 0, 0 )
+ );
+
+ SDL::Video::flip($app);
+
+ return 0;
}
my $move_id = $game->add_move_handler( \&on_move );
@@ -12,11 +12,10 @@
my $disp = SDL::Video::set_video_mode( 300, 300, 32, SDL_ANYFORMAT );
-my $pixel = SDL::Video::map_RGB( $disp->format, rand(255), rand(255), rand(255) );
-SDL::Video::fill_rect(
- $disp, SDL::Rect->new( 0, 0, $disp->w, $disp->h ),
- $pixel
-);
+my $pixel =
+ SDL::Video::map_RGB( $disp->format, rand(255), rand(255), rand(255) );
+SDL::Video::fill_rect( $disp, SDL::Rect->new( 0, 0, $disp->w, $disp->h ),
+ $pixel );
my $sprite = SDLx::Sprite->new( image => 'test/data/chest.png' );
@@ -25,22 +24,20 @@
my $angle = 0;
while ( $angle++ < 360 ) {
- SDL::Video::fill_rect(
- $disp, SDL::Rect->new( 0, 0, $disp->w, $disp->h ),
- $pixel
- );
+ SDL::Video::fill_rect( $disp, SDL::Rect->new( 0, 0, $disp->w, $disp->h ),
+ $pixel );
- $sprite->rotation($angle);
+ $sprite->rotation($angle);
- #
- $sprite->draw_xy(
- $disp,
- $disp->w / 2 - ( $sprite->w / 2 ),
- $disp->h / 2 - ( $sprite->h / 2 )
- );
+ #
+ $sprite->draw_xy(
+ $disp,
+ $disp->w / 2 - ( $sprite->w / 2 ),
+ $disp->h / 2 - ( $sprite->h / 2 )
+ );
- SDL::Video::update_rect( $disp, 0, 0, 300, 300 );
+ SDL::Video::update_rect( $disp, 0, 0, 300, 300 );
- SDL::delay(2);
+ SDL::delay(2);
}
SDL::delay(2000);
@@ -11,15 +11,13 @@
my $disp = SDL::Video::set_video_mode( 300, 300, 32, SDL_ANYFORMAT );
my $pixel = SDL::Video::map_RGB( $disp->format, 0, 0, 0 );
-SDL::Video::fill_rect(
- $disp, SDL::Rect->new( 0, 0, $disp->w, $disp->h ),
- $pixel
-);
+SDL::Video::fill_rect( $disp, SDL::Rect->new( 0, 0, $disp->w, $disp->h ),
+ $pixel );
my $sprite = SDLx::Sprite::Animated->new(
- image => 'test/data/hero.png',
- rect => SDL::Rect->new( 48, 0, 48, 48 ),
- ticks_per_frame => 6,
+ image => 'test/data/hero.png',
+ rect => SDL::Rect->new( 48, 0, 48, 48 ),
+ ticks_per_frame => 6,
);
$sprite->set_sequences( left => [ [ 1, 0 ], [ 1, 1 ], [ 1, 2 ] ], );
$sprite->alpha_key( SDL::Color->new( 0xfc, 0x00, 0xff ) );
@@ -29,17 +27,15 @@
my $ticks = 0;
while ( $x++ < 30 ) {
- SDL::Video::fill_rect(
- $disp, SDL::Rect->new( 0, 0, $disp->w, $disp->h ),
- $pixel
- );
+ SDL::Video::fill_rect( $disp, SDL::Rect->new( 0, 0, $disp->w, $disp->h ),
+ $pixel );
- $sprite->x( $x * 10 );
- $sprite->next();
- $sprite->draw($disp);
+ $sprite->x( $x * 10 );
+ $sprite->next();
+ $sprite->draw($disp);
- SDL::Video::update_rect( $disp, 0, 0, 0, 0 );
+ SDL::Video::update_rect( $disp, 0, 0, 0, 0 );
- SDL::delay(100);
+ SDL::delay(100);
}
Oops, something went wrong.

0 comments on commit 91586c2

Please sign in to comment.