summaryrefslogtreecommitdiff
path: root/saveload.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-03-25 09:22:10 +0000
committerDarkvater <darkvater@openttd.org>2006-03-25 09:22:10 +0000
commit9b5d8a9921d0f8a0ed5b9dd0f3d796a35c342f8c (patch)
tree86d8ae1e4f41e2d9e2ecfe600c9e0bcd66d31b18 /saveload.c
parent6cafd5f0e33f44818cc128ad3b1a140a3215e853 (diff)
downloadopenttd-9b5d8a9921d0f8a0ed5b9dd0f3d796a35c342f8c.tar.xz
(svn r4105) - Feature: Add proper ISO-8859-15 <> LOCALCODE conversion. As the mess that is makefile can't properly support it at the moment, it is only available for MACOSX. Windows doesn't need FS conversion and I have no idea about OS/2 so it's disabled for them.
- CodeChange: Change the function GetCurrentLocale(). It returns the locale from some default environment-variables, plus a custom one defined as parameter. If all fail, it tries $LANG.
Diffstat (limited to 'saveload.c')
-rw-r--r--saveload.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/saveload.c b/saveload.c
index 653ff2402..3b304f445 100644
--- a/saveload.c
+++ b/saveload.c
@@ -19,6 +19,7 @@
#include "openttd.h"
#include "debug.h"
#include "functions.h"
+#include "hal.h"
#include "vehicle.h"
#include "station.h"
#include "thread.h"
@@ -1314,12 +1315,6 @@ extern bool AfterLoadGame(void);
extern void BeforeSaveGame(void);
extern bool LoadOldSaveGame(const char *file);
-#if defined(__APPLE__) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3)
-extern const char *convert_to_fs_charset(const char *filename);
-#else
-#define convert_to_fs_charset(str) (str)
-#endif
-
/** Small helper function to close the to be loaded savegame an signal error */
static inline SaveOrLoadResult AbortSaveLoad(void)
{
@@ -1454,11 +1449,7 @@ SaveOrLoadResult SaveOrLoad(const char *filename, int mode)
return SL_OK;
}
- if(mode == SL_SAVE) {
- _sl.fh = fopen(convert_to_fs_charset(filename), "wb");
- } else {
- _sl.fh = fopen(filename, "rb");
- }
+ _sl.fh = (mode == SL_SAVE) ? fopen(OTTD2FS(filename), "wb") : fopen(filename, "rb");
if (_sl.fh == NULL) {
DEBUG(misc, 0) ("[Sl] Cannot open savegame for saving/loading.");
return SL_ERROR;