示例#1
0
/*
 * reads a polymodel structure from a CFILE
 */
extern void polymodel_read(polymodel *pm, CFILE *fp)
{
	int i;

	pm->n_models = cfile_read_int(fp);
	pm->model_data_size = cfile_read_int(fp);
	pm->model_data = (ubyte *) cfile_read_int(fp);
	for (i = 0; i < MAX_SUBMODELS; i++)
		pm->submodel_ptrs[i] = cfile_read_int(fp);
	for (i = 0; i < MAX_SUBMODELS; i++)
		cfile_read_vector(&(pm->submodel_offsets[i]), fp);
	for (i = 0; i < MAX_SUBMODELS; i++)
		cfile_read_vector(&(pm->submodel_norms[i]), fp);
	for (i = 0; i < MAX_SUBMODELS; i++)
		cfile_read_vector(&(pm->submodel_pnts[i]), fp);
	for (i = 0; i < MAX_SUBMODELS; i++)
		pm->submodel_rads[i] = cfile_read_fix(fp);
	cfread(pm->submodel_parents, MAX_SUBMODELS, 1, fp);
	for (i = 0; i < MAX_SUBMODELS; i++)
		cfile_read_vector(&(pm->submodel_mins[i]), fp);
	for (i = 0; i < MAX_SUBMODELS; i++)
		cfile_read_vector(&(pm->submodel_maxs[i]), fp);
	cfile_read_vector(&(pm->mins), fp);
	cfile_read_vector(&(pm->maxs), fp);
	pm->rad = cfile_read_fix(fp);
	pm->n_textures = cfile_read_byte(fp);
	pm->first_texture = cfile_read_short(fp);
	pm->simpler_model = cfile_read_byte(fp);
}
示例#2
0
/*
 * reads n polymodel structs from a CFILE
 */
extern int polymodel_read_n(polymodel *pm, int n, CFILE *fp)
{
	int i, j;

	for (i = 0; i < n; i++) {
		pm[i].n_models = cfile_read_int(fp);
		pm[i].model_data_size = cfile_read_int(fp);
		pm[i].model_data = (ubyte *) (size_t)cfile_read_int(fp);
		for (j = 0; j < MAX_SUBMODELS; j++)
			pm[i].submodel_ptrs[j] = cfile_read_int(fp);
		for (j = 0; j < MAX_SUBMODELS; j++)
			cfile_read_vector(&(pm[i].submodel_offsets[j]), fp);
		for (j = 0; j < MAX_SUBMODELS; j++)
			cfile_read_vector(&(pm[i].submodel_norms[j]), fp);
		for (j = 0; j < MAX_SUBMODELS; j++)
			cfile_read_vector(&(pm[i].submodel_pnts[j]), fp);
		for (j = 0; j < MAX_SUBMODELS; j++)
			pm[i].submodel_rads[j] = cfile_read_fix(fp);
		cfread(pm[i].submodel_parents, MAX_SUBMODELS, 1, fp);
		for (j = 0; j < MAX_SUBMODELS; j++)
			cfile_read_vector(&(pm[i].submodel_mins[j]), fp);
		for (j = 0; j < MAX_SUBMODELS; j++)
			cfile_read_vector(&(pm[i].submodel_maxs[j]), fp);
		cfile_read_vector(&(pm[i].mins), fp);
		cfile_read_vector(&(pm[i].maxs), fp);
		pm[i].rad = cfile_read_fix(fp);
		pm[i].n_textures = cfile_read_byte(fp);
		pm[i].first_texture = cfile_read_short(fp);
		pm[i].simpler_model = cfile_read_byte(fp);
	}
	return i;
}
示例#3
0
/*
 * reads a v29_trigger structure from a CFILE
 */
extern void trigger_read(trigger *t, CFILE *fp)
{
	int i;
	
	t->type = cfile_read_byte(fp);
	t->flags = cfile_read_short(fp);
	t->value = cfile_read_fix(fp);
	t->time = cfile_read_fix(fp);
	t->link_num = cfile_read_byte(fp);
	t->num_links = cfile_read_short(fp);
	for (i=0; i<MAX_WALLS_PER_LINK; i++ )
		t->seg[i] = cfile_read_short(fp);
	for (i=0; i<MAX_WALLS_PER_LINK; i++ )
		t->side[i] = cfile_read_short(fp);
}
示例#4
0
/*
 * reads n vclip structs from a CFILE
 */
int vclip_read_n(vclip *vc, int n, CFILE *fp)
{
	int i, j;
	
	for (i = 0; i < n; i++) {
		vc[i].play_time = cfile_read_fix(fp);
		vc[i].num_frames = cfile_read_int(fp);
		vc[i].frame_time = cfile_read_fix(fp);
		vc[i].flags = cfile_read_int(fp);
		vc[i].sound_num = cfile_read_short(fp);
		for (j = 0; j < VCLIP_MAX_FRAMES; j++)
			vc[i].frames[j].index = cfile_read_short(fp);
		vc[i].light_value = cfile_read_fix(fp);
	}
	return i;
}
示例#5
0
文件: segment.c 项目: btb/d2x
/*
 * reads a segment2 structure from a CFILE
 */
