mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-01 09:18:00 +03:00

* Starting Reformat the project
- New Import Method, no more "../../" in import,
- New Entity Folder Structure, less compile time
* Refactoring the Project
- added precompiled header with default import like microsoft or directx.
- fix many double import.
- fix math.h confliting math.h from
microsoft.
- fix effects.h confliting Effects.h from DirectX.
- refactored TR4 entity folder and how it's loaded.
* Update Some Code Before Switching to Master
* Finished the NewProjectFormat Template
- need to finish entity in the master later.
* Added Monty NewFileFormat
* Fixed Monty NewFileFormat Include
* Revert "Fixed Monty NewFileFormat Include"
This reverts commit ebf0afca10
.
* Trying to fix conflits for NewFileFormat
* Fixed .filters
* Last Commit in NewProjectFormat
57 lines
1.6 KiB
C++
57 lines
1.6 KiB
C++
#include "framework.h"
|
|
#include "footprint.h"
|
|
#include "control.h"
|
|
#include "lara.h"
|
|
#include "draw.h"
|
|
#include "groundfx.h"
|
|
#include "level.h"
|
|
|
|
std::deque<FOOTPRINT_STRUCT> footprints = deque<FOOTPRINT_STRUCT>();
|
|
|
|
bool CheckFootOnFloor(ITEM_INFO& const item, int joint, PHD_3DPOS& outFootprintPosition){
|
|
int x = item.pos.xPos;
|
|
int y = item.pos.yPos;
|
|
int z = item.pos.zPos;
|
|
short roomNumber = item.roomNumber;
|
|
FLOOR_INFO* floor = GetFloor(x, y, z, &roomNumber);
|
|
if (!(floor->fx == GroundMaterial::Ice || floor->fx == GroundMaterial::Sand || floor->fx == GroundMaterial::Mud)) {
|
|
return false;
|
|
}
|
|
int height = GetFloorHeight(floor, x, y, z);
|
|
int diff;
|
|
PHD_VECTOR pos;
|
|
pos.x = pos.z = 0;
|
|
pos.y = FOOT_HEIGHT_OFFSET;
|
|
GetLaraJointPosition(&pos, joint);
|
|
outFootprintPosition.xPos = pos.x;
|
|
outFootprintPosition.zPos = pos.z;
|
|
outFootprintPosition.yPos = height-1;
|
|
outFootprintPosition.yRot = item.pos.yRot;
|
|
return abs(pos.y - height) < 32;
|
|
}
|
|
|
|
void updateFootprints()
|
|
{
|
|
if (footprints.size() == 0) {
|
|
return;
|
|
}
|
|
int numInvalidFootprints = 0;
|
|
for (auto i = footprints.begin(); i != footprints.end(); i++) {
|
|
FOOTPRINT_STRUCT& footprint = *i;
|
|
footprint.life--;
|
|
if (footprint.life <= 0) {
|
|
numInvalidFootprints++;
|
|
continue;
|
|
}
|
|
if (footprint.life > footprint.lifeStartFading) {
|
|
footprint.opacity = footprint.startOpacity;
|
|
}
|
|
else {
|
|
float opacity = lerp(0, footprint.startOpacity, fmax(0, fmin(1, footprint.life / (float)footprint.lifeStartFading)));
|
|
footprint.opacity = opacity;
|
|
}
|
|
}
|
|
for (int i = 0; i < numInvalidFootprints; i++) {
|
|
footprints.pop_back();
|
|
}
|
|
}
|