From 0995476f61c8033bbc4fa3f9f75d399bc3315841 Mon Sep 17 00:00:00 2001
From: Owen <owenca@users.noreply.github.com>
Date: Thu, 21 Dec 2017 03:10:58 +0000
Subject: roadfighter: change settings directory to B_USER_SETTINGS_DIRECTORY

Fixes #1294

diff --git a/src/filehandling.cpp b/src/filehandling.cpp
index 5f5bfd8..284b1b9 100644
--- a/src/filehandling.cpp
+++ b/src/filehandling.cpp
@@ -1,5 +1,10 @@
 #include "filehandling.h"
 
+#ifdef __HAIKU__
+#include <FindDirectory.h>
+#include <Path.h>
+#endif
+
 #ifndef _WIN32
 // make (sub)directories including multiple subdirs
 int mkdirp(const char *fqfn, mode_t mode) {
@@ -42,13 +47,23 @@ FILE *f1open(const char *f, const char *m, const enum filetype t) {
       break;
 
     case USERDATA:
+#ifdef __HAIKU__
+    {
+      BPath path;
+      find_directory(B_USER_SETTINGS_DIRECTORY, &path);
+      snprintf(fname, STRLEN-1, "%s/%s/%s", path.Path(), GAMENAME, f);
+#else
       // userdata is put in $HOME/.GAMENAME/
       snprintf(fname, STRLEN-1, "%s/.%s/%s", getenv("HOME"), GAMENAME, f);
+#endif
       // create subdirs if they don't exist
       mkdirp(fname, S_IRWXU | S_IRGRP|S_IXGRP | S_IROTH|S_IXOTH);
       // open file
       return(fopen(fname, m));
       break;
+#ifdef __HAIKU__
+    }
+#endif
   }
 #endif
 
-- 
2.21.0


From f2f2016799d39072878e67428bd7c7452ab7a742 Mon Sep 17 00:00:00 2001
From: Owen <owenca@users.noreply.github.com>
Date: Fri, 19 Jan 2018 07:46:24 +0000
Subject: override LDFLAGS


diff --git a/build/linux/Makefile b/build/linux/Makefile
index 064c63d..9b7a383 100644
--- a/build/linux/Makefile
+++ b/build/linux/Makefile
@@ -38,7 +38,7 @@ OBJS = \
 
 CC = g++
 CFLAGS = -g3 -O3 `sdl-config --cflags` -I/usr/X11R6/include
-LDFLAGS = `sdl-config --libs` -L/usr/X11R6/lib/ -lSDL_image -lSDL_mixer -lSDL_sound -lSDL_ttf
+override LDFLAGS += `sdl-config --libs` -L/usr/X11R6/lib/ -lSDL_image -lSDL_mixer -lSDL_sound -lSDL_ttf
 RM = rm -f
 CP = cp -r
 MD = mkdir -p
-- 
2.21.0


From bfa0ea0660f2740a7028038099ec7fdbee3faf5a Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Sat, 27 Jul 2019 08:47:06 +0200
Subject: Fix build with gcc8


diff --git a/src/auxiliar.cpp b/src/auxiliar.cpp
index 11cac85..b311fbf 100644
--- a/src/auxiliar.cpp
+++ b/src/auxiliar.cpp
@@ -13,6 +13,11 @@
 #include "SDL_image.h"
 #include "SDL_ttf.h"
 
+#ifdef __HAIKU__
+typedef int boolean;
+#define HAVE_BOOLEAN
+#endif
+
 #include "auxiliar.h"
 #include "List.h"
 
@@ -84,7 +89,7 @@ SDL_Surface *load_maskedimage(char *imagefile,char *maskfile,char *path)
 	mask=IMG_Load(name);
 
     if (tmp==0 ||
-		mask==0) return false;
+		mask==0) return (boolean)false;
 
 	res=SDL_DisplayFormatAlpha(tmp);
 
-- 
2.21.0

