Move model_buf back onto stack
This commit is contained in:
parent
feb4abd98b
commit
56b65506ce
|
@ -177,8 +177,6 @@ vms_angvec anim_angs[N_ANIM_STATES][MAX_SUBMODELS];
|
||||||
void robot_set_angles(robot_info *r,polymodel *pm,vms_angvec angs[N_ANIM_STATES][MAX_SUBMODELS]);
|
void robot_set_angles(robot_info *r,polymodel *pm,vms_angvec angs[N_ANIM_STATES][MAX_SUBMODELS]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DEBUG_LEVEL CON_NORMAL
|
|
||||||
|
|
||||||
#ifdef WORDS_NEED_ALIGNMENT
|
#ifdef WORDS_NEED_ALIGNMENT
|
||||||
ubyte * old_dest(chunk o) // return where chunk is (in unaligned struct)
|
ubyte * old_dest(chunk o) // return where chunk is (in unaligned struct)
|
||||||
{
|
{
|
||||||
|
@ -269,11 +267,7 @@ polymodel *read_model_file(polymodel *pm,char *filename,robot_info *r)
|
||||||
short version;
|
short version;
|
||||||
int id,len, next_chunk;
|
int id,len, next_chunk;
|
||||||
int anim_flag = 0;
|
int anim_flag = 0;
|
||||||
ubyte *model_buf;
|
ubyte model_buf[MODEL_BUF_SIZE];
|
||||||
|
|
||||||
model_buf = (ubyte *)d_malloc( MODEL_BUF_SIZE * sizeof(ubyte) );
|
|
||||||
if (!model_buf)
|
|
||||||
Error("Can't allocate space to read model %s\n", filename);
|
|
||||||
|
|
||||||
if ((ifile=PHYSFSX_openReadBuffered(filename))==NULL)
|
if ((ifile=PHYSFSX_openReadBuffered(filename))==NULL)
|
||||||
Error("Can't open file <%s>",filename);
|
Error("Can't open file <%s>",filename);
|
||||||
|
@ -431,16 +425,12 @@ polymodel *read_model_file(polymodel *pm,char *filename,robot_info *r)
|
||||||
pof_cfseek(model_buf,next_chunk,SEEK_SET);
|
pof_cfseek(model_buf,next_chunk,SEEK_SET);
|
||||||
}
|
}
|
||||||
|
|
||||||
d_free(model_buf);
|
|
||||||
|
|
||||||
#ifdef WORDS_NEED_ALIGNMENT
|
#ifdef WORDS_NEED_ALIGNMENT
|
||||||
align_polygon_model_data(pm);
|
align_polygon_model_data(pm);
|
||||||
#endif
|
#endif
|
||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef WORDS_BIGENDIAN
|
||||||
swap_polygon_model_data(pm->model_data);
|
swap_polygon_model_data(pm->model_data);
|
||||||
#endif
|
#endif
|
||||||
//verify(pm->model_data);
|
|
||||||
|
|
||||||
return pm;
|
return pm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -452,11 +442,7 @@ int read_model_guns(char *filename,vms_vector *gun_points, vms_vector *gun_dirs,
|
||||||
short version;
|
short version;
|
||||||
int id,len;
|
int id,len;
|
||||||
int n_guns=0;
|
int n_guns=0;
|
||||||
ubyte *model_buf;
|
ubyte model_buf[MODEL_BUF_SIZE];
|
||||||
|
|
||||||
model_buf = (ubyte *)d_malloc( MODEL_BUF_SIZE * sizeof(ubyte) );
|
|
||||||
if (!model_buf)
|
|
||||||
Error("Can't allocate space to read model %s\n", filename);
|
|
||||||
|
|
||||||
if ((ifile=PHYSFSX_openReadBuffered(filename))==NULL)
|
if ((ifile=PHYSFSX_openReadBuffered(filename))==NULL)
|
||||||
Error("Can't open file <%s>",filename);
|
Error("Can't open file <%s>",filename);
|
||||||
|
@ -510,8 +496,6 @@ int read_model_guns(char *filename,vms_vector *gun_points, vms_vector *gun_dirs,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
d_free(model_buf);
|
|
||||||
|
|
||||||
return n_guns;
|
return n_guns;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue