summaryrefslogtreecommitdiff
path: root/src/heretic/r_data.c
diff options
context:
space:
mode:
authorSimon Howard2008-09-26 16:27:32 +0000
committerSimon Howard2008-09-26 16:27:32 +0000
commitaf2add1cbef05bf05fe6a59f84975caabe0779c0 (patch)
treec71a9f147e4d4603f0a798a3700669f381dd0731 /src/heretic/r_data.c
parent717ca7f67c77b09c9fc6f36936fbc6bdc4ff8e98 (diff)
downloadchocolate-doom-af2add1cbef05bf05fe6a59f84975caabe0779c0.tar.gz
chocolate-doom-af2add1cbef05bf05fe6a59f84975caabe0779c0.tar.bz2
chocolate-doom-af2add1cbef05bf05fe6a59f84975caabe0779c0.zip
Use sizeof for size of types, rather than hard-coding the size.
Subversion-branch: /branches/raven-branch Subversion-revision: 1289
Diffstat (limited to 'src/heretic/r_data.c')
-rw-r--r--src/heretic/r_data.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/heretic/r_data.c b/src/heretic/r_data.c
index ebd89018..6e65abdd 100644
--- a/src/heretic/r_data.c
+++ b/src/heretic/r_data.c
@@ -360,13 +360,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(texture_t *), PU_STATIC, 0);
+ texturecolumnlump = Z_Malloc(numtextures * sizeof(short *), PU_STATIC, 0);
+ texturecolumnofs = Z_Malloc(numtextures * sizeof(unsigned short *), PU_STATIC, 0);
+ texturecomposite = Z_Malloc(numtextures * sizeof(byte *), PU_STATIC, 0);
+ texturecompositesize = Z_Malloc(numtextures * sizeof(int), PU_STATIC, 0);
+ texturewidthmask = Z_Malloc(numtextures * sizeof(int), PU_STATIC, 0);
+ textureheight = Z_Malloc(numtextures * sizeof(fixed_t), PU_STATIC, 0);
totalwidth = 0;
@@ -438,7 +438,7 @@ void R_InitTextures(void)
//
// translation table for global animation
//
- texturetranslation = Z_Malloc((numtextures + 1) * 4, PU_STATIC, 0);
+ texturetranslation = Z_Malloc((numtextures + 1) * sizeof(int), PU_STATIC, 0);
for (i = 0; i < numtextures; i++)
texturetranslation[i] = i;
}
@@ -461,7 +461,7 @@ void R_InitFlats(void)
numflats = lastflat - firstflat + 1;
// translation table for global animation
- flattranslation = Z_Malloc((numflats + 1) * 4, PU_STATIC, 0);
+ flattranslation = Z_Malloc((numflats + 1) * sizeof(int), PU_STATIC, 0);
for (i = 0; i < numflats; i++)
flattranslation[i] = i;
}
@@ -485,9 +485,9 @@ void R_InitSpriteLumps(void)
firstspritelump = W_GetNumForName("S_START") + 1;
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(fixed_t), PU_STATIC, 0);
+ spriteoffset = Z_Malloc(numspritelumps * sizeof(fixed_t), PU_STATIC, 0);
+ spritetopoffset = Z_Malloc(numspritelumps * sizeof(fixed_t), PU_STATIC, 0);
for (i = 0; i < numspritelumps; i++)
{