mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 14:27:16 +00:00
(svn r16023) -Fix (r15615) [FS#2817]: 32 bpp sprites in tars would also be shown in the list of heightmaps.
This commit is contained in:
parent
2663ad302f
commit
4bf3508680
27
src/fios.cpp
27
src/fios.cpp
@ -8,6 +8,7 @@
|
||||
#include "openttd.h"
|
||||
#include "fios.h"
|
||||
#include "fileio_func.h"
|
||||
#include "tar_type.h"
|
||||
#include "string_func.h"
|
||||
#include <sys/stat.h>
|
||||
|
||||
@ -469,7 +470,31 @@ static FiosType FiosGetHeightmapListCallback(SaveLoadDialogMode mode, const char
|
||||
|
||||
if (strcasecmp(ext, ".bmp") == 0) type = FIOS_TYPE_BMP;
|
||||
|
||||
if (type != FIOS_TYPE_INVALID) GetFileTitle(file, title, last);
|
||||
if (type == FIOS_TYPE_INVALID) return FIOS_TYPE_INVALID;
|
||||
|
||||
TarFileList::iterator it = _tar_filelist.find(file);
|
||||
if (it != _tar_filelist.end()) {
|
||||
/* If the file is in a tar and that tar is not in a heightmap
|
||||
* directory we are for sure not supposed to see it.
|
||||
* Examples of this are pngs part of documentation within
|
||||
* collections of NewGRFs or 32 bpp graphics replacement PNGs.
|
||||
*/
|
||||
bool match = false;
|
||||
Searchpath sp;
|
||||
FOR_ALL_SEARCHPATHS(sp) {
|
||||
char buf[MAX_PATH];
|
||||
FioAppendDirectory(buf, sizeof(buf), sp, HEIGHTMAP_DIR);
|
||||
|
||||
if (strncmp(buf, it->second.tar_filename, strlen(buf)) == 0) {
|
||||
match = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!match) return FIOS_TYPE_INVALID;
|
||||
}
|
||||
|
||||
GetFileTitle(file, title, last);
|
||||
|
||||
return type;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user