pkgsrc/games/xdoom/patches/patch-ar
mycroft 1c5bda26b8 Deal with some obvious pointer size issues that prevent xdoom even loading the
WAD file on LP64.  Whether it works beyond that point now, I don't know.
2002-08-22 04:18:43 +00:00

78 lines
3.2 KiB
Text

$NetBSD: patch-ar,v 1.2 2002/08/22 04:18:44 mycroft Exp $
--- linuxdoom-1.10/r_data.c.orig Mon Dec 22 20:57:47 1997
+++ linuxdoom-1.10/r_data.c Mon Aug 22 04:13:08 2022
@@ -84,10 +84,10 @@
typedef struct
{
char name[8];
- boolean masked;
+ short masked[2]; // OBSOLETE
short width;
short height;
- void **columndirectory; // OBSOLETE
+ short columndirectory[2]; // OBSOLETE
short patchcount;
mappatch_t patches[1];
} maptexture_t;
@@ -479,13 +479,13 @@
}
numtextures = numtextures1 + numtextures2;
- 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;
@@ -567,7 +567,7 @@
R_GenerateLookup (i);
// Create translation table for global animation.
- texturetranslation = Z_Malloc ((numtextures+1)*4, PU_STATIC, 0);
+ texturetranslation = Z_Malloc ((numtextures+1)*sizeof(*texturetranslation), PU_STATIC, 0);
for (i=0 ; i<numtextures ; i++)
texturetranslation[i] = i;
@@ -587,7 +587,7 @@
numflats = lastflat - firstflat + 1;
// Create translation table for global animation.
- flattranslation = Z_Malloc ((numflats+1)*4, PU_STATIC, 0);
+ flattranslation = Z_Malloc ((numflats+1)*sizeof(*flattranslation), PU_STATIC, 0);
for (i=0 ; i<numflats ; i++)
flattranslation[i] = i;
@@ -609,9 +609,9 @@
lastspritelump = W_GetNumForName ("S_END") - 1;
numspritelumps = lastspritelump - firstspritelump + 1;
- spritewidth = Z_Malloc (numspritelumps*4, PU_STATIC, 0);
- spriteoffset = Z_Malloc (numspritelumps*4, PU_STATIC, 0);
- spritetopoffset = Z_Malloc (numspritelumps*4, PU_STATIC, 0);
+ spritewidth = Z_Malloc (numspritelumps*sizeof(*spritewidth), PU_STATIC, 0);
+ spriteoffset = Z_Malloc (numspritelumps*sizeof(*spriteoffset), PU_STATIC, 0);
+ spritetopoffset = Z_Malloc (numspritelumps*sizeof(*spritetopoffset), PU_STATIC, 0);
for (i=0 ; i< numspritelumps ; i++)
{
@@ -639,7 +639,7 @@
lump = W_GetNumForName("COLORMAP");
length = W_LumpLength (lump) + 255;
colormaps = Z_Malloc (length, PU_STATIC, 0);
- colormaps = (byte *)( ((int)colormaps + 255)&~0xff);
+ colormaps = (byte *)( ((long)colormaps + 255)&~0xff);
W_ReadLump (lump,colormaps);
}