Some 64-bit fixes
authorDan Olson <theoddone33@icculus.org>
Sun, 20 Mar 2011 08:17:09 +0000 (01:17 -0700)
committerDan Olson <theoddone33@icculus.org>
Sun, 20 Mar 2011 08:17:09 +0000 (01:17 -0700)
base/r_data.c
base/r_draw.c
include/doomdata.h
include/doomdef.h

index 2cd5d4e..6c7b94c 100644 (file)
@@ -312,13 +312,13 @@ void R_InitTextures (void)
                InitThermo(spramount + numtextures + 6);
        }
 
-       textures = Z_Malloc (numtextures*4, PU_STATIC, 0);
-       texturecolumnlump = Z_Malloc (numtextures*4, PU_STATIC, 0);
-       texturecolumnofs = Z_Malloc (numtextures*4, PU_STATIC, 0);
-       texturecomposite = Z_Malloc (numtextures*4, PU_STATIC, 0);
-       texturecompositesize = Z_Malloc (numtextures*4, PU_STATIC, 0);
-       texturewidthmask = Z_Malloc (numtextures*4, PU_STATIC, 0);
-       textureheight = Z_Malloc (numtextures*4, PU_STATIC, 0);
+       textures = Z_Malloc (numtextures*sizeof(*textures), PU_STATIC, 0);
+       texturecolumnlump = Z_Malloc (numtextures*sizeof(*texturecolumnlump), PU_STATIC, 0);
+       texturecolumnofs = Z_Malloc (numtextures*sizeof(*texturecolumnofs), PU_STATIC, 0);
+       texturecomposite = Z_Malloc (numtextures*sizeof(*texturecomposite), PU_STATIC, 0);
+       texturecompositesize = Z_Malloc (numtextures*sizeof(*texturecompositesize), PU_STATIC, 0);
+       texturewidthmask = Z_Malloc (numtextures*sizeof(*texturewidthmask), PU_STATIC, 0);
+       textureheight = Z_Malloc (numtextures*sizeof(*textureheight), PU_STATIC, 0);
 
        totalwidth = 0;
 
@@ -471,7 +471,7 @@ void R_InitColormaps (void)
        lump = W_GetNumForName("COLORMAP");
        length = W_LumpLength (lump) + 255;
        colormaps = Z_Malloc (length, PU_STATIC, 0);
-       colormaps = (byte *)( ((int)colormaps + 255)&~0xff);
+       colormaps = (byte *)( ((intptr_t)colormaps + 255)&~0xff);
        W_ReadLump (lump,colormaps);
 }
 
index cd66567..3039ab9 100644 (file)
@@ -242,7 +242,7 @@ void R_InitTranslationTables (void)
 
        // Allocate translation tables
        translationtables = Z_Malloc(256*3+255, PU_STATIC, 0);
-       translationtables = (byte *)(( (int)translationtables + 255 )& ~255);
+       translationtables = (byte *)(( (intptr_t)translationtables + 255 )& ~255);
 
        // Fill out the translation tables
        for(i = 0; i < 256; i++)
index 967c7ef..77010a4 100644 (file)
@@ -133,7 +133,7 @@ typedef struct
        boolean         masked; 
        short           width;
        short           height;
-       void            **columndirectory;      // OBSOLETE
+       int columndirectory;    // OBSOLETE
        short           patchcount;
        mappatch_t      patches[1];
 } maptexture_t;
index 4053014..3c47f44 100644 (file)
@@ -11,6 +11,8 @@
 #define        strncasecmp strnicmp
 #endif
 
+#include <stdint.h>
+
 #include "config.h"
 
 #define VERSION 130