From 759bed096a304842f4ba3de290f19b6c3cd4bcc9 Mon Sep 17 00:00:00 2001 From: Julie Marchant Date: Wed, 3 Jul 2019 13:20:18 -0400 Subject: [PATCH] Removed the attempt at Windows API code. --- Makefile.am | 2 +- src/engine.c | 10 ++-------- win32build.sh | 7 +++++++ 3 files changed, 10 insertions(+), 9 deletions(-) create mode 100755 win32build.sh diff --git a/Makefile.am b/Makefile.am index 7dbe70b..8af005f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,7 +6,7 @@ SUBDIRS = src misc dist_doc_DATA = README.txt COPYING LICENSES -dist_data_DATA = data gfx music sound locale misc +dist_data_DATA = win32build.sh data gfx music sound locale misc if !RUN_IN_PLACE diff --git a/src/engine.c b/src/engine.c index fdf092e..bda4094 100644 --- a/src/engine.c +++ b/src/engine.c @@ -22,9 +22,7 @@ along with this program. If not, see . #include #include -#ifdef _WIN32 -#include -#else +#ifndef _WIN32 #include #endif @@ -203,11 +201,7 @@ void engine_setupConfigDirectory() char dir[PATH_MAX]; #ifdef _WIN32 - if (SHGetKnownFolderPath(FOLDERID_LocalAppData, KF_FLAG_CREATE, NULL, &userHome) != S_OK) - { - userHome = "."; - engine_warn("Could not get appdata location; using the current working directory instead."); - } + userHome = "."; #else if ((userHome = getenv("HOME")) == NULL) userHome = getpwuid(getuid())->pw_dir; diff --git a/win32build.sh b/win32build.sh new file mode 100755 index 0000000..2a1f1c3 --- /dev/null +++ b/win32build.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# Note: Before running, be sure to add the MXE usr/bin location to PATH + +export SF_RUN_IN_PLACE=1 +./configure --host=i686-w64-mingw32.static +make +mv src/starfighter.exe .