Removed the "LINUX" definition.
This is silly. The libraries used have absolutely nothing to do with "Linux". They're POSIX standard libraries, and will work just as well on Mac OS X and BSD. The actual code might need to be replaced, but in any case, this isn't something to limit to "Linux" systems.
This commit is contained in:
parent
1834011314
commit
ea33be4591
2
Makefile
2
Makefile
|
@ -1,5 +1,5 @@
|
||||||
CXXFLAGS ?= -O2 -Wall -g
|
CXXFLAGS ?= -O2 -Wall -g
|
||||||
CXXFLAGS += `pkg-config --cflags sdl2 SDL2_image SDL2_mixer` -DLINUX
|
CXXFLAGS += `pkg-config --cflags sdl2 SDL2_image SDL2_mixer`
|
||||||
LIBS = `pkg-config --libs sdl2 SDL2_image SDL2_mixer`
|
LIBS = `pkg-config --libs sdl2 SDL2_image SDL2_mixer`
|
||||||
OBJS = alien.o audio.o bullets.o cargo.o collectable.o comms.o debris.o events.o explosions.o game.o globals.o graphics.o init.o intermission.o loadSave.o messages.o misc.o missions.o player.o resources.o script.o shop.o Starfighter.o title.o weapons.o
|
OBJS = alien.o audio.o bullets.o cargo.o collectable.o comms.o debris.o events.o explosions.o game.o globals.o graphics.o init.o intermission.o loadSave.o messages.o misc.o missions.o player.o resources.o script.o shop.o Starfighter.o title.o weapons.o
|
||||||
|
|
||||||
|
|
|
@ -19,12 +19,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
#include "Starfighter.h"
|
#include "Starfighter.h"
|
||||||
|
|
||||||
#if LINUX
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Initalises a whole load of variables
|
Initalises a whole load of variables
|
||||||
|
@ -109,7 +107,6 @@ This bit is just for Linux users. It attempts to get the user's
|
||||||
home directory, then creates the .parallelrealities and .parallelrealities/starfighter
|
home directory, then creates the .parallelrealities and .parallelrealities/starfighter
|
||||||
directories so that saves and temporary data files can be written there. Good, eh? :)
|
directories so that saves and temporary data files can be written there. Good, eh? :)
|
||||||
*/
|
*/
|
||||||
#if LINUX
|
|
||||||
static void setupUserHomeDirectory()
|
static void setupUserHomeDirectory()
|
||||||
{
|
{
|
||||||
char *userHome;
|
char *userHome;
|
||||||
|
@ -144,7 +141,6 @@ static void setupUserHomeDirectory()
|
||||||
|
|
||||||
sprintf(engine.userHomeDirectory, "%s/.parallelrealities/starfighter/", userHome);
|
sprintf(engine.userHomeDirectory, "%s/.parallelrealities/starfighter/", userHome);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Chugg chugg chugg.... brrr... chugg chugg chugg...brrrrrr... chugg ch..
|
Chugg chugg chugg.... brrr... chugg chugg chugg...brrrrrr... chugg ch..
|
||||||
|
@ -154,9 +150,7 @@ void initSystem()
|
||||||
{
|
{
|
||||||
strcpy(engine.userHomeDirectory, "");
|
strcpy(engine.userHomeDirectory, "");
|
||||||
|
|
||||||
#if LINUX
|
|
||||||
setupUserHomeDirectory();
|
setupUserHomeDirectory();
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Initialize the SDL library */
|
/* Initialize the SDL library */
|
||||||
if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO|SDL_INIT_JOYSTICK) < 0)
|
if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO|SDL_INIT_JOYSTICK) < 0)
|
||||||
|
|
|
@ -290,7 +290,6 @@ struct globalEngineVariables {
|
||||||
bool useMusic;
|
bool useMusic;
|
||||||
bool fullScreen;
|
bool fullScreen;
|
||||||
|
|
||||||
// This really only applies to Linux users.
|
|
||||||
char userHomeDirectory[1024];
|
char userHomeDirectory[1024];
|
||||||
|
|
||||||
char keyState[KEY_LAST];
|
char keyState[KEY_LAST];
|
||||||
|
|
Loading…
Reference in New Issue