Example #1
0
/*
 * reads n eclip structs from a PHYSFS_file
 */
int eclip_read_n(eclip *ec, int n, PHYSFS_file *fp)
{
	int i;

	for (i = 0; i < n; i++) {
		vclip_read_n(&ec[i].vc, 1, fp);
		ec[i].time_left = PHYSFSX_readFix(fp);
		ec[i].frame_count = PHYSFSX_readInt(fp);
		ec[i].changing_wall_texture = PHYSFSX_readShort(fp);
		ec[i].changing_object_texture = PHYSFSX_readShort(fp);
		ec[i].flags = PHYSFSX_readInt(fp);
		ec[i].crit_clip = PHYSFSX_readInt(fp);
		ec[i].dest_bm_num = PHYSFSX_readInt(fp);
		ec[i].dest_vclip = PHYSFSX_readInt(fp);
		ec[i].dest_eclip = PHYSFSX_readInt(fp);
		ec[i].dest_size = PHYSFSX_readFix(fp);
		ec[i].sound_num = PHYSFSX_readInt(fp);
		ec[i].segnum = (segnum_t)PHYSFSX_readInt(fp);
		ec[i].sidenum = PHYSFSX_readInt(fp);
	}
	return i;
}
Example #2
0
/*
 * reads n eclip structs from a CFILE
 */
int EClipReadN(eclip *ecP, int n, CFILE *fp)
{
	int i = n;

for (; n; n--, ecP++) {
	vclip_read_n(&ecP->vc, 1, fp);
	ecP->time_left = CFReadFix(fp);
	ecP->nCurFrame = CFReadInt(fp);
	ecP->changing_wall_texture = CFReadShort(fp);
	ecP->changingObject_texture = CFReadShort(fp);
	ecP->flags = CFReadInt(fp);
	ecP->crit_clip = CFReadInt(fp);
	ecP->dest_bm_num = CFReadInt(fp);
	ecP->dest_vclip = CFReadInt(fp);
	ecP->dest_eclip = CFReadInt(fp);
	ecP->dest_size = CFReadFix(fp);
	ecP->nSound = CFReadInt(fp);
	ecP->nSegment = CFReadInt(fp);
	ecP->nSide = CFReadInt(fp);
	}
	return i;
}
Example #3
0
void bm_read_all(PHYSFS_file * fp)
{
	int i,t;

	NumTextures = PHYSFSX_readInt(fp);
	bitmap_index_read_n(Textures, NumTextures, fp );
	tmap_info_read_n(TmapInfo, NumTextures, fp);

	t = PHYSFSX_readInt(fp);
	PHYSFS_read( fp, Sounds, sizeof(ubyte), t );
	PHYSFS_read( fp, AltSounds, sizeof(ubyte), t );

	Num_vclips = PHYSFSX_readInt(fp);
	vclip_read_n(Vclip, Num_vclips, fp);

	Num_effects = PHYSFSX_readInt(fp);
	eclip_read_n(Effects, Num_effects, fp);

	Num_wall_anims = PHYSFSX_readInt(fp);
	wclip_read_n(WallAnims, Num_wall_anims, fp);

	N_robot_types = PHYSFSX_readInt(fp);
	robot_info_read_n(Robot_info, N_robot_types, fp);

	N_robot_joints = PHYSFSX_readInt(fp);
	jointpos_read_n(Robot_joints, N_robot_joints, fp);

	N_weapon_types = PHYSFSX_readInt(fp);
	weapon_info_read_n(Weapon_info, N_weapon_types, fp, Piggy_hamfile_version);

	N_powerup_types = PHYSFSX_readInt(fp);
	powerup_type_info_read_n(Powerup_info, N_powerup_types, fp);

	N_polygon_models = PHYSFSX_readInt(fp);
	polymodel_read_n(Polygon_models, N_polygon_models, fp);

	for (i=0; i<N_polygon_models; i++ )
		polygon_model_data_read(&Polygon_models[i], fp);

	for (i = 0; i < N_polygon_models; i++)
		Dying_modelnums[i] = PHYSFSX_readInt(fp);
	for (i = 0; i < N_polygon_models; i++)
		Dead_modelnums[i] = PHYSFSX_readInt(fp);

	t = PHYSFSX_readInt(fp);
	bitmap_index_read_n(Gauges, t, fp);
	bitmap_index_read_n(Gauges_hires, t, fp);

	N_ObjBitmaps = PHYSFSX_readInt(fp);
	bitmap_index_read_n(ObjBitmaps, N_ObjBitmaps, fp);
	for (i = 0; i < N_ObjBitmaps; i++)
		ObjBitmapPtrs[i] = PHYSFSX_readShort(fp);

	player_ship_read(&only_player_ship, fp);

	Num_cockpits = PHYSFSX_readInt(fp);
	bitmap_index_read_n(cockpit_bitmap, Num_cockpits, fp);

//@@	PHYSFS_read( fp, &Num_total_object_types, sizeof(int), 1 );
//@@	PHYSFS_read( fp, ObjType, sizeof(byte), Num_total_object_types );
//@@	PHYSFS_read( fp, ObjId, sizeof(byte), Num_total_object_types );
//@@	PHYSFS_read( fp, ObjStrength, sizeof(fix), Num_total_object_types );

	First_multi_bitmap_num = PHYSFSX_readInt(fp);

	Num_reactors = PHYSFSX_readInt(fp);
	reactor_read_n(Reactors, Num_reactors, fp);

	Marker_model_num = PHYSFSX_readInt(fp);

	//@@PHYSFS_read( fp, &N_controlcen_guns, sizeof(int), 1 );
	//@@PHYSFS_read( fp, controlcen_gun_points, sizeof(vms_vector), N_controlcen_guns );
	//@@PHYSFS_read( fp, controlcen_gun_dirs, sizeof(vms_vector), N_controlcen_guns );

	if (Piggy_hamfile_version < 3) {
		exit_modelnum = PHYSFSX_readInt(fp);
		destroyed_exit_modelnum = PHYSFSX_readInt(fp);
	}
	else
		exit_modelnum = destroyed_exit_modelnum = N_polygon_models;
}