1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Get the new animation framework properly working

Store start and end frames as v2f

Also move bone animations to their own function instead of object properties
This commit is contained in:
MirceaKitsune 2012-10-26 18:03:24 +03:00 committed by Perttu Ahola
parent ba4d93027f
commit 118285e6ba
10 changed files with 139 additions and 135 deletions

View file

@ -92,19 +92,30 @@ std::string gob_cmd_set_sprite(
return os.str();
}
std::string gob_cmd_set_animations(int frame_start, int frame_end, float frame_speed, float frame_blend)
std::string gob_cmd_set_animations(v2f frames, float frame_speed, float frame_blend)
{
std::ostringstream os(std::ios::binary);
// command
writeU8(os, GENERIC_CMD_SET_ANIMATIONS);
// parameters
writeU16(os, frame_start);
writeU16(os, frame_end);
writeV2F1000(os, frames);
writeF1000(os, frame_speed);
writeF1000(os, frame_blend);
return os.str();
}
std::string gob_cmd_set_bone_posrot(std::string bone, v3f position, v3f rotation)
{
std::ostringstream os(std::ios::binary);
// command
writeU8(os, GENERIC_CMD_SET_BONE_POSROT);
// parameters
os<<serializeString(bone);
writeV3F1000(os, position);
writeV3F1000(os, rotation);
return os.str();
}
std::string gob_cmd_punched(s16 damage, s16 result_hp)
{
std::ostringstream os(std::ios::binary);