EMI: better detect tile, thanks klusark and somaen
This commit is contained in:
parent
0cf157132a
commit
9c0c7a503d
1 changed files with 5 additions and 8 deletions
|
@ -42,14 +42,11 @@ static void decompress_codec3(const char *compressed, char *result);
|
||||||
Bitmap::Bitmap(const char *fname, const char *data, int len) :
|
Bitmap::Bitmap(const char *fname, const char *data, int len) :
|
||||||
Object() {
|
Object() {
|
||||||
_fname = fname;
|
_fname = fname;
|
||||||
printf("Trying to load %s\n", fname);
|
if (len > 4 && memcmp(data, "\x1f\x8b\x08\0", 4) == 0) {
|
||||||
if (len < 8 || memcmp(data, "BM F\0\0\0", 8) != 0) {
|
loadTile(fname, data, len);
|
||||||
// Should probably just check the filename
|
return;
|
||||||
if (loadTile(fname, data, len)){
|
} else if (len < 8 || memcmp(data, "BM F\0\0\0", 8) != 0) {
|
||||||
return;
|
if (gDebugLevel == DEBUG_BITMAPS || gDebugLevel == DEBUG_ERROR || gDebugLevel == DEBUG_ALL)
|
||||||
// Everything is fine
|
|
||||||
}
|
|
||||||
else if (gDebugLevel == DEBUG_BITMAPS || gDebugLevel == DEBUG_ERROR || gDebugLevel == DEBUG_ALL)
|
|
||||||
error("Invalid magic loading bitmap");
|
error("Invalid magic loading bitmap");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue