mirror of
https://github.com/yann64/haikuports.git
synced 2026-03-19 01:46:00 +01:00
airstrike: new recipe (#7044)
* airstrike: new recipe * airstrike: remove trailing whitespace
This commit is contained in:
BIN
games-arcade/airstrike/additional-files/airstrike
Normal file
BIN
games-arcade/airstrike/additional-files/airstrike
Normal file
Binary file not shown.
32
games-arcade/airstrike/additional-files/airstrike.rdef.in
Normal file
32
games-arcade/airstrike/additional-files/airstrike.rdef.in
Normal file
@@ -0,0 +1,32 @@
|
||||
resource app_flags B_SINGLE_LAUNCH | B_ARGV_ONLY;
|
||||
|
||||
resource app_version {
|
||||
major = @MAJOR@,
|
||||
middle = @MIDDLE@,
|
||||
minor = @MINOR@,
|
||||
|
||||
variety = B_APPV_FINAL,
|
||||
internal = 0,
|
||||
|
||||
short_info = "@SHORT_INFO@",
|
||||
long_info = "@LONG_INFO@"
|
||||
};
|
||||
|
||||
resource app_signature "application/x-vnd.airstrike";
|
||||
|
||||
resource vector_icon {
|
||||
$"6E636966040201040270D74B4B93A20404020104022CE9D0D0FF897E7E020204"
|
||||
$"02767F4C00FFBC7F2802000402007E6136FF5E38020402044030C34530BC3A30"
|
||||
$"304030BC3A30C3454050BC3A50C34550504050C34550BC3A0607B23334504847"
|
||||
$"594953C205CB44445D3E5D445D3A5D383558375D33530A042747275126512647"
|
||||
$"0606B20C224828294929C2F629C3B5284A222149214A21480C0A03010202C0DB"
|
||||
$"0BBE01CEBCB26B4049254C0AE9C00C840A030102024000000000000000003ECC"
|
||||
$"CC48A0004816660A0001000240BA0000000000000040BA00C6FC00C8AE000A01"
|
||||
$"010002405E0000000000000040C600C51800C8C5FF0A00010002400000000000"
|
||||
$"00000040BC00000000C8BC000A010100023E700000000000000040C600474800"
|
||||
$"C8C6000A000100023C700000000000000040C40048E000C8C0000A0301020240"
|
||||
$"D0BCBE424D3E213E40A789C6E569C66A120A0201012021230A0301020240E772"
|
||||
$"38ED25B737D83F3194496FCF46D5570A030101124000000000000000003FBBBB"
|
||||
$"4000004511110215810004178100040A03010302434000000000000000410000"
|
||||
$"47B000C6C000"
|
||||
};
|
||||
74
games-arcade/airstrike/airstrike-0.99.6.recipe
Normal file
74
games-arcade/airstrike/airstrike-0.99.6.recipe
Normal file
@@ -0,0 +1,74 @@
|
||||
SUMMARY="2D dogfighting game"
|
||||
DESCRIPTION="Airstrike is a 2d dogfighting game which can be played by one or two persons.\
|
||||
Features include alpha blended graphics and accurate physics."
|
||||
HOMEPAGE="http://icculus.org/airstrike/"
|
||||
COPYRIGHT="2001-2003 Ulf Ekström and contributors"
|
||||
LICENSE="GNU GPL v2"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://github.com/tommybee/Airstrike/archive/ddb52b072c5a1af3bd51088526575290a8c9d27b.zip"
|
||||
CHECKSUM_SHA256="534aab3a7dcb5d075e4de861bfa936d242b3badee33b56bb975d15f542fc3681"
|
||||
SOURCE_DIR="Airstrike-ddb52b072c5a1af3bd51088526575290a8c9d27b"
|
||||
PATCHES="airstrike-$portVersion.patchset"
|
||||
ADDITIONAL_FILES="airstrike.rdef.in"
|
||||
|
||||
ARCHITECTURES="all !x86_gcc2"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
PROVIDES="
|
||||
airstrike$secondaryArchSuffix = $portVersion
|
||||
app:Airstrike = $portVersion
|
||||
"
|
||||
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
lib:libSDL_1.2$secondaryArchSuffix
|
||||
lib:libSDL_mixer_1.2$secondaryArchSuffix
|
||||
lib:libSDL_image_1.2$secondaryArchSuffix
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
devel:libSDL_1.2$secondaryArchSuffix
|
||||
devel:libSDL_mixer_1.2$secondaryArchSuffix
|
||||
devel:libSDL_image_1.2$secondaryArchSuffix
|
||||
"
|
||||
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:find
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:make
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
make clean
|
||||
make $jobArgs airstrike-sound
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
# prepare the rdef file
|
||||
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
|
||||
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
|
||||
local MINOR="`echo "$portVersion" | cut -d. -f3 | cut -dp -f1`"
|
||||
local SHORT_INFO="$SUMMARY"
|
||||
local LONG_INFO="$SUMMARY"
|
||||
|
||||
sed \
|
||||
-e "s|@MAJOR@|$MAJOR|" \
|
||||
-e "s|@MIDDLE@|$MIDDLE|" \
|
||||
-e "s|@MINOR@|$MINOR|" \
|
||||
-e "s|@SHORT_INFO@|$SHORT_INFO|" \
|
||||
-e "s|@LONG_INFO@|$LONG_INFO|" \
|
||||
$portDir/additional-files/airstrike.rdef.in > $portDir/airstrike.rdef
|
||||
|
||||
mkdir -p $appsDir
|
||||
mkdir -p $dataDir
|
||||
|
||||
cp -r data $dataDir/airstrike
|
||||
cp airstrikerc $dataDir/airstrike/
|
||||
cp airstrike $appsDir/Airstrike
|
||||
addResourcesToBinaries $portDir/airstrike.rdef $appsDir/Airstrike
|
||||
addAppDeskbarSymlink $appsDir/Airstrike
|
||||
|
||||
}
|
||||
279
games-arcade/airstrike/patches/airstrike-0.99.6.patchset
Normal file
279
games-arcade/airstrike/patches/airstrike-0.99.6.patchset
Normal file
@@ -0,0 +1,279 @@
|
||||
From d29fd19d5b7b22c21741b9d63155ac62f5916092 Mon Sep 17 00:00:00 2001
|
||||
From: Victor Gamper <victor@wenzeslaus.de>
|
||||
Date: Fri, 8 Jul 2022 03:50:46 +0200
|
||||
Subject: Cleaned up the makefile to work again
|
||||
|
||||
|
||||
diff --git a/src/Makefile b/src/Makefile
|
||||
index 78dd5d4..20cf761 100644
|
||||
--- a/src/Makefile
|
||||
+++ b/src/Makefile
|
||||
@@ -1,25 +1,16 @@
|
||||
-SDL_LIBS = -static -L/mingw32/lib -lSDL_gfx -lSDL_image -lSDL_mixer -L/mingw32/lib -lvorbisfile -lvorbis -lmingw32 -lSDLmain -lSDL \
|
||||
- -lbz2 -lharfbuzz -lglib-2.0 -lintl -liconv -ltiff -ljpeg -llzma -lpng16 -lstdc++ -lwebp -lwinpthread -lz -larchive -lwinmm -lgdi32 -ldxguid \
|
||||
- -lasprintf -lcharset -lcrypto -lcurl -lexpat -lffi -lFLAC++ -lFLAC -lfontconfig -lformw -lfreeglut_static -lgdbm -lgettextlib -lgettextpo -lgif \
|
||||
- -lgio-2.0 -lglew32 -lglew32mx -lgmodule-2.0 -lgmp -lgmpxx -lgnurx -lgnutls -lgnutlsxx -lgobject-2.0 -lgthread-2.0 -lhistory -lhogweed -lidn -lisl -ljansson \
|
||||
- -ljsoncpp -llua -llzo2 -lmenuw -lmetalink -lminizip -lmpc -lmpfr -lncurses++w -lncursesw -lnettle -lnghttp2 -logg -lopenal -lpanelw -lphysfs -lpixman-1 \
|
||||
- -lreadline -lregex -lrtmp -lssh2 -lssl -lsystre -ltasn1 -ltclstub86 -ltermcap -ltheora -ltheoradec -ltheoraenc \
|
||||
- -ltkstub86 -ltre -lturbojpeg -lvorbisenc -lwebpdecoder -lwebpdemux -lwebpmux -lole32 -lws2_32 -mwindows
|
||||
-
|
||||
CFLAGS:= -g -O2 -Wall -Wno-unused $(OPTIONS)
|
||||
|
||||
CFLAGS += $(shell sdl-config --cflags) -Isprite -I. -Isupport -DINLINE=inline
|
||||
-CFLAGS += -DLINUX
|
||||
CFILES:= $(shell find . -name '*.c')
|
||||
OBJECTS:= $(CFILES:.c=.o)
|
||||
|
||||
airstrike: $(OBJECTS)
|
||||
-# $(CC) -o $@ $(CFLAGS) $(OBJECTS) `sdl-config --libs` -lSDL_image
|
||||
- $(CC) -o $@ $(CFLAGS) $(OBJECTS) $(SDL_LIBS)
|
||||
+ $(CC) -o $@ $(CFLAGS) $(OBJECTS) `sdl-config --libs` -lSDL_image
|
||||
+# $(CC) -o $@ $(CFLAGS) $(OBJECTS) $(SDL_LIBS)
|
||||
|
||||
airstrike-sound: $(OBJECTS)
|
||||
-# $(CC) -o $@ $(CFLAGS) $(OBJECTS) `sdl-config --libs` -lSDL_image -lSDL_mixer
|
||||
- $(CC) -o $@ $(CFLAGS) $(OBJECTS) $(SDL_LIBS)
|
||||
+ $(CC) -o $@ $(CFLAGS) $(OBJECTS) `sdl-config --libs` -lSDL_image -lSDL_mixer
|
||||
+# $(CC) -o $@ $(CFLAGS) $(OBJECTS) $(SDL_LIBS)
|
||||
|
||||
# Use the rule below when coding new sprite types
|
||||
#sprites_autogen.h: sprite_types/*.c
|
||||
--
|
||||
2.36.1
|
||||
|
||||
|
||||
From ea638c5b9832e796881fca6d183aa130665ed517 Mon Sep 17 00:00:00 2001
|
||||
From: Victor Gamper <victor@wenzeslaus.de>
|
||||
Date: Fri, 8 Jul 2022 17:30:23 +0200
|
||||
Subject: use the correct paths for Haiku
|
||||
|
||||
|
||||
diff --git a/src/airstrike.c b/src/airstrike.c
|
||||
index 20753f6..652d713 100644
|
||||
--- a/src/airstrike.c
|
||||
+++ b/src/airstrike.c
|
||||
@@ -5,6 +5,11 @@
|
||||
#pragma comment(lib, "SDL_image.lib")
|
||||
#endif
|
||||
|
||||
+#ifdef __HAIKU__
|
||||
+#include <FindDirectory.h>
|
||||
+#include <fs_info.h>
|
||||
+#endif
|
||||
+
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
@@ -35,6 +40,9 @@ static int frame_time_i = 0;
|
||||
static int screen_w;
|
||||
static int screen_h;
|
||||
|
||||
+char* airstrikerc;
|
||||
+char* airstrikerc_user;
|
||||
+char* dataDir;
|
||||
|
||||
static void atexit_cleanup(void)
|
||||
{
|
||||
@@ -81,7 +89,7 @@ static int general_setup(void)
|
||||
console_set_pos(9,254);
|
||||
console_load_bg(path_to_data("console-bg.png"));
|
||||
sprite_types_setup();
|
||||
- sprite_background_load("data/bg.png","data/bgmask.png");
|
||||
+ sprite_background_load(path_to_data("bg.png"), path_to_data("bgmask.png"));
|
||||
|
||||
level_setup();
|
||||
winds_setup();
|
||||
@@ -657,6 +665,26 @@ void saveanimframe()
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
+#ifdef __HAIKU__
|
||||
+ dev_t vol = dev_for_path("/boot");
|
||||
+ int fLen = sizeof("airstrikerc");
|
||||
+ char buf[B_PATH_NAME_LENGTH + B_FILE_NAME_LENGTH];
|
||||
+ find_directory(B_SYSTEM_DATA_DIRECTORY, vol, false, buf, sizeof(buf));strcat(buf, "/airstrike");
|
||||
+ dataDir = malloc(strlen(buf));
|
||||
+ strcpy(dataDir, buf);
|
||||
+ airstrikerc = malloc(strlen(buf) + fLen);
|
||||
+ strcpy(airstrikerc, buf);
|
||||
+ strcat(airstrikerc, "/airstrikerc");
|
||||
+ find_directory(B_USER_SETTINGS_DIRECTORY, vol, false, buf, sizeof(buf));
|
||||
+ strcat(buf, "/airstrikerc");
|
||||
+ airstrikerc_user = malloc(strlen(buf));
|
||||
+ strcpy(airstrikerc_user, buf);
|
||||
+#else
|
||||
+ dataDir = "data";
|
||||
+ airstrikerc = "data/airstrikerc";
|
||||
+ airstrikerc_user = ".airstrikerc";
|
||||
+#endif
|
||||
+
|
||||
int res;
|
||||
if (argc > 1)
|
||||
{
|
||||
diff --git a/src/airstrike.h b/src/airstrike.h
|
||||
index 3b64275..115789f 100644
|
||||
--- a/src/airstrike.h
|
||||
+++ b/src/airstrike.h
|
||||
@@ -18,5 +18,8 @@ extern char *p2_name;
|
||||
extern controller_t *p1_controller;
|
||||
extern controller_t *p2_controller;
|
||||
|
||||
+extern char* airstrikerc;
|
||||
+extern char* airstrikerc_user;
|
||||
+extern char* dataDir;
|
||||
|
||||
#endif
|
||||
diff --git a/src/config.c b/src/config.c
|
||||
index 1abbad0..4cf0320 100644
|
||||
--- a/src/config.c
|
||||
+++ b/src/config.c
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <SDL.h>
|
||||
+#include "airstrike.h"
|
||||
#include "config.h"
|
||||
#include "names.h"
|
||||
|
||||
@@ -10,9 +11,10 @@ static char *datapath;
|
||||
int config_setup()
|
||||
{
|
||||
FILE *cfile;
|
||||
- char cbuf[1024]; /* stupid, really */
|
||||
+ char cbuf[2048]; /* stupid, really */
|
||||
int got_file = 0;
|
||||
- cfile = fopen(ROOT_CONFIG_FILE,"r");
|
||||
+ sprintf(cbuf,"%s",airstrikerc);
|
||||
+ cfile = fopen(cbuf,"r");
|
||||
if (cfile)
|
||||
{
|
||||
nread_str(&config_user,cfile);
|
||||
@@ -21,7 +23,11 @@ int config_setup()
|
||||
}
|
||||
if (getenv("HOME"))
|
||||
{
|
||||
- sprintf(cbuf,"%s/%s",getenv("HOME"),USER_CONFIG_FILE);
|
||||
+#ifdef __HAIKU__
|
||||
+ sprintf(cbuf,"%s",airstrikerc_user);
|
||||
+#else
|
||||
+ sprintf(cbuf,"%s/%s",getenv("HOME"),USER_CONFIG_FILE);
|
||||
+#endif
|
||||
cfile = fopen(cbuf,"r");
|
||||
if (cfile)
|
||||
{
|
||||
@@ -35,12 +41,17 @@ int config_setup()
|
||||
fprintf(stderr,"Looked for config files at '%s' and '$HOME/%s', but could not find any. Quitting.\n",ROOT_CONFIG_FILE,USER_CONFIG_FILE);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
+
|
||||
+#ifdef __HAIKU__
|
||||
+ datapath = dataDir;
|
||||
+#else
|
||||
datapath = cfgstr("datapath",0);
|
||||
if (!datapath)
|
||||
{
|
||||
fprintf(stderr,"Cannot find datapath in config files. Quitting.\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
+#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
--
|
||||
2.36.1
|
||||
|
||||
|
||||
From fcefe4cfa6f6238eb1a27ca78f8bcc5ea8a11ad0 Mon Sep 17 00:00:00 2001
|
||||
From: Victor Gamper <victor@wenzeslaus.de>
|
||||
Date: Fri, 8 Jul 2022 20:39:07 +0200
|
||||
Subject: airstrike: fix bombs
|
||||
|
||||
|
||||
diff --git a/src/sprite_types/biplane.c b/src/sprite_types/biplane.c
|
||||
index a23b589..40481e7 100644
|
||||
--- a/src/sprite_types/biplane.c
|
||||
+++ b/src/sprite_types/biplane.c
|
||||
@@ -203,8 +203,9 @@ static void sigget(sprite_t *s, int signal, void *data)
|
||||
break;
|
||||
case SIGNAL_NUM0: /* create bomb */
|
||||
if (sprite_timer_finished(((struct biplane*)s)->bomb_timer) &&
|
||||
- (!(s->state & BIPLANE_CRASHING)))
|
||||
+ (!(s->state & BIPLANE_CRASHING)) && (((struct biplane*)s)->nr_bombs > 0))
|
||||
{
|
||||
+ ((struct biplane*)s)->nr_bombs--;
|
||||
p = sprite_create(&bomb);
|
||||
p->anim_p = s->anim_p;
|
||||
((mech_sprite_t *)p)->angle = ((mech_sprite_t *)s)->angle;
|
||||
--
|
||||
2.36.1
|
||||
|
||||
|
||||
From 2e3478015559fc380d48b8265ababc79225424d9 Mon Sep 17 00:00:00 2001
|
||||
From: Victor Gamper <victor@wenzeslaus.de>
|
||||
Date: Fri, 8 Jul 2022 20:45:31 +0200
|
||||
Subject: airstrike: fix for x86-64
|
||||
|
||||
This is pretty much copied from debian
|
||||
SEE: https://sources.debian.org/patches/airstrike/0.99+1.0pre6a-10/fix-unusable-on-amd64.patch/
|
||||
|
||||
diff --git a/src/mech.c b/src/mech.c
|
||||
index 2010088..fe83335 100644
|
||||
--- a/src/mech.c
|
||||
+++ b/src/mech.c
|
||||
@@ -335,11 +335,10 @@ void mech_sprite_collide(sprite_t *s1, sprite_t *s2, int x, int y)
|
||||
n[2]*((mech_sprite_t *)s1)->ang_vel +
|
||||
n[3]*((mech_sprite_t *)s2)->ang_vel;
|
||||
|
||||
- if (a > 0)
|
||||
- {
|
||||
- b = n[0]*delta[0] + n[1]*delta[1] + n[2]*delta[2]
|
||||
+ b = n[0]*delta[0] + n[1]*delta[1] + n[2]*delta[2]
|
||||
- n[0]*delta[3] - n[1]*delta[4] + n[3]*delta[5];
|
||||
-
|
||||
+ if ( (a > 0) && (abs(b) > 0) )
|
||||
+ {
|
||||
c = -1.4*a/b;
|
||||
|
||||
s1->vel[0] += c*delta[0];
|
||||
@@ -479,10 +478,9 @@ void mech_sprite_bg_collide(sprite_t *s1, int x, int y)
|
||||
a = n[0]*s1->vel[0] + n[1]*s1->vel[1] +
|
||||
n[2]*((mech_sprite_t *)s1)->ang_vel;
|
||||
|
||||
- if (a > 0)
|
||||
+ b = n[0]*delta[0] + n[1]*delta[1] + n[2]*delta[2];
|
||||
+ if ( (a > 0) && (abs(b) > 0) )
|
||||
{
|
||||
- b = n[0]*delta[0] + n[1]*delta[1] + n[2]*delta[2];
|
||||
-
|
||||
c = -1.2*a/b;
|
||||
|
||||
s1->vel[0] += c*delta[0];
|
||||
--
|
||||
2.36.1
|
||||
|
||||
|
||||
From ae63790c6851a79ed211fbabfaec1531264f1b34 Mon Sep 17 00:00:00 2001
|
||||
From: Victor Gamper <victor@wenzeslaus.de>
|
||||
Date: Fri, 8 Jul 2022 21:29:17 +0200
|
||||
Subject: airstrike: fix physics
|
||||
|
||||
|
||||
diff --git a/src/airstrike.c b/src/airstrike.c
|
||||
index 652d713..ea67017 100644
|
||||
--- a/src/airstrike.c
|
||||
+++ b/src/airstrike.c
|
||||
@@ -89,7 +89,10 @@ static int general_setup(void)
|
||||
console_set_pos(9,254);
|
||||
console_load_bg(path_to_data("console-bg.png"));
|
||||
sprite_types_setup();
|
||||
- sprite_background_load(path_to_data("bg.png"), path_to_data("bgmask.png"));
|
||||
+ char* tmp = path_to_data("bgmask.png");
|
||||
+ char bgmask[strlen(tmp)];
|
||||
+ strcpy(bgmask, tmp);
|
||||
+ sprite_background_load(path_to_data("bg.png"), bgmask);
|
||||
|
||||
level_setup();
|
||||
winds_setup();
|
||||
--
|
||||
2.36.1
|
||||
|
||||
Reference in New Issue
Block a user