mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +00:00
- Exhumed: AddFlash floatified
This commit is contained in:
parent
f6c7a1c41d
commit
d5bcc64206
11 changed files with 17 additions and 29 deletions
|
@ -177,7 +177,7 @@ void FuncLava(int, int, int, int);
|
|||
|
||||
|
||||
void InitLights();
|
||||
void AddFlash(sectortype* pSector, int x, int y, int z, int val);
|
||||
void AddFlash(sectortype* pSector, const DVector3& pos, int val);
|
||||
void SetTorch(int nPlayer, int bTorchOnOff);
|
||||
void UndoFlashes();
|
||||
void DoLights();
|
||||
|
|
|
@ -408,7 +408,7 @@ MOVEEND:
|
|||
|
||||
if (nVal == 0 && nType != 15 && nType != 3)
|
||||
{
|
||||
AddFlash(pActor->sector(), pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z, 0);
|
||||
AddFlash(pActor->sector(), pActor->spr.pos, 0);
|
||||
|
||||
if (pActor->spr.pal != 5) {
|
||||
pActor->spr.pal = 1;
|
||||
|
@ -534,7 +534,7 @@ HITSPRITE:
|
|||
|
||||
nRadialBullet = -1;
|
||||
|
||||
AddFlash(pActor->sector(), pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z, 128);
|
||||
AddFlash(pActor->sector(), pActor->spr.pos, 128);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -209,7 +209,7 @@ void DoRedAlert(int nVal)
|
|||
if (nVal)
|
||||
{
|
||||
PlayFXAtXYZ(StaticSound[kSoundAlarm], ac->int_pos().X, ac->int_pos().Y, ac->int_pos().Z);
|
||||
AddFlash(ac->sector(), ac->int_pos().X, ac->int_pos().Y, ac->int_pos().Z, 192);
|
||||
AddFlash(ac->sector(), ac->spr.pos, 192);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -191,7 +191,7 @@ void ExplodeGrenade(DExhumedActor* pActor)
|
|||
runlist_RadialDamageEnemy(pActor, nDamage, BulletInfo[kWeaponGrenade].nRadius);
|
||||
|
||||
BuildAnim(nullptr, var_28, 0, pActor->spr.pos, pActor->sector(), var_20, 4);
|
||||
AddFlash(pActor->sector(), pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z, 128);
|
||||
AddFlash(pActor->sector(), pActor->spr.pos, 128);
|
||||
|
||||
DestroyGrenade(pActor);
|
||||
}
|
||||
|
|
|
@ -601,9 +601,7 @@ loc_flag:
|
|||
BuildFlash(nPlayer, 512);
|
||||
AddFlash(
|
||||
pPlayerActor->sector(),
|
||||
pPlayerActor->int_pos().X,
|
||||
pPlayerActor->int_pos().Y,
|
||||
pPlayerActor->int_pos().Z,
|
||||
pPlayerActor->spr.pos,
|
||||
0);
|
||||
}
|
||||
|
||||
|
|
|
@ -345,7 +345,7 @@ void DropMagic(DExhumedActor* pActor)
|
|||
|
||||
if (pAnimActor)
|
||||
{
|
||||
AddFlash(pAnimActor->sector(), pAnimActor->int_pos().X, pAnimActor->int_pos().Y, pAnimActor->int_pos().Z, 128);
|
||||
AddFlash(pAnimActor->sector(), pAnimActor->spr.pos, 128);
|
||||
ChangeActorStat(pAnimActor, 950);
|
||||
}
|
||||
nMagicCount = RandomSize(2);
|
||||
|
|
|
@ -226,7 +226,7 @@ void InitLights()
|
|||
nLastFlash = -1;
|
||||
}
|
||||
|
||||
void AddFlash(sectortype* pSector, int x, int y, int z, int val)
|
||||
void AddFlash(sectortype* pSector, const DVector3& pos, int val)
|
||||
{
|
||||
int var_28 = 0;
|
||||
int var_1C = val >> 8;
|
||||
|
@ -254,7 +254,7 @@ void AddFlash(sectortype* pSector, int x, int y, int z, int val)
|
|||
|
||||
if (!var_18)
|
||||
{
|
||||
walldist = (int)sqrt(SquareDistToWall(x * inttoworld, y * inttoworld, &wal)) - 255;
|
||||
walldist = (int)sqrt(SquareDistToWall(pos.X, pos.Y, &wal)) - 255;
|
||||
}
|
||||
|
||||
if (walldist < 0)
|
||||
|
@ -281,7 +281,7 @@ void AddFlash(sectortype* pSector, int x, int y, int z, int val)
|
|||
|
||||
if (!var_1C && !wal.overpicnum && pNextSector)
|
||||
{
|
||||
AddFlash(pNextSector, x, y, z, val);
|
||||
AddFlash(pNextSector, pos, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -353,17 +353,10 @@ void AddFlash(sectortype* pSector, int x, int y, int z, int val)
|
|||
|
||||
if (!var_18)
|
||||
{
|
||||
int xDiff = x - pActor->int_pos().X;
|
||||
if (xDiff < 0) {
|
||||
xDiff = -xDiff;
|
||||
}
|
||||
double xDiff = fabs(pos.X - pActor->spr.pos.X);
|
||||
double yDiff = fabs(pos.Y - pActor->spr.pos.Y);
|
||||
|
||||
int yDiff = y - pActor->int_pos().Y;
|
||||
if (yDiff < 0) {
|
||||
yDiff = -yDiff;
|
||||
}
|
||||
|
||||
eax = ((xDiff + yDiff) >> 4) - 255;
|
||||
eax += int(xDiff + yDiff);
|
||||
}
|
||||
|
||||
if (eax < 0)
|
||||
|
|
|
@ -1930,7 +1930,7 @@ void AIObject::Tick(RunListEvent* ev)
|
|||
var_18 = 34;
|
||||
}
|
||||
|
||||
AddFlash(pActor->sector(), pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z, 128);
|
||||
AddFlash(pActor->sector(), pActor->spr.pos, 128);
|
||||
BuildAnim(nullptr, var_18, 0, DVector3(pActor->spr.pos.XY(), pActor->sector()->floorz), pActor->sector(), 240, 4);
|
||||
|
||||
// int edi = nSprite | 0x4000;
|
||||
|
|
|
@ -772,10 +772,7 @@ void AIPlayer::Tick(RunListEvent* ev)
|
|||
if (nPlayer != nLocalPlayer)
|
||||
{
|
||||
nFlashDepth = 5;
|
||||
AddFlash(pPlayerActor->sector(),
|
||||
pPlayerActor->int_pos().X,
|
||||
pPlayerActor->int_pos().Y,
|
||||
pPlayerActor->int_pos().Z, 0);
|
||||
AddFlash(pPlayerActor->sector(), pPlayerActor->spr.pos, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -426,7 +426,7 @@ void DoSpiritHead()
|
|||
if (nCount < (15 * nPixels) / 16) {
|
||||
SoundBigEntrance();
|
||||
AddGlow(pSpiritSpr->sector(), 20);
|
||||
AddFlash(pSpiritSpr->sector(), pSpiritSpr->int_pos().X, pSpiritSpr->int_pos().Y, pSpiritSpr->int_pos().Z, 128);
|
||||
AddFlash(pSpiritSpr->sector(), pSpiritSpr->spr.pos, 128);
|
||||
nHeadStage = 3;
|
||||
TintPalette(255, 255, 255);
|
||||
CopyHeadToWorkTile(kTileRamsesNormal);
|
||||
|
|
|
@ -119,7 +119,7 @@ void ExplodeSnakeSprite(DExhumedActor* pActor, int nPlayer)
|
|||
|
||||
BuildAnim(nullptr, 23, 0, pActor->spr.pos, pActor->sector(), 40, 4);
|
||||
|
||||
AddFlash(pActor->sector(), pActor->int_pos().X, pActor->int_pos().Y, pActor->int_pos().Z, 128);
|
||||
AddFlash(pActor->sector(), pActor->spr.pos, 128);
|
||||
|
||||
StopActorSound(pActor);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue