summaryrefslogtreecommitdiff
path: root/src/fios.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-17 15:48:57 +0000
committerrubidium <rubidium@openttd.org>2007-06-17 15:48:57 +0000
commit3c7a85fe9456b2bc31f3d29198bf2ec060e176f3 (patch)
tree8bc2a050b44170ed785af66e6e9045d429c789db /src/fios.cpp
parent4e4b152adb9e4fed758748622c66991be2aad730 (diff)
downloadopenttd-3c7a85fe9456b2bc31f3d29198bf2ec060e176f3.tar.xz
(svn r10182) -Codechange: rewrite most part of the file loading/searching to be more flexible.
-Codechange: add support for personal directories on Windows. -Fix [FS#153, FS#193, FS#502, FS#816, FS#854]: fix issues related to fixed names, fixed places of files/directories and application bundles.
Diffstat (limited to 'src/fios.cpp')
-rw-r--r--src/fios.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/fios.cpp b/src/fios.cpp
index cdde6e3cd..bec0475c2 100644
--- a/src/fios.cpp
+++ b/src/fios.cpp
@@ -14,6 +14,7 @@
#include "helpers.hpp"
#include "table/strings.h"
#include "fios.h"
+#include "fileio.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -334,7 +335,7 @@ FiosItem *FiosGetSavegameList(int mode)
if (_fios_save_path == NULL) {
_fios_save_path = MallocT<char>(MAX_PATH);
- ttd_strlcpy(_fios_save_path, _paths.save_dir, MAX_PATH);
+ FioGetDirectory(_fios_save_path, MAX_PATH, SAVE_DIR);
}
_fios_path = _fios_save_path;
@@ -380,9 +381,10 @@ FiosItem *FiosGetScenarioList(int mode)
{
static char *_fios_scn_path = NULL;
+ /* Copy the default path on first run or on 'New Game' */
if (_fios_scn_path == NULL) {
_fios_scn_path = MallocT<char>(MAX_PATH);
- ttd_strlcpy(_fios_scn_path, _paths.scenario_dir, MAX_PATH);
+ FioGetDirectory(_fios_scn_path, MAX_PATH, SCENARIO_DIR);
}
_fios_path = _fios_scn_path;
@@ -413,7 +415,7 @@ FiosItem *FiosGetHeightmapList(int mode)
if (_fios_hmap_path == NULL) {
_fios_hmap_path = MallocT<char>(MAX_PATH);
- strcpy(_fios_hmap_path, _paths.heightmap_dir);
+ FioGetDirectory(_fios_hmap_path, MAX_PATH, HEIGHTMAP_DIR);
}
_fios_path = _fios_hmap_path;