aboutsummaryrefslogtreecommitdiff
path: root/src/GameTick.cpp
diff options
context:
space:
mode:
authorNguyễn Gia Phong <cnx@loang.net>2023-08-24 04:21:46 +0900
committerNguyễn Gia Phong <cnx@loang.net>2023-08-24 04:30:20 +0900
commitefd25d51cdd7a9cadda1c0f6983905fc17545f14 (patch)
tree8dea973669d8dfe4e7209c9f419bf8cbbf483323 /src/GameTick.cpp
parent2598835c54a3869a477d287d2845bbe42790a359 (diff)
downloadblackshades-efd25d51cdd7a9cadda1c0f6983905fc17545f14.tar.gz
Fix decal fading animation2.5.1
Also fix missing decal regression. Fixes: 48417e11854f8 ("Make XYZ C-compatible")
Diffstat (limited to 'src/GameTick.cpp')
-rw-r--r--src/GameTick.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/GameTick.cpp b/src/GameTick.cpp
index 634db76..7fa90fa 100644
--- a/src/GameTick.cpp
+++ b/src/GameTick.cpp
@@ -758,12 +758,12 @@ void bleed(Game* game, size_t i)
XYZ normish {0.0f, 1.0f, 0.0f};
if (whichtri >= 0) {
- decals.MakeDecal(bloodpool, temp, 12, normish,
+ addDecal(&decals, BLOOD_POOL, temp, 12, normish,
whichtri, &game->sidewalkcollide, move, rot);
} else {
temp = person.skeleton.joints[abdomen].position;
temp.y = -0.5f;
- decals.MakeDecal(bloodpool, temp, 12, normish,
+ addDecal(&decals, BLOOD_POOL, temp, 12, normish,
0, &game->sidewalkcollide, {}, 0);
}
person.firstlongdead = true;
@@ -1004,7 +1004,7 @@ void Game::Tick()
spawnNpc(this);
sprites.DoStuff();
- decals.DoStuff();
+ updateDecals(&decals);
// Facing
XYZ facing {0, 0, -1};
@@ -2089,7 +2089,7 @@ void Game::Tick()
// with wall
if(oldend==finalwallhit){
- decals.MakeDecal(bullethole, finalwallhit,.7,hitnorm, hitpoly, model, hitmove, hitrotation);
+ addDecal(&decals, BULLET_HOLE, finalwallhit,.7,hitnorm, hitpoly, model, hitmove, hitrotation);
XYZ velocity;
@@ -2234,7 +2234,7 @@ void Game::Tick()
impact = true;
auto normalrotated = rotate(blocks[citytype[wherex][wherey]].normals[whichtri], 0, cityrotation[wherex][wherey] * 90, 0);
if (sprites.size[i] > 1)
- decals.MakeDecal(crater, wallhit, 9, normalrotated, whichtri, &blocks[citytype[wherex][wherey]], move, cityrotation[wherex][wherey] * 90);
+ addDecal(&decals, CRATER, wallhit, 9, normalrotated, whichtri, &blocks[citytype[wherex][wherey]], move, cityrotation[wherex][wherey] * 90);
sprites.location[i] = wallhit + normalrotated * 0.02f;
reflect(&sprites.velocity[i], normalrotated);
sprites.velocity[i] *= 0.3f;
@@ -2267,7 +2267,7 @@ void Game::Tick()
move = {};
sprites.location[i].y=-.5;
XYZ normish = {0.0f, 1.0f, 0.0f};
- decals.MakeDecal(crater, sprites.location[i],9,normish, 0, &blocks[citytype[wherex][wherey]], move, 0);
+ addDecal(&decals, CRATER, sprites.location[i],9,normish, 0, &blocks[citytype[wherex][wherey]], move, 0);
}
auto soundpos = sprites.location[i] - camera.position;
@@ -2390,14 +2390,14 @@ void Game::Tick()
XYZ normish = {0.0f, 1.0f, 0.0f};
if(whichtri>=0){
- decals.MakeDecal(crater, sprites.location[i],9,normish, 0, &sidewalkcollide, move, cityrotation[wherex][wherey]*90);
+ addDecal(&decals, CRATER, sprites.location[i],9,normish, 0, &sidewalkcollide, move, cityrotation[wherex][wherey]*90);
}
if(whichtri==-1){
temp=sprites.location[i];
temp.y=-.5;
move = {};
- decals.MakeDecal(crater, sprites.location[i],9,normish, 0, &sidewalkcollide, move, 0);
+ addDecal(&decals, CRATER, sprites.location[i],9,normish, 0, &sidewalkcollide, move, 0);
}
for(int k=0;k<numpeople;k++){