コード例 #1
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;
}
コード例 #2
0
ファイル: polyobj.c プロジェクト: gameplayer22/d2x-1
/*
 * 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);
}
コード例 #3
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);
}
コード例 #4
0
ファイル: cntrlcen.c プロジェクト: btb/d2x
/*
 * reads n reactor structs from a CFILE
 */
extern int reactor_read_n(reactor *r, int n, CFILE *fp)
{
	int i, j;

	for (i = 0; i < n; i++) {
		r[i].model_num = cfile_read_int(fp);
		r[i].n_guns = cfile_read_int(fp);
		for (j = 0; j < MAX_CONTROLCEN_GUNS; j++)
			cfile_read_vector(&(r[i].gun_points[j]), fp);
		for (j = 0; j < MAX_CONTROLCEN_GUNS; j++)
			cfile_read_vector(&(r[i].gun_dirs[j]), fp);
	}
	return i;
}
コード例 #5
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);
}
コード例 #6
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);
}
コード例 #7
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;
}
コード例 #8
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);
}
コード例 #9
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);
}
コード例 #10
0
ファイル: robot.c プロジェクト: gameplayer22/d2x-1
/*
 * 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;
}