Add particles

This commit is contained in:
Miloslav Ciz 2025-04-20 19:38:13 +02:00
parent 06c1d1c42e
commit d905718bab
6 changed files with 105 additions and 51 deletions

14
game.h
View file

@ -1621,6 +1621,20 @@ uint8_t LCR_gameStep(uint32_t time)
uint32_t events = paused ? 0 : LCR_racingStep(input);
#if LCR_SETTING_PARTICLES
LCR_rendererSetParticles(0);
if (LCR_racingGetCarSpeedUnsigned() > 60)
{
if (LCR_racingCurrentGroundMaterial() == LCR_BLOCK_MATERIAL_GRASS)
LCR_rendererSetParticles(0x538a);
else if (LCR_racingCurrentGroundMaterial() == LCR_BLOCK_MATERIAL_DIRT)
LCR_rendererSetParticles(0x8c2b);
else if (LCR_racingCarIsDrifting())
LCR_rendererSetParticles(0x4208);
}
#endif
#ifdef LCR_FPS_GET_MS
LCR_game.physicsFrameMS += LCR_FPS_GET_MS - frameTime;
LCR_game.physicsFramesMeasured++;