[abe] 20/30: Rebase all patches
Markus Koschany
apo at moszumanska.debian.org
Sat Jun 11 10:41:25 UTC 2016
This is an automated email from the git hooks/post-receive script.
apo pushed a commit to branch master
in repository abe.
commit 8fb51b2088262d3f6242a91c689a807dbcae918f
Author: Markus Koschany <apo at debian.org>
Date: Sat Jun 11 11:08:48 2016 +0200
Rebase all patches
---
debian/patches/01-resolutions.patch | 87 +++++++++++++++++++++++++++++++
debian/patches/02-enter-keys.patch | 60 ++++++++++++++++++++++
debian/patches/03-truncate-menu.patch | 20 ++++++++
debian/patches/04-default-reso.patch | 29 +++++++++++
debian/patches/05-cheat.patch | 96 +++++++++++++++++++++++++++++++++++
debian/patches/series | 5 ++
6 files changed, 297 insertions(+)
diff --git a/debian/patches/01-resolutions.patch b/debian/patches/01-resolutions.patch
new file mode 100644
index 0000000..362e76c
--- /dev/null
+++ b/debian/patches/01-resolutions.patch
@@ -0,0 +1,87 @@
+From: Bart Martens <bartm at debian.org>
+Date: Sat, 11 Jun 2016 10:52:04 +0200
+Subject: 01 resolutions
+
+---
+ src/Main.c | 54 +++++++++++++++---------------------------------------
+ 1 file changed, 15 insertions(+), 39 deletions(-)
+
+diff --git a/src/Main.c b/src/Main.c
+index 2520856..894c519 100644
+--- a/src/Main.c
++++ b/src/Main.c
+@@ -84,7 +84,9 @@ int
+ main(int argc, char *argv[])
+ {
+ Uint32 flags = SDL_DOUBLEBUF;
+- int i;
++ int i, j;
++ static int available_resolution_width [] = { 320, 320, 640, 640, 800, 1024, 1280, 1600, 1280, 1280, 1440, 1400, 0 };
++ static int available_resolution_height[] = { 200, 240, 400, 480, 600, 768, 1024, 1200, 768, 800, 900, 1050, 0 };
+ int w, h, bpp, n;
+ int hw_mem = 1;
+ int intro = 0;
+@@ -129,43 +131,13 @@ main(int argc, char *argv[])
+ runmode = RUNMODE_GAME;
+ } else if(!strcmp(argv[i], "--size") && i < argc - 1) {
+ n = atoi(argv[i + 1]);
+- switch (n) {
+- case 0:
+- w = 320;
+- h = 200;
+- break;
+- case 1:
+- w = 320;
+- h = 240;
+- break;
+- case 2:
+- w = 640;
+- h = 400;
+- break;
+- case 3:
+- w = 640;
+- h = 480;
+- break;
+- case 4:
+- w = 800;
+- h = 600;
+- break;
+- case 5:
+- w = 1024;
+- h = 768;
+- break;
+- case 6:
+- w = 1280;
+- h = 1024;
+- break;
+- case 7:
+- w = 1600;
+- h = 1200;
+- break;
+- default:
+- w = 640;
+- h = 480;
+- }
++ for( j = 0 ; available_resolution_width[j] != 0 ; j++ )
++ if( j == n )
++ {
++ w = available_resolution_width[j];
++ h = available_resolution_height[j];
++ break;
++ }
+ } else if((!strcmp(argv[i], "--bpp") || !strcmp(argv[i], "-b"))
+ && i < argc - 1) {
+ n = atoi(argv[i + 1]);
+@@ -191,7 +163,11 @@ main(int argc, char *argv[])
+ printf
+ ("--size # Use this width/height for the video mode.\n");
+ printf
+- ("\tModes: 0-320/200 1-320/240 2-640/400 3-640/480 4-800/600 5-1024/768 6-1280/1024 7-1600/1200\n");
++ ("\tModes:\n");
++ for( j = 0 ; available_resolution_width[j] != 0 ; j++ )
++ printf( "\t %2d: %4d/%4d (%1.2f)\n", j,
++ available_resolution_width[j], available_resolution_height[j],
++ (float)available_resolution_width[j] / (float)available_resolution_height[j] );
+ printf("-b --bpp # Use this bpp for the video mode.\n");
+ printf("--nosound Don't use sound.\n");
+ printf("-? -h --help Show this help message.\n");
diff --git a/debian/patches/02-enter-keys.patch b/debian/patches/02-enter-keys.patch
new file mode 100644
index 0000000..be36901
--- /dev/null
+++ b/debian/patches/02-enter-keys.patch
@@ -0,0 +1,60 @@
+From: Bart Martens <bartm at debian.org>
+Date: Sat, 11 Jun 2016 10:52:24 +0200
+Subject: 02 enter keys
+
+Fixes the return/enter key on some keyboards
+---
+ src/Editor.c | 1 +
+ src/Game.c | 1 +
+ src/Icons.c | 1 +
+ src/Splash.c | 1 +
+ 4 files changed, 4 insertions(+)
+
+diff --git a/src/Editor.c b/src/Editor.c
+index 845e35b..1a73d43 100644
+--- a/src/Editor.c
++++ b/src/Editor.c
+@@ -298,6 +298,7 @@ editorMainLoop(SDL_Event * event)
+ cursor.dir = DIR_NONE;
+ map.redraw = 1;
+ break;
++ case SDLK_KP_ENTER:
+ case SDLK_RETURN:
+ setImage(edit_panel.level, edit_panel.image_index);
+ break;
+diff --git a/src/Game.c b/src/Game.c
+index 8d9532e..a5cbcb1 100644
+--- a/src/Game.c
++++ b/src/Game.c
+@@ -386,6 +386,7 @@ gameMainLoop(SDL_Event * event)
+ game.keys++;
+ break;
+ #endif
++ case SDLK_KP_ENTER:
+ case SDLK_RETURN:
+ if(!game.end_game) {
+ if(!game.balloonTimer && game.balloons) {
+diff --git a/src/Icons.c b/src/Icons.c
+index 29f7303..9eaea45 100644
+--- a/src/Icons.c
++++ b/src/Icons.c
+@@ -99,6 +99,7 @@ selectIcon()
+ icon_selection = -1;
+ goto escape;
+ case SDLK_SPACE:
++ case SDLK_KP_ENTER:
+ case SDLK_RETURN:
+ goto escape;
+ case SDLK_LEFT:
+diff --git a/src/Splash.c b/src/Splash.c
+index 6b3e7d1..d6605ac 100644
+--- a/src/Splash.c
++++ b/src/Splash.c
+@@ -40,6 +40,7 @@ splashMainLoop(SDL_Event * event)
+ if(menu_y < 0)
+ menu_y = FONT_HEIGHT * (GOD_MODE ? 4 : 3);
+ break;
++ case SDLK_KP_ENTER:
+ case SDLK_RETURN:
+ case SDLK_SPACE:
+ map.quit = 1;
diff --git a/debian/patches/03-truncate-menu.patch b/debian/patches/03-truncate-menu.patch
new file mode 100644
index 0000000..ea38e6e
--- /dev/null
+++ b/debian/patches/03-truncate-menu.patch
@@ -0,0 +1,20 @@
+From: Bart Martens <bartm at debian.org>
+Date: Sat, 11 Jun 2016 10:52:47 +0200
+Subject: 03 truncate menu
+
+---
+ src/Menu.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/Menu.c b/src/Menu.c
+index 87066cc..7575b37 100644
+--- a/src/Menu.c
++++ b/src/Menu.c
+@@ -21,6 +21,7 @@ SettingEntry entries[] = {
+ {"audio", 0, {""}, 0},
+ {"sound", 2, {"on", "off"}, 0},
+ {"music", 2, {"on", "off"}, 0},
++ {"", 0, {""}, 0}, // truncates the menu here
+ {"video", 0, {""}, 0},
+ {"full screen", 2, {"on", "off"}, 0},
+ {"background", 2, {"on", "off"}, 0},
diff --git a/debian/patches/04-default-reso.patch b/debian/patches/04-default-reso.patch
new file mode 100644
index 0000000..024f30e
--- /dev/null
+++ b/debian/patches/04-default-reso.patch
@@ -0,0 +1,29 @@
+From: Bart Martens <bartm at debian.org>
+Date: Sat, 11 Jun 2016 10:53:49 +0200
+Subject: 04 default reso
+
+---
+ src/Main.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/src/Main.c b/src/Main.c
+index 894c519..5e06db3 100644
+--- a/src/Main.c
++++ b/src/Main.c
+@@ -115,6 +115,16 @@ main(int argc, char *argv[])
+
+ atexit(SDL_Quit);
+
++ SDL_VideoInfo *vid_info;
++ vid_info = (SDL_VideoInfo*) SDL_GetVideoInfo ();
++ if( vid_info )
++ if( vid_info->current_w == 1440 && vid_info->current_h ==900
++ || vid_info->current_w == 1400 && vid_info->current_h ==1050 )
++ {
++ w = vid_info->current_w;
++ h = vid_info->current_h;
++ }
++
+ for(i = 0; i < argc; i++) {
+ if(!strcmp(argv[i], "--window")) {
+ mainstruct.full_screen = 0;
diff --git a/debian/patches/05-cheat.patch b/debian/patches/05-cheat.patch
new file mode 100644
index 0000000..7a5b344
--- /dev/null
+++ b/debian/patches/05-cheat.patch
@@ -0,0 +1,96 @@
+From: Bart Martens <bartm at debian.org>
+Date: Sat, 11 Jun 2016 10:54:35 +0200
+Subject: 05 cheat
+
+---
+ src/Game.c | 19 ++++++++++++++++++-
+ src/Game.h | 1 +
+ 2 files changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/src/Game.c b/src/Game.c
+index a5cbcb1..74002c7 100644
+--- a/src/Game.c
++++ b/src/Game.c
+@@ -3,6 +3,7 @@
+ #include <string.h>
+
+ Game game;
++static int cheat = 0; // 0=no, 1=yes
+
+ // path_sprintf should not be used by other .c files, as it does not fit for them.
+ static void
+@@ -381,6 +382,17 @@ gameMainLoop(SDL_Event * event)
+ case SDLK_d:
+ debugMonsters();
+ break;
++ case SDLK_c:
++ if( event->key.keysym.mod & ( KMOD_CTRL | KMOD_SHIFT | KMOD_ALT ) && getenv( "ABE_IS_CHEATING" ) )
++ cheat = 1 - cheat;
++ if( cheat )
++ {
++ game.lives = MAX_LIVES;
++ game.keys = MAX_KEYS;
++ game.balloons = MAX_BALLOONS;
++ game.health = MAX_HEALTH;
++ }
++ break;
+ #if GOD_MODE
+ case SDLK_k:
+ game.keys++;
+@@ -391,6 +403,7 @@ gameMainLoop(SDL_Event * event)
+ if(!game.end_game) {
+ if(!game.balloonTimer && game.balloons) {
+ playSound(BUBBLE_SOUND);
++ if( ! cheat )
+ game.balloons--;
+ game.balloonTimer = BALLOON_RIDE_INTERVAL;
+ map.gravity = 0;
+@@ -457,9 +470,11 @@ handleDeath(LiveMonster * live)
+
+ if(live) {
+ showMapStatus(live->monster->name);
++ if( ! cheat )
+ game.health -= (live->monster->damage * (game.difficoulty + 1));
+ } else {
+ showMapStatus("drowning!");
++ if( ! cheat )
+ game.health--; // water damage
+ show_effect = !(game.tick % 40);
+ }
+@@ -490,6 +505,7 @@ handleDeath(LiveMonster * live)
+ if(game.god_mode)
+ return;
+
++ if( ! cheat )
+ game.lives--;
+
+ // Flash player. Don't move monsters during this.
+@@ -692,6 +708,7 @@ detectCollision(int dir)
+ EMPTY_MAP;
+ map.image_index[LEVEL_FORE][key.pos_x + (key.pos_y * map.w)] =
+ img_door2;
++ if( ! cheat )
+ game.keys--;
+ map.redraw = 1;
+ // always return 0 (block) so we don't fall into a door and get stuck there... (was a nasty bug)
+@@ -772,7 +789,7 @@ runMap()
+ game.player_start_y = 28;
+ }
+
+- game.lives = 5;
++ game.lives = MAX_LIVES;
+ game.score = 0;
+ game.keys = 0;
+ game.balloons = 0;
+diff --git a/src/Game.h b/src/Game.h
+index aa61e51..84c1b03 100644
+--- a/src/Game.h
++++ b/src/Game.h
+@@ -20,6 +20,7 @@
+
+ #define SPRING_JUMP 30
+
++#define MAX_LIVES 5
+ #define MAX_HEALTH 100
+
+ // don't hold more than these... mainly b/c the gui can't handle it
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..0c3fdbe
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,5 @@
+01-resolutions.patch
+02-enter-keys.patch
+03-truncate-menu.patch
+04-default-reso.patch
+05-cheat.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/abe.git
More information about the Pkg-games-commits
mailing list