Move TextmapFixFlatOffsets() above P_LoadTextmap() so that it can compile.

This commit is contained in:
Nev3r 2019-12-30 12:33:24 +01:00
parent f9aabe753e
commit e43df2993f
1 changed files with 29 additions and 29 deletions

View File

@ -1478,6 +1478,35 @@ static void TextmapParse(UINT32 dataPos, size_t num, void (*parser)(UINT32, char
Z_Free(open);
}
/** Provides a fix to the flat alignment coordinate transform from standard Textmaps.
*/
static void TextmapFixFlatOffsets (sector_t* sec)
{
if (sec->floorpic_angle)
{
fixed_t pc = FINECOSINE(sec->floorpic_angle>>ANGLETOFINESHIFT);
fixed_t ps = FINESINE (sec->floorpic_angle>>ANGLETOFINESHIFT);
fixed_t xoffs = sec->floor_xoffs;
fixed_t yoffs = sec->floor_yoffs;
#define MAXFLATSIZE (2048<<FRACBITS)
sec->floor_xoffs = (FixedMul(xoffs, pc) % MAXFLATSIZE) - (FixedMul(yoffs, ps) % MAXFLATSIZE);
sec->floor_yoffs = (FixedMul(xoffs, ps) % MAXFLATSIZE) + (FixedMul(yoffs, pc) % MAXFLATSIZE);
#undef MAXFLATSIZE
}
if (sec->ceilingpic_angle)
{
fixed_t pc = FINECOSINE(sec->ceilingpic_angle>>ANGLETOFINESHIFT);
fixed_t ps = FINESINE (sec->ceilingpic_angle>>ANGLETOFINESHIFT);
fixed_t xoffs = sec->ceiling_xoffs;
fixed_t yoffs = sec->ceiling_yoffs;
#define MAXFLATSIZE (2048<<FRACBITS)
sec->ceiling_xoffs = (FixedMul(xoffs, pc) % MAXFLATSIZE) - (FixedMul(yoffs, ps) % MAXFLATSIZE);
sec->ceiling_yoffs = (FixedMul(xoffs, ps) % MAXFLATSIZE) + (FixedMul(yoffs, pc) % MAXFLATSIZE);
#undef MAXFLATSIZE
}
}
/** Loads the textmap data, after obtaining the elements count and allocating their respective space.
*/
static void P_LoadTextmap (void)
@ -1562,35 +1591,6 @@ static void P_LoadTextmap (void)
}
}
/** Provides a fix to the flat alignment coordinate transform from standard Textmaps.
*/
static void TextmapFixFlatOffsets (sector_t* sec)
{
if (sec->floorpic_angle)
{
fixed_t pc = FINECOSINE(sec->floorpic_angle>>ANGLETOFINESHIFT);
fixed_t ps = FINESINE (sec->floorpic_angle>>ANGLETOFINESHIFT);
fixed_t xoffs = sec->floor_xoffs;
fixed_t yoffs = sec->floor_yoffs;
#define MAXFLATSIZE (2048<<FRACBITS)
sec->floor_xoffs = (FixedMul(xoffs, pc) % MAXFLATSIZE) - (FixedMul(yoffs, ps) % MAXFLATSIZE);
sec->floor_yoffs = (FixedMul(xoffs, ps) % MAXFLATSIZE) + (FixedMul(yoffs, pc) % MAXFLATSIZE);
#undef MAXFLATSIZE
}
if (sec->ceilingpic_angle)
{
fixed_t pc = FINECOSINE(sec->ceilingpic_angle>>ANGLETOFINESHIFT);
fixed_t ps = FINESINE (sec->ceilingpic_angle>>ANGLETOFINESHIFT);
fixed_t xoffs = sec->ceiling_xoffs;
fixed_t yoffs = sec->ceiling_yoffs;
#define MAXFLATSIZE (2048<<FRACBITS)
sec->ceiling_xoffs = (FixedMul(xoffs, pc) % MAXFLATSIZE) - (FixedMul(yoffs, ps) % MAXFLATSIZE);
sec->ceiling_yoffs = (FixedMul(xoffs, ps) % MAXFLATSIZE) + (FixedMul(yoffs, pc) % MAXFLATSIZE);
#undef MAXFLATSIZE
}
}
static void P_LoadMapData(const virtres_t *virt)
{
virtlump_t* virtvertexes = NULL, * virtsectors = NULL, * virtsidedefs = NULL, * virtlinedefs = NULL, * virtthings = NULL;