summaryrefslogtreecommitdiff
path: root/src/hexen
diff options
context:
space:
mode:
Diffstat (limited to 'src/hexen')
-rw-r--r--src/hexen/am_data.h6
-rw-r--r--src/hexen/p_mobj.c4
-rw-r--r--src/hexen/r_data.c20
3 files changed, 20 insertions, 10 deletions
diff --git a/src/hexen/am_data.h b/src/hexen/am_data.h
index db964598..e20e34ce 100644
--- a/src/hexen/am_data.h
+++ b/src/hexen/am_data.h
@@ -108,9 +108,9 @@ mline_t triangle_guy[] = {
#define R (FRACUNIT)
mline_t thintriangle_guy[] = {
- { { -.5*R, -.7*R }, { R, 0 } },
- { { R, 0 }, { -.5*R, .7*R } },
- { { -.5*R, .7*R }, { -.5*R, -.7*R } }
+ { { (fixed_t)(-.5*R), (fixed_t)(-.7*R) }, { (fixed_t)(R ), (fixed_t)(0 ) } },
+ { { (fixed_t)(R ), (fixed_t)(0 ) }, { (fixed_t)(-.5*R), (fixed_t)(.7*R ) } },
+ { { (fixed_t)(-.5*R), (fixed_t)(.7*R ) }, { (fixed_t)(-.5*R), (fixed_t)(-.7*R) } }
};
#undef R
#define NUMTHINTRIANGLEGUYLINES (sizeof(thintriangle_guy)/sizeof(mline_t))
diff --git a/src/hexen/p_mobj.c b/src/hexen/p_mobj.c
index 5d6f7097..ee8f8fd4 100644
--- a/src/hexen/p_mobj.c
+++ b/src/hexen/p_mobj.c
@@ -100,7 +100,7 @@ boolean P_SetMobjState(mobj_t * mobj, statenum_t state)
if (state == S_NULL)
{ // Remove mobj
- mobj->state = S_NULL;
+ mobj->state = (state_t *) S_NULL;
P_RemoveMobj(mobj);
return (false);
}
@@ -130,7 +130,7 @@ boolean P_SetMobjStateNF(mobj_t * mobj, statenum_t state)
if (state == S_NULL)
{ // Remove mobj
- mobj->state = S_NULL;
+ mobj->state = (state_t *) S_NULL;
P_RemoveMobj(mobj);
return (false);
}
diff --git a/src/hexen/r_data.c b/src/hexen/r_data.c
index bd020073..b82c0ff6 100644
--- a/src/hexen/r_data.c
+++ b/src/hexen/r_data.c
@@ -218,7 +218,7 @@ void R_GenerateLookup(int texnum)
// fill in the lump / offset, so columns with only a single patch are
// all done
//
- patchcount = (byte *) alloca(texture->width);
+ patchcount = (byte *) Z_Malloc(texture->width, PU_STATIC, &patchcount);
memset(patchcount, 0, texture->width);
patch = texture->patches;
@@ -260,6 +260,8 @@ void R_GenerateLookup(int texnum)
texturecompositesize[texnum] += texture->height;
}
}
+
+ Z_Free(patchcount);
}
@@ -319,7 +321,7 @@ void R_InitTextures(void)
names = W_CacheLumpName("PNAMES", PU_STATIC);
nummappatches = LONG(*((int *) names));
name_p = names + 4;
- patchlookup = alloca(nummappatches * sizeof(*patchlookup));
+ patchlookup = Z_Malloc(nummappatches * sizeof(*patchlookup), PU_STATIC, NULL);
for (i = 0; i < nummappatches; i++)
{
strncpy(name, name_p + i * 8, 8);
@@ -403,6 +405,8 @@ void R_InitTextures(void)
totalwidth += texture->width;
}
+ Z_Free(patchlookup);
+
W_ReleaseLumpName("TEXTURE1");
if (maptex2)
W_ReleaseLumpName("TEXTURE2");
@@ -620,7 +624,7 @@ void R_PrecacheLevel(void)
//
// precache flats
//
- flatpresent = alloca(numflats);
+ flatpresent = Z_Malloc(numflats, PU_STATIC, NULL);
memset(flatpresent, 0, numflats);
for (i = 0; i < numsectors; i++)
{
@@ -637,10 +641,12 @@ void R_PrecacheLevel(void)
W_CacheLumpNum(lump, PU_CACHE);
}
+ Z_Free(flatpresent);
+
//
// precache textures
//
- texturepresent = alloca(numtextures);
+ texturepresent = Z_Malloc(numtextures, PU_STATIC, NULL);
memset(texturepresent, 0, numtextures);
for (i = 0; i < numsides; i++)
@@ -667,10 +673,12 @@ void R_PrecacheLevel(void)
}
}
+ Z_Free(texturepresent);
+
//
// precache sprites
//
- spritepresent = alloca(numsprites);
+ spritepresent = Z_Malloc(numsprites, PU_STATIC, NULL);
memset(spritepresent, 0, numsprites);
for (th = thinkercap.next; th != &thinkercap; th = th->next)
@@ -695,4 +703,6 @@ void R_PrecacheLevel(void)
}
}
}
+
+ Z_Free(spritepresent);
}