void segment2_read(segment2 *s2, CFILE *fp)
{
	s2->special = cfile_read_byte(fp);
	s2->matcen_num = cfile_read_byte(fp);
	s2->value = cfile_read_byte(fp);
	s2->s2_flags = cfile_read_byte(fp);
	s2->static_light = cfile_read_fix(fp);
}
示例#6
0
文件: wall.c 项目: gameplayer22/d2x-1
/*
 * reads an active_door structure from a CFILE
 */
extern void active_door_read(active_door *ad, CFILE *fp)
{
	ad->n_parts = cfile_read_int(fp);
	ad->front_wallnum[0] = cfile_read_short(fp);
	ad->front_wallnum[1] = cfile_read_short(fp);
	ad->back_wallnum[0] = cfile_read_short(fp);
	ad->back_wallnum[1] = cfile_read_short(fp);
	ad->time = cfile_read_fix(fp);
}
示例#7
0
文件: wall.c 项目: gameplayer22/d2x-1
/*
 * reads a v16_wall structure from a CFILE
 */
extern void v16_wall_read(v16_wall *w, CFILE *fp)
{
	w->type = cfile_read_byte(fp);
	w->flags = cfile_read_byte(fp);
	w->hps = cfile_read_fix(fp);
	w->trigger = cfile_read_byte(fp);
	w->clip_num = cfile_read_byte(fp);
	w->keys = cfile_read_byte(fp);
}
示例#8
0
文件: wall.c 项目: gameplayer22/d2x-1
/*
 * reads a v19_door structure from a CFILE
 */
extern void v19_door_read(v19_door *d, CFILE *fp)
{
	d->n_parts = cfile_read_int(fp);
	d->seg[0] = cfile_read_short(fp);
	d->seg[1] = cfile_read_short(fp);
	d->side[0] = cfile_read_short(fp);
	d->side[1] = cfile_read_short(fp);
	d->type[0] = cfile_read_short(fp);
	d->type[1] = cfile_read_short(fp);
	d->open = cfile_read_fix(fp);
}
示例#9
0
文件: wall.c 项目: gameplayer22/d2x-1
/*
 * reads a v19_wall structure from a CFILE
 */
extern void v19_wall_read(v19_wall *w, CFILE *fp)
{
	w->segnum = cfile_read_int(fp);
	w->sidenum = cfile_read_int(fp);
	w->type = cfile_read_byte(fp);
	w->flags = cfile_read_byte(fp);
	w->hps = cfile_read_fix(fp);
	w->trigger = cfile_read_byte(fp);
	w->clip_num = cfile_read_byte(fp);
	w->keys = cfile_read_byte(fp);
	w->linked_wall = cfile_read_int(fp);
}
示例#10
0
文件: wall.c 项目: gameplayer22/d2x-1
/*
 * reads a wall structure from a CFILE
 */
extern void wall_read(wall *w, CFILE *fp)
{
	w->segnum = cfile_read_int(fp);
	w->sidenum = cfile_read_int(fp);
	w->hps = cfile_read_fix(fp);
	w->linked_wall = cfile_read_int(fp);
	w->type = cfile_read_byte(fp);
	w->flags = cfile_read_byte(fp);
	w->state = cfile_read_byte(fp);
	w->trigger = cfile_read_byte(fp);
	w->clip_num = cfile_read_byte(fp);
	w->keys = cfile_read_byte(fp);
	w->controlling_trigger = cfile_read_byte(fp);
	w->cloak_value = cfile_read_byte(fp);
}
示例#11
0
文件: wall.c 项目: gameplayer22/d2x-1
/*
 * reads a wclip structure from a CFILE
 */
int wclip_read_n(wclip *wc, int n, CFILE *fp)
{
	int i, j;

	for (i = 0; i < n; i++) {
		wc[i].play_time = cfile_read_fix(fp);
		wc[i].num_frames = cfile_read_short(fp);
		for (j = 0; j < MAX_CLIP_FRAMES; j++)
			wc[i].frames[j] = cfile_read_short(fp);
		wc[i].open_sound = cfile_read_short(fp);
		wc[i].close_sound = cfile_read_short(fp);
		wc[i].flags = cfile_read_short(fp);
		cfread(wc[i].filename, 13, 1, fp);
		wc[i].pad = cfile_read_byte(fp);
	}
	return i;
}
示例#12
0
文件: player.c 项目: btb/d2x
/*
 * reads a player_ship structure from a CFILE
 */
void player_ship_read(player_ship *ps, CFILE *fp)
{
	int i;

	ps->model_num = cfile_read_int(fp);
	ps->expl_vclip_num = cfile_read_int(fp);
	ps->mass = cfile_read_fix(fp);
	ps->drag = cfile_read_fix(fp);
	ps->max_thrust = cfile_read_fix(fp);
	ps->reverse_thrust = cfile_read_fix(fp);
	ps->brakes = cfile_read_fix(fp);
	ps->wiggle = cfile_read_fix(fp);
	ps->max_rotthrust = cfile_read_fix(fp);
	for (i = 0; i < N_PLAYER_GUNS; i++)
		cfile_read_vector(&(ps->gun_points[i]), fp);
}
示例#13
0
/*
 * reads n robot_info structs from a CFILE
 */
int robot_info_read_n(robot_info *ri, int n, CFILE *fp)
{
	int i, j;

	for (i = 0; i < n; i++) {
		ri[i].model_num = cfile_read_int(fp);
		for (j = 0; j < MAX_GUNS; j++)
			cfile_read_vector(&(ri[i].gun_points[j]), fp);
		cfread(ri[i].gun_submodels, MAX_GUNS, 1, fp);

		ri[i].exp1_vclip_num = cfile_read_short(fp);
		ri[i].exp1_sound_num = cfile_read_short(fp);

		ri[i].exp2_vclip_num = cfile_read_short(fp);
		ri[i].exp2_sound_num = cfile_read_short(fp);

		ri[i].weapon_type = cfile_read_byte(fp);
		ri[i].weapon_type2 = cfile_read_byte(fp);
		ri[i].n_guns = cfile_read_byte(fp);
		ri[i].contains_id = cfile_read_byte(fp);

		ri[i].contains_count = cfile_read_byte(fp);
		ri[i].contains_prob = cfile_read_byte(fp);
		ri[i].contains_type = cfile_read_byte(fp);
		ri[i].kamikaze = cfile_read_byte(fp);

		ri[i].score_value = cfile_read_short(fp);
		ri[i].badass = cfile_read_byte(fp);
		ri[i].energy_drain = cfile_read_byte(fp);

		ri[i].lighting = cfile_read_fix(fp);
		ri[i].strength = cfile_read_fix(fp);

		ri[i].mass = cfile_read_fix(fp);
		ri[i].drag = cfile_read_fix(fp);

		for (j = 0; j < NDL; j++)
			ri[i].field_of_view[j] = cfile_read_fix(fp);
		for (j = 0; j < NDL; j++)
			ri[i].firing_wait[j] = cfile_read_fix(fp);
		for (j = 0; j < NDL; j++)
			ri[i].firing_wait2[j] = cfile_read_fix(fp);
		for (j = 0; j < NDL; j++)
			ri[i].turn_time[j] = cfile_read_fix(fp);
		for (j = 0; j < NDL; j++)
			ri[i].max_speed[j] = cfile_read_fix(fp);
		for (j = 0; j < NDL; j++)
			ri[i].circle_distance[i] = cfile_read_fix(fp);
		cfread(ri[i].rapidfire_count, NDL, 1, fp);

		cfread(ri[i].evade_speed, NDL, 1, fp);

		ri[i].cloak_type = cfile_read_byte(fp);
		ri[i].attack_type = cfile_read_byte(fp);

		ri[i].see_sound = cfile_read_byte(fp);
		ri[i].attack_sound = cfile_read_byte(fp);
		ri[i].claw_sound = cfile_read_byte(fp);
		ri[i].taunt_sound = cfile_read_byte(fp);

		ri[i].boss_flag = cfile_read_byte(fp);
		ri[i].companion = cfile_read_byte(fp);
		ri[i].smart_blobs = cfile_read_byte(fp);
		ri[i].energy_blobs = cfile_read_byte(fp);

		ri[i].thief = cfile_read_byte(fp);
		ri[i].pursuit = cfile_read_byte(fp);
		ri[i].lightcast = cfile_read_byte(fp);
		ri[i].death_roll = cfile_read_byte(fp);

		ri[i].flags = cfile_read_byte(fp);
		cfread(ri[i].pad, 3, 1, fp);

		ri[i].deathroll_sound = cfile_read_byte(fp);
		ri[i].glow = cfile_read_byte(fp);
		ri[i].behavior = cfile_read_byte(fp);
		ri[i].aim = cfile_read_byte(fp);

		for (j = 0; j < MAX_GUNS + 1; j++)
			jointlist_read_n(ri[i].anim_states[j], N_ANIM_STATES, fp);

		ri[i].always_0xabcd = cfile_read_int(fp);
	}
	return i;
}
示例#14
0
void cfile_read_vector(vms_vector *v, CFILE *file)
{
	v->x = cfile_read_fix(file);
	v->y = cfile_read_fix(file);
	v->z = cfile_read_fix(file);
}