Skip to content

Commit

Permalink
Fixed the issue with textures not loading on 64bit linux.
Browse files Browse the repository at this point in the history
On 64bit linux, the long type is 64bits long, while one 32bit linux and both 64 and 32bit windows it is only 32bits long.
There are probally many other places in the code where longs are causing issues.

Right now, the menu runs fine, but it crashes when I try to start new a game.
  • Loading branch information
phire committed Nov 24, 2011
1 parent 07420da commit b62c4a5
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions neo/renderer/Image.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,57 +64,57 @@ typedef enum {
static const int MAX_TEXTURE_LEVELS = 14;

// surface description flags
const unsigned long DDSF_CAPS = 0x00000001l;
const unsigned long DDSF_HEIGHT = 0x00000002l;
const unsigned long DDSF_WIDTH = 0x00000004l;
const unsigned long DDSF_PITCH = 0x00000008l;
const unsigned long DDSF_PIXELFORMAT = 0x00001000l;
const unsigned long DDSF_MIPMAPCOUNT = 0x00020000l;
const unsigned long DDSF_LINEARSIZE = 0x00080000l;
const unsigned long DDSF_DEPTH = 0x00800000l;
const uint DDSF_CAPS = 0x00000001l;
const uint DDSF_HEIGHT = 0x00000002l;
const uint DDSF_WIDTH = 0x00000004l;
const uint DDSF_PITCH = 0x00000008l;
const uint DDSF_PIXELFORMAT = 0x00001000l;
const uint DDSF_MIPMAPCOUNT = 0x00020000l;
const uint DDSF_LINEARSIZE = 0x00080000l;
const uint DDSF_DEPTH = 0x00800000l;

// pixel format flags
const unsigned long DDSF_ALPHAPIXELS = 0x00000001l;
const unsigned long DDSF_FOURCC = 0x00000004l;
const unsigned long DDSF_RGB = 0x00000040l;
const unsigned long DDSF_RGBA = 0x00000041l;
const uint DDSF_ALPHAPIXELS = 0x00000001l;
const uint DDSF_FOURCC = 0x00000004l;
const uint DDSF_RGB = 0x00000040l;
const uint DDSF_RGBA = 0x00000041l;

// our extended flags
const unsigned long DDSF_ID_INDEXCOLOR = 0x10000000l;
const unsigned long DDSF_ID_MONOCHROME = 0x20000000l;
const uint DDSF_ID_INDEXCOLOR = 0x10000000l;
const uint DDSF_ID_MONOCHROME = 0x20000000l;

// dwCaps1 flags
const unsigned long DDSF_COMPLEX = 0x00000008l;
const unsigned long DDSF_TEXTURE = 0x00001000l;
const unsigned long DDSF_MIPMAP = 0x00400000l;
const uint DDSF_COMPLEX = 0x00000008l;
const uint DDSF_TEXTURE = 0x00001000l;
const uint DDSF_MIPMAP = 0x00400000l;

#define DDS_MAKEFOURCC(a, b, c, d) ((a) | ((b) << 8) | ((c) << 16) | ((d) << 24))

typedef struct {
unsigned long dwSize;
unsigned long dwFlags;
unsigned long dwFourCC;
unsigned long dwRGBBitCount;
unsigned long dwRBitMask;
unsigned long dwGBitMask;
unsigned long dwBBitMask;
unsigned long dwABitMask;
uint dwSize;
uint dwFlags;
uint dwFourCC;
uint dwRGBBitCount;
uint dwRBitMask;
uint dwGBitMask;
uint dwBBitMask;
uint dwABitMask;
} ddsFilePixelFormat_t;

typedef struct
{
unsigned long dwSize;
unsigned long dwFlags;
unsigned long dwHeight;
unsigned long dwWidth;
unsigned long dwPitchOrLinearSize;
unsigned long dwDepth;
unsigned long dwMipMapCount;
unsigned long dwReserved1[11];
uint dwSize;
uint dwFlags;
uint dwHeight;
uint dwWidth;
uint dwPitchOrLinearSize;
uint dwDepth;
uint dwMipMapCount;
uint dwReserved1[11];
ddsFilePixelFormat_t ddspf;
unsigned long dwCaps1;
unsigned long dwCaps2;
unsigned long dwReserved2[3];
uint dwCaps1;
uint dwCaps2;
uint dwReserved2[3];
} ddsFileHeader_t;


Expand Down

0 comments on commit b62c4a5

Please sign in to comment.