mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add particles
This commit is contained in:
parent
443bbe6a78
commit
61f5ca6b16
9 changed files with 370 additions and 1 deletions
22
src/game.cpp
22
src/game.cpp
|
@ -36,6 +36,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "guiChatConsole.h"
|
||||
#include "config.h"
|
||||
#include "clouds.h"
|
||||
#include "particles.h"
|
||||
#include "camera.h"
|
||||
#include "farmesh.h"
|
||||
#include "mapblock.h"
|
||||
|
@ -2399,6 +2400,13 @@ void the_game(
|
|||
else
|
||||
{
|
||||
dig_time_complete = params.time;
|
||||
if (g_settings->getBool("enable_particles"))
|
||||
{
|
||||
const ContentFeatures &features =
|
||||
client.getNodeDefManager()->get(n);
|
||||
addPunchingParticles
|
||||
(gamedef, smgr, player, nodepos, features.tiles);
|
||||
}
|
||||
}
|
||||
|
||||
if(dig_time_complete >= 0.001)
|
||||
|
@ -2430,6 +2438,14 @@ void the_game(
|
|||
MapNode wasnode = map.getNode(nodepos);
|
||||
client.removeNode(nodepos);
|
||||
|
||||
if (g_settings->getBool("enable_particles"))
|
||||
{
|
||||
const ContentFeatures &features =
|
||||
client.getNodeDefManager()->get(wasnode);
|
||||
addDiggingParticles
|
||||
(gamedef, smgr, player, nodepos, features.tiles);
|
||||
}
|
||||
|
||||
dig_time = 0;
|
||||
digging = false;
|
||||
|
||||
|
@ -2698,6 +2714,12 @@ void the_game(
|
|||
farmesh->update(v2f(player_position.X, player_position.Z),
|
||||
brightness, farmesh_range);
|
||||
}
|
||||
|
||||
/*
|
||||
Update particles
|
||||
*/
|
||||
|
||||
allparticles_step(dtime, client.getEnv());
|
||||
|
||||
/*
|
||||
Fog
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue