mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Adding particle blend, glow and animation (#4705)
This commit is contained in:
parent
649448a2a9
commit
93e3555eae
15 changed files with 800 additions and 81 deletions
|
@ -1658,7 +1658,11 @@ void Server::SendShowFormspecMessage(u16 peer_id, const std::string &formspec,
|
|||
void Server::SendSpawnParticle(u16 peer_id, v3f pos, v3f velocity, v3f acceleration,
|
||||
float expirationtime, float size, bool collisiondetection,
|
||||
bool collision_removal,
|
||||
bool vertical, const std::string &texture)
|
||||
bool vertical, const std::string &texture,
|
||||
u32 material_type_param, AnimationType animation_type,
|
||||
u16 vertical_frame_num, u16 horizontal_frame_num, u16 first_frame,
|
||||
float frame_length, bool loop_animation,
|
||||
u8 glow)
|
||||
{
|
||||
DSTACK(FUNCTION_NAME);
|
||||
|
||||
|
@ -1670,6 +1674,12 @@ void Server::SendSpawnParticle(u16 peer_id, v3f pos, v3f velocity, v3f accelerat
|
|||
pkt << vertical;
|
||||
pkt << collision_removal;
|
||||
|
||||
pkt << material_type_param
|
||||
<< (u8)animation_type
|
||||
<< vertical_frame_num
|
||||
<< horizontal_frame_num << first_frame
|
||||
<< frame_length << loop_animation << glow;
|
||||
|
||||
if (peer_id != PEER_ID_INEXISTENT) {
|
||||
Send(&pkt);
|
||||
}
|
||||
|
@ -1682,7 +1692,10 @@ void Server::SendSpawnParticle(u16 peer_id, v3f pos, v3f velocity, v3f accelerat
|
|||
void Server::SendAddParticleSpawner(u16 peer_id, u16 amount, float spawntime, v3f minpos, v3f maxpos,
|
||||
v3f minvel, v3f maxvel, v3f minacc, v3f maxacc, float minexptime, float maxexptime,
|
||||
float minsize, float maxsize, bool collisiondetection, bool collision_removal,
|
||||
u16 attached_id, bool vertical, const std::string &texture, u32 id)
|
||||
u16 attached_id, bool vertical, const std::string &texture, u32 id,
|
||||
u32 material_type_param, AnimationType animation_type, u16 vertical_frame_num, u16 horizontal_frame_num,
|
||||
u16 min_first_frame, u16 max_first_frame, float frame_length,
|
||||
bool loop_animation, u8 glow)
|
||||
{
|
||||
DSTACK(FUNCTION_NAME);
|
||||
|
||||
|
@ -1698,6 +1711,12 @@ void Server::SendAddParticleSpawner(u16 peer_id, u16 amount, float spawntime, v3
|
|||
pkt << collision_removal;
|
||||
pkt << attached_id;
|
||||
|
||||
pkt << material_type_param
|
||||
<< (u8)animation_type
|
||||
<< vertical_frame_num << horizontal_frame_num
|
||||
<< min_first_frame << max_first_frame
|
||||
<< frame_length << loop_animation << glow;
|
||||
|
||||
if (peer_id != PEER_ID_INEXISTENT) {
|
||||
Send(&pkt);
|
||||
}
|
||||
|
@ -3147,7 +3166,11 @@ void Server::spawnParticle(const std::string &playername, v3f pos,
|
|||
v3f velocity, v3f acceleration,
|
||||
float expirationtime, float size, bool
|
||||
collisiondetection, bool collision_removal,
|
||||
bool vertical, const std::string &texture)
|
||||
bool vertical, const std::string &texture,
|
||||
u32 material_type_param, AnimationType animation_type,
|
||||
u16 vertical_frame_num, u16 horizontal_frame_num, u16 first_frame,
|
||||
float frame_length, bool loop_animation,
|
||||
u8 glow)
|
||||
{
|
||||
// m_env will be NULL if the server is initializing
|
||||
if (!m_env)
|
||||
|
@ -3163,7 +3186,11 @@ void Server::spawnParticle(const std::string &playername, v3f pos,
|
|||
|
||||
SendSpawnParticle(peer_id, pos, velocity, acceleration,
|
||||
expirationtime, size, collisiondetection,
|
||||
collision_removal, vertical, texture);
|
||||
collision_removal, vertical, texture,
|
||||
material_type_param, animation_type,
|
||||
vertical_frame_num, horizontal_frame_num,
|
||||
first_frame, frame_length, loop_animation,
|
||||
glow);
|
||||
}
|
||||
|
||||
u32 Server::addParticleSpawner(u16 amount, float spawntime,
|
||||
|
@ -3171,7 +3198,9 @@ u32 Server::addParticleSpawner(u16 amount, float spawntime,
|
|||
float minexptime, float maxexptime, float minsize, float maxsize,
|
||||
bool collisiondetection, bool collision_removal,
|
||||
ServerActiveObject *attached, bool vertical, const std::string &texture,
|
||||
const std::string &playername)
|
||||
const std::string &playername, u32 material_type_param, AnimationType animation_type,
|
||||
u16 vertical_frame_num, u16 horizontal_frame_num, u16 min_first_frame, u16 max_first_frame,
|
||||
float frame_length, bool loop_animation, u8 glow)
|
||||
{
|
||||
// m_env will be NULL if the server is initializing
|
||||
if (!m_env)
|
||||
|
@ -3197,7 +3226,10 @@ u32 Server::addParticleSpawner(u16 amount, float spawntime,
|
|||
minpos, maxpos, minvel, maxvel, minacc, maxacc,
|
||||
minexptime, maxexptime, minsize, maxsize,
|
||||
collisiondetection, collision_removal, attached_id, vertical,
|
||||
texture, id);
|
||||
texture, id, material_type_param, animation_type,
|
||||
vertical_frame_num, horizontal_frame_num,
|
||||
min_first_frame, max_first_frame, frame_length, loop_animation,
|
||||
glow);
|
||||
|
||||
return id;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue