From 180f39cb9da6e3169f95e9da5c8782c50f826af4 Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Wed, 4 Jan 2006 18:58:43 +0000 Subject: FreeBSD Fixes from Icy. --- ChangeLog | 5 +++++ src/game.cpp | 2 +- src/main.cpp | 4 ++-- src/main.h | 12 +++++++----- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 81cb37c0..d2f92117 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-01-04 Icy + + * src/game.cpp, src/main.cpp, src/main.h: FreeBSD fixes to The Mana + World. + 2006-01-03 Eugenio Favalli * src/game.cpp, src/gui/chat.cpp, src/gui/chat.h, src/gui/login.cpp, diff --git a/src/game.cpp b/src/game.cpp index 7f873aef..72dbb0c9 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -344,7 +344,7 @@ bool saveScreenshot(SDL_Surface *screenshot) do { screenshotCount++; filename.str(""); -#ifdef __USE_UNIX98 +#if (defined __USE_UNIX98 || defined __FreeBSD__) filename << PHYSFS_getUserDir() << "/"; #endif filename << "TMW_Screenshot_" << screenshotCount << ".png"; diff --git a/src/main.cpp b/src/main.cpp index 0a126afb..f0f885e7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -33,7 +33,7 @@ #include -#ifdef __USE_UNIX98 +#if (defined __USE_UNIX98 || defined __FreeBSD__) #include #include #endif @@ -136,7 +136,7 @@ void init_engine() SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); std::string homeDir = ""; -#ifndef __USE_UNIX98 +#if !(defined __USE_UNIX98 || defined __FreeBSD__) // In Windows and other systems we currently store data next to executable. homeDir = "."; #else diff --git a/src/main.h b/src/main.h index 69d54a5a..a939879b 100644 --- a/src/main.h +++ b/src/main.h @@ -29,7 +29,7 @@ class Image; class Sound; -#ifdef __USE_UNIX98 +#if (defined __USE_UNIX98 || defined __FreeBSD__) #include "../config.h" #elif defined WIN32 #include "../The_Mana_World_private.h" @@ -59,10 +59,12 @@ enum { * to be able to use strncpy instead of strcpy for * security and stability reasons */ -#define LEN_MAX_USERNAME 25 -#define LEN_MIN_USERNAME 4 -#define LEN_MAX_PASSWORD 25 -#define LEN_MIN_PASSWORD 4 +enum { + LEN_MAX_USERNAME = 25, + LEN_MIN_USERNAME = 4, + LEN_MAX_PASSWORD = 25, + LEN_MIN_PASSWORD = 4 +}; extern int map_address, char_ID; extern short map_port; -- cgit v1.2.3-70-g09d2