summaryrefslogtreecommitdiff
path: root/src/fios.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-11-18 18:28:32 +0000
committerrubidium <rubidium@openttd.org>2007-11-18 18:28:32 +0000
commitda6ee7c73b3a50f6061b200757ba7af103714d12 (patch)
tree75fd97c8a7f10ea2cd73cdf46c98d32cc23e7dac /src/fios.cpp
parent67bbd8f7ab94407684bd2a8de1c610710fb68528 (diff)
downloadopenttd-da6ee7c73b3a50f6061b200757ba7af103714d12.tar.xz
(svn r11464) -Fix: some issue that made OpenTTD on MorphOS seriously unplayable.
Diffstat (limited to 'src/fios.cpp')
-rw-r--r--src/fios.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/fios.cpp b/src/fios.cpp
index 31c3d8390..2dc10002c 100644
--- a/src/fios.cpp
+++ b/src/fios.cpp
@@ -145,15 +145,7 @@ char *FiosBrowseTo(const FiosItem *item)
case FIOS_TYPE_BMP:
{
static char str_buffr[512];
-
-#if defined(__MORPHOS__) || defined(__AMIGAOS__)
- /* On MorphOS or AmigaOS paths look like: "Volume:directory/subdirectory" */
- if (FiosIsRoot(path)) {
- snprintf(str_buffr, lengthof(str_buffr), "%s:%s", path, item->name);
- } else // XXX - only next line!
-#endif
snprintf(str_buffr, lengthof(str_buffr), "%s%s", path, item->name);
-
return str_buffr;
}
}
@@ -170,8 +162,21 @@ void FiosMakeSavegameName(char *buf, const char *name, size_t size)
/* Don't append the extension if it is already there */
period = strrchr(name, '.');
if (period != NULL && strcasecmp(period, extension) == 0) extension = "";
-
+#if defined(__MORPHOS__) || defined(__AMIGAOS__)
+ if (_fios_path != NULL) {
+ unsigned char sepchar = _fios_path[(strlen(_fios_path) - 1)];
+
+ if (sepchar != ':' && sepchar != '/') {
+ snprintf(buf, size, "%s" PATHSEP "%s%s", _fios_path, name, extension);
+ } else {
+ snprintf(buf, size, "%s%s%s", _fios_path, name, extension);
+ }
+ } else {
+ snprintf(buf, size, "%s%s", name, extension);
+ }
+#else
snprintf(buf, size, "%s" PATHSEP "%s%s", _fios_path, name, extension);
+#endif
}
#if defined(WIN32)