143 case FIOS_TYPE_OLD_SCENARIO: |
143 case FIOS_TYPE_OLD_SCENARIO: |
144 case FIOS_TYPE_PNG: |
144 case FIOS_TYPE_PNG: |
145 case FIOS_TYPE_BMP: |
145 case FIOS_TYPE_BMP: |
146 { |
146 { |
147 static char str_buffr[512]; |
147 static char str_buffr[512]; |
148 |
|
149 #if defined(__MORPHOS__) || defined(__AMIGAOS__) |
|
150 /* On MorphOS or AmigaOS paths look like: "Volume:directory/subdirectory" */ |
|
151 if (FiosIsRoot(path)) { |
|
152 snprintf(str_buffr, lengthof(str_buffr), "%s:%s", path, item->name); |
|
153 } else // XXX - only next line! |
|
154 #endif |
|
155 snprintf(str_buffr, lengthof(str_buffr), "%s%s", path, item->name); |
148 snprintf(str_buffr, lengthof(str_buffr), "%s%s", path, item->name); |
156 |
|
157 return str_buffr; |
149 return str_buffr; |
158 } |
150 } |
159 } |
151 } |
160 |
152 |
161 return NULL; |
153 return NULL; |
168 extension = (_game_mode == GM_EDITOR) ? ".scn" : ".sav"; |
160 extension = (_game_mode == GM_EDITOR) ? ".scn" : ".sav"; |
169 |
161 |
170 /* Don't append the extension if it is already there */ |
162 /* Don't append the extension if it is already there */ |
171 period = strrchr(name, '.'); |
163 period = strrchr(name, '.'); |
172 if (period != NULL && strcasecmp(period, extension) == 0) extension = ""; |
164 if (period != NULL && strcasecmp(period, extension) == 0) extension = ""; |
173 |
165 #if defined(__MORPHOS__) || defined(__AMIGAOS__) |
|
166 if (_fios_path != NULL) { |
|
167 unsigned char sepchar = _fios_path[(strlen(_fios_path) - 1)]; |
|
168 |
|
169 if (sepchar != ':' && sepchar != '/') { |
|
170 snprintf(buf, size, "%s" PATHSEP "%s%s", _fios_path, name, extension); |
|
171 } else { |
|
172 snprintf(buf, size, "%s%s%s", _fios_path, name, extension); |
|
173 } |
|
174 } else { |
|
175 snprintf(buf, size, "%s%s", name, extension); |
|
176 } |
|
177 #else |
174 snprintf(buf, size, "%s" PATHSEP "%s%s", _fios_path, name, extension); |
178 snprintf(buf, size, "%s" PATHSEP "%s%s", _fios_path, name, extension); |
|
179 #endif |
175 } |
180 } |
176 |
181 |
177 #if defined(WIN32) |
182 #if defined(WIN32) |
178 # define unlink _tunlink |
183 # define unlink _tunlink |
179 #endif |
184 #endif |