Remove #define segment2 segment

This commit is contained in:
Kp 2014-10-21 03:14:36 +00:00
parent 32cb662f66
commit 944baf824d
4 changed files with 9 additions and 12 deletions

View file

@ -228,8 +228,6 @@ struct segment {
};
#if defined(DXX_BUILD_DESCENT_II)
#define segment2 segment
#define Segment2s Segments
#define S2F_AMBIENT_WATER 0x01
@ -396,7 +394,7 @@ extern void add_segment_to_group(int segment_num, int group_num);
/*
* reads a segment2 structure from a PHYSFS_file
*/
void segment2_read(segment2 *s2, PHYSFS_file *fp);
void segment2_read(segment *s2, PHYSFS_file *fp);
/*
* reads a delta_light structure from a PHYSFS_file
@ -408,7 +406,7 @@ void delta_light_read(delta_light *dl, PHYSFS_file *fp);
*/
void dl_index_read(dl_index *di, PHYSFS_file *fp);
void segment2_write(segment2 *s2, PHYSFS_file *fp);
void segment2_write(const segment *s2, PHYSFS_file *fp);
void delta_light_write(delta_light *dl, PHYSFS_file *fp);
void dl_index_write(dl_index *di, PHYSFS_file *fp);
#endif

View file

@ -456,7 +456,7 @@ int load_mine_data(PHYSFS_file *LoadFile)
mine_fileinfo.segment2_offset = -1;
mine_fileinfo.segment2_howmany = 0;
mine_fileinfo.segment2_sizeof = sizeof(segment2);
mine_fileinfo.segment2_sizeof = 0;
#endif
// Read in mine_top_fileinfo to get size of saved fileinfo.
@ -704,7 +704,7 @@ int load_mine_data(PHYSFS_file *LoadFile)
if (mine_top_fileinfo.fileinfo_version >= 20)
range_for (auto i, highest_valid(Segments))
{
PHYSFS_read(LoadFile, &Segment2s[i], sizeof(segment2), 1);
segment2_read(&Segments[i], LoadFile);
fuelcen_activate( &Segments[i], Segment2s[i].special );
}
#endif

View file

@ -1665,7 +1665,6 @@ static void apply_light_to_segment(visited_segment_bitarray_t &visited, segment
light_at_point = Magical_light_constant;
if (light_at_point >= 0) {
segment2 *seg2p = &Segment2s[segnum];
light_at_point = fixmul(light_at_point, light_intensity);
#if 0 // don't see the point, static_light can be greater than F1_0
if (light_at_point >= F1_0)
@ -1673,9 +1672,9 @@ static void apply_light_to_segment(visited_segment_bitarray_t &visited, segment
if (light_at_point <= -F1_0)
light_at_point = -(F1_0-1);
#endif
seg2p->static_light += light_at_point;
if (seg2p->static_light < 0) // if it went negative, saturate
seg2p->static_light = 0;
segp->static_light += light_at_point;
if (segp->static_light < 0) // if it went negative, saturate
segp->static_light = 0;
} // end if (light_at_point...
} // end if (dist_to_rseg...
}

View file

@ -30,7 +30,7 @@ void segment_side_wall_tmap_write(PHYSFS_file *fp, const side &side)
/*
* reads a segment2 structure from a PHYSFS_file
*/
void segment2_read(segment2 *s2, PHYSFS_file *fp)
void segment2_read(segment *s2, PHYSFS_file *fp)
{
s2->special = PHYSFSX_readByte(fp);
s2->matcen_num = PHYSFSX_readByte(fp);
@ -65,7 +65,7 @@ void dl_index_read(dl_index *di, PHYSFS_file *fp)
di->index = PHYSFSX_readShort(fp);
}
void segment2_write(segment2 *s2, PHYSFS_file *fp)
void segment2_write(const segment *s2, PHYSFS_file *fp)
{
PHYSFSX_writeU8(fp, s2->special);
PHYSFSX_writeU8(fp, s2->matcen_num);