diff --git a/alex4-fcommon-fix.patch b/alex4-fcommon-fix.patch new file mode 100644 index 0000000..5ef36b0 --- /dev/null +++ b/alex4-fcommon-fix.patch @@ -0,0 +1,177 @@ +diff -ur alex4src/src/bullet.c alex4src.nre/src/bullet.c +--- alex4src/src/bullet.c 2003-07-26 12:53:52.000000000 +0200 ++++ alex4src.nre/src/bullet.c 2020-02-14 16:55:54.227165835 +0100 +@@ -26,6 +26,8 @@ + #include "timer.h" + #include "../data/data.h" + ++// the bullets themselves ++Tbullet bullet[MAX_BULLETS]; + + // sets values on a bullet + void set_bullet(Tbullet *b, int x, int y, double dx, double dy, BITMAP *bmp, int bad) { +diff -ur alex4src/src/bullet.h alex4src.nre/src/bullet.h +--- alex4src/src/bullet.h 2020-02-14 20:21:00.557446660 +0100 ++++ alex4src.nre/src/bullet.h 2020-02-14 16:55:54.227165835 +0100 +@@ -42,7 +42,7 @@ + #define MAX_BULLETS 64 + + // the bullets themselves +-Tbullet bullet[MAX_BULLETS]; ++extern Tbullet bullet[MAX_BULLETS]; + + // functions + void reset_bullets(Tbullet *b, int max); +diff -ur alex4src/src/edit.c alex4src.nre/src/edit.c +--- alex4src/src/edit.c 2020-02-14 20:21:00.559446658 +0100 ++++ alex4src.nre/src/edit.c 2020-02-14 20:14:07.160857305 +0100 +@@ -33,8 +33,6 @@ + int edit_tile = 0; + // path to current map + char edit_path_and_file[1024]; +-// datafile to use +-DATAFILE *data; + // current edit mode + int edit_mode; + +diff -ur alex4src/src/main.h alex4src.nre/src/main.h +--- alex4src/src/main.h 2020-02-14 20:21:00.556446662 +0100 ++++ alex4src.nre/src/main.h 2020-02-14 20:13:57.681842152 +0100 +@@ -59,6 +59,7 @@ + #define SMPL_TALK 24 + #define SMPL_BEAM 25 + ++extern DATAFILE *data; + + // functions + char *get_init_string(); +diff -ur alex4src/src/particle.c alex4src.nre/src/particle.c +--- alex4src/src/particle.c 2003-07-26 12:53:52.000000000 +0200 ++++ alex4src.nre/src/particle.c 2020-02-14 20:17:53.166697996 +0100 +@@ -21,16 +21,11 @@ + + + ++#include "main.h" + #include "particle.h" + +-// pointer to datafile +-DATAFILE *data; +- +- +-// set datafile to use +-void set_datafile(DATAFILE *d) { +- data = d; +-} ++// the particles themselves ++Tparticle particle[MAX_PARTICLES]; + + + // inits variables in a particle +diff -ur alex4src/src/particle.h alex4src.nre/src/particle.h +--- alex4src/src/particle.h 2020-02-14 20:21:00.555446663 +0100 ++++ alex4src.nre/src/particle.h 2020-02-14 20:15:57.210817230 +0100 +@@ -42,10 +42,9 @@ + + + // the particles themselves +-Tparticle particle[MAX_PARTICLES]; ++extern Tparticle particle[MAX_PARTICLES]; + + // functions +-void set_datafile(DATAFILE *d); + void reset_particles(Tparticle *p, int max); + Tparticle *get_free_particle(Tparticle *p, int max); + void set_particle(Tparticle *p, int x, int y, double dx, double dy, int color, int life, int bmp); +diff -ur alex4src/src/player.c alex4src.nre/src/player.c +--- alex4src/src/player.c 2003-07-26 12:53:52.000000000 +0200 ++++ alex4src.nre/src/player.c 2020-02-14 16:55:54.229165835 +0100 +@@ -25,6 +25,9 @@ + #include "timer.h" + #include "../data/data.h" + ++// the player ++Tplayer player; ++ + // draws the player depending on his state + void draw_player(BITMAP *bmp, Tplayer *p, int x, int y) { + BITMAP *head, *body; +diff -ur alex4src/src/player.h alex4src.nre/src/player.h +--- alex4src/src/player.h 2020-02-14 20:21:00.554446664 +0100 ++++ alex4src.nre/src/player.h 2020-02-14 16:55:54.229165835 +0100 +@@ -53,7 +53,7 @@ + + + // the player +-Tplayer player; ++extern Tplayer player; + + // functions + void draw_player(BITMAP *bmp, Tplayer *p, int x, int y); +diff -ur alex4src/src/script.c alex4src.nre/src/script.c +--- alex4src/src/script.c 2020-02-14 20:21:00.560446657 +0100 ++++ alex4src.nre/src/script.c 2020-02-14 20:14:25.441886527 +0100 +@@ -33,9 +33,8 @@ + // silly value + #define NO_CHANGE -3249587 + +- +-// datafile to use +-DATAFILE *data; ++// array holding the sounds ids ++int active_sounds[MAX_SCRIPT_SOUNDS]; + // internal buffers + BITMAP *buffer; + BITMAP *swap_buffer; +diff -ur alex4src/src/script.h alex4src.nre/src/script.h +--- alex4src/src/script.h 2020-02-14 20:21:00.556446662 +0100 ++++ alex4src.nre/src/script.h 2020-02-14 16:55:54.230165835 +0100 +@@ -42,7 +42,7 @@ + // max number of sounds played by the script + #define MAX_SCRIPT_SOUNDS 16 + // array holding the sounds ids +-int active_sounds[MAX_SCRIPT_SOUNDS]; ++extern int active_sounds[MAX_SCRIPT_SOUNDS]; + + + // functions +diff -ur alex4src/src/timer.c alex4src.nre/src/timer.c +--- alex4src/src/timer.c 2020-02-14 20:21:00.557446660 +0100 ++++ alex4src.nre/src/timer.c 2020-02-14 16:55:54.226165836 +0100 +@@ -23,6 +23,14 @@ + #include "allegro.h" + #include "timer.h" + ++// the variables used by the timers ++volatile int frame_count; ++volatile int fps; ++volatile int logic_count; ++volatile int lps; ++volatile int cycle_count; ++volatile int game_count; ++ + // keeps track of frames each second + void fps_counter(void) { + fps = frame_count; +diff -ur alex4src/src/timer.h alex4src.nre/src/timer.h +--- alex4src/src/timer.h 2020-02-14 20:21:00.556446662 +0100 ++++ alex4src.nre/src/timer.h 2020-02-14 16:55:54.227165835 +0100 +@@ -24,12 +24,12 @@ + #define _TIMERS_H_ + + // the variables used by the timers +-volatile int frame_count; +-volatile int fps; +-volatile int logic_count; +-volatile int lps; +-volatile int cycle_count; +-volatile int game_count; ++extern volatile int frame_count; ++extern volatile int fps; ++extern volatile int logic_count; ++extern volatile int lps; ++extern volatile int cycle_count; ++extern volatile int game_count; + + + // functions diff --git a/alex4.spec b/alex4.spec index 0c23e69..c4746d5 100644 --- a/alex4.spec +++ b/alex4.spec @@ -1,6 +1,6 @@ Name: alex4 Version: 1.0 -Release: 31%{?dist} +Release: 32%{?dist} Summary: Alex the Allegator 4 - Platform game License: GPL+ URL: https://obiot.github.io/Alex4-WE/readme.html @@ -14,6 +14,7 @@ Patch2: alex4-dot-files-endian-clean.patch Patch3: alex4-fsf-address.patch Patch4: alex4-ini-comment.patch Patch5: alex4src-warnings.patch +Patch6: alex4-fcommon-fix.patch BuildRequires: gcc BuildRequires: allegro-devel dumb-devel desktop-file-utils libappstream-glib Requires: hicolor-icon-theme @@ -64,6 +65,9 @@ appstream-util validate-relax --nonet \ %changelog +* Fri Feb 14 2020 Hans de Goede - 1.0-32 +- Fix FTBFS (rhbz#1799146) + * Tue Jan 28 2020 Fedora Release Engineering - 1.0-31 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild diff --git a/alex4src-warnings.patch b/alex4src-warnings.patch index 2e73f64..66bf30d 100644 --- a/alex4src-warnings.patch +++ b/alex4src-warnings.patch @@ -1,6 +1,15 @@ diff -up alex4src/src/main.c~ alex4src/src/main.c --- alex4src/src/main.c~ 2017-09-08 12:11:48.000000000 +0200 +++ alex4src/src/main.c 2017-09-08 12:15:45.784592931 +0200 +@@ -452,7 +452,7 @@ void load_level_files(const char *filena + mode = 2; + } + else { +- char full_path_to_map[1024]; ++ char full_path_to_map[2048]; + + clear_trailing_whitespace(buf); + sprintf(full_path_to_map, "%s%s", path, buf); @@ -2579,7 +2579,7 @@ int get_string(BITMAP *bmp, char *string if (block == NULL) return 1;