mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 07:12:16 +00:00
Merge branch 'codesanity' of https://github.com/ZzZombo/zdoom
Conflicts: src/info.h
This commit is contained in:
commit
45117b2603
18 changed files with 58 additions and 68 deletions
|
@ -2056,6 +2056,7 @@ void FDynamicBuffer::SetData (const BYTE *data, int len)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_Len = 0;
|
m_Len = 0;
|
||||||
|
M_Free(m_Data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ class FWeaponSlot
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FWeaponSlot() { Clear(); }
|
FWeaponSlot() { Clear(); }
|
||||||
FWeaponSlot(const FWeaponSlot &other) { Weapons = other.Weapons; }
|
FWeaponSlot(const FWeaponSlot &other):Weapons(other.Weapons) {}
|
||||||
FWeaponSlot &operator= (const FWeaponSlot &other) { Weapons = other.Weapons; return *this; }
|
FWeaponSlot &operator= (const FWeaponSlot &other) { Weapons = other.Weapons; return *this; }
|
||||||
void Clear() { Weapons.Clear(); }
|
void Clear() { Weapons.Clear(); }
|
||||||
bool AddWeapon (const char *type);
|
bool AddWeapon (const char *type);
|
||||||
|
|
|
@ -937,13 +937,10 @@ void FNodeBuilder::SetNodeFromSeg (node_t &node, const FPrivSeg *pseg) const
|
||||||
|
|
||||||
DWORD FNodeBuilder::SplitSeg (DWORD segnum, int splitvert, int v1InFront)
|
DWORD FNodeBuilder::SplitSeg (DWORD segnum, int splitvert, int v1InFront)
|
||||||
{
|
{
|
||||||
double dx, dy;
|
|
||||||
FPrivSeg newseg;
|
FPrivSeg newseg;
|
||||||
int newnum = (int)Segs.Size();
|
int newnum = (int)Segs.Size();
|
||||||
|
|
||||||
newseg = Segs[segnum];
|
newseg = Segs[segnum];
|
||||||
dx = double(Vertices[splitvert].x - Vertices[newseg.v1].x);
|
|
||||||
dy = double(Vertices[splitvert].y - Vertices[newseg.v1].y);
|
|
||||||
if (v1InFront > 0)
|
if (v1InFront > 0)
|
||||||
{
|
{
|
||||||
newseg.v1 = splitvert;
|
newseg.v1 = splitvert;
|
||||||
|
@ -1129,8 +1126,7 @@ int ClassifyLineBackpatchC (node_t &node, const FSimpleVert *v1, const FSimpleVe
|
||||||
long pagesize = sysconf(_SC_PAGESIZE);
|
long pagesize = sysconf(_SC_PAGESIZE);
|
||||||
char *callerpage = (char *)((intptr_t)calleroffset & ~(pagesize - 1));
|
char *callerpage = (char *)((intptr_t)calleroffset & ~(pagesize - 1));
|
||||||
size_t protectlen = (intptr_t)calleroffset + sizeof(void*) - (intptr_t)callerpage;
|
size_t protectlen = (intptr_t)calleroffset + sizeof(void*) - (intptr_t)callerpage;
|
||||||
int ptect;
|
if (!mprotect(callerpage, protectlen, PROT_READ|PROT_WRITE|PROT_EXEC))
|
||||||
if (!(ptect = mprotect(callerpage, protectlen, PROT_READ|PROT_WRITE|PROT_EXEC)))
|
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
*calleroffset = diff;
|
*calleroffset = diff;
|
||||||
|
|
|
@ -317,7 +317,6 @@ int FNodeBuilder::CloseSubsector (TArray<glseg_t> &segs, int subsector, vertex_t
|
||||||
{
|
{
|
||||||
angle_t bestdiff = ANGLE_MAX;
|
angle_t bestdiff = ANGLE_MAX;
|
||||||
FPrivSeg *bestseg = NULL;
|
FPrivSeg *bestseg = NULL;
|
||||||
DWORD bestj = DWORD_MAX;
|
|
||||||
j = first;
|
j = first;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
@ -328,14 +327,12 @@ int FNodeBuilder::CloseSubsector (TArray<glseg_t> &segs, int subsector, vertex_t
|
||||||
{
|
{
|
||||||
bestdiff = diff;
|
bestdiff = diff;
|
||||||
bestseg = seg;
|
bestseg = seg;
|
||||||
bestj = j;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (diff < bestdiff && diff > 0)
|
if (diff < bestdiff && diff > 0)
|
||||||
{
|
{
|
||||||
bestdiff = diff;
|
bestdiff = diff;
|
||||||
bestseg = seg;
|
bestseg = seg;
|
||||||
bestj = j;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (++j < max);
|
while (++j < max);
|
||||||
|
|
|
@ -176,7 +176,7 @@ void FNodeBuilder::AddMinisegs (const node_t &node, DWORD splitseg, DWORD &fset,
|
||||||
{
|
{
|
||||||
if (prev != NULL)
|
if (prev != NULL)
|
||||||
{
|
{
|
||||||
DWORD fseg1, bseg1, fseg2, bseg2;
|
DWORD fseg1, bseg1;
|
||||||
DWORD fnseg, bnseg;
|
DWORD fnseg, bnseg;
|
||||||
|
|
||||||
// Minisegs should only be added when they can create valid loops on both the front and
|
// Minisegs should only be added when they can create valid loops on both the front and
|
||||||
|
@ -186,8 +186,8 @@ void FNodeBuilder::AddMinisegs (const node_t &node, DWORD splitseg, DWORD &fset,
|
||||||
|
|
||||||
if ((fseg1 = CheckLoopStart (node.dx, node.dy, prev->Info.Vertex, event->Info.Vertex)) != DWORD_MAX &&
|
if ((fseg1 = CheckLoopStart (node.dx, node.dy, prev->Info.Vertex, event->Info.Vertex)) != DWORD_MAX &&
|
||||||
(bseg1 = CheckLoopStart (-node.dx, -node.dy, event->Info.Vertex, prev->Info.Vertex)) != DWORD_MAX &&
|
(bseg1 = CheckLoopStart (-node.dx, -node.dy, event->Info.Vertex, prev->Info.Vertex)) != DWORD_MAX &&
|
||||||
(fseg2 = CheckLoopEnd (node.dx, node.dy, event->Info.Vertex)) != DWORD_MAX &&
|
(CheckLoopEnd (node.dx, node.dy, event->Info.Vertex)) != DWORD_MAX &&
|
||||||
(bseg2 = CheckLoopEnd (-node.dx, -node.dy, prev->Info.Vertex)) != DWORD_MAX)
|
(CheckLoopEnd (-node.dx, -node.dy, prev->Info.Vertex)) != DWORD_MAX)
|
||||||
{
|
{
|
||||||
// Add miniseg on the front side
|
// Add miniseg on the front side
|
||||||
fnseg = AddMiniseg (prev->Info.Vertex, event->Info.Vertex, DWORD_MAX, fseg1, splitseg);
|
fnseg = AddMiniseg (prev->Info.Vertex, event->Info.Vertex, DWORD_MAX, fseg1, splitseg);
|
||||||
|
|
|
@ -660,10 +660,7 @@ void ACSStringPool::ReadStrings(PNGHandle *png, DWORD id)
|
||||||
i++;
|
i++;
|
||||||
j = arc.ReadCount();
|
j = arc.ReadCount();
|
||||||
}
|
}
|
||||||
if (str != NULL)
|
delete[] str;
|
||||||
{
|
|
||||||
delete[] str;
|
|
||||||
}
|
|
||||||
FindFirstFreeEntry(0);
|
FindFirstFreeEntry(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2052,7 +2049,6 @@ FBehavior::FBehavior (int lumpnum, FileReader * fr, int len)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
i += 4+ArrayStore[arraynum].ArraySize;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5846,13 +5842,13 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
|
||||||
}
|
}
|
||||||
|
|
||||||
FActorIterator iterator(args[0]);
|
FActorIterator iterator(args[0]);
|
||||||
bool canraiseall = false;
|
bool canraiseall = true;
|
||||||
while ((actor = iterator.Next()))
|
while ((actor = iterator.Next()))
|
||||||
{
|
{
|
||||||
canraiseall = !P_Thing_CanRaise(actor) | canraiseall;
|
canraiseall = P_Thing_CanRaise(actor) && canraiseall;
|
||||||
}
|
}
|
||||||
|
|
||||||
return !canraiseall;
|
return canraiseall;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -924,7 +924,7 @@ public:
|
||||||
{
|
{
|
||||||
const char *speakerName;
|
const char *speakerName;
|
||||||
int x, y, linesize;
|
int x, y, linesize;
|
||||||
int width, fontheight;
|
int width=screen->GetWidth(), height=screen->GetHeight(), fontheight;
|
||||||
|
|
||||||
player_t *cp = &players[consoleplayer];
|
player_t *cp = &players[consoleplayer];
|
||||||
|
|
||||||
|
@ -949,8 +949,8 @@ public:
|
||||||
{
|
{
|
||||||
screen->DrawTexture (TexMan(CurNode->Backdrop), 0, 0, DTA_320x200, true, TAG_DONE);
|
screen->DrawTexture (TexMan(CurNode->Backdrop), 0, 0, DTA_320x200, true, TAG_DONE);
|
||||||
}
|
}
|
||||||
x = 16 * screen->GetWidth() / 320;
|
x = 16 * width / 320;
|
||||||
y = 16 * screen->GetHeight() / 200;
|
y = 16 * height / 200;
|
||||||
linesize = 10 * CleanYfac;
|
linesize = 10 * CleanYfac;
|
||||||
|
|
||||||
// Who is talking to you?
|
// Who is talking to you?
|
||||||
|
@ -970,16 +970,16 @@ public:
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; mDialogueLines[i].Width >= 0; ++i)
|
for (i = 0; mDialogueLines[i].Width >= 0; ++i)
|
||||||
{ }
|
{ }
|
||||||
screen->Dim (0, 0.45f, 14 * screen->GetWidth() / 320, 13 * screen->GetHeight() / 200,
|
screen->Dim (0, 0.45f, 14 * width / 320, 13 * height / 200,
|
||||||
308 * screen->GetWidth() / 320 - 14 * screen->GetWidth () / 320,
|
308 * width / 320 - 14 * width / 320,
|
||||||
speakerName == NULL ? linesize * i + 6 * CleanYfac
|
speakerName == NULL ? linesize * i + 6 * CleanYfac
|
||||||
: linesize * i + 6 * CleanYfac + linesize * 3/2);
|
: linesize * i + 6 * CleanYfac + linesize * 3/2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dim the screen behind the PC's choices.
|
// Dim the screen behind the PC's choices.
|
||||||
|
|
||||||
screen->Dim (0, 0.45f, (24-160) * CleanXfac + screen->GetWidth()/2,
|
screen->Dim (0, 0.45f, (24-160) * CleanXfac + width/2,
|
||||||
(mYpos - 2 - 100) * CleanYfac + screen->GetHeight()/2,
|
(mYpos - 2 - 100) * CleanYfac + height/2,
|
||||||
272 * CleanXfac,
|
272 * CleanXfac,
|
||||||
MIN<int>(mResponseLines.Size() * OptionSettings.mLinespacing + 4, 200 - mYpos) * CleanYfac);
|
MIN<int>(mResponseLines.Size() * OptionSettings.mLinespacing + 4, 200 - mYpos) * CleanYfac);
|
||||||
|
|
||||||
|
@ -989,7 +989,7 @@ public:
|
||||||
DTA_CleanNoMove, true, TAG_DONE);
|
DTA_CleanNoMove, true, TAG_DONE);
|
||||||
y += linesize * 3 / 2;
|
y += linesize * 3 / 2;
|
||||||
}
|
}
|
||||||
x = 24 * screen->GetWidth() / 320;
|
x = 24 * width / 320;
|
||||||
for (int i = 0; mDialogueLines[i].Width >= 0; ++i)
|
for (int i = 0; mDialogueLines[i].Width >= 0; ++i)
|
||||||
{
|
{
|
||||||
screen->DrawText (SmallFont, CR_UNTRANSLATED, x, y, mDialogueLines[i].Text,
|
screen->DrawText (SmallFont, CR_UNTRANSLATED, x, y, mDialogueLines[i].Text,
|
||||||
|
@ -1019,7 +1019,6 @@ public:
|
||||||
int response = 0;
|
int response = 0;
|
||||||
for (unsigned i = 0; i < mResponseLines.Size(); i++, y += fontheight)
|
for (unsigned i = 0; i < mResponseLines.Size(); i++, y += fontheight)
|
||||||
{
|
{
|
||||||
width = SmallFont->StringWidth(mResponseLines[i]);
|
|
||||||
x = 64;
|
x = 64;
|
||||||
|
|
||||||
screen->DrawText (SmallFont, CR_GREEN, x, y, mResponseLines[i], DTA_Clean, true, TAG_DONE);
|
screen->DrawText (SmallFont, CR_GREEN, x, y, mResponseLines[i], DTA_Clean, true, TAG_DONE);
|
||||||
|
@ -1037,8 +1036,8 @@ public:
|
||||||
{
|
{
|
||||||
int color = ((DMenu::MenuTime%8) < 4) || DMenu::CurrentMenu != this ? CR_RED:CR_GREY;
|
int color = ((DMenu::MenuTime%8) < 4) || DMenu::CurrentMenu != this ? CR_RED:CR_GREY;
|
||||||
|
|
||||||
x = (50 + 3 - 160) * CleanXfac + screen->GetWidth() / 2;
|
x = (50 + 3 - 160) * CleanXfac + width / 2;
|
||||||
int yy = (y + fontheight/2 - 5 - 100) * CleanYfac + screen->GetHeight() / 2;
|
int yy = (y + fontheight/2 - 5 - 100) * CleanYfac + height / 2;
|
||||||
screen->DrawText (ConFont, color, x, yy, "\xd",
|
screen->DrawText (ConFont, color, x, yy, "\xd",
|
||||||
DTA_CellX, 8 * CleanXfac,
|
DTA_CellX, 8 * CleanXfac,
|
||||||
DTA_CellY, 8 * CleanYfac,
|
DTA_CellY, 8 * CleanYfac,
|
||||||
|
|
|
@ -2544,8 +2544,6 @@ static bool P_CheckForResurrection(AActor *self, bool usevilestates)
|
||||||
// use the current actor's radius instead of the Arch Vile's default.
|
// use the current actor's radius instead of the Arch Vile's default.
|
||||||
fixed_t maxdist = corpsehit->GetDefault()->radius + self->radius;
|
fixed_t maxdist = corpsehit->GetDefault()->radius + self->radius;
|
||||||
|
|
||||||
maxdist = corpsehit->GetDefault()->radius + self->radius;
|
|
||||||
|
|
||||||
if (abs(corpsehit->x - viletryx) > maxdist ||
|
if (abs(corpsehit->x - viletryx) > maxdist ||
|
||||||
abs(corpsehit->y - viletryy) > maxdist)
|
abs(corpsehit->y - viletryy) > maxdist)
|
||||||
continue; // not actually touching
|
continue; // not actually touching
|
||||||
|
|
|
@ -900,12 +900,12 @@ DElevator::DElevator ()
|
||||||
}
|
}
|
||||||
|
|
||||||
DElevator::DElevator (sector_t *sec)
|
DElevator::DElevator (sector_t *sec)
|
||||||
: Super (sec)
|
: m_Interp_Floor(sec->SetInterpolation(sector_t::FloorMove, true)),
|
||||||
|
m_Interp_Ceiling(sec->SetInterpolation(sector_t::CeilingMove, true)),
|
||||||
|
Super (sec)
|
||||||
{
|
{
|
||||||
sec->floordata = this;
|
sec->floordata = this;
|
||||||
sec->ceilingdata = this;
|
sec->ceilingdata = this;
|
||||||
m_Interp_Floor = sec->SetInterpolation(sector_t::FloorMove, true);
|
|
||||||
m_Interp_Ceiling = sec->SetInterpolation(sector_t::CeilingMove, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DElevator::Serialize (FArchive &arc)
|
void DElevator::Serialize (FArchive &arc)
|
||||||
|
|
|
@ -366,7 +366,7 @@ void AActor::Die (AActor *source, AActor *inflictor, int dmgflags)
|
||||||
|
|
||||||
if (debugfile && this->player)
|
if (debugfile && this->player)
|
||||||
{
|
{
|
||||||
static int dieticks[MAXPLAYERS];
|
static int dieticks[MAXPLAYERS]; // [ZzZombo] not used? Except if for peeking in debugger...
|
||||||
int pnum = int(this->player-players);
|
int pnum = int(this->player-players);
|
||||||
dieticks[pnum] = gametic;
|
dieticks[pnum] = gametic;
|
||||||
fprintf (debugfile, "died (%d) on tic %d (%s)\n", pnum, gametic,
|
fprintf (debugfile, "died (%d) on tic %d (%s)\n", pnum, gametic,
|
||||||
|
@ -1716,14 +1716,12 @@ void P_PoisonDamage (player_t *player, AActor *source, int damage,
|
||||||
bool playPainSound)
|
bool playPainSound)
|
||||||
{
|
{
|
||||||
AActor *target;
|
AActor *target;
|
||||||
AActor *inflictor;
|
|
||||||
|
|
||||||
if (player == NULL)
|
if (player == NULL)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
target = player->mo;
|
target = player->mo;
|
||||||
inflictor = source;
|
|
||||||
if (target->health <= 0)
|
if (target->health <= 0)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -755,12 +755,14 @@ bool PIT_CheckLine(line_t *ld, const FBoundingBox &box, FCheckPosition &tm)
|
||||||
if (!(tm.thing->flags & MF_DROPOFF) &&
|
if (!(tm.thing->flags & MF_DROPOFF) &&
|
||||||
!(tm.thing->flags & (MF_NOGRAVITY | MF_NOCLIP)))
|
!(tm.thing->flags & (MF_NOGRAVITY | MF_NOCLIP)))
|
||||||
{
|
{
|
||||||
secplane_t frontplane = ld->frontsector->floorplane;
|
secplane_t frontplane, backplane;
|
||||||
secplane_t backplane = ld->backsector->floorplane;
|
|
||||||
#ifdef _3DFLOORS
|
#ifdef _3DFLOORS
|
||||||
// Check 3D floors as well
|
// Check 3D floors as well
|
||||||
frontplane = P_FindFloorPlane(ld->frontsector, tm.thing->x, tm.thing->y, tm.thing->floorz);
|
frontplane = P_FindFloorPlane(ld->frontsector, tm.thing->x, tm.thing->y, tm.thing->floorz);
|
||||||
backplane = P_FindFloorPlane(ld->backsector, tm.thing->x, tm.thing->y, tm.thing->floorz);
|
backplane = P_FindFloorPlane(ld->backsector, tm.thing->x, tm.thing->y, tm.thing->floorz);
|
||||||
|
#else
|
||||||
|
frontplane = ld->frontsector->floorplane;
|
||||||
|
backplane = ld->backsector->floorplane;
|
||||||
#endif
|
#endif
|
||||||
if (frontplane.c < STEEPSLOPE || backplane.c < STEEPSLOPE)
|
if (frontplane.c < STEEPSLOPE || backplane.c < STEEPSLOPE)
|
||||||
{
|
{
|
||||||
|
@ -2964,7 +2966,6 @@ bool FSlide::BounceWall(AActor *mo)
|
||||||
deltaangle = (2 * lineangle) - moveangle;
|
deltaangle = (2 * lineangle) - moveangle;
|
||||||
mo->angle = deltaangle;
|
mo->angle = deltaangle;
|
||||||
|
|
||||||
lineangle >>= ANGLETOFINESHIFT;
|
|
||||||
deltaangle >>= ANGLETOFINESHIFT;
|
deltaangle >>= ANGLETOFINESHIFT;
|
||||||
|
|
||||||
movelen = fixed_t(sqrt(double(mo->velx)*mo->velx + double(mo->vely)*mo->vely));
|
movelen = fixed_t(sqrt(double(mo->velx)*mo->velx + double(mo->vely)*mo->vely));
|
||||||
|
@ -3151,9 +3152,6 @@ bool aim_t::AimTraverse3DFloors(const divline_t &trace, intercept_t * in)
|
||||||
fixed_t trY = trace.y + FixedMul(trace.dy, in->frac);
|
fixed_t trY = trace.y + FixedMul(trace.dy, in->frac);
|
||||||
fixed_t dist = FixedMul(attackrange, in->frac);
|
fixed_t dist = FixedMul(attackrange, in->frac);
|
||||||
|
|
||||||
|
|
||||||
int dir = aimpitch < 0 ? 1 : aimpitch > 0 ? -1 : 0;
|
|
||||||
|
|
||||||
frontflag = P_PointOnLineSide(shootthing->x, shootthing->y, li);
|
frontflag = P_PointOnLineSide(shootthing->x, shootthing->y, li);
|
||||||
|
|
||||||
// 3D floor check. This is not 100% accurate but normally sufficient when
|
// 3D floor check. This is not 100% accurate but normally sufficient when
|
||||||
|
|
|
@ -1979,11 +1979,7 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
|
||||||
bool blockingtg = (BlockingMobj->target != NULL);
|
bool blockingtg = (BlockingMobj->target != NULL);
|
||||||
if (BlockingMobj->flags7 & MF7_AIMREFLECT && (tg || blockingtg))
|
if (BlockingMobj->flags7 & MF7_AIMREFLECT && (tg || blockingtg))
|
||||||
{
|
{
|
||||||
AActor *origin;
|
AActor *origin=tg ? mo->target : BlockingMobj->target;
|
||||||
if (tg)
|
|
||||||
origin = mo->target;
|
|
||||||
else if (blockingtg)
|
|
||||||
origin = BlockingMobj->target;
|
|
||||||
|
|
||||||
float speed = (float)(mo->Speed);
|
float speed = (float)(mo->Speed);
|
||||||
//dest->x - source->x
|
//dest->x - source->x
|
||||||
|
@ -3496,11 +3492,13 @@ void AActor::Tick ()
|
||||||
velz <= 0 &&
|
velz <= 0 &&
|
||||||
floorz == z)
|
floorz == z)
|
||||||
{
|
{
|
||||||
secplane_t floorplane = floorsector->floorplane;
|
secplane_t floorplane;
|
||||||
|
|
||||||
#ifdef _3DFLOORS
|
#ifdef _3DFLOORS
|
||||||
// Check 3D floors as well
|
// Check 3D floors as well
|
||||||
floorplane = P_FindFloorPlane(floorsector, x, y, floorz);
|
floorplane = P_FindFloorPlane(floorsector, x, y, floorz);
|
||||||
|
#else
|
||||||
|
floorplane = floorsector->floorplane;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (floorplane.c < STEEPSLOPE &&
|
if (floorplane.c < STEEPSLOPE &&
|
||||||
|
@ -5631,18 +5629,25 @@ static fixed_t GetDefaultSpeed(const PClass *type)
|
||||||
|
|
||||||
AActor *P_SpawnMissile (AActor *source, AActor *dest, const PClass *type, AActor *owner)
|
AActor *P_SpawnMissile (AActor *source, AActor *dest, const PClass *type, AActor *owner)
|
||||||
{
|
{
|
||||||
|
if(!source)
|
||||||
|
return NULL;
|
||||||
return P_SpawnMissileXYZ (source->x, source->y, source->z + 32*FRACUNIT + source->GetBobOffset(),
|
return P_SpawnMissileXYZ (source->x, source->y, source->z + 32*FRACUNIT + source->GetBobOffset(),
|
||||||
source, dest, type, true, owner);
|
source, dest, type, true, owner);
|
||||||
}
|
}
|
||||||
|
|
||||||
AActor *P_SpawnMissileZ (AActor *source, fixed_t z, AActor *dest, const PClass *type)
|
AActor *P_SpawnMissileZ (AActor *source, fixed_t z, AActor *dest, const PClass *type)
|
||||||
{
|
{
|
||||||
|
if(!source)
|
||||||
|
return NULL;
|
||||||
return P_SpawnMissileXYZ (source->x, source->y, z, source, dest, type);
|
return P_SpawnMissileXYZ (source->x, source->y, z, source, dest, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z,
|
AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z,
|
||||||
AActor *source, AActor *dest, const PClass *type, bool checkspawn, AActor *owner)
|
AActor *source, AActor *dest, const PClass *type, bool checkspawn, AActor *owner)
|
||||||
{
|
{
|
||||||
|
if(!source)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
if (dest == NULL)
|
if (dest == NULL)
|
||||||
{
|
{
|
||||||
Printf ("P_SpawnMissilyXYZ: Tried to shoot %s from %s with no dest\n",
|
Printf ("P_SpawnMissilyXYZ: Tried to shoot %s from %s with no dest\n",
|
||||||
|
@ -5712,6 +5717,8 @@ AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z,
|
||||||
|
|
||||||
AActor * P_OldSpawnMissile(AActor * source, AActor * owner, AActor * dest, const PClass *type)
|
AActor * P_OldSpawnMissile(AActor * source, AActor * owner, AActor * dest, const PClass *type)
|
||||||
{
|
{
|
||||||
|
if(!source)
|
||||||
|
return NULL;
|
||||||
angle_t an;
|
angle_t an;
|
||||||
fixed_t dist;
|
fixed_t dist;
|
||||||
AActor *th = Spawn (type, source->x, source->y, source->z + 4*8*FRACUNIT, ALLOW_REPLACE);
|
AActor *th = Spawn (type, source->x, source->y, source->z + 4*8*FRACUNIT, ALLOW_REPLACE);
|
||||||
|
@ -5753,6 +5760,8 @@ AActor * P_OldSpawnMissile(AActor * source, AActor * owner, AActor * dest, const
|
||||||
AActor *P_SpawnMissileAngle (AActor *source, const PClass *type,
|
AActor *P_SpawnMissileAngle (AActor *source, const PClass *type,
|
||||||
angle_t angle, fixed_t velz)
|
angle_t angle, fixed_t velz)
|
||||||
{
|
{
|
||||||
|
if(!source)
|
||||||
|
return NULL;
|
||||||
return P_SpawnMissileAngleZSpeed (source, source->z + 32*FRACUNIT + source->GetBobOffset(),
|
return P_SpawnMissileAngleZSpeed (source, source->z + 32*FRACUNIT + source->GetBobOffset(),
|
||||||
type, angle, velz, GetDefaultSpeed (type));
|
type, angle, velz, GetDefaultSpeed (type));
|
||||||
}
|
}
|
||||||
|
@ -5760,12 +5769,16 @@ AActor *P_SpawnMissileAngle (AActor *source, const PClass *type,
|
||||||
AActor *P_SpawnMissileAngleZ (AActor *source, fixed_t z,
|
AActor *P_SpawnMissileAngleZ (AActor *source, fixed_t z,
|
||||||
const PClass *type, angle_t angle, fixed_t velz)
|
const PClass *type, angle_t angle, fixed_t velz)
|
||||||
{
|
{
|
||||||
|
if(!source)
|
||||||
|
return NULL;
|
||||||
return P_SpawnMissileAngleZSpeed (source, z, type, angle, velz,
|
return P_SpawnMissileAngleZSpeed (source, z, type, angle, velz,
|
||||||
GetDefaultSpeed (type));
|
GetDefaultSpeed (type));
|
||||||
}
|
}
|
||||||
|
|
||||||
AActor *P_SpawnMissileZAimed (AActor *source, fixed_t z, AActor *dest, const PClass *type)
|
AActor *P_SpawnMissileZAimed (AActor *source, fixed_t z, AActor *dest, const PClass *type)
|
||||||
{
|
{
|
||||||
|
if(!source)
|
||||||
|
return NULL;
|
||||||
angle_t an;
|
angle_t an;
|
||||||
fixed_t dist;
|
fixed_t dist;
|
||||||
fixed_t speed;
|
fixed_t speed;
|
||||||
|
@ -5796,6 +5809,8 @@ AActor *P_SpawnMissileZAimed (AActor *source, fixed_t z, AActor *dest, const PCl
|
||||||
AActor *P_SpawnMissileAngleSpeed (AActor *source, const PClass *type,
|
AActor *P_SpawnMissileAngleSpeed (AActor *source, const PClass *type,
|
||||||
angle_t angle, fixed_t velz, fixed_t speed)
|
angle_t angle, fixed_t velz, fixed_t speed)
|
||||||
{
|
{
|
||||||
|
if(!source)
|
||||||
|
return NULL;
|
||||||
return P_SpawnMissileAngleZSpeed (source, source->z + 32*FRACUNIT + source->GetBobOffset(),
|
return P_SpawnMissileAngleZSpeed (source, source->z + 32*FRACUNIT + source->GetBobOffset(),
|
||||||
type, angle, velz, speed);
|
type, angle, velz, speed);
|
||||||
}
|
}
|
||||||
|
@ -5803,6 +5818,8 @@ AActor *P_SpawnMissileAngleSpeed (AActor *source, const PClass *type,
|
||||||
AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z,
|
AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z,
|
||||||
const PClass *type, angle_t angle, fixed_t velz, fixed_t speed, AActor *owner, bool checkspawn)
|
const PClass *type, angle_t angle, fixed_t velz, fixed_t speed, AActor *owner, bool checkspawn)
|
||||||
{
|
{
|
||||||
|
if(!source)
|
||||||
|
return NULL;
|
||||||
AActor *mo;
|
AActor *mo;
|
||||||
|
|
||||||
if (z != ONFLOORZ && z != ONCEILINGZ && source != NULL)
|
if (z != ONFLOORZ && z != ONCEILINGZ && source != NULL)
|
||||||
|
@ -5840,6 +5857,8 @@ AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z,
|
||||||
|
|
||||||
AActor *P_SpawnPlayerMissile (AActor *source, const PClass *type)
|
AActor *P_SpawnPlayerMissile (AActor *source, const PClass *type)
|
||||||
{
|
{
|
||||||
|
if(!source)
|
||||||
|
return NULL;
|
||||||
return P_SpawnPlayerMissile (source, 0, 0, 0, type, source->angle);
|
return P_SpawnPlayerMissile (source, 0, 0, 0, type, source->angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1362,7 +1362,7 @@ void P_LoadSegs (MapData * map)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (badseg bad)
|
catch (const badseg &bad) // the preferred way is to catch by (const) reference.
|
||||||
{
|
{
|
||||||
switch (bad.badtype)
|
switch (bad.badtype)
|
||||||
{
|
{
|
||||||
|
@ -1467,7 +1467,6 @@ void P_LoadSubsectors (MapData * map)
|
||||||
|
|
||||||
void P_LoadSectors (MapData *map, FMissingTextureTracker &missingtex)
|
void P_LoadSectors (MapData *map, FMissingTextureTracker &missingtex)
|
||||||
{
|
{
|
||||||
char fname[9];
|
|
||||||
int i;
|
int i;
|
||||||
char *msp;
|
char *msp;
|
||||||
mapsector_t *ms;
|
mapsector_t *ms;
|
||||||
|
@ -1486,7 +1485,6 @@ void P_LoadSectors (MapData *map, FMissingTextureTracker &missingtex)
|
||||||
defSeqType = -1;
|
defSeqType = -1;
|
||||||
|
|
||||||
fogMap = normMap = NULL;
|
fogMap = normMap = NULL;
|
||||||
fname[8] = 0;
|
|
||||||
|
|
||||||
msp = new char[lumplen];
|
msp = new char[lumplen];
|
||||||
map->Read(ML_SECTORS, msp);
|
map->Read(ML_SECTORS, msp);
|
||||||
|
@ -3044,16 +3042,14 @@ void P_LoadBlockMap (MapData * map)
|
||||||
blockmap = blockmaplump+4;
|
blockmap = blockmaplump+4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
line_t** linebuffer;
|
||||||
|
|
||||||
//
|
//
|
||||||
// P_GroupLines
|
// P_GroupLines
|
||||||
// Builds sector line lists and subsector sector numbers.
|
// Builds sector line lists and subsector sector numbers.
|
||||||
// Finds block bounding boxes for sectors.
|
// Finds block bounding boxes for sectors.
|
||||||
// [RH] Handles extra lights
|
// [RH] Handles extra lights.
|
||||||
//
|
//
|
||||||
struct linf { short tag; WORD count; };
|
|
||||||
line_t** linebuffer;
|
|
||||||
|
|
||||||
static void P_GroupLines (bool buildmap)
|
static void P_GroupLines (bool buildmap)
|
||||||
{
|
{
|
||||||
|
@ -3062,7 +3058,6 @@ static void P_GroupLines (bool buildmap)
|
||||||
int i;
|
int i;
|
||||||
int j;
|
int j;
|
||||||
int total;
|
int total;
|
||||||
int totallights;
|
|
||||||
line_t* li;
|
line_t* li;
|
||||||
sector_t* sector;
|
sector_t* sector;
|
||||||
FBoundingBox bbox;
|
FBoundingBox bbox;
|
||||||
|
@ -3095,7 +3090,6 @@ static void P_GroupLines (bool buildmap)
|
||||||
// count number of lines in each sector
|
// count number of lines in each sector
|
||||||
times[1].Clock();
|
times[1].Clock();
|
||||||
total = 0;
|
total = 0;
|
||||||
totallights = 0;
|
|
||||||
for (i = 0, li = lines; i < numlines; i++, li++)
|
for (i = 0, li = lines; i < numlines; i++, li++)
|
||||||
{
|
{
|
||||||
if (li->frontsector == NULL)
|
if (li->frontsector == NULL)
|
||||||
|
|
|
@ -529,11 +529,9 @@ static void P_AlignPlane (sector_t *sec, line_t *line, int which)
|
||||||
|
|
||||||
FVector3 p, v1, v2, cross;
|
FVector3 p, v1, v2, cross;
|
||||||
|
|
||||||
const secplane_t *refplane;
|
|
||||||
secplane_t *srcplane;
|
secplane_t *srcplane;
|
||||||
fixed_t srcheight, destheight;
|
fixed_t srcheight, destheight;
|
||||||
|
|
||||||
refplane = (which == 0) ? &refsec->floorplane : &refsec->ceilingplane;
|
|
||||||
srcplane = (which == 0) ? &sec->floorplane : &sec->ceilingplane;
|
srcplane = (which == 0) ? &sec->floorplane : &sec->ceilingplane;
|
||||||
srcheight = (which == 0) ? sec->GetPlaneTexZ(sector_t::floor) : sec->GetPlaneTexZ(sector_t::ceiling);
|
srcheight = (which == 0) ? sec->GetPlaneTexZ(sector_t::floor) : sec->GetPlaneTexZ(sector_t::ceiling);
|
||||||
destheight = (which == 0) ? refsec->GetPlaneTexZ(sector_t::floor) : refsec->GetPlaneTexZ(sector_t::ceiling);
|
destheight = (which == 0) ? refsec->GetPlaneTexZ(sector_t::floor) : refsec->GetPlaneTexZ(sector_t::ceiling);
|
||||||
|
|
|
@ -188,8 +188,7 @@ bool P_Teleport (AActor *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle,
|
||||||
// Spawn teleport fog at source and destination
|
// Spawn teleport fog at source and destination
|
||||||
if (sourceFog && !predicting)
|
if (sourceFog && !predicting)
|
||||||
{
|
{
|
||||||
fixed_t fogDelta = thing->flags & MF_MISSILE ? 0 : TELEFOGHEIGHT;
|
P_SpawnTeleportFog(thing, oldx, oldy, oldz, true, true); //Passes the actor through then pulls the TeleFog metadata types based on properties.
|
||||||
P_SpawnTeleportFog(thing, oldx, oldy, oldz, true, true); //Passes the actor through which then pulls the TeleFog metadate types based on properties.
|
|
||||||
}
|
}
|
||||||
if (useFog)
|
if (useFog)
|
||||||
{
|
{
|
||||||
|
|
|
@ -135,7 +135,6 @@ class USDFParser : public UDMFParserBase
|
||||||
while (!sc.CheckToken('}'))
|
while (!sc.CheckToken('}'))
|
||||||
{
|
{
|
||||||
bool block = false;
|
bool block = false;
|
||||||
int costs = 0;
|
|
||||||
FName key = ParseKey(true, &block);
|
FName key = ParseKey(true, &block);
|
||||||
if (!block)
|
if (!block)
|
||||||
{
|
{
|
||||||
|
|
|
@ -101,11 +101,10 @@ FPlayerClass::FPlayerClass ()
|
||||||
Flags = 0;
|
Flags = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
FPlayerClass::FPlayerClass (const FPlayerClass &other)
|
FPlayerClass::FPlayerClass (const FPlayerClass &other) : Skins(other.Skins)
|
||||||
{
|
{
|
||||||
Type = other.Type;
|
Type = other.Type;
|
||||||
Flags = other.Flags;
|
Flags = other.Flags;
|
||||||
Skins = other.Skins;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FPlayerClass::~FPlayerClass ()
|
FPlayerClass::~FPlayerClass ()
|
||||||
|
|
|
@ -438,7 +438,6 @@ void R_MapTiltedPlane (int y, int x1)
|
||||||
}
|
}
|
||||||
startu = endu;
|
startu = endu;
|
||||||
startv = endv;
|
startv = endv;
|
||||||
startz = endz;
|
|
||||||
width -= SPANSIZE;
|
width -= SPANSIZE;
|
||||||
}
|
}
|
||||||
if (width > 0)
|
if (width > 0)
|
||||||
|
|
Loading…
Reference in a new issue