mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-17 23:21:22 +00:00
Merge branch 'have_png-compile-fix' into 'master'
NO_PNG_LUMPS compile fix See merge request STJr/SRB2Internal!598
This commit is contained in:
commit
6a811515db
3 changed files with 19 additions and 15 deletions
|
@ -568,7 +568,9 @@ or NULL if we want to allocate it now.
|
|||
static INT32
|
||||
Ploadflat (levelflat_t *levelflat, const char *flatname)
|
||||
{
|
||||
#ifndef NO_PNG_LUMPS
|
||||
UINT8 buffer[8];
|
||||
#endif
|
||||
|
||||
lumpnum_t flatnum;
|
||||
int texturenum;
|
||||
|
|
|
@ -17,13 +17,13 @@
|
|||
#include "r_defs.h"
|
||||
#include "doomdef.h"
|
||||
|
||||
// structs
|
||||
// Structs
|
||||
#ifdef ROTSPRITE
|
||||
typedef enum
|
||||
{
|
||||
ROTAXIS_X, // roll (the default)
|
||||
ROTAXIS_Y, // pitch
|
||||
ROTAXIS_Z // yaw
|
||||
ROTAXIS_X, // Roll (the default)
|
||||
ROTAXIS_Y, // Pitch
|
||||
ROTAXIS_Z // Yaw
|
||||
} rotaxis_t;
|
||||
|
||||
typedef struct
|
||||
|
@ -41,30 +41,30 @@ typedef struct
|
|||
boolean available;
|
||||
} spriteinfo_t;
|
||||
|
||||
extern spriteinfo_t spriteinfo[NUMSPRITES];
|
||||
|
||||
// patches, flats, textures...
|
||||
// Conversions between patches / flats / textures...
|
||||
boolean R_CheckIfPatch(lumpnum_t lump);
|
||||
boolean R_IsLumpPNG(const UINT8 *d, size_t s);
|
||||
|
||||
void R_TextureToFlat(size_t tex, UINT8 *flat);
|
||||
void R_PatchToFlat(patch_t *patch, UINT8 *flat);
|
||||
void R_PatchToFlat_16bpp(patch_t *patch, UINT16 *raw, boolean flip);
|
||||
patch_t *R_FlatToPatch(UINT8 *raw, UINT16 width, UINT16 height, UINT16 leftoffset, UINT16 topoffset, size_t *destsize, boolean transparency);
|
||||
patch_t *R_FlatToPatch_16bpp(UINT16 *raw, UINT16 width, UINT16 height, size_t *size);
|
||||
|
||||
// png
|
||||
// Portable Network Graphics
|
||||
boolean R_IsLumpPNG(const UINT8 *d, size_t s);
|
||||
#define W_ThrowPNGError(lumpname, wadfilename) I_Error("W_Wad: Lump \"%s\" in file \"%s\" is a .png - please convert to either Doom or Flat (raw) image format.", lumpname, wadfilename); // Fears Of LJ Sonic
|
||||
|
||||
#ifndef NO_PNG_LUMPS
|
||||
UINT8 *R_PNGToFlat(UINT16 *width, UINT16 *height, UINT8 *png, size_t size);
|
||||
patch_t *R_PNGToPatch(const UINT8 *png, size_t size, size_t *destsize, boolean transparency);
|
||||
boolean R_PNGDimensions(UINT8 *png, INT16 *width, INT16 *height, size_t size);
|
||||
#endif
|
||||
|
||||
// spriteinfo
|
||||
// SpriteInfo
|
||||
extern spriteinfo_t spriteinfo[NUMSPRITES];
|
||||
void R_LoadSpriteInfoLumps(UINT16 wadnum, UINT16 numlumps);
|
||||
void R_ParseSPRTINFOLump(UINT16 wadNum, UINT16 lumpNum);
|
||||
|
||||
// rotsprite
|
||||
// Sprite rotation
|
||||
#ifdef ROTSPRITE
|
||||
void R_CacheRotSprite(spritenum_t sprnum, UINT8 frame, spriteinfo_t *sprinfo, spriteframe_t *sprframe, INT32 rot, UINT8 flip);
|
||||
void R_FreeSingleRotSprite(spritedef_t *spritedef);
|
||||
|
|
|
@ -1229,7 +1229,7 @@ size_t W_ReadLumpHeaderPwad(UINT16 wad, UINT16 lump, void *dest, size_t size, si
|
|||
{
|
||||
size_t bytesread = fread(dest, 1, size, handle);
|
||||
if (R_IsLumpPNG((UINT8 *)dest, bytesread))
|
||||
I_Error("W_Wad: Lump \"%s\" in file \"%s\" is a .png - please convert to either Doom or Flat (raw) image format.", l->name2, wadfiles[wad]->filename);
|
||||
W_ThrowPNGError(l->name2, wadfiles[wad]->filename);
|
||||
return bytesread;
|
||||
}
|
||||
#else
|
||||
|
@ -1270,7 +1270,8 @@ size_t W_ReadLumpHeaderPwad(UINT16 wad, UINT16 lump, void *dest, size_t size, si
|
|||
Z_Free(rawData);
|
||||
Z_Free(decData);
|
||||
#ifdef NO_PNG_LUMPS
|
||||
ErrorIfPNG(dest, size, wadfiles[wad]->filename, l->name2);
|
||||
if (R_IsLumpPNG((UINT8 *)dest, size))
|
||||
W_ThrowPNGError(l->name2, wadfiles[wad]->filename);
|
||||
#endif
|
||||
return size;
|
||||
#else
|
||||
|
@ -1332,7 +1333,8 @@ size_t W_ReadLumpHeaderPwad(UINT16 wad, UINT16 lump, void *dest, size_t size, si
|
|||
Z_Free(decData);
|
||||
|
||||
#ifdef NO_PNG_LUMPS
|
||||
ErrorIfPNG(dest, size, wadfiles[wad]->filename, l->name2);
|
||||
if (R_IsLumpPNG((UINT8 *)dest, size))
|
||||
W_ThrowPNGError(l->name2, wadfiles[wad]->filename);
|
||||
#endif
|
||||
return size;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue