- changed the #defines in ddstexture.cpp into an enum

(because #defines suck...)
This commit is contained in:
Christoph Oelckers 2017-03-10 20:08:39 +01:00
parent fec958cc0a
commit 343db41b63

View file

@ -59,42 +59,45 @@
// Since we want this to compile under Linux too, we need to define this
// stuff ourselves instead of including a DirectX header.
#define ID_DDS MAKE_ID('D','D','S',' ')
#define ID_DXT1 MAKE_ID('D','X','T','1')
#define ID_DXT2 MAKE_ID('D','X','T','2')
#define ID_DXT3 MAKE_ID('D','X','T','3')
#define ID_DXT4 MAKE_ID('D','X','T','4')
#define ID_DXT5 MAKE_ID('D','X','T','5')
enum
{
ID_DDS = MAKE_ID('D', 'D', 'S', ' '),
ID_DXT1 = MAKE_ID('D', 'X', 'T', '1'),
ID_DXT2 = MAKE_ID('D', 'X', 'T', '2'),
ID_DXT3 = MAKE_ID('D', 'X', 'T', '3'),
ID_DXT4 = MAKE_ID('D', 'X', 'T', '4'),
ID_DXT5 = MAKE_ID('D', 'X', 'T', '5'),
// Bits in dwFlags
#define DDSD_CAPS 0x00000001
#define DDSD_HEIGHT 0x00000002
#define DDSD_WIDTH 0x00000004
#define DDSD_PITCH 0x00000008
#define DDSD_PIXELFORMAT 0x00001000
#define DDSD_MIPMAPCOUNT 0x00020000
#define DDSD_LINEARSIZE 0x00080000
#define DDSD_DEPTH 0x00800000
// Bits in dwFlags
DDSD_CAPS = 0x00000001,
DDSD_HEIGHT = 0x00000002,
DDSD_WIDTH = 0x00000004,
DDSD_PITCH = 0x00000008,
DDSD_PIXELFORMAT = 0x00001000,
DDSD_MIPMAPCOUNT = 0x00020000,
DDSD_LINEARSIZE = 0x00080000,
DDSD_DEPTH = 0x00800000,
// Bits in ddpfPixelFormat
#define DDPF_ALPHAPIXELS 0x00000001
#define DDPF_FOURCC 0x00000004
#define DDPF_RGB 0x00000040
// Bits in ddpfPixelFormat
DDPF_ALPHAPIXELS = 0x00000001,
DDPF_FOURCC = 0x00000004,
DDPF_RGB = 0x00000040,
// Bits in DDSCAPS2.dwCaps1
#define DDSCAPS_COMPLEX 0x00000008
#define DDSCAPS_TEXTURE 0x00001000
#define DDSCAPS_MIPMAP 0x00400000
// Bits in DDSCAPS2.dwCaps1
DDSCAPS_COMPLEX = 0x00000008,
DDSCAPS_TEXTURE = 0x00001000,
DDSCAPS_MIPMAP = 0x00400000,
// Bits in DDSCAPS2.dwCaps2
#define DDSCAPS2_CUBEMAP 0x00000200
#define DDSCAPS2_CUBEMAP_POSITIVEX 0x00000400
#define DDSCAPS2_CUBEMAP_NEGATIVEX 0x00000800
#define DDSCAPS2_CUBEMAP_POSITIVEY 0x00001000
#define DDSCAPS2_CUBEMAP_NEGATIVEY 0x00002000
#define DDSCAPS2_CUBEMAP_POSITIVEZ 0x00004000
#define DDSCAPS2_CUBEMAP_NEGATIZEZ 0x00008000
#define DDSCAPS2_VOLUME 0x00200000
// Bits in DDSCAPS2.dwCaps2
DDSCAPS2_CUBEMAP = 0x00000200,
DDSCAPS2_CUBEMAP_POSITIVEX = 0x00000400,
DDSCAPS2_CUBEMAP_NEGATIVEX = 0x00000800,
DDSCAPS2_CUBEMAP_POSITIVEY = 0x00001000,
DDSCAPS2_CUBEMAP_NEGATIVEY = 0x00002000,
DDSCAPS2_CUBEMAP_POSITIVEZ = 0x00004000,
DDSCAPS2_CUBEMAP_NEGATIZEZ = 0x00008000,
DDSCAPS2_VOLUME = 0x00200000,
};
//==========================================================================
//
@ -132,15 +135,15 @@ struct DDSURFACEDESC2
uint32_t Depth;
uint32_t MipMapCount;
uint32_t Reserved1[11];
DDPIXELFORMAT PixelFormat;
DDCAPS2 Caps;
DDPIXELFORMAT PixelFormat;
DDCAPS2 Caps;
uint32_t Reserved2;
};
struct DDSFileHeader
{
uint32_t Magic;
DDSURFACEDESC2 Desc;
DDSURFACEDESC2 Desc;
};