1
This commit is contained in:
parent
ca53f58ac6
commit
a52e40665a
@ -10,6 +10,85 @@
|
||||
|
||||
IMPL_TABLE(mt::Hero)
|
||||
|
||||
static bool LoadNormalHeroAnimi(const std::string key,
|
||||
std::shared_ptr<a8::XObject> anim_xobj,
|
||||
mt::HeroShotAnimation& anim)
|
||||
{
|
||||
int id = a8::XValue(key);
|
||||
int t = anim_xobj->At("t") ? anim_xobj->At("t")->AsXValue().GetInt() : 0;
|
||||
|
||||
float r_x = 0;
|
||||
float r_y = 0;
|
||||
float r_z = 0;
|
||||
if (anim_xobj->At("r") && anim_xobj->At("r")->IsObject()) {
|
||||
r_x = anim_xobj->At("r")->At("x")->AsXValue().GetDouble();
|
||||
r_y = anim_xobj->At("r")->At("y")->AsXValue().GetDouble();
|
||||
r_z = anim_xobj->At("r")->At("z")->AsXValue().GetDouble();
|
||||
}
|
||||
|
||||
float l_x = 0;
|
||||
float l_y = 0;
|
||||
float l_z = 0;
|
||||
if (anim_xobj->At("l") && anim_xobj->At("l")->IsObject()) {
|
||||
l_x = anim_xobj->At("l")->At("x")->AsXValue().GetDouble();
|
||||
l_y = anim_xobj->At("l")->At("y")->AsXValue().GetDouble();
|
||||
l_z = anim_xobj->At("l")->At("z")->AsXValue().GetDouble();
|
||||
}
|
||||
|
||||
float p3_x = 0;
|
||||
float p3_y = 0;
|
||||
float p3_z = 0;
|
||||
if (anim_xobj->At("p3") && anim_xobj->At("p3")->IsObject()) {
|
||||
p3_x = anim_xobj->At("p3")->At("x")->AsXValue().GetDouble();
|
||||
p3_y = anim_xobj->At("p3")->At("y")->AsXValue().GetDouble();
|
||||
p3_z = anim_xobj->At("p3")->At("z")->AsXValue().GetDouble();
|
||||
}
|
||||
|
||||
float p4_x = 0;
|
||||
float p4_y = 0;
|
||||
float p4_z = 0;
|
||||
if (anim_xobj->At("p4") && anim_xobj->At("p4")->IsObject()) {
|
||||
|
||||
p4_x = anim_xobj->At("p4")->At("x")->AsXValue().GetDouble();
|
||||
p4_y = anim_xobj->At("p4")->At("y")->AsXValue().GetDouble();
|
||||
p4_z = anim_xobj->At("p4")->At("z")->AsXValue().GetDouble();
|
||||
}
|
||||
|
||||
float p5_x = 0;
|
||||
float p5_y = 0;
|
||||
float p5_z = 0;
|
||||
if (anim_xobj->At("p5") && anim_xobj->At("p5")->IsObject()) {
|
||||
p5_x = anim_xobj->At("p5")->At("x")->AsXValue().GetDouble();
|
||||
p5_y = anim_xobj->At("p5")->At("y")->AsXValue().GetDouble();
|
||||
p5_z = anim_xobj->At("p5")->At("z")->AsXValue().GetDouble();
|
||||
}
|
||||
|
||||
anim.id = id;
|
||||
anim.t = t;
|
||||
|
||||
anim.r_x = r_x;
|
||||
anim.r_y = r_y;
|
||||
anim.r_z = r_z;
|
||||
|
||||
anim.l_x = l_x;
|
||||
anim.l_y = l_y;
|
||||
anim.l_z = l_z;
|
||||
|
||||
anim.p3_x = p3_x;
|
||||
anim.p3_y = p3_y;
|
||||
anim.p3_z = p3_z;
|
||||
|
||||
anim.p4_x = p4_x;
|
||||
anim.p4_y = p4_y;
|
||||
anim.p4_z = p4_z;
|
||||
|
||||
anim.p5_x = p5_x;
|
||||
anim.p5_y = p5_y;
|
||||
anim.p5_z = p5_z;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
namespace mt
|
||||
{
|
||||
|
||||
@ -95,6 +174,23 @@ namespace mt
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
if (!other_key_time().empty()) {
|
||||
std::vector<std::string> strings;
|
||||
a8::Split(other_key_time(), strings, '|');
|
||||
for (auto& str : strings) {
|
||||
std::vector<std::string> strings1;
|
||||
a8::Split(str, strings1, ':');
|
||||
if (strings1.empty()) {
|
||||
abort();
|
||||
}
|
||||
_other_keys.push_back(a8::XValue(strings.at(0)));
|
||||
}
|
||||
if (_other_keys.empty()) {
|
||||
abort();
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
#if 0
|
||||
if (jump_speed() < 0.0001f) {
|
||||
@ -216,83 +312,13 @@ namespace mt
|
||||
|
||||
for (auto& key2 : keys2) {
|
||||
auto anim_xobj = hero_xobj->At(key2);
|
||||
int id = a8::XValue(key2);
|
||||
int t = anim_xobj->At("t") ? anim_xobj->At("t")->AsXValue().GetInt() : 0;
|
||||
|
||||
float r_x = 0;
|
||||
float r_y = 0;
|
||||
float r_z = 0;
|
||||
if (anim_xobj->At("r") && anim_xobj->At("r")->IsObject()) {
|
||||
r_x = anim_xobj->At("r")->At("x")->AsXValue().GetDouble();
|
||||
r_y = anim_xobj->At("r")->At("y")->AsXValue().GetDouble();
|
||||
r_z = anim_xobj->At("r")->At("z")->AsXValue().GetDouble();
|
||||
}
|
||||
|
||||
float l_x = 0;
|
||||
float l_y = 0;
|
||||
float l_z = 0;
|
||||
if (anim_xobj->At("l") && anim_xobj->At("l")->IsObject()) {
|
||||
l_x = anim_xobj->At("l")->At("x")->AsXValue().GetDouble();
|
||||
l_y = anim_xobj->At("l")->At("y")->AsXValue().GetDouble();
|
||||
l_z = anim_xobj->At("l")->At("z")->AsXValue().GetDouble();
|
||||
}
|
||||
|
||||
float p3_x = 0;
|
||||
float p3_y = 0;
|
||||
float p3_z = 0;
|
||||
if (anim_xobj->At("p3") && anim_xobj->At("p3")->IsObject()) {
|
||||
p3_x = anim_xobj->At("p3")->At("x")->AsXValue().GetDouble();
|
||||
p3_y = anim_xobj->At("p3")->At("y")->AsXValue().GetDouble();
|
||||
p3_z = anim_xobj->At("p3")->At("z")->AsXValue().GetDouble();
|
||||
}
|
||||
|
||||
float p4_x = 0;
|
||||
float p4_y = 0;
|
||||
float p4_z = 0;
|
||||
if (anim_xobj->At("p4") && anim_xobj->At("p4")->IsObject()) {
|
||||
|
||||
p4_x = anim_xobj->At("p4")->At("x")->AsXValue().GetDouble();
|
||||
p4_y = anim_xobj->At("p4")->At("y")->AsXValue().GetDouble();
|
||||
p4_z = anim_xobj->At("p4")->At("z")->AsXValue().GetDouble();
|
||||
}
|
||||
|
||||
float p5_x = 0;
|
||||
float p5_y = 0;
|
||||
float p5_z = 0;
|
||||
if (anim_xobj->At("p5") && anim_xobj->At("p5")->IsObject()) {
|
||||
p5_x = anim_xobj->At("p5")->At("x")->AsXValue().GetDouble();
|
||||
p5_y = anim_xobj->At("p5")->At("y")->AsXValue().GetDouble();
|
||||
p5_z = anim_xobj->At("p5")->At("z")->AsXValue().GetDouble();
|
||||
}
|
||||
|
||||
{
|
||||
if (hero_meta) {
|
||||
if (hero_meta) {
|
||||
mt::Hero* mut_hero_meta = (mt::Hero*)hero_meta;
|
||||
{
|
||||
mt::HeroShotAnimation anim;
|
||||
anim.id = id;
|
||||
anim.t = t;
|
||||
|
||||
anim.r_x = r_x;
|
||||
anim.r_y = r_y;
|
||||
anim.r_z = r_z;
|
||||
|
||||
anim.l_x = l_x;
|
||||
anim.l_y = l_y;
|
||||
anim.l_z = l_z;
|
||||
|
||||
anim.p3_x = p3_x;
|
||||
anim.p3_y = p3_y;
|
||||
anim.p3_z = p3_z;
|
||||
|
||||
anim.p4_x = p4_x;
|
||||
anim.p4_y = p4_y;
|
||||
anim.p4_z = p4_z;
|
||||
|
||||
anim.p5_x = p5_x;
|
||||
anim.p5_y = p5_y;
|
||||
anim.p5_z = p5_z;
|
||||
|
||||
((mt::Hero*)hero_meta)->shot_animations[id] = anim;
|
||||
}
|
||||
LoadNormalHeroAnimi(key2, anim_xobj, anim);
|
||||
mut_hero_meta->shot_animations[anim.id] = anim;
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
f8::UdpLog::Instance()->Info
|
||||
|
Loading…
x
Reference in New Issue
Block a user