From da6ee7c73b3a50f6061b200757ba7af103714d12 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 18 Nov 2007 18:28:32 +0000 Subject: (svn r11464) -Fix: some issue that made OpenTTD on MorphOS seriously unplayable. --- src/fios.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'src/fios.cpp') 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) -- cgit v1.2.3-70-g09d2