Fixed mixed-code-and-declaration, shadowed variables, etc ...and the compiler doesn't like P_AddEachTimeThinker being inline anymore for some reason, oh well
This commit is contained in:
parent
848061d517
commit
dc71e297bb
|
@ -5918,9 +5918,10 @@ static void P_Boss9Thinker(mobj_t *mobj)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
|
{
|
||||||
// We're all charged and ready now! Unleash the fury!!
|
// We're all charged and ready now! Unleash the fury!!
|
||||||
S_StopSound(mobj);
|
|
||||||
mobj_t *removemobj = mobj->tracer;
|
mobj_t *removemobj = mobj->tracer;
|
||||||
|
S_StopSound(mobj);
|
||||||
P_SetTarget(&mobj->tracer, mobj->hnext);
|
P_SetTarget(&mobj->tracer, mobj->hnext);
|
||||||
P_RemoveMobj(removemobj);
|
P_RemoveMobj(removemobj);
|
||||||
if (mobj->health <= mobj->info->damage)
|
if (mobj->health <= mobj->info->damage)
|
||||||
|
@ -5960,7 +5961,7 @@ static void P_Boss9Thinker(mobj_t *mobj)
|
||||||
// looking for the number of things to fire? that's done in case 1 now
|
// looking for the number of things to fire? that's done in case 1 now
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case 3:
|
case 3:
|
||||||
// Return to idle.
|
// Return to idle.
|
||||||
mobj->watertop = mobj->target->floorz + 32*FRACUNIT;
|
mobj->watertop = mobj->target->floorz + 32*FRACUNIT;
|
||||||
|
@ -9239,7 +9240,7 @@ void P_SceneryThinker(mobj_t *mobj)
|
||||||
mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
||||||
{
|
{
|
||||||
const mobjinfo_t *info = &mobjinfo[type];
|
const mobjinfo_t *info = &mobjinfo[type];
|
||||||
UINT8 sc = -1;
|
SINT8 sc = -1;
|
||||||
state_t *st;
|
state_t *st;
|
||||||
mobj_t *mobj = Z_Calloc(sizeof (*mobj), PU_LEVEL, NULL);
|
mobj_t *mobj = Z_Calloc(sizeof (*mobj), PU_LEVEL, NULL);
|
||||||
|
|
||||||
|
|
112
src/p_spec.c
112
src/p_spec.c
|
@ -5621,26 +5621,26 @@ ffloor_t *P_GetFFloorByID(sector_t *sec, UINT16 id)
|
||||||
/** Adds a newly formed 3Dfloor structure to a sector's ffloors list.
|
/** Adds a newly formed 3Dfloor structure to a sector's ffloors list.
|
||||||
*
|
*
|
||||||
* \param sec Target sector.
|
* \param sec Target sector.
|
||||||
* \param ffloor Newly formed 3Dfloor structure.
|
* \param fflr Newly formed 3Dfloor structure.
|
||||||
* \sa P_AddFakeFloor
|
* \sa P_AddFakeFloor
|
||||||
*/
|
*/
|
||||||
static inline void P_AddFFloorToList(sector_t *sec, ffloor_t *ffloor)
|
static inline void P_AddFFloorToList(sector_t *sec, ffloor_t *fflr)
|
||||||
{
|
{
|
||||||
ffloor_t *rover;
|
ffloor_t *rover;
|
||||||
|
|
||||||
if (!sec->ffloors)
|
if (!sec->ffloors)
|
||||||
{
|
{
|
||||||
sec->ffloors = ffloor;
|
sec->ffloors = fflr;
|
||||||
ffloor->next = 0;
|
fflr->next = 0;
|
||||||
ffloor->prev = 0;
|
fflr->prev = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (rover = sec->ffloors; rover->next; rover = rover->next);
|
for (rover = sec->ffloors; rover->next; rover = rover->next);
|
||||||
|
|
||||||
rover->next = ffloor;
|
rover->next = fflr;
|
||||||
ffloor->prev = rover;
|
fflr->prev = rover;
|
||||||
ffloor->next = 0;
|
fflr->next = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Adds a 3Dfloor.
|
/** Adds a 3Dfloor.
|
||||||
|
@ -5655,7 +5655,7 @@ static inline void P_AddFFloorToList(sector_t *sec, ffloor_t *ffloor)
|
||||||
*/
|
*/
|
||||||
static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, ffloortype_e flags, thinkerlist_t *secthinkers)
|
static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, ffloortype_e flags, thinkerlist_t *secthinkers)
|
||||||
{
|
{
|
||||||
ffloor_t *ffloor;
|
ffloor_t *fflr;
|
||||||
thinker_t *th;
|
thinker_t *th;
|
||||||
friction_t *f;
|
friction_t *f;
|
||||||
pusher_t *p;
|
pusher_t *p;
|
||||||
|
@ -5665,8 +5665,8 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f
|
||||||
|
|
||||||
if (sec == sec2)
|
if (sec == sec2)
|
||||||
return NULL; //Don't need a fake floor on a control sector.
|
return NULL; //Don't need a fake floor on a control sector.
|
||||||
if ((ffloor = (P_GetFFloorBySec(sec, sec2))))
|
if ((fflr = (P_GetFFloorBySec(sec, sec2))))
|
||||||
return ffloor; // If this ffloor already exists, return it
|
return fflr; // If this ffloor already exists, return it
|
||||||
|
|
||||||
if (sec2->ceilingheight < sec2->floorheight)
|
if (sec2->ceilingheight < sec2->floorheight)
|
||||||
{
|
{
|
||||||
|
@ -5705,27 +5705,27 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the floor
|
// Add the floor
|
||||||
ffloor = Z_Calloc(sizeof (*ffloor), PU_LEVEL, NULL);
|
fflr = Z_Calloc(sizeof (*fflr), PU_LEVEL, NULL);
|
||||||
ffloor->secnum = sec2 - sectors;
|
fflr->secnum = sec2 - sectors;
|
||||||
ffloor->target = sec;
|
fflr->target = sec;
|
||||||
ffloor->bottomheight = &sec2->floorheight;
|
fflr->bottomheight = &sec2->floorheight;
|
||||||
ffloor->bottompic = &sec2->floorpic;
|
fflr->bottompic = &sec2->floorpic;
|
||||||
ffloor->bottomxoffs = &sec2->floor_xoffs;
|
fflr->bottomxoffs = &sec2->floor_xoffs;
|
||||||
ffloor->bottomyoffs = &sec2->floor_yoffs;
|
fflr->bottomyoffs = &sec2->floor_yoffs;
|
||||||
ffloor->bottomangle = &sec2->floorpic_angle;
|
fflr->bottomangle = &sec2->floorpic_angle;
|
||||||
|
|
||||||
// Add the ceiling
|
// Add the ceiling
|
||||||
ffloor->topheight = &sec2->ceilingheight;
|
fflr->topheight = &sec2->ceilingheight;
|
||||||
ffloor->toppic = &sec2->ceilingpic;
|
fflr->toppic = &sec2->ceilingpic;
|
||||||
ffloor->toplightlevel = &sec2->lightlevel;
|
fflr->toplightlevel = &sec2->lightlevel;
|
||||||
ffloor->topxoffs = &sec2->ceiling_xoffs;
|
fflr->topxoffs = &sec2->ceiling_xoffs;
|
||||||
ffloor->topyoffs = &sec2->ceiling_yoffs;
|
fflr->topyoffs = &sec2->ceiling_yoffs;
|
||||||
ffloor->topangle = &sec2->ceilingpic_angle;
|
fflr->topangle = &sec2->ceilingpic_angle;
|
||||||
|
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
// Add slopes
|
// Add slopes
|
||||||
ffloor->t_slope = &sec2->c_slope;
|
fflr->t_slope = &sec2->c_slope;
|
||||||
ffloor->b_slope = &sec2->f_slope;
|
fflr->b_slope = &sec2->f_slope;
|
||||||
// mark the target sector as having slopes, if the FOF has any of its own
|
// mark the target sector as having slopes, if the FOF has any of its own
|
||||||
// (this fixes FOF slopes glitching initially at level load in software mode)
|
// (this fixes FOF slopes glitching initially at level load in software mode)
|
||||||
if (sec2->hasslope)
|
if (sec2->hasslope)
|
||||||
|
@ -5738,10 +5738,10 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f
|
||||||
if ((flags & FF_SOLID) && (master->flags & ML_EFFECT2)) // Block all BUT player
|
if ((flags & FF_SOLID) && (master->flags & ML_EFFECT2)) // Block all BUT player
|
||||||
flags &= ~FF_BLOCKPLAYER;
|
flags &= ~FF_BLOCKPLAYER;
|
||||||
|
|
||||||
ffloor->spawnflags = ffloor->flags = flags;
|
fflr->spawnflags = fflr->flags = flags;
|
||||||
ffloor->master = master;
|
fflr->master = master;
|
||||||
ffloor->norender = INFTICS;
|
fflr->norender = INFTICS;
|
||||||
ffloor->fadingdata = NULL;
|
fflr->fadingdata = NULL;
|
||||||
|
|
||||||
// Scan the thinkers to check for special conditions applying to this FOF.
|
// Scan the thinkers to check for special conditions applying to this FOF.
|
||||||
// If we have thinkers sorted by sector, just check the relevant ones;
|
// If we have thinkers sorted by sector, just check the relevant ones;
|
||||||
|
@ -5797,14 +5797,14 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f
|
||||||
if (flags & FF_TRANSLUCENT)
|
if (flags & FF_TRANSLUCENT)
|
||||||
{
|
{
|
||||||
if (sides[master->sidenum[0]].toptexture > 0)
|
if (sides[master->sidenum[0]].toptexture > 0)
|
||||||
ffloor->alpha = sides[master->sidenum[0]].toptexture; // for future reference, "#0" is 1, and "#255" is 256. Be warned
|
fflr->alpha = sides[master->sidenum[0]].toptexture; // for future reference, "#0" is 1, and "#255" is 256. Be warned
|
||||||
else
|
else
|
||||||
ffloor->alpha = 0x80;
|
fflr->alpha = 0x80;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ffloor->alpha = 0xff;
|
fflr->alpha = 0xff;
|
||||||
|
|
||||||
ffloor->spawnalpha = ffloor->alpha; // save for netgames
|
fflr->spawnalpha = fflr->alpha; // save for netgames
|
||||||
|
|
||||||
if (flags & FF_QUICKSAND)
|
if (flags & FF_QUICKSAND)
|
||||||
CheckForQuicksand = true;
|
CheckForQuicksand = true;
|
||||||
|
@ -5828,9 +5828,9 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f
|
||||||
CheckForFloatBob = true;
|
CheckForFloatBob = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
P_AddFFloorToList(sec, ffloor);
|
P_AddFFloorToList(sec, fflr);
|
||||||
|
|
||||||
return ffloor;
|
return fflr;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -6141,7 +6141,7 @@ static inline void P_AddNoEnemiesThinker(sector_t *sec, line_t *sourceline)
|
||||||
* \sa P_SpawnSpecials, T_EachTimeThinker
|
* \sa P_SpawnSpecials, T_EachTimeThinker
|
||||||
* \author SSNTails <http://www.ssntails.org>
|
* \author SSNTails <http://www.ssntails.org>
|
||||||
*/
|
*/
|
||||||
static inline void P_AddEachTimeThinker(sector_t *sec, line_t *sourceline)
|
static void P_AddEachTimeThinker(sector_t *sec, line_t *sourceline)
|
||||||
{
|
{
|
||||||
levelspecthink_t *eachtime;
|
levelspecthink_t *eachtime;
|
||||||
|
|
||||||
|
@ -6193,30 +6193,30 @@ void T_LaserFlash(laserthink_t *flash)
|
||||||
msecnode_t *node;
|
msecnode_t *node;
|
||||||
mobj_t *thing;
|
mobj_t *thing;
|
||||||
sector_t *sourcesec;
|
sector_t *sourcesec;
|
||||||
ffloor_t *ffloor = flash->ffloor;
|
ffloor_t *fflr = flash->ffloor;
|
||||||
sector_t *sector = flash->sector;
|
sector_t *sector = flash->sector;
|
||||||
fixed_t top, bottom;
|
fixed_t top, bottom;
|
||||||
|
|
||||||
if (!ffloor || !(ffloor->flags & FF_EXISTS))
|
if (!fflr || !(fflr->flags & FF_EXISTS))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (leveltime & 2)
|
if (leveltime & 2)
|
||||||
//ffloor->flags |= FF_RENDERALL;
|
//fflr->flags |= FF_RENDERALL;
|
||||||
ffloor->alpha = 0xB0;
|
fflr->alpha = 0xB0;
|
||||||
else
|
else
|
||||||
//ffloor->flags &= ~FF_RENDERALL;
|
//fflr->flags &= ~FF_RENDERALL;
|
||||||
ffloor->alpha = 0x90;
|
fflr->alpha = 0x90;
|
||||||
|
|
||||||
sourcesec = ffloor->master->frontsector; // Less to type!
|
sourcesec = fflr->master->frontsector; // Less to type!
|
||||||
|
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
top = (*ffloor->t_slope) ? P_GetZAt(*ffloor->t_slope, sector->soundorg.x, sector->soundorg.y)
|
top = (*fflr->t_slope) ? P_GetZAt(*fflr->t_slope, sector->soundorg.x, sector->soundorg.y)
|
||||||
: *ffloor->topheight;
|
: *fflr->topheight;
|
||||||
bottom = (*ffloor->b_slope) ? P_GetZAt(*ffloor->b_slope, sector->soundorg.x, sector->soundorg.y)
|
bottom = (*fflr->b_slope) ? P_GetZAt(*fflr->b_slope, sector->soundorg.x, sector->soundorg.y)
|
||||||
: *ffloor->bottomheight;
|
: *fflr->bottomheight;
|
||||||
sector->soundorg.z = (top + bottom)/2;
|
sector->soundorg.z = (top + bottom)/2;
|
||||||
#else
|
#else
|
||||||
sector->soundorg.z = (*ffloor->topheight + *ffloor->bottomheight)/2;
|
sector->soundorg.z = (*fflr->topheight + *fflr->bottomheight)/2;
|
||||||
#endif
|
#endif
|
||||||
S_StartSound(§or->soundorg, sfx_laser);
|
S_StartSound(§or->soundorg, sfx_laser);
|
||||||
|
|
||||||
|
@ -6225,7 +6225,7 @@ void T_LaserFlash(laserthink_t *flash)
|
||||||
{
|
{
|
||||||
thing = node->m_thing;
|
thing = node->m_thing;
|
||||||
|
|
||||||
if ((ffloor->master->flags & ML_EFFECT1)
|
if ((fflr->master->flags & ML_EFFECT1)
|
||||||
&& thing->flags & MF_BOSS)
|
&& thing->flags & MF_BOSS)
|
||||||
continue; // Don't hurt bosses
|
continue; // Don't hurt bosses
|
||||||
|
|
||||||
|
@ -6249,7 +6249,7 @@ void T_LaserFlash(laserthink_t *flash)
|
||||||
|
|
||||||
/** Adds a laser thinker to a 3Dfloor.
|
/** Adds a laser thinker to a 3Dfloor.
|
||||||
*
|
*
|
||||||
* \param ffloor 3Dfloor to turn into a laser block.
|
* \param fflr 3Dfloor to turn into a laser block.
|
||||||
* \param sector Target sector.
|
* \param sector Target sector.
|
||||||
* \param secthkiners Lists of thinkers sorted by sector. May be NULL.
|
* \param secthkiners Lists of thinkers sorted by sector. May be NULL.
|
||||||
* \sa T_LaserFlash
|
* \sa T_LaserFlash
|
||||||
|
@ -6258,9 +6258,9 @@ void T_LaserFlash(laserthink_t *flash)
|
||||||
static inline void EV_AddLaserThinker(sector_t *sec, sector_t *sec2, line_t *line, thinkerlist_t *secthinkers)
|
static inline void EV_AddLaserThinker(sector_t *sec, sector_t *sec2, line_t *line, thinkerlist_t *secthinkers)
|
||||||
{
|
{
|
||||||
laserthink_t *flash;
|
laserthink_t *flash;
|
||||||
ffloor_t *ffloor = P_AddFakeFloor(sec, sec2, line, laserflags, secthinkers);
|
ffloor_t *fflr = P_AddFakeFloor(sec, sec2, line, laserflags, secthinkers);
|
||||||
|
|
||||||
if (!ffloor)
|
if (!fflr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
flash = Z_Calloc(sizeof (*flash), PU_LEVSPEC, NULL);
|
flash = Z_Calloc(sizeof (*flash), PU_LEVSPEC, NULL);
|
||||||
|
@ -6268,7 +6268,7 @@ static inline void EV_AddLaserThinker(sector_t *sec, sector_t *sec2, line_t *lin
|
||||||
P_AddThinker(THINK_MAIN, &flash->thinker);
|
P_AddThinker(THINK_MAIN, &flash->thinker);
|
||||||
|
|
||||||
flash->thinker.function.acp1 = (actionf_p1)T_LaserFlash;
|
flash->thinker.function.acp1 = (actionf_p1)T_LaserFlash;
|
||||||
flash->ffloor = ffloor;
|
flash->ffloor = fflr;
|
||||||
flash->sector = sec; // For finding mobjs
|
flash->sector = sec; // For finding mobjs
|
||||||
flash->sec = sec2;
|
flash->sec = sec2;
|
||||||
flash->sourceline = line;
|
flash->sourceline = line;
|
||||||
|
@ -8230,7 +8230,7 @@ static void P_AddFakeFloorFader(ffloor_t *rover, size_t sectornum, size_t ffloor
|
||||||
d->ffloornum = (UINT32)ffloornum;
|
d->ffloornum = (UINT32)ffloornum;
|
||||||
|
|
||||||
d->alpha = d->sourcevalue = rover->alpha;
|
d->alpha = d->sourcevalue = rover->alpha;
|
||||||
d->destvalue = max(1, min(256, relative ? rover->alpha + destvalue : destvalue)); // ffloor->alpha is 1-256
|
d->destvalue = max(1, min(256, relative ? rover->alpha + destvalue : destvalue)); // rover->alpha is 1-256
|
||||||
|
|
||||||
if (ticbased)
|
if (ticbased)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue