mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-16 01:31:26 +00:00
// we're fucking sick of this
Why hasn't SRB2 already done this themselves YEARS ago...
This commit is contained in:
parent
03e1ed179e
commit
76033a51d7
1 changed files with 18 additions and 0 deletions
18
src/w_wad.c
18
src/w_wad.c
|
@ -769,6 +769,24 @@ static size_t W_RawReadLumpHeader(UINT16 wad, UINT16 lump, void *dest, size_t si
|
||||||
fseek(handle, (long)(l->position + offset), SEEK_SET);
|
fseek(handle, (long)(l->position + offset), SEEK_SET);
|
||||||
bytesread = fread(dest, 1, size, handle);
|
bytesread = fread(dest, 1, size, handle);
|
||||||
|
|
||||||
|
#if 1 // we're fucking sick of this
|
||||||
|
if (bytesread < 67) // http://garethrees.org/2007/11/14/pngcrush/
|
||||||
|
return bytesread;
|
||||||
|
|
||||||
|
#define sigcheck ((UINT8 *)dest)
|
||||||
|
if (sigcheck[0] == 0x89
|
||||||
|
&& sigcheck[1] == 0x50
|
||||||
|
&& sigcheck[2] == 0x4e
|
||||||
|
&& sigcheck[3] == 0x47
|
||||||
|
&& sigcheck[4] == 0x0d
|
||||||
|
&& sigcheck[5] == 0x0a
|
||||||
|
&& sigcheck[6] == 0x1a
|
||||||
|
&& sigcheck[7] == 0x0a)
|
||||||
|
I_Error("W_Wad: Tried to cache a .PNG - have you tried converting to Doom or Flat (raw) image formats?");
|
||||||
|
#undef sigcheck
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
return bytesread;
|
return bytesread;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue