mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-12 09:09:09 +00:00
(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.
This commit is contained in:
13
saveload.c
13
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;
|
||||
|
Reference in New Issue
Block a user