[oe-commits] org.oe.dev supertux-qvga 0.1.3: Add QVGA port of SperTux, based on GP2X port.

pfalcon commit openembedded-commits at lists.openembedded.org
Thu Jan 17 13:05:20 UTC 2008


supertux-qvga 0.1.3: Add QVGA port of SperTux, based on GP2X port.
* Original GP2X port by Ingo Arndt.
* Data conversion preparation and script by myself.

Author: pfalcon at openembedded.org
Branch: org.openembedded.dev
Revision: 295685151d124dddda4263fcad5e205cd0c1e745
ViewMTN: http://monotone.openembedded.org/revision/info/295685151d124dddda4263fcad5e205cd0c1e745
Files:
1
packages/supertux/files/gp2x.patch
packages/supertux/files/img-resize.sh
packages/supertux/files/supertux-smallsize-data.tar.bz2
packages/supertux/supertux-qvga_0.1.3.bb
mtn:manual_merge
true
Diffs:

#
# mt diff -rae05ef03b3b408506db8aa1bcebc8ff64ff6c8fd -r295685151d124dddda4263fcad5e205cd0c1e745
#
# 
# 
# add_file "packages/supertux/files/gp2x.patch"
#  content [26a86f577e4742adc10c15df42c058f4cea5183a]
# 
# add_file "packages/supertux/files/img-resize.sh"
#  content [0179d1a7105160d62d20293a7513dd948a13cd3c]
# 
# add_file "packages/supertux/files/supertux-smallsize-data.tar.bz2"
#  content [982bfb74c80c28fa6574ec3ccd3facae4e943404]
# 
# add_file "packages/supertux/supertux-qvga_0.1.3.bb"
#  content [53598bc864a257e7201e4e07636d2e6c83095af2]
# 
#   set "packages/supertux/files/supertux-smallsize-data.tar.bz2"
#  attr "mtn:manual_merge"
# value "true"
# 
============================================================
--- packages/supertux/files/gp2x.patch	26a86f577e4742adc10c15df42c058f4cea5183a
+++ packages/supertux/files/gp2x.patch	26a86f577e4742adc10c15df42c058f4cea5183a
@@ -0,0 +1,2614 @@
+Only in supertux-0.1.3: aclocal.m4
+diff -ur supertux-0.1.3/AUTHORS supertux-0.1.3-gp2x/AUTHORS
+--- supertux-0.1.3/AUTHORS	2005-07-02 14:37:30.000000000 +0300
++++ supertux-0.1.3-gp2x/AUTHORS	2006-04-13 06:11:02.000000000 +0300
+@@ -91,6 +91,12 @@
+ 
+     Royalty free CDROMs and FTP sites sounds
+ 
++Port to GP2X
++-----------
++    Ingo Arndt
++    scachi at gmx.de
++    http://www.bitmage.de
++
+ More information and contacts
+ =============================
+ 
+Only in supertux-0.1.3: autom4te.cache
+Only in supertux-0.1.3-gp2x: autoscan.log
+Only in supertux-0.1.3-gp2x: COMPILE4GP2X
+Only in supertux-0.1.3: config.guess
+Only in supertux-0.1.3: config.log
+Only in supertux-0.1.3: config.status
+Only in supertux-0.1.3: config.sub
+Only in supertux-0.1.3: configure
+diff -ur supertux-0.1.3/configure.ac supertux-0.1.3-gp2x/configure.ac
+--- supertux-0.1.3/configure.ac	2005-07-06 12:26:15.000000000 +0300
++++ supertux-0.1.3-gp2x/configure.ac	2006-04-19 22:29:05.000000000 +0300
+@@ -76,13 +76,33 @@
+ CFLAGS="$CFLAGS $SDL_CFLAGS"
+ LIBS="$LIBS $SDL_LIBS"
+ 
++AM_PATH_LIBMIKMOD(,
++            :,
++	    AC_MSG_ERROR([*** mikmod not found!]))
++CXXFLAGS="$CXXFLAGS $LIBMIKMOD_CFLAGS"
++CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS"
++LIBS="$LIBS $LIBMIKMOD_LIBS"
++
+ dnl Checks for additional libraries.
++AC_CHECK_LIB(smpeg, SMPEG_status)
++
++AC_CHECK_LIB(mikmod, MikMod_Init)
++
+ AC_CHECK_LIB(SDL_mixer, Mix_OpenAudio,,
+ 	AC_MSG_ERROR([SDL_mixer library required]))
+ 
++AC_CHECK_LIB(jpeg,jpeg_abort)
++
++AC_CHECK_LIB(z,compress)
++
++AC_CHECK_LIB(png,png_free)
++
+ AC_CHECK_LIB(SDL_image, IMG_Load,,
+ 	AC_MSG_ERROR([SDL_image library required]))
+ 
++AC_CHECK_LIB(SDL_gfx, rotozoomSurface,,
++	AC_MSG_ERROR([SDL_gfx library required]))
++
+ if test "x${enable_opengl}" != "xno"; then
+   AX_CHECK_GL
+ fi
+@@ -95,7 +115,30 @@
+   LIBS="$LIBS $GL_LIBS"
+ fi
+ 
+-AC_CHECK_LIB(z, gzopen,, AC_MSG_ERROR([*** zlib is missing]))
++# compile for the testing the 320x240 resolution
++# compile for the gp2x
++AC_ARG_ENABLE(gp2x,
++[  --enable-gp2x          Build the gp2x version [default=no]],
++              , enable_gp2x=no)
++if test x$enable_gp2x = xyes; then
++    CXXFLAGS="$CXXFLAGS -DGP2X"
++fi
++
++AC_ARG_ENABLE(320x240,
++[  --enable-320x240          Test the 320x240 resolution [default=no]],
++              , enable_320x240=no)
++if test x$enable_320x240 = xyes; then
++    CXXFLAGS="$CXXFLAGS -DRES320X240"
++fi
++
++# compile static
++AC_ARG_ENABLE(static,
++[  --enable-static          Build the static version [default=no]],
++              , enable_static=no)
++if test x$enable_static = xyes; then
++    CXXFLAGS="$CXXFLAGS -static"
++fi
++
+ 
+ CXXFLAGS="$CXXFLAGS -DDATA_PREFIX='\"$datadir/supertux\"'" 
+ 
+@@ -110,6 +153,9 @@
+ echo " Profile Mode:   $enable_gprof"
+ echo " Debug Mode:     $enable_debug"
+ echo " OpenGL Support: $enable_opengl"
++echo " 320x240 Resolution:    $enable_320x240"
++echo " GP2X Build (+320x240): $enable_gp2x"
++echo " Static Build:          $enable_static"
+ echo ""
+ 
+ # EOF #
+Only in supertux-0.1.3/data: CREDITS
+Only in supertux-0.1.3/data: extro-bonus2.txt
+Only in supertux-0.1.3/data: extro-bonus.txt
+Only in supertux-0.1.3/data: extro.txt
+Only in supertux-0.1.3/data: images
+Only in supertux-0.1.3/data: intro.txt
+Only in supertux-0.1.3/data: levels
+Only in supertux-0.1.3/data: Makefile
+Only in supertux-0.1.3/data: Makefile.in
+Only in supertux-0.1.3/data: music
+Only in supertux-0.1.3/data: sounds
+Only in supertux-0.1.3/data: supertux.strf
+Only in supertux-0.1.3: depcomp
+Only in supertux-0.1.3: install-sh
+Only in supertux-0.1.3: m4
+Only in supertux-0.1.3: Makefile
+Only in supertux-0.1.3: Makefile.in
+Only in supertux-0.1.3: missing
+Only in supertux-0.1.3: mkinstalldirs
+Only in supertux-0.1.3: patches
+diff -ur supertux-0.1.3/src/badguy.cpp supertux-0.1.3-gp2x/src/badguy.cpp
+--- supertux-0.1.3/src/badguy.cpp	2005-06-22 00:16:07.000000000 +0300
++++ supertux-0.1.3-gp2x/src/badguy.cpp	2006-04-20 21:32:23.000000000 +0300
+@@ -250,7 +250,11 @@
+           tux.kick_timer.start(KICKING_TIME);
+           set_sprite(img_mriceblock_flat_left, img_mriceblock_flat_right);
+           physic.set_velocity_x((dir == LEFT) ? -3.5 : 3.5);
++#ifndef GP2X
+           play_sound(sounds[SND_KICK],SOUND_CENTER_SPEAKER);
++#else
++          play_chunk(SND_KICK);
++#endif
+         }
+     }
+ 
+@@ -260,6 +264,7 @@
+       check_horizontal_bump();
+       if(mode == KICK && changed != dir)
+         {
++#ifndef GP2X
+           /* handle stereo sound (number 10 should be tweaked...)*/
+           if (base.x < scroll_x + screen->w/2 - 10)
+             play_sound(sounds[SND_RICOCHET], SOUND_LEFT_SPEAKER);
+@@ -267,6 +272,9 @@
+             play_sound(sounds[SND_RICOCHET], SOUND_RIGHT_SPEAKER);
+           else
+             play_sound(sounds[SND_RICOCHET], SOUND_CENTER_SPEAKER);
++#else
++          play_chunk(SND_RICOCHET);
++#endif
+         }
+     }
+ 
+@@ -455,11 +463,15 @@
+ 
+       /* play explosion sound */  // FIXME: is the stereo all right? maybe we should use player cordinates...
+       if (base.x < scroll_x + screen->w/2 - 10)
++#ifndef GP2X
+         play_sound(sounds[SND_EXPLODE], SOUND_LEFT_SPEAKER);
+       else if (base.x > scroll_x + screen->w/2 + 10)
+         play_sound(sounds[SND_EXPLODE], SOUND_RIGHT_SPEAKER);
+       else
+         play_sound(sounds[SND_EXPLODE], SOUND_CENTER_SPEAKER);
++#else
++	play_chunk(SND_EXPLODE);
++#endif
+ 
+     } else if(mode == BOMB_EXPLODE) {
+       remove_me();
+@@ -677,13 +689,21 @@
+     }
+ 
+   // BadGuy fall below the ground
++#ifndef RES320X240
+   if (base.y > screen->h) {
++#else
++  if (base.y > 640) {
++#endif
+     remove_me();
+     return;
+   }
+ 
+   // Once it's on screen, it's activated!
++#ifndef RES320X240
+   if (base.x <= scroll_x + screen->w + OFFSCREEN_DISTANCE)
++#else
++  if (base.x <= scroll_x + 640 + OFFSCREEN_DISTANCE)
++#endif
+     seen = true;
+ 
+   if(!seen)
+@@ -743,7 +763,11 @@
+ BadGuy::draw()
+ {
+   // Don't try to draw stuff that is outside of the screen
++#ifndef RES320X240
+   if(base.x <= scroll_x - base.width || base.x >= scroll_x + screen->w)
++#else
++  if(base.x <= scroll_x - base.width || base.x >= scroll_x + 640)
++#endif
+     return;
+   
+   if(sprite_left == 0 || sprite_right == 0)
+@@ -811,7 +835,11 @@
+     
+   World::current()->add_score(base.x - scroll_x,
+                               base.y, 50 * player_status.score_multiplier);
++#ifndef GP2X
+   play_sound(sounds[SND_SQUISH], SOUND_CENTER_SPEAKER);
++#else
++  play_chunk(SND_SQUISH);
++#endif
+   player_status.score_multiplier++;
+ 
+   dying = DYING_SQUISHED;
+@@ -830,7 +858,11 @@
+    
+     player->jump_of_badguy(this);
+     World::current()->add_score(base.x - scroll_x, base.y, 50 * player_status.score_multiplier);
++#ifndef GP2X
+     play_sound(sounds[SND_SQUISH], SOUND_CENTER_SPEAKER);
++#else
++    play_chunk(SND_SQUISH);
++#endif
+     player_status.score_multiplier++;
+     remove_me();
+     return;
+@@ -839,7 +871,11 @@
+     if (mode == NORMAL || mode == KICK)
+       {
+         /* Flatten! */
++#ifndef GP2X
+         play_sound(sounds[SND_STOMP], SOUND_CENTER_SPEAKER);
++#else
++	play_chunk(SND_STOMP);
++#endif
+         mode = FLAT;
+         set_sprite(img_mriceblock_flat_left, img_mriceblock_flat_right);
+         physic.set_velocity_x(0);
+@@ -847,7 +883,11 @@
+         timer.start(4000);
+       } else if (mode == FLAT) {
+         /* Kick! */
++#ifndef GP2X
+         play_sound(sounds[SND_KICK], SOUND_CENTER_SPEAKER);
++#else
++	play_chunk(SND_KICK);
++#endif
+ 
+         if (player->base.x < base.x + (base.width/2)) {
+           physic.set_velocity_x(5);
+@@ -925,7 +965,11 @@
+                     score * player_status.score_multiplier);
+ 
+   /* Play death sound: */
++#ifndef GP2X
+   play_sound(sounds[SND_FALL], SOUND_CENTER_SPEAKER);
++#else
++	play_chunk(SND_FALL);
++#endif
+ }
+ 
+ void BadGuy::explode(BadGuy *badguy)
+@@ -1053,7 +1097,11 @@
+       /* Get kicked if were flat */
+       if (mode == FLAT && !dying)
+       {
++#ifndef GP2X
+         play_sound(sounds[SND_KICK], SOUND_CENTER_SPEAKER);
++#else
++	play_chunk(SND_KICK);
++#endif
+ 
+         // Hit from left side
+         if (player->base.x < base.x) {
+diff -ur supertux-0.1.3/src/configfile.cpp supertux-0.1.3-gp2x/src/configfile.cpp
+--- supertux-0.1.3/src/configfile.cpp	2005-06-22 00:16:07.000000000 +0300
++++ supertux-0.1.3-gp2x/src/configfile.cpp	2006-04-10 13:32:19.000000000 +0300
+@@ -92,12 +92,22 @@
+   else
+     use_joystick = true;
+ 
++#ifndef GP2X
+   reader.read_int ("joystick-x", &joystick_keymap.x_axis);
+   reader.read_int ("joystick-y", &joystick_keymap.y_axis);
+   reader.read_int ("joystick-a", &joystick_keymap.a_button);
+   reader.read_int ("joystick-b", &joystick_keymap.b_button);
+   reader.read_int ("joystick-start", &joystick_keymap.start_button);
+   reader.read_int ("joystick-deadzone", &joystick_keymap.dead_zone);
++#else
++  reader.read_int ("joystick-up", &joystick_keymap.up_button);
++  reader.read_int ("joystick-down", &joystick_keymap.down_button);
++  reader.read_int ("joystick-right", &joystick_keymap.right_button);
++  reader.read_int ("joystick-left", &joystick_keymap.left_button);
++  reader.read_int ("joystick-a", &joystick_keymap.a_button);
++  reader.read_int ("joystick-b", &joystick_keymap.b_button);
++  reader.read_int ("joystick-start", &joystick_keymap.start_button);
++#endif
+ 
+   reader.read_int ("keyboard-jump", &keymap.jump);
+   reader.read_int ("keyboard-duck", &keymap.duck);
+@@ -130,12 +140,22 @@
+       fprintf(config, "\n\t;; joystick number (-1 means no joystick):\n");
+       fprintf(config, "\t(joystick   %d)\n", use_joystick ? joystick_num : -1);
+ 
++#ifndef GP2X
+       fprintf(config, "\t(joystick-x   %d)\n", joystick_keymap.x_axis);
+       fprintf(config, "\t(joystick-y   %d)\n", joystick_keymap.y_axis);
+       fprintf(config, "\t(joystick-a   %d)\n", joystick_keymap.a_button);
+       fprintf(config, "\t(joystick-b   %d)\n", joystick_keymap.b_button);
+       fprintf(config, "\t(joystick-start  %d)\n", joystick_keymap.start_button);
+       fprintf(config, "\t(joystick-deadzone  %d)\n", joystick_keymap.dead_zone);
++#else
++      fprintf(config, "\t(joystick-up   %d)\n", joystick_keymap.up_button);
++      fprintf(config, "\t(joystick-down   %d)\n", joystick_keymap.down_button);
++      fprintf(config, "\t(joystick-right   %d)\n", joystick_keymap.right_button);
++      fprintf(config, "\t(joystick-left   %d)\n", joystick_keymap.left_button);
++      fprintf(config, "\t(joystick-a   %d)\n", joystick_keymap.a_button);
++      fprintf(config, "\t(joystick-b   %d)\n", joystick_keymap.b_button);
++      fprintf(config, "\t(joystick-start  %d)\n", joystick_keymap.start_button);
++#endif
+ 
+       fprintf(config, "\t(keyboard-jump  %d)\n", keymap.jump);
+       fprintf(config, "\t(keyboard-duck  %d)\n", keymap.duck);
+diff -ur supertux-0.1.3/src/defines.h supertux-0.1.3-gp2x/src/defines.h
+--- supertux-0.1.3/src/defines.h	2005-07-07 02:05:03.000000000 +0300
++++ supertux-0.1.3-gp2x/src/defines.h	2006-04-11 22:02:05.000000000 +0300
+@@ -91,7 +91,11 @@
+ 
+ /* Scrolling text speed */
+ 
++#ifndef RES320X240
+ #define SCROLL_SPEED_CREDITS 1.2
++#else
++#define SCROLL_SPEED_CREDITS 2.4
++#endif
+ #define SCROLL_SPEED_MESSAGE 1.0
+ 
+ /* Debugging */
+Only in supertux-0.1.3/src: .deps
+diff -ur supertux-0.1.3/src/gameloop.cpp supertux-0.1.3-gp2x/src/gameloop.cpp
+--- supertux-0.1.3/src/gameloop.cpp	2005-07-02 15:16:08.000000000 +0300
++++ supertux-0.1.3-gp2x/src/gameloop.cpp	2006-05-05 23:22:58.000000000 +0300
+@@ -288,6 +288,7 @@
+   
+               switch(event.type)
+                 {
++#ifndef GP2X
+                 case SDL_QUIT:        /* Quit event - quit: */
+                   st_abort("Received window close", "");
+                   break;
+@@ -434,22 +435,60 @@
+                         tux.input.down = UP;
+                     }
+                   break;
+-            
++#endif            
+                 case SDL_JOYBUTTONDOWN:
++#ifndef GP2X
++                  if (event.jbutton.button == joystick_keymap.a_button)
++                    tux.input.up = DOWN;
++                  else if (event.jbutton.button == joystick_keymap.b_button)
++                    tux.input.fire = DOWN;
++                  else if (event.jbutton.button == joystick_keymap.start_button)
++                    on_escape_press();
++                  break;
++#else
+                   if (event.jbutton.button == joystick_keymap.a_button)
+                     tux.input.up = DOWN;
+                   else if (event.jbutton.button == joystick_keymap.b_button)
+                     tux.input.fire = DOWN;
+                   else if (event.jbutton.button == joystick_keymap.start_button)
+                     on_escape_press();
++                  else if (event.jbutton.button == joystick_keymap.up_button)
++                    tux.input.up = DOWN;
++                  else if (event.jbutton.button == joystick_keymap.down_button)
++                    tux.input.down = DOWN;
++                  else if (event.jbutton.button == joystick_keymap.right_button)
++                    tux.input.right = DOWN;
++                  else if (event.jbutton.button == joystick_keymap.left_button)
++                    tux.input.left = DOWN;
++                  else if (event.jbutton.button == joystick_keymap.voldown_button)
++		    decreaseSoundVolume();
++                  else if (event.jbutton.button == joystick_keymap.volup_button)
++		    increaseSoundVolume();
+                   break;
++#endif
++
+                 case SDL_JOYBUTTONUP:
++#ifndef GP2X
+                   if (event.jbutton.button == joystick_keymap.a_button)
+                     tux.input.up = UP;
+                   else if (event.jbutton.button == joystick_keymap.b_button)
+                     tux.input.fire = UP;
+                   break;
+-
++#else
++                  if (event.jbutton.button == joystick_keymap.a_button)
++                    tux.input.up = UP;
++                  else if (event.jbutton.button == joystick_keymap.b_button)
++                    tux.input.fire = UP;
++                  else if (event.jbutton.button == joystick_keymap.up_button)
++                    tux.input.up = UP;
++                  else if (event.jbutton.button == joystick_keymap.down_button)
++                    tux.input.down = UP;
++                  else if (event.jbutton.button == joystick_keymap.right_button)
++                    tux.input.right = UP;
++                  else if (event.jbutton.button == joystick_keymap.left_button)
++                    tux.input.left = UP;
++                  break;
++#endif
+                 default:
+                   break;
+                 }  /* switch */
+@@ -464,7 +503,7 @@
+   Player* tux = world->get_tux();
+ 
+   /* End of level? */
+-  int endpos = (World::current()->get_level()->width-5) * 32;
++  int endpos = (World::current()->get_level()->width-5) * (32);
+   Tile* endtile = collision_goal(tux->base);
+ 
+   // fallback in case the other endpositions don't trigger
+@@ -545,7 +584,7 @@
+       Menu::current()->draw();
+       mouse_cursor->draw();
+     }
+-
++  //updateSound();
+   updatescreen();
+ }
+ 
+@@ -599,6 +638,7 @@
+ 
+   while (exit_status == ES_NONE)
+     {
++      SDL_Delay(10);
+       /* Calculate the movement-factor */
+       double frame_ratio = ((double)(update_time-last_update_time))/((double)FRAME_RATE);
+ 
+@@ -686,6 +726,7 @@
+              %s
>>> DIFF TRUNCATED @ 16K






More information about the Openembedded-commits mailing list