mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-28 15:57:59 +03:00
Refactored EffectsList
This commit is contained in:
parent
d667122672
commit
616e68160c
28 changed files with 125 additions and 132 deletions
|
@ -84,11 +84,12 @@ int LevelComplete;
|
||||||
bool InItemControlLoop;
|
bool InItemControlLoop;
|
||||||
short ItemNewRoomNo;
|
short ItemNewRoomNo;
|
||||||
short ItemNewRooms[MAX_ROOMS];
|
short ItemNewRooms[MAX_ROOMS];
|
||||||
|
|
||||||
short NextItemFree;
|
short NextItemFree;
|
||||||
short NextFxActive;
|
|
||||||
short NextFxFree;
|
short NextFxFree;
|
||||||
|
|
||||||
std::vector<short> ActiveItems;
|
std::vector<short> ActiveItems;
|
||||||
|
std::vector<short> ActiveEffects;
|
||||||
|
|
||||||
int WeaponDelay;
|
int WeaponDelay;
|
||||||
int WeaponEnemyTimer;
|
int WeaponEnemyTimer;
|
||||||
|
@ -290,15 +291,12 @@ GameStatus ControlPhase(int numFrames, int demoMode)
|
||||||
// Update all effects
|
// Update all effects
|
||||||
InItemControlLoop = true;
|
InItemControlLoop = true;
|
||||||
|
|
||||||
short fxNumber = NextFxActive;
|
for (short fxNumber : ActiveEffects)
|
||||||
while (fxNumber != NO_ITEM)
|
|
||||||
{
|
{
|
||||||
short nextFx = EffectList[fxNumber].nextActive;
|
|
||||||
auto* fx = &EffectList[fxNumber];
|
auto* fx = &EffectList[fxNumber];
|
||||||
|
|
||||||
if (Objects[fx->objectNumber].control)
|
if (Objects[fx->objectNumber].control)
|
||||||
Objects[fx->objectNumber].control(fxNumber);
|
Objects[fx->objectNumber].control(fxNumber);
|
||||||
|
|
||||||
fxNumber = nextFx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
InItemControlLoop = false;
|
InItemControlLoop = false;
|
||||||
|
|
|
@ -60,16 +60,18 @@ extern int CurrentLevel;
|
||||||
extern int LevelComplete;
|
extern int LevelComplete;
|
||||||
|
|
||||||
extern bool InItemControlLoop;
|
extern bool InItemControlLoop;
|
||||||
|
|
||||||
extern short ItemNewRoomNo;
|
extern short ItemNewRoomNo;
|
||||||
extern short ItemNewRooms[MAX_ROOMS];
|
extern short ItemNewRooms[MAX_ROOMS];
|
||||||
|
|
||||||
extern short NextItemFree;
|
extern short NextItemFree;
|
||||||
extern short NextFxActive;
|
|
||||||
extern short NextFxFree;
|
extern short NextFxFree;
|
||||||
|
|
||||||
extern int WeaponDelay;
|
extern int WeaponDelay;
|
||||||
extern int WeaponEnemyTimer;
|
extern int WeaponEnemyTimer;
|
||||||
|
|
||||||
extern std::vector<short> ActiveItems;
|
extern std::vector<short> ActiveItems;
|
||||||
|
extern std::vector<short> ActiveEffects;
|
||||||
|
|
||||||
extern std::vector<short> OutsideRoomTable[OUTSIDE_SIZE][OUTSIDE_SIZE];
|
extern std::vector<short> OutsideRoomTable[OUTSIDE_SIZE][OUTSIDE_SIZE];
|
||||||
|
|
||||||
|
|
|
@ -54,11 +54,10 @@ enum FireSizeEnum
|
||||||
|
|
||||||
struct FX_INFO
|
struct FX_INFO
|
||||||
{
|
{
|
||||||
|
bool Active;
|
||||||
PHD_3DPOS pos;
|
PHD_3DPOS pos;
|
||||||
short roomNumber;
|
short RoomNumber;
|
||||||
short objectNumber;
|
short objectNumber;
|
||||||
short nextFx;
|
|
||||||
short nextActive;
|
|
||||||
short speed;
|
short speed;
|
||||||
short fallspeed;
|
short fallspeed;
|
||||||
int frameNumber;
|
int frameNumber;
|
||||||
|
|
|
@ -1235,7 +1235,7 @@ int ExplodingDeath(short itemNumber, int meshBits, short flags)
|
||||||
fx->pos.Position.y = boneMatrix.Translation().y + item->Pose.Position.y;
|
fx->pos.Position.y = boneMatrix.Translation().y + item->Pose.Position.y;
|
||||||
fx->pos.Position.z = boneMatrix.Translation().z + item->Pose.Position.z;
|
fx->pos.Position.z = boneMatrix.Translation().z + item->Pose.Position.z;
|
||||||
|
|
||||||
fx->roomNumber = item->RoomNumber;
|
fx->RoomNumber = item->RoomNumber;
|
||||||
fx->pos.Orientation.x = 0;
|
fx->pos.Orientation.x = 0;
|
||||||
fx->pos.Orientation.y = GetRandomControl() * 2;
|
fx->pos.Orientation.y = GetRandomControl() * 2;
|
||||||
|
|
||||||
|
@ -1286,7 +1286,7 @@ int ExplodingDeath(short itemNumber, int meshBits, short flags)
|
||||||
fx->pos.Position.y = boneMatrix.Translation().y + item->Pose.Position.y;
|
fx->pos.Position.y = boneMatrix.Translation().y + item->Pose.Position.y;
|
||||||
fx->pos.Position.z = boneMatrix.Translation().z + item->Pose.Position.z;
|
fx->pos.Position.z = boneMatrix.Translation().z + item->Pose.Position.z;
|
||||||
|
|
||||||
fx->roomNumber = item->RoomNumber;
|
fx->RoomNumber = item->RoomNumber;
|
||||||
fx->pos.Orientation.x = 0;
|
fx->pos.Orientation.x = 0;
|
||||||
fx->pos.Orientation.y = GetRandomControl() * 2;
|
fx->pos.Orientation.y = GetRandomControl() * 2;
|
||||||
|
|
||||||
|
|
|
@ -152,25 +152,20 @@ void EffectNewRoom(short fxNumber, short roomNumber)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto* fx = &EffectList[fxNumber];
|
auto* fx = &EffectList[fxNumber];
|
||||||
auto* room = &g_Level.Rooms[fx->roomNumber];
|
|
||||||
|
|
||||||
if (room->fxNumber == fxNumber)
|
if (fx->RoomNumber != NO_ROOM)
|
||||||
room->fxNumber = fx->nextFx;
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
for (short linkNumber = room->fxNumber; linkNumber != -1; linkNumber = EffectList[linkNumber].nextFx)
|
auto* oldRoom = &g_Level.Rooms[fx->RoomNumber];
|
||||||
{
|
oldRoom->Effects.erase(
|
||||||
if (EffectList[linkNumber].nextFx == fxNumber)
|
std::remove(
|
||||||
{
|
oldRoom->Effects.begin(),
|
||||||
EffectList[linkNumber].nextFx = fx->nextFx;
|
oldRoom->Effects.end(),
|
||||||
break;
|
fxNumber),
|
||||||
}
|
oldRoom->Effects.end());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fx->roomNumber = roomNumber;
|
fx->RoomNumber = roomNumber;
|
||||||
fx->nextFx = g_Level.Rooms[roomNumber].fxNumber;
|
g_Level.Rooms[roomNumber].Effects.push_back(fxNumber);
|
||||||
g_Level.Rooms[roomNumber].fxNumber = fxNumber;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,74 +179,74 @@ void KillEffect(short fxNumber)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto* fx = &EffectList[fxNumber];
|
auto* fx = &EffectList[fxNumber];
|
||||||
|
|
||||||
DetatchSpark(fxNumber, SP_FX);
|
DetatchSpark(fxNumber, SP_FX);
|
||||||
|
|
||||||
if (NextFxActive == fxNumber)
|
fx->Active = false;
|
||||||
NextFxActive = fx->nextActive;
|
|
||||||
else
|
ActiveEffects.erase(
|
||||||
|
std::remove(
|
||||||
|
ActiveEffects.begin(),
|
||||||
|
ActiveEffects.end(),
|
||||||
|
fxNumber),
|
||||||
|
ActiveEffects.end());
|
||||||
|
|
||||||
|
if (fx->RoomNumber != NO_ROOM)
|
||||||
{
|
{
|
||||||
for (short linknum = NextFxActive; linknum != NO_ITEM; linknum = EffectList[linknum].nextActive)
|
g_Level.Rooms[fx->RoomNumber].Items.erase(
|
||||||
{
|
std::remove(
|
||||||
if (EffectList[linknum].nextActive == fxNumber)
|
g_Level.Rooms[fx->RoomNumber].Effects.begin(),
|
||||||
{
|
g_Level.Rooms[fx->RoomNumber].Effects.end(),
|
||||||
EffectList[linknum].nextActive = fx->nextActive;
|
fxNumber),
|
||||||
break;
|
g_Level.Rooms[fx->RoomNumber].Effects.end());
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_Level.Rooms[fx->roomNumber].fxNumber == fxNumber)
|
|
||||||
g_Level.Rooms[fx->roomNumber].fxNumber = fx->nextFx;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (short linknum = g_Level.Rooms[fx->roomNumber].fxNumber; linknum != NO_ITEM; linknum = EffectList[linknum].nextFx)
|
|
||||||
{
|
|
||||||
if (EffectList[linknum].nextFx == fxNumber)
|
|
||||||
{
|
|
||||||
EffectList[linknum].nextFx = fx->nextFx;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fx->nextFx = NextFxFree;
|
|
||||||
NextFxFree = fxNumber;
|
NextFxFree = fxNumber;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
short CreateNewEffect(short roomNum)
|
short CreateNewEffect(short roomNum)
|
||||||
{
|
{
|
||||||
short fxNumber = NextFxFree;
|
|
||||||
|
|
||||||
if (NextFxFree != NO_ITEM)
|
if (NextFxFree != NO_ITEM)
|
||||||
{
|
{
|
||||||
auto* fx = &EffectList[NextFxFree];
|
short fxNumber = NextFxFree;
|
||||||
NextFxFree = fx->nextFx;
|
auto* fx = &EffectList[fxNumber];
|
||||||
|
|
||||||
auto* room = &g_Level.Rooms[roomNum];
|
fx->Active = true;
|
||||||
fx->roomNumber = roomNum;
|
fx->RoomNumber = roomNum;
|
||||||
fx->nextFx = room->fxNumber;
|
|
||||||
room->fxNumber = fxNumber;
|
|
||||||
fx->nextActive = NextFxActive;
|
|
||||||
NextFxActive = fxNumber;
|
|
||||||
fx->shade = GRAY555;
|
fx->shade = GRAY555;
|
||||||
}
|
|
||||||
|
auto* room = &g_Level.Rooms[roomNum];
|
||||||
|
room->Effects.push_back(fxNumber);
|
||||||
|
|
||||||
return fxNumber;
|
NextFxFree = NO_ITEM;
|
||||||
|
for (short currentFxNumber = 0; currentFxNumber < NUM_EFFECTS; currentFxNumber++)
|
||||||
|
{
|
||||||
|
auto* currentFx = &EffectList[currentFxNumber];
|
||||||
|
if (!currentFx->Active)
|
||||||
|
{
|
||||||
|
NextFxFree = currentFxNumber;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return fxNumber;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return NO_ITEM;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitialiseFXArray(int allocateMemory)
|
void InitialiseFXArray(int allocateMemory)
|
||||||
{
|
{
|
||||||
NextFxActive = NO_ITEM;
|
|
||||||
NextFxFree = 0;
|
NextFxFree = 0;
|
||||||
|
ActiveEffects.clear();
|
||||||
|
|
||||||
for (int i = 0; i < NUM_EFFECTS; i++)
|
for (short currentFxNumber = 0; currentFxNumber < NUM_EFFECTS; currentFxNumber++)
|
||||||
{
|
{
|
||||||
auto* fx = &EffectList[i];
|
EffectList[currentFxNumber].Active = false;
|
||||||
fx->nextFx = i + 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EffectList[NUM_EFFECTS - 1].nextFx = NO_ITEM;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemoveDrawnItem(short itemNumber)
|
void RemoveDrawnItem(short itemNumber)
|
||||||
|
|
|
@ -43,7 +43,7 @@ void ControlMissile(short fxNumber)
|
||||||
printf("ControlMissile\n");
|
printf("ControlMissile\n");
|
||||||
|
|
||||||
if (fx->objectNumber == ID_SCUBA_HARPOON &&
|
if (fx->objectNumber == ID_SCUBA_HARPOON &&
|
||||||
!TestEnvironment(ENV_FLAG_WATER, fx->roomNumber) &&
|
!TestEnvironment(ENV_FLAG_WATER, fx->RoomNumber) &&
|
||||||
fx->pos.Orientation.x > -0x3000);
|
fx->pos.Orientation.x > -0x3000);
|
||||||
{
|
{
|
||||||
fx->pos.Orientation.x -= ANGLE(1.0f);
|
fx->pos.Orientation.x -= ANGLE(1.0f);
|
||||||
|
@ -54,7 +54,7 @@ void ControlMissile(short fxNumber)
|
||||||
fx->pos.Position.z += velocity * phd_cos(fx->pos.Orientation.y);
|
fx->pos.Position.z += velocity * phd_cos(fx->pos.Orientation.y);
|
||||||
fx->pos.Position.x += velocity * phd_sin(fx->pos.Orientation.y);
|
fx->pos.Position.x += velocity * phd_sin(fx->pos.Orientation.y);
|
||||||
|
|
||||||
auto probe = GetCollision(fx->pos.Position.x, fx->pos.Position.y, fx->pos.Position.z, fx->roomNumber);
|
auto probe = GetCollision(fx->pos.Position.x, fx->pos.Position.y, fx->pos.Position.z, fx->RoomNumber);
|
||||||
|
|
||||||
// Check for hitting something.
|
// Check for hitting something.
|
||||||
if (fx->pos.Position.y >= probe.Position.Floor ||
|
if (fx->pos.Position.y >= probe.Position.Floor ||
|
||||||
|
@ -77,7 +77,7 @@ void ControlMissile(short fxNumber)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (probe.RoomNumber != fx->roomNumber)
|
if (probe.RoomNumber != fx->RoomNumber)
|
||||||
EffectNewRoom(fxNumber, probe.RoomNumber);
|
EffectNewRoom(fxNumber, probe.RoomNumber);
|
||||||
|
|
||||||
// Check for hitting Lara.
|
// Check for hitting Lara.
|
||||||
|
@ -114,8 +114,8 @@ void ControlMissile(short fxNumber)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create bubbles in wake of harpoon bolt.
|
// Create bubbles in wake of harpoon bolt.
|
||||||
//if (fx->objectNumber == ID_SCUBA_HARPOON && g_Level.Rooms[fx->roomNumber].flags & 1)
|
//if (fx->objectNumber == ID_SCUBA_HARPOON && g_Level.Rooms[fx->RoomNumber].flags & 1)
|
||||||
// CreateBubble(&fx->pos, fx->roomNumber, 1, 0);
|
// CreateBubble(&fx->pos, fx->RoomNumber, 1, 0);
|
||||||
/*else if (fx->objectNumber == DRAGON_FIRE && !fx->counter--)
|
/*else if (fx->objectNumber == DRAGON_FIRE && !fx->counter--)
|
||||||
{
|
{
|
||||||
AddDynamicLight(fx->pos.Position.x, fx->pos.Position.y, fx->pos.Position.z, 14, 11);
|
AddDynamicLight(fx->pos.Position.x, fx->pos.Position.y, fx->pos.Position.z, 14, 11);
|
||||||
|
@ -142,7 +142,7 @@ void ControlNatlaGun(short fxNumber)
|
||||||
int x = fx->pos.Position.x + fx->speed * phd_sin(fx->pos.Orientation.y);
|
int x = fx->pos.Position.x + fx->speed * phd_sin(fx->pos.Orientation.y);
|
||||||
int y = fx->pos.Position.y;
|
int y = fx->pos.Position.y;
|
||||||
|
|
||||||
auto probe = GetCollision(x, y, z, fx->roomNumber);
|
auto probe = GetCollision(x, y, z, fx->RoomNumber);
|
||||||
|
|
||||||
// Don't create one if hit a wall.
|
// Don't create one if hit a wall.
|
||||||
if (y >= probe.Position.Floor ||
|
if (y >= probe.Position.Floor ||
|
||||||
|
@ -160,7 +160,7 @@ void ControlNatlaGun(short fxNumber)
|
||||||
fxNew->pos.Position.y = y;
|
fxNew->pos.Position.y = y;
|
||||||
fxNew->pos.Position.z = z;
|
fxNew->pos.Position.z = z;
|
||||||
fxNew->pos.Orientation.y = fx->pos.Orientation.y;
|
fxNew->pos.Orientation.y = fx->pos.Orientation.y;
|
||||||
fxNew->roomNumber = probe.RoomNumber;
|
fxNew->RoomNumber = probe.RoomNumber;
|
||||||
fxNew->speed = fx->speed;
|
fxNew->speed = fx->speed;
|
||||||
fxNew->frameNumber = 0;
|
fxNew->frameNumber = 0;
|
||||||
fxNew->objectNumber = ID_PROJ_NATLA;
|
fxNew->objectNumber = ID_PROJ_NATLA;
|
||||||
|
@ -178,7 +178,7 @@ short ShardGun(int x, int y, int z, short velocity, short yRot, short roomNumber
|
||||||
fx->pos.Position.x = x;
|
fx->pos.Position.x = x;
|
||||||
fx->pos.Position.y = y;
|
fx->pos.Position.y = y;
|
||||||
fx->pos.Position.z = z;
|
fx->pos.Position.z = z;
|
||||||
fx->roomNumber = roomNumber;
|
fx->RoomNumber = roomNumber;
|
||||||
fx->pos.Orientation.x = fx->pos.Orientation.z = 0;
|
fx->pos.Orientation.x = fx->pos.Orientation.z = 0;
|
||||||
fx->pos.Orientation.y = yRot;
|
fx->pos.Orientation.y = yRot;
|
||||||
fx->speed = SHARD_VELOCITY;
|
fx->speed = SHARD_VELOCITY;
|
||||||
|
@ -201,7 +201,7 @@ short BombGun(int x, int y, int z, short velocity, short yRot, short roomNumber)
|
||||||
fx->pos.Position.x = x;
|
fx->pos.Position.x = x;
|
||||||
fx->pos.Position.y = y;
|
fx->pos.Position.y = y;
|
||||||
fx->pos.Position.z = z;
|
fx->pos.Position.z = z;
|
||||||
fx->roomNumber = roomNumber;
|
fx->RoomNumber = roomNumber;
|
||||||
fx->pos.Orientation.x = fx->pos.Orientation.z = 0;
|
fx->pos.Orientation.x = fx->pos.Orientation.z = 0;
|
||||||
fx->pos.Orientation.y = yRot;
|
fx->pos.Orientation.y = yRot;
|
||||||
fx->speed = ROCKET_VELOCITY;
|
fx->speed = ROCKET_VELOCITY;
|
||||||
|
@ -224,7 +224,7 @@ short NatlaGun(int x, int y, int z, short velocity, short yRot, short roomNumber
|
||||||
fx->pos.Position.x = x;
|
fx->pos.Position.x = x;
|
||||||
fx->pos.Position.y = y;
|
fx->pos.Position.y = y;
|
||||||
fx->pos.Position.z = z;
|
fx->pos.Position.z = z;
|
||||||
fx->roomNumber = roomNumber;
|
fx->RoomNumber = roomNumber;
|
||||||
fx->pos.Orientation.x = fx->pos.Orientation.z = 0;
|
fx->pos.Orientation.x = fx->pos.Orientation.z = 0;
|
||||||
fx->pos.Orientation.y = yRot;
|
fx->pos.Orientation.y = yRot;
|
||||||
fx->speed = NATLA_GUN_VELOCITY;
|
fx->speed = NATLA_GUN_VELOCITY;
|
||||||
|
|
|
@ -39,7 +39,7 @@ void DoFlipMap(short group)
|
||||||
flipped->flippedRoom = -1;
|
flipped->flippedRoom = -1;
|
||||||
|
|
||||||
room->Items = flipped->Items;
|
room->Items = flipped->Items;
|
||||||
room->fxNumber = flipped->fxNumber;
|
room->Effects = flipped->Effects;
|
||||||
|
|
||||||
AddRoomFlipItems(room);
|
AddRoomFlipItems(room);
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ struct ROOM_INFO
|
||||||
std::vector<Vector3> positions;
|
std::vector<Vector3> positions;
|
||||||
std::vector<Vector3> normals;
|
std::vector<Vector3> normals;
|
||||||
std::vector<Vector3> colors;
|
std::vector<Vector3> colors;
|
||||||
std::vector<Vector3> effects;
|
std::vector<Vector3> verticesEffects;
|
||||||
std::vector<BUCKET> buckets;
|
std::vector<BUCKET> buckets;
|
||||||
std::vector<ROOM_DOOR> doors;
|
std::vector<ROOM_DOOR> doors;
|
||||||
int xSize;
|
int xSize;
|
||||||
|
@ -114,10 +114,10 @@ struct ROOM_INFO
|
||||||
int meshEffect;
|
int meshEffect;
|
||||||
int reverbType;
|
int reverbType;
|
||||||
int flipNumber;
|
int flipNumber;
|
||||||
short fxNumber;
|
|
||||||
bool boundActive;
|
bool boundActive;
|
||||||
std::vector<TriggerVolume> triggerVolumes;
|
std::vector<TriggerVolume> triggerVolumes;
|
||||||
std::vector<short> Items;
|
std::vector<short> Items;
|
||||||
|
std::vector<short> Effects;
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr auto NUM_ROOMS = 1024;
|
constexpr auto NUM_ROOMS = 1024;
|
||||||
|
|
|
@ -125,7 +125,7 @@ namespace TEN::Entities::Effects
|
||||||
ShatterItem.sphere.z = fx->pos.Position.z;
|
ShatterItem.sphere.z = fx->pos.Position.z;
|
||||||
ShatterItem.bit = 0;
|
ShatterItem.bit = 0;
|
||||||
ShatterItem.flags = fx->flag2 & 0x400;
|
ShatterItem.flags = fx->flag2 & 0x400;
|
||||||
ShatterObject(&ShatterItem, 0, param2, fx->roomNumber, param1);
|
ShatterObject(&ShatterItem, 0, param2, fx->RoomNumber, param1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ControlEnemyMissile(short fxNum)
|
void ControlEnemyMissile(short fxNum)
|
||||||
|
@ -206,7 +206,7 @@ namespace TEN::Entities::Effects
|
||||||
fx->pos.Position.y += -((fx->speed * phd_sin(fx->pos.Orientation.x))) + fx->fallspeed;
|
fx->pos.Position.y += -((fx->speed * phd_sin(fx->pos.Orientation.x))) + fx->fallspeed;
|
||||||
fx->pos.Position.z += (speed * phd_cos(fx->pos.Orientation.y));
|
fx->pos.Position.z += (speed * phd_cos(fx->pos.Orientation.y));
|
||||||
|
|
||||||
auto probe = GetCollision(fx->pos.Position.x, fx->pos.Position.y, fx->pos.Position.z, fx->roomNumber);
|
auto probe = GetCollision(fx->pos.Position.x, fx->pos.Position.y, fx->pos.Position.z, fx->RoomNumber);
|
||||||
|
|
||||||
if (fx->pos.Position.y >= probe.Position.Floor || fx->pos.Position.y <= probe.Position.Ceiling)
|
if (fx->pos.Position.y >= probe.Position.Floor || fx->pos.Position.y <= probe.Position.Ceiling)
|
||||||
{
|
{
|
||||||
|
@ -219,8 +219,8 @@ namespace TEN::Entities::Effects
|
||||||
|
|
||||||
if (fx->flag1 == 1)
|
if (fx->flag1 == 1)
|
||||||
{
|
{
|
||||||
TriggerShockwave(&fx->pos, 32, 160, 64, 64, 128, 00, 24, (((~g_Level.Rooms[fx->roomNumber].flags) / 16) & 2) * 65536, 0);
|
TriggerShockwave(&fx->pos, 32, 160, 64, 64, 128, 00, 24, (((~g_Level.Rooms[fx->RoomNumber].flags) / 16) & 2) * 65536, 0);
|
||||||
TriggerExplosionSparks(oldX, oldY, oldZ, 3, -2, 2, fx->roomNumber);
|
TriggerExplosionSparks(oldX, oldY, oldZ, 3, -2, 2, fx->RoomNumber);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -236,7 +236,7 @@ namespace TEN::Entities::Effects
|
||||||
{
|
{
|
||||||
if (fx->flag1 == 6)
|
if (fx->flag1 == 6)
|
||||||
{
|
{
|
||||||
TriggerExplosionSparks(oldX, oldY, oldZ, 3, -2, 0, fx->roomNumber);
|
TriggerExplosionSparks(oldX, oldY, oldZ, 3, -2, 0, fx->RoomNumber);
|
||||||
TriggerShockwave(&fx->pos, 48, 240, 64, 0, 96, 128, 24, 0, 2);
|
TriggerShockwave(&fx->pos, 48, 240, 64, 0, 96, 128, 24, 0, 2);
|
||||||
fx->pos.Position.y -= 128;
|
fx->pos.Position.y -= 128;
|
||||||
TriggerShockwave(&fx->pos, 48, 240, 48, 0, 112, 128, 16, 0, 2);
|
TriggerShockwave(&fx->pos, 48, 240, 48, 0, 112, 128, 16, 0, 2);
|
||||||
|
@ -268,7 +268,7 @@ namespace TEN::Entities::Effects
|
||||||
if (fx->flag1 == 1)
|
if (fx->flag1 == 1)
|
||||||
{
|
{
|
||||||
TriggerShockwave(&fx->pos, 48, 240, 64, 64, 128, 0, 24, 0, 0);
|
TriggerShockwave(&fx->pos, 48, 240, 64, 64, 128, 0, 24, 0, 0);
|
||||||
TriggerExplosionSparks(oldX, oldY, oldZ, 3, -2, 2, fx->roomNumber);
|
TriggerExplosionSparks(oldX, oldY, oldZ, 3, -2, 2, fx->RoomNumber);
|
||||||
LaraBurn(LaraItem);
|
LaraBurn(LaraItem);
|
||||||
}
|
}
|
||||||
else if (fx->flag1)
|
else if (fx->flag1)
|
||||||
|
@ -289,7 +289,7 @@ namespace TEN::Entities::Effects
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
TriggerExplosionSparks(oldX, oldY, oldZ, 3, -2, 0, fx->roomNumber);
|
TriggerExplosionSparks(oldX, oldY, oldZ, 3, -2, 0, fx->RoomNumber);
|
||||||
TriggerShockwave(&fx->pos, 48, 240, 64, 0, 96, 128, 24, 0, 0);
|
TriggerShockwave(&fx->pos, 48, 240, 64, 0, 96, 128, 24, 0, 0);
|
||||||
fx->pos.Position.y -= 128;
|
fx->pos.Position.y -= 128;
|
||||||
TriggerShockwave(&fx->pos, 48, 240, 48, 0, 112, 128, 16, 0, 0);
|
TriggerShockwave(&fx->pos, 48, 240, 48, 0, 112, 128, 16, 0, 0);
|
||||||
|
@ -300,11 +300,11 @@ namespace TEN::Entities::Effects
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
TriggerShockwave(&fx->pos, 24, 88, 48, 64, 128, 0, 16, (((~g_Level.Rooms[fx->roomNumber].flags) / 16) & 2) * 65536, 0);
|
TriggerShockwave(&fx->pos, 24, 88, 48, 64, 128, 0, 16, (((~g_Level.Rooms[fx->RoomNumber].flags) / 16) & 2) * 65536, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (probe.RoomNumber != fx->roomNumber)
|
if (probe.RoomNumber != fx->RoomNumber)
|
||||||
EffectNewRoom(fxNum, probe.RoomNumber);
|
EffectNewRoom(fxNum, probe.RoomNumber);
|
||||||
|
|
||||||
int dx = oldX - fx->pos.Position.x;
|
int dx = oldX - fx->pos.Position.x;
|
||||||
|
|
|
@ -330,10 +330,10 @@ namespace TEN::Entities::Effects
|
||||||
(GetRandomControl() & 0x1F) + 96);
|
(GetRandomControl() & 0x1F) + 96);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LaraItem->RoomNumber != fx->roomNumber)
|
if (LaraItem->RoomNumber != fx->RoomNumber)
|
||||||
EffectNewRoom(fxNumber, LaraItem->RoomNumber);
|
EffectNewRoom(fxNumber, LaraItem->RoomNumber);
|
||||||
|
|
||||||
int wh = GetWaterHeight(fx->pos.Position.x, fx->pos.Position.y, fx->pos.Position.z, fx->roomNumber);
|
int wh = GetWaterHeight(fx->pos.Position.x, fx->pos.Position.y, fx->pos.Position.z, fx->RoomNumber);
|
||||||
if (wh == NO_HEIGHT || fx->pos.Position.y <= wh || Lara.BurnBlue)
|
if (wh == NO_HEIGHT || fx->pos.Position.y <= wh || Lara.BurnBlue)
|
||||||
{
|
{
|
||||||
SoundEffect(SFX_TR4_LOOP_FOR_SMALL_FIRES, &fx->pos, 0);
|
SoundEffect(SFX_TR4_LOOP_FOR_SMALL_FIRES, &fx->pos, 0);
|
||||||
|
|
|
@ -47,7 +47,7 @@ void KnifeControl(short fxNumber)
|
||||||
fx->pos.Position.x += speed * phd_sin(fx->pos.Orientation.y);
|
fx->pos.Position.x += speed * phd_sin(fx->pos.Orientation.y);
|
||||||
fx->pos.Position.y += fx->speed * phd_sin(-fx->pos.Orientation.x);
|
fx->pos.Position.y += fx->speed * phd_sin(-fx->pos.Orientation.x);
|
||||||
|
|
||||||
auto probe = GetCollision(fx->pos.Position.x, fx->pos.Position.y, fx->pos.Position.z, fx->roomNumber);
|
auto probe = GetCollision(fx->pos.Position.x, fx->pos.Position.y, fx->pos.Position.z, fx->RoomNumber);
|
||||||
|
|
||||||
if (fx->pos.Position.y >= probe.Position.Floor ||
|
if (fx->pos.Position.y >= probe.Position.Floor ||
|
||||||
fx->pos.Position.y <= probe.Position.Ceiling)
|
fx->pos.Position.y <= probe.Position.Ceiling)
|
||||||
|
@ -56,7 +56,7 @@ void KnifeControl(short fxNumber)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (probe.RoomNumber != fx->roomNumber)
|
if (probe.RoomNumber != fx->RoomNumber)
|
||||||
EffectNewRoom(fxNumber, probe.RoomNumber);
|
EffectNewRoom(fxNumber, probe.RoomNumber);
|
||||||
|
|
||||||
fx->pos.Orientation.z += ANGLE(30.0f);
|
fx->pos.Orientation.z += ANGLE(30.0f);
|
||||||
|
@ -71,7 +71,7 @@ void KnifeControl(short fxNumber)
|
||||||
fx->frameNumber = fx->counter = 0;
|
fx->frameNumber = fx->counter = 0;
|
||||||
|
|
||||||
SoundEffect(SFX_TR2_CRUNCH2, &fx->pos, 0);
|
SoundEffect(SFX_TR2_CRUNCH2, &fx->pos, 0);
|
||||||
DoBloodSplat(fx->pos.Position.x, fx->pos.Position.y, fx->pos.Position.z, 80, fx->pos.Orientation.y, fx->roomNumber);
|
DoBloodSplat(fx->pos.Position.x, fx->pos.Position.y, fx->pos.Position.z, 80, fx->pos.Orientation.y, fx->RoomNumber);
|
||||||
KillEffect(fxNumber);
|
KillEffect(fxNumber);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ static void Flame(int x, int y, int z, int velocity, short yRot, short roomNumbe
|
||||||
fx->pos.Position.x = x;
|
fx->pos.Position.x = x;
|
||||||
fx->pos.Position.y = y;
|
fx->pos.Position.y = y;
|
||||||
fx->pos.Position.z = z;
|
fx->pos.Position.z = z;
|
||||||
fx->roomNumber = roomNumber;
|
fx->RoomNumber = roomNumber;
|
||||||
//TODO: complete fx parameters
|
//TODO: complete fx parameters
|
||||||
fx->shade = 14 * 256;
|
fx->shade = 14 * 256;
|
||||||
fx->counter = 40;
|
fx->counter = 40;
|
||||||
|
|
|
@ -175,7 +175,7 @@ static short TriggerFlameThrower(ItemInfo* item, BITE_INFO* bite, short speed)
|
||||||
|
|
||||||
fx->pos.Position = pos1;
|
fx->pos.Position = pos1;
|
||||||
fx->pos.Orientation = angles;
|
fx->pos.Orientation = angles;
|
||||||
fx->roomNumber = item->RoomNumber;
|
fx->RoomNumber = item->RoomNumber;
|
||||||
fx->speed = speed * 4;
|
fx->speed = speed * 4;
|
||||||
fx->counter = 20;
|
fx->counter = 20;
|
||||||
fx->flag1 = 0;
|
fx->flag1 = 0;
|
||||||
|
|
|
@ -394,7 +394,7 @@ void ControlTonyFireBall(short fxNumber)
|
||||||
TriggerFireBallFlame(fxNumber, (TonyFlameType)fx->flag1, (short)((oldX - fx->pos.Position.x) * 8), (short)((oldY - fx->pos.Position.y) * 8), (short)((oldZ - fx->pos.Position.z) * 4));
|
TriggerFireBallFlame(fxNumber, (TonyFlameType)fx->flag1, (short)((oldX - fx->pos.Position.x) * 8), (short)((oldY - fx->pos.Position.y) * 8), (short)((oldZ - fx->pos.Position.z) * 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
auto probe = GetCollision(fx->pos.Position.x, fx->pos.Position.y, fx->pos.Position.z, fx->roomNumber);
|
auto probe = GetCollision(fx->pos.Position.x, fx->pos.Position.y, fx->pos.Position.z, fx->RoomNumber);
|
||||||
|
|
||||||
if (fx->pos.Position.y >= probe.Position.Floor ||
|
if (fx->pos.Position.y >= probe.Position.Floor ||
|
||||||
fx->pos.Position.y < probe.Position.Ceiling)
|
fx->pos.Position.y < probe.Position.Ceiling)
|
||||||
|
@ -403,11 +403,11 @@ void ControlTonyFireBall(short fxNumber)
|
||||||
{
|
{
|
||||||
Vector3Int pos;
|
Vector3Int pos;
|
||||||
|
|
||||||
TriggerExplosionSparks(oldX, oldY, oldZ, 3, -2, 0, fx->roomNumber);
|
TriggerExplosionSparks(oldX, oldY, oldZ, 3, -2, 0, fx->RoomNumber);
|
||||||
if (fx->flag1 == T_ROCKZAPPL || fx->flag1 == T_ROCKZAPPR)
|
if (fx->flag1 == T_ROCKZAPPL || fx->flag1 == T_ROCKZAPPR)
|
||||||
{
|
{
|
||||||
for (int x = 0; x < 2; x++)
|
for (int x = 0; x < 2; x++)
|
||||||
TriggerExplosionSparks(oldX, oldY, oldZ, 3, -1, 0, fx->roomNumber);
|
TriggerExplosionSparks(oldX, oldY, oldZ, 3, -1, 0, fx->RoomNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
pos.x = oldX;
|
pos.x = oldX;
|
||||||
|
@ -429,7 +429,7 @@ void ControlTonyFireBall(short fxNumber)
|
||||||
type = T_ROCKZAPPDEBRIS;
|
type = T_ROCKZAPPDEBRIS;
|
||||||
|
|
||||||
for (int x = 0; x < j; x++)
|
for (int x = 0; x < j; x++)
|
||||||
TriggerFireBall(NULL, type, &pos, fx->roomNumber, fx->pos.Orientation.y, 32 + (x * 4));
|
TriggerFireBall(NULL, type, &pos, fx->RoomNumber, fx->pos.Orientation.y, 32 + (x * 4));
|
||||||
|
|
||||||
if (fx->flag1 == T_ROCKZAPPL || fx->flag1 == T_ROCKZAPPR)
|
if (fx->flag1 == T_ROCKZAPPL || fx->flag1 == T_ROCKZAPPR)
|
||||||
{
|
{
|
||||||
|
@ -467,7 +467,7 @@ void ControlTonyFireBall(short fxNumber)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (probe.RoomNumber != fx->roomNumber)
|
if (probe.RoomNumber != fx->RoomNumber)
|
||||||
EffectNewRoom(fxNumber, LaraItem->RoomNumber);
|
EffectNewRoom(fxNumber, LaraItem->RoomNumber);
|
||||||
|
|
||||||
unsigned char radtab[7] = { 16, 0, 14, 9, 7, 7, 7 };
|
unsigned char radtab[7] = { 16, 0, 14, 9, 7, 7, 7 };
|
||||||
|
|
|
@ -123,7 +123,7 @@ namespace TEN::Entities::TR4
|
||||||
|
|
||||||
fx->pos.Orientation.z = 0;
|
fx->pos.Orientation.z = 0;
|
||||||
|
|
||||||
fx->roomNumber = roomNumber;
|
fx->RoomNumber = roomNumber;
|
||||||
fx->counter = 2 * GetRandomControl() + -ANGLE(180.0f);
|
fx->counter = 2 * GetRandomControl() + -ANGLE(180.0f);
|
||||||
fx->flag1 = flags;
|
fx->flag1 = flags;
|
||||||
fx->speed = (GetRandomControl() & 0x1F) + 96;
|
fx->speed = (GetRandomControl() & 0x1F) + 96;
|
||||||
|
|
|
@ -52,7 +52,7 @@ static void TriggerHarpyMissile(PHD_3DPOS* pos, short roomNumber, int count)
|
||||||
fx->pos.Orientation.x = pos->Orientation.x;
|
fx->pos.Orientation.x = pos->Orientation.x;
|
||||||
fx->pos.Orientation.y = pos->Orientation.y;
|
fx->pos.Orientation.y = pos->Orientation.y;
|
||||||
fx->pos.Orientation.z = 0;
|
fx->pos.Orientation.z = 0;
|
||||||
fx->roomNumber = roomNumber;
|
fx->RoomNumber = roomNumber;
|
||||||
fx->counter = 2 * GetRandomControl() + -32768;
|
fx->counter = 2 * GetRandomControl() + -32768;
|
||||||
fx->objectNumber = ID_ENERGY_BUBBLES;
|
fx->objectNumber = ID_ENERGY_BUBBLES;
|
||||||
fx->speed = (GetRandomControl() & 0x1F) + 96;
|
fx->speed = (GetRandomControl() & 0x1F) + 96;
|
||||||
|
|
|
@ -41,7 +41,7 @@ namespace TEN::Entities::TR4
|
||||||
fx->pos.Orientation.x = src->Orientation.x;
|
fx->pos.Orientation.x = src->Orientation.x;
|
||||||
fx->pos.Orientation.y = src->Orientation.y;
|
fx->pos.Orientation.y = src->Orientation.y;
|
||||||
fx->pos.Orientation.z = 0;
|
fx->pos.Orientation.z = 0;
|
||||||
fx->roomNumber = roomNumber;
|
fx->RoomNumber = roomNumber;
|
||||||
fx->counter = 16 * counter + 15;
|
fx->counter = 16 * counter + 15;
|
||||||
fx->objectNumber = ID_ENERGY_BUBBLES;
|
fx->objectNumber = ID_ENERGY_BUBBLES;
|
||||||
fx->frameNumber = Objects[fx->objectNumber].meshIndex + 5;
|
fx->frameNumber = Objects[fx->objectNumber].meshIndex + 5;
|
||||||
|
|
|
@ -545,7 +545,7 @@ void SethaThrowAttack(PHD_3DPOS* pos, short roomNumber, short mesh)
|
||||||
fx->pos.Orientation.x = pos->Orientation.x;
|
fx->pos.Orientation.x = pos->Orientation.x;
|
||||||
fx->pos.Orientation.y = pos->Orientation.y;
|
fx->pos.Orientation.y = pos->Orientation.y;
|
||||||
fx->pos.Orientation.z = 0;
|
fx->pos.Orientation.z = 0;
|
||||||
fx->roomNumber = roomNumber;
|
fx->RoomNumber = roomNumber;
|
||||||
fx->counter = 2 * GetRandomControl() + -ANGLE(180);
|
fx->counter = 2 * GetRandomControl() + -ANGLE(180);
|
||||||
fx->flag1 = mesh;
|
fx->flag1 = mesh;
|
||||||
fx->objectNumber = ID_BODY_PART;
|
fx->objectNumber = ID_BODY_PART;
|
||||||
|
|
|
@ -31,7 +31,7 @@ namespace TEN::Entities::TR4
|
||||||
fx->pos.Position.x = (byte)GetRandomControl() + item->Pose.Position.x - 128;
|
fx->pos.Position.x = (byte)GetRandomControl() + item->Pose.Position.x - 128;
|
||||||
fx->pos.Position.y = GetCollision(item).Position.Floor;
|
fx->pos.Position.y = GetCollision(item).Position.Floor;
|
||||||
fx->pos.Position.z = (byte)GetRandomControl() + item->Pose.Position.z - 128;
|
fx->pos.Position.z = (byte)GetRandomControl() + item->Pose.Position.z - 128;
|
||||||
fx->roomNumber = item->RoomNumber;
|
fx->RoomNumber = item->RoomNumber;
|
||||||
fx->pos.Orientation.y = 2 * GetRandomControl();
|
fx->pos.Orientation.y = 2 * GetRandomControl();
|
||||||
fx->speed = GetRandomControl() / 2048;
|
fx->speed = GetRandomControl() / 2048;
|
||||||
fx->fallspeed = -(GetRandomControl() / 1024);
|
fx->fallspeed = -(GetRandomControl() / 1024);
|
||||||
|
|
|
@ -70,7 +70,7 @@ static void HydraBubblesAttack(PHD_3DPOS* pos, short roomNumber, int count)
|
||||||
fx->pos.Orientation.x = pos->Orientation.x;
|
fx->pos.Orientation.x = pos->Orientation.x;
|
||||||
fx->pos.Orientation.y = pos->Orientation.y;
|
fx->pos.Orientation.y = pos->Orientation.y;
|
||||||
fx->pos.Orientation.z = 0;
|
fx->pos.Orientation.z = 0;
|
||||||
fx->roomNumber = roomNumber;
|
fx->RoomNumber = roomNumber;
|
||||||
fx->counter = 16 * count + 15;
|
fx->counter = 16 * count + 15;
|
||||||
fx->flag1 = 0;
|
fx->flag1 = 0;
|
||||||
fx->objectNumber = ID_BUBBLES;
|
fx->objectNumber = ID_BUBBLES;
|
||||||
|
|
|
@ -92,7 +92,7 @@ static void ImpThrowStones(ItemInfo* item)
|
||||||
auto* fx = &EffectList[fxNumber];
|
auto* fx = &EffectList[fxNumber];
|
||||||
|
|
||||||
fx->pos.Position = pos1;
|
fx->pos.Position = pos1;
|
||||||
fx->roomNumber = item->RoomNumber;
|
fx->RoomNumber = item->RoomNumber;
|
||||||
fx->speed = 4 * sqrt(distance);
|
fx->speed = 4 * sqrt(distance);
|
||||||
|
|
||||||
fx->pos.Orientation = Vector3Shrt(
|
fx->pos.Orientation = Vector3Shrt(
|
||||||
|
|
|
@ -67,7 +67,7 @@ static void RomanStatueHitEffect(ItemInfo* item, Vector3Int* pos, int joint)
|
||||||
fx->pos.Position.x = pos->x;
|
fx->pos.Position.x = pos->x;
|
||||||
fx->pos.Position.y = pos->y;
|
fx->pos.Position.y = pos->y;
|
||||||
fx->pos.Position.z = pos->z;
|
fx->pos.Position.z = pos->z;
|
||||||
fx->roomNumber = item->RoomNumber;
|
fx->RoomNumber = item->RoomNumber;
|
||||||
fx->pos.Orientation.z = 0;
|
fx->pos.Orientation.z = 0;
|
||||||
fx->pos.Orientation.x = 0;
|
fx->pos.Orientation.x = 0;
|
||||||
fx->pos.Orientation.y = 2 * GetRandomControl();
|
fx->pos.Orientation.y = 2 * GetRandomControl();
|
||||||
|
@ -235,7 +235,7 @@ static void RomanStatueAttack(PHD_3DPOS* pos, short roomNumber, short count)
|
||||||
fx->pos.Orientation.x = pos->Orientation.x;
|
fx->pos.Orientation.x = pos->Orientation.x;
|
||||||
fx->pos.Orientation.y = pos->Orientation.y;
|
fx->pos.Orientation.y = pos->Orientation.y;
|
||||||
fx->pos.Orientation.z = 0;
|
fx->pos.Orientation.z = 0;
|
||||||
fx->roomNumber = roomNumber;
|
fx->RoomNumber = roomNumber;
|
||||||
fx->counter = 16 * count + 15;
|
fx->counter = 16 * count + 15;
|
||||||
fx->flag1 = 1;
|
fx->flag1 = 1;
|
||||||
fx->objectNumber = ID_BUBBLES;
|
fx->objectNumber = ID_BUBBLES;
|
||||||
|
|
|
@ -42,7 +42,7 @@ void ControlBodyPart(short fxNumber)
|
||||||
fx->pos.Position.y += fx->fallspeed;
|
fx->pos.Position.y += fx->fallspeed;
|
||||||
fx->pos.Position.z += fx->speed * phd_cos(fx->pos.Orientation.y);
|
fx->pos.Position.z += fx->speed * phd_cos(fx->pos.Orientation.y);
|
||||||
|
|
||||||
short roomNumber = fx->roomNumber;
|
short roomNumber = fx->RoomNumber;
|
||||||
FloorInfo* floor = GetFloor(fx->pos.Position.x, fx->pos.Position.y, fx->pos.Position.z,&roomNumber);
|
FloorInfo* floor = GetFloor(fx->pos.Position.x, fx->pos.Position.y, fx->pos.Position.z,&roomNumber);
|
||||||
|
|
||||||
if (!fx->counter)
|
if (!fx->counter)
|
||||||
|
@ -109,10 +109,10 @@ void ControlBodyPart(short fxNumber)
|
||||||
(GetRandomControl() & 0x3F) + fx->pos.Position.z - 32,
|
(GetRandomControl() & 0x3F) + fx->pos.Position.z - 32,
|
||||||
1,
|
1,
|
||||||
2 * GetRandomControl(),
|
2 * GetRandomControl(),
|
||||||
fx->roomNumber);
|
fx->RoomNumber);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (roomNumber != fx->roomNumber)
|
if (roomNumber != fx->RoomNumber)
|
||||||
EffectNewRoom(fxNumber, roomNumber);
|
EffectNewRoom(fxNumber, roomNumber);
|
||||||
}
|
}
|
|
@ -104,7 +104,7 @@ void MissileControl(short itemNumber)
|
||||||
fx->pos.Position.y += fx->speed * phd_sin(-fx->pos.Orientation.x);
|
fx->pos.Position.y += fx->speed * phd_sin(-fx->pos.Orientation.x);
|
||||||
fx->pos.Position.z += c * phd_cos(fx->pos.Orientation.y);
|
fx->pos.Position.z += c * phd_cos(fx->pos.Orientation.y);
|
||||||
|
|
||||||
auto probe = GetCollision(fx->pos.Position.x, fx->pos.Position.y, fx->pos.Position.z, fx->roomNumber);
|
auto probe = GetCollision(fx->pos.Position.x, fx->pos.Position.y, fx->pos.Position.z, fx->RoomNumber);
|
||||||
|
|
||||||
if (fx->pos.Position.y >= probe.Position.Floor || fx->pos.Position.y <= probe.Position.Ceiling)
|
if (fx->pos.Position.y >= probe.Position.Floor || fx->pos.Position.y <= probe.Position.Ceiling)
|
||||||
{
|
{
|
||||||
|
@ -116,7 +116,7 @@ void MissileControl(short itemNumber)
|
||||||
{
|
{
|
||||||
if (fx->flag1 == 1)
|
if (fx->flag1 == 1)
|
||||||
{
|
{
|
||||||
TriggerExplosionSparks(x, y, z, 3, -2, 2, fx->roomNumber);
|
TriggerExplosionSparks(x, y, z, 3, -2, 2, fx->RoomNumber);
|
||||||
fx->pos.Position.y -= 64;
|
fx->pos.Position.y -= 64;
|
||||||
TriggerShockwave((PHD_3DPOS*)fx, 48, 256, 64, 64, 128, 0, 24, 0, 1);
|
TriggerShockwave((PHD_3DPOS*)fx, 48, 256, 64, 64, 128, 0, 24, 0, 1);
|
||||||
fx->pos.Position.y -= 128;
|
fx->pos.Position.y -= 128;
|
||||||
|
@ -130,7 +130,7 @@ void MissileControl(short itemNumber)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TriggerExplosionSparks(x, y, z, 3, -2, 0, fx->roomNumber);
|
TriggerExplosionSparks(x, y, z, 3, -2, 0, fx->RoomNumber);
|
||||||
TriggerShockwave((PHD_3DPOS*)fx, 48, 240, 48, 0, 96, 128, 24, 0, 2);
|
TriggerShockwave((PHD_3DPOS*)fx, 48, 240, 48, 0, 96, 128, 24, 0, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ void MissileControl(short itemNumber)
|
||||||
if (fx->flag1 == 1)
|
if (fx->flag1 == 1)
|
||||||
{
|
{
|
||||||
// ROMAN_GOD hit effect
|
// ROMAN_GOD hit effect
|
||||||
TriggerExplosionSparks(x, y, z, 3, -2, 2, fx->roomNumber);
|
TriggerExplosionSparks(x, y, z, 3, -2, 2, fx->RoomNumber);
|
||||||
fx->pos.Position.y -= 64;
|
fx->pos.Position.y -= 64;
|
||||||
TriggerShockwave((PHD_3DPOS*)fx, 48, 256, 64, 0, 128, 64, 24, 0, 1);
|
TriggerShockwave((PHD_3DPOS*)fx, 48, 256, 64, 0, 128, 64, 24, 0, 1);
|
||||||
fx->pos.Position.y -= 128;
|
fx->pos.Position.y -= 128;
|
||||||
|
@ -171,7 +171,7 @@ void MissileControl(short itemNumber)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// HYDRA hit effect
|
// HYDRA hit effect
|
||||||
TriggerExplosionSparks(x, y, z, 3, -2, 0, fx->roomNumber);
|
TriggerExplosionSparks(x, y, z, 3, -2, 0, fx->RoomNumber);
|
||||||
TriggerShockwave((PHD_3DPOS*)fx, 48, 240, 48, 0, 96, 128, 24, 0, 0);
|
TriggerShockwave((PHD_3DPOS*)fx, 48, 240, 48, 0, 96, 128, 24, 0, 0);
|
||||||
if (LaraItem->HitPoints >= 500)
|
if (LaraItem->HitPoints >= 500)
|
||||||
LaraItem->HitPoints -= 300;
|
LaraItem->HitPoints -= 300;
|
||||||
|
@ -182,7 +182,7 @@ void MissileControl(short itemNumber)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (probe.RoomNumber != fx->roomNumber)
|
if (probe.RoomNumber != fx->RoomNumber)
|
||||||
EffectNewRoom(itemNumber, probe.RoomNumber);
|
EffectNewRoom(itemNumber, probe.RoomNumber);
|
||||||
|
|
||||||
if (GlobalCounter & 1)
|
if (GlobalCounter & 1)
|
||||||
|
@ -217,7 +217,7 @@ void ExplodeFX(FX_INFO* fx, int noXZVel, int bits)
|
||||||
if (fx->flag2 & 0x2000)
|
if (fx->flag2 & 0x2000)
|
||||||
DebrisFlags = 1;
|
DebrisFlags = 1;
|
||||||
|
|
||||||
ShatterObject(&ShatterItem, 0, bits, fx->roomNumber, noXZVel);
|
ShatterObject(&ShatterItem, 0, bits, fx->RoomNumber, noXZVel);
|
||||||
|
|
||||||
DebrisFlags = 0;
|
DebrisFlags = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -220,7 +220,7 @@ namespace TEN::Renderer
|
||||||
vertex->BiTangent = poly.bitangents[k];
|
vertex->BiTangent = poly.bitangents[k];
|
||||||
vertex->IndexInPoly = k;
|
vertex->IndexInPoly = k;
|
||||||
vertex->OriginalIndex = index;
|
vertex->OriginalIndex = index;
|
||||||
vertex->Effects = room.effects[index];
|
vertex->Effects = room.verticesEffects[index];
|
||||||
unsigned long long primes[]{ 73856093ULL ,19349663ULL ,83492791ULL };
|
unsigned long long primes[]{ 73856093ULL ,19349663ULL ,83492791ULL };
|
||||||
|
|
||||||
vertex->hash = std::hash<float>{}((vertex->Position.x)* primes[0]) ^ (std::hash<float>{}(vertex->Position.y)* primes[1]) ^ std::hash<float>{}(vertex->Position.z) * primes[2];
|
vertex->hash = std::hash<float>{}((vertex->Position.x)* primes[0]) ^ (std::hash<float>{}(vertex->Position.y)* primes[1]) ^ std::hash<float>{}(vertex->Position.z) * primes[2];
|
||||||
|
|
|
@ -1104,7 +1104,7 @@ namespace TEN::Renderer
|
||||||
int firstBucket = (transparent ? 2 : 0);
|
int firstBucket = (transparent ? 2 : 0);
|
||||||
int lastBucket = (transparent ? 4 : 2);
|
int lastBucket = (transparent ? 4 : 2);
|
||||||
|
|
||||||
RendererRoom const & room = m_rooms[effect->Effect->roomNumber];
|
RendererRoom const & room = m_rooms[effect->Effect->RoomNumber];
|
||||||
//RendererObject * moveableObj = m_moveableObjects[effect->Effect->objectNumber];
|
//RendererObject * moveableObj = m_moveableObjects[effect->Effect->objectNumber];
|
||||||
|
|
||||||
m_stItem.World = effect->World;
|
m_stItem.World = effect->World;
|
||||||
|
@ -1162,7 +1162,7 @@ namespace TEN::Renderer
|
||||||
{
|
{
|
||||||
for (auto effect : room->EffectsToDraw)
|
for (auto effect : room->EffectsToDraw)
|
||||||
{
|
{
|
||||||
RendererRoom const& room = m_rooms[effect->Effect->roomNumber];
|
RendererRoom const& room = m_rooms[effect->Effect->RoomNumber];
|
||||||
ObjectInfo* obj = &Objects[effect->Effect->objectNumber];
|
ObjectInfo* obj = &Objects[effect->Effect->objectNumber];
|
||||||
|
|
||||||
if (obj->drawRoutine && obj->loaded)
|
if (obj->drawRoutine && obj->loaded)
|
||||||
|
|
|
@ -723,8 +723,7 @@ namespace TEN::Renderer
|
||||||
RendererRoom& room = m_rooms[roomNumber];
|
RendererRoom& room = m_rooms[roomNumber];
|
||||||
ROOM_INFO* r = &g_Level.Rooms[room.RoomNumber];
|
ROOM_INFO* r = &g_Level.Rooms[room.RoomNumber];
|
||||||
|
|
||||||
short fxNum = NO_ITEM;
|
for (short fxNum : r->Effects)
|
||||||
for (fxNum = r->fxNumber; fxNum != NO_ITEM; fxNum = EffectList[fxNum].nextFx)
|
|
||||||
{
|
{
|
||||||
FX_INFO *fx = &EffectList[fxNum];
|
FX_INFO *fx = &EffectList[fxNum];
|
||||||
|
|
||||||
|
@ -740,7 +739,7 @@ namespace TEN::Renderer
|
||||||
newEffect->World = Matrix::CreateFromYawPitchRoll(fx->pos.Orientation.y, fx->pos.Position.x, fx->pos.Position.z) * Matrix::CreateTranslation(fx->pos.Position.x, fx->pos.Position.y, fx->pos.Position.z);
|
newEffect->World = Matrix::CreateFromYawPitchRoll(fx->pos.Orientation.y, fx->pos.Position.x, fx->pos.Position.z) * Matrix::CreateTranslation(fx->pos.Position.x, fx->pos.Position.y, fx->pos.Position.z);
|
||||||
newEffect->Mesh = GetMesh(obj->nmeshes ? obj->meshIndex : fx->frameNumber);
|
newEffect->Mesh = GetMesh(obj->nmeshes ? obj->meshIndex : fx->frameNumber);
|
||||||
|
|
||||||
CollectLightsForEffect(fx->roomNumber, newEffect, renderView);
|
CollectLightsForEffect(fx->RoomNumber, newEffect, renderView);
|
||||||
|
|
||||||
room.EffectsToDraw.push_back(newEffect);
|
room.EffectsToDraw.push_back(newEffect);
|
||||||
}
|
}
|
||||||
|
|
|
@ -567,9 +567,9 @@ void ReadRooms()
|
||||||
for (int j = 0; j < numVertices; j++)
|
for (int j = 0; j < numVertices; j++)
|
||||||
room.colors.push_back(ReadVector3());
|
room.colors.push_back(ReadVector3());
|
||||||
|
|
||||||
room.effects.reserve(numVertices);
|
room.verticesEffects.reserve(numVertices);
|
||||||
for (int j = 0; j < numVertices; j++)
|
for (int j = 0; j < numVertices; j++)
|
||||||
room.effects.push_back(ReadVector3());
|
room.verticesEffects.push_back(ReadVector3());
|
||||||
|
|
||||||
int numBuckets = ReadInt32();
|
int numBuckets = ReadInt32();
|
||||||
room.buckets.reserve(numBuckets);
|
room.buckets.reserve(numBuckets);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue