Overhaul of Auth3d system

This commit is contained in:
korenkonder
2026-05-11 15:02:12 +03:00
parent c5c8983a17
commit e16faa0fad
65 changed files with 15076 additions and 13135 deletions
+17 -17
View File
@@ -11,12 +11,12 @@ namespace Glitter {
const uint8_t step, size_t i, double_t t1, double_t t2, double_t t2_old,
std::vector<Curve::KeyRev>* keys_rev);
Curve::Key::Key() : type(), frame(), value(), tangent1(), tangent2(), random_range() {
Curve::Key::Key() : type(), frame(), value(), l_slope(), r_slope(), random_range() {
}
Curve::Key::Key(KeyType type, int32_t frame,
float_t value, float_t random_range) : tangent1(), tangent2() {
float_t value, float_t random_range) : l_slope(), r_slope() {
this->type = type;
this->frame = frame;
this->value = value;
@@ -24,21 +24,21 @@ namespace Glitter {
}
Curve::Key::Key(KeyType type, int32_t frame, float_t value,
float_t tangent1, float_t tangent2, float_t random_range) {
float_t l_slope, float_t r_slope, float_t random_range) {
this->type = type;
this->frame = frame;
this->value = value;
this->tangent1 = tangent1;
this->tangent2 = tangent2;
this->l_slope = l_slope;
this->r_slope = r_slope;
this->random_range = random_range;
}
Curve::KeyRev::KeyRev() : type(), frame(), value(), tangent1(), tangent2(), random_range() {
Curve::KeyRev::KeyRev() : type(), frame(), value(), l_slope(), r_slope(), random_range() {
}
Curve::KeyRev::KeyRev(KeyType type, int32_t frame,
double_t value, double_t random_range) : tangent1(), tangent2() {
double_t value, double_t random_range) : l_slope(), r_slope() {
this->type = type;
this->frame = frame;
this->value = value;
@@ -46,12 +46,12 @@ namespace Glitter {
}
Curve::KeyRev::KeyRev(KeyType type, int32_t frame, double_t value,
double_t tangent1, double_t tangent2, double_t random_range) {
double_t l_slope, double_t r_slope, double_t random_range) {
this->type = type;
this->frame = frame;
this->value = value;
this->tangent1 = tangent1;
this->tangent2 = tangent2;
this->l_slope = l_slope;
this->r_slope = r_slope;
this->random_range = random_range;
}
@@ -171,7 +171,7 @@ namespace Glitter {
float_t next_val = F2RandomizeKey(GLT_VAL, next, random);
float_t curr_val = F2RandomizeKey(GLT_VAL, curr, random);
return InterpolateHermite(F2RandomizeKey(GLT_VAL, curr, random),
next_val - curr_val, curr.tangent2, next.tangent1,
next_val - curr_val, curr.r_slope, next.l_slope,
(float_t)curr.frame, (float_t)next.frame, frame);
}
@@ -211,8 +211,8 @@ namespace Glitter {
const Curve::Key& src, bool baked_x = false, bool negate = false) {
dst.type = src.type;
dst.frame = src.frame;
dst.tangent1 = src.tangent1;
dst.tangent2 = src.tangent2;
dst.l_slope = src.l_slope;
dst.r_slope = src.r_slope;
if (!baked_x) {
dst.value = src.value;
@@ -497,8 +497,8 @@ namespace Glitter {
const Curve::KeyRev& src, bool baked_x = false, bool negate = false) {
dst.type = src.type;
dst.frame = src.frame;
dst.tangent1 = (float_t)src.tangent1;
dst.tangent2 = (float_t)src.tangent2;
dst.l_slope = (float_t)src.l_slope;
dst.r_slope = (float_t)src.r_slope;
if (!baked_x) {
dst.value = (float_t)src.value;
@@ -598,7 +598,7 @@ namespace Glitter {
}
else if (curr_key->type == KEY_HERMITE) {
val = InterpolateHermite(curr_key->value, next_key->value - curr_key->value,
curr_key->tangent2, next_key->tangent1,
curr_key->r_slope, next_key->l_slope,
(double_t)curr_key->frame, (double_t)next_key->frame, (double_t)frame);
rand_range = InterpolateHermite(curr_key->random_range,
next_key->random_range - curr_key->random_range, 0.0, 0.0,
@@ -716,7 +716,7 @@ namespace Glitter {
float_t next_val = XRandomizeKey(next, random);
float_t curr_val = XRandomizeKey(curr, random);
return InterpolateHermite(XRandomizeKey(curr, random),
next_val - curr_val, curr.tangent2, next.tangent1,
next_val - curr_val, curr.r_slope, next.l_slope,
(float_t)curr.frame, (float_t)next.frame, frame);
}
+26 -29
View File
@@ -25,7 +25,7 @@ namespace Glitter {
mat = mat4_identity;
flags = (EffectInstFlag)0;
random = 0;
req_frame = 0.0f;
frame_req = 0.0f;
ext_color = 0.0f;
ext_anim_scale = 0.0f;
ext_scale = -1.0f;
@@ -100,7 +100,7 @@ namespace Glitter {
return bone_data->get_bone_node_index(BONE_KIND_CMN, bone_names[node]);
}
EffectInstF2::ExtAnim::ExtAnim() : object_index(), mesh_index(), a3da_id(), object_is_hrc(), mesh_name() {
EffectInstF2::ExtAnim::ExtAnim() : object_index(), mesh_index(), scene_handle(), is_hrc(), mesh_name() {
}
@@ -111,8 +111,8 @@ namespace Glitter {
void EffectInstF2::ExtAnim::Reset() {
object_index = -1;
mesh_index = -1;
a3da_id = -1;
object_is_hrc = false;
scene_handle = -1;
is_hrc = false;
mesh_name = 0;
mat = mat4_identity;
translation = 0.0f;
@@ -376,8 +376,6 @@ namespace Glitter {
|| (flags & EFFECT_INST_EXT_ANIM_SET_ONCE && flags & EFFECT_INST_EXT_ANIM_TRANS))
return;
int32_t chara_id;
if (flags & EFFECT_INST_EXT_ANIM_CHARA) {
RobManagement* rob_man = get_rob_management();
if (!rob_man)
@@ -414,25 +412,25 @@ namespace Glitter {
}
else if (flags & EFFECT_INST_EXT_ANIM_AUTH) {
const mat4* obj_mat = 0;
if (ext_anim->a3da_id != -1)
obj_mat = auth_3d_id(ext_anim->a3da_id).get_auth_3d_object_mat(
ext_anim->object_index, ext_anim->object_is_hrc);
if (ext_anim->scene_handle != -1)
obj_mat = auth_3d_detail::get_object_matrix(ext_anim->scene_handle,
ext_anim->object_index, ext_anim->is_hrc);
if (!obj_mat) {
ext_anim->a3da_id = auth_3d_data_get_auth_3d_id(ext_anim->object,
&ext_anim->object_index, &ext_anim->object_is_hrc);
if (ext_anim->a3da_id == -1)
ext_anim->scene_handle = auth_3d_detail::get_scene_object_index(ext_anim->object,
&ext_anim->object_index, &ext_anim->is_hrc);
if (ext_anim->scene_handle == -1)
return;
ext_anim->mesh_index = -1;
obj_mat = auth_3d_id(ext_anim->a3da_id).get_auth_3d_object_mat(
ext_anim->object_index, ext_anim->object_is_hrc);
obj_mat = auth_3d_detail::get_object_matrix(ext_anim->scene_handle,
ext_anim->object_index, ext_anim->is_hrc);
if (!obj_mat)
return;
}
mat4 mat = mat4_identity;
chara_id = auth_3d_id(ext_anim->a3da_id).get_chara_id();
int32_t chara_id = auth_3d_detail::get_assign_rob_id(ext_anim->scene_handle);
if (chara_id >= 0 && chara_id < ROB_ID_MAX) {
RobManagement* rob_man = get_rob_management();
if (rob_man) {
@@ -659,8 +657,8 @@ namespace Glitter {
return ret;
}
EffectInstX::ExtAnim::ExtAnim() : object_index(), mesh_index(), a3da_id(),
object_is_hrc(), file_name_hash(), object_hash(), instance_id(), mesh_name() {
EffectInstX::ExtAnim::ExtAnim() : object_index(), mesh_index(), scene_handle(),
is_hrc(), file_name_hash(), object_hash(), instance_id(), mesh_name() {
}
@@ -671,8 +669,8 @@ namespace Glitter {
void EffectInstX::ExtAnim::Reset() {
object_index = -1;
mesh_index = -1;
a3da_id = -1;
object_is_hrc = false;
scene_handle = -1;
is_hrc = false;
file_name_hash = hash_murmurhash_empty;
object_hash = hash_murmurhash_empty;
instance_id = 0;
@@ -1113,27 +1111,26 @@ namespace Glitter {
}
else if (flags & EFFECT_INST_EXT_ANIM_AUTH) {
const mat4* obj_mat = 0;
if (ext_anim->a3da_id != -1)
obj_mat = auth_3d_id(ext_anim->a3da_id).get_auth_3d_object_mat(
ext_anim->object_index, ext_anim->object_is_hrc);
if (ext_anim->scene_handle != -1)
obj_mat = auth_3d_detail::get_object_matrix(ext_anim->scene_handle,
ext_anim->object_index, ext_anim->is_hrc);
if (!obj_mat) {
ext_anim->a3da_id = auth_3d_data_get_auth_3d_id(
ext_anim->scene_handle = auth_3d_detail::get_scene_object_index(
ext_anim->file_name_hash, ext_anim->object_hash,
&ext_anim->object_index, &ext_anim->object_is_hrc, ext_anim->instance_id);
if (ext_anim->a3da_id == -1)
&ext_anim->object_index, &ext_anim->is_hrc, ext_anim->instance_id);
if (ext_anim->scene_handle == -1)
return;
ext_anim->mesh_index = -1;
obj_mat = auth_3d_id(ext_anim->a3da_id).get_auth_3d_object_mat(
ext_anim->object_index, ext_anim->object_is_hrc);
obj_mat = auth_3d_detail::get_object_matrix(ext_anim->scene_handle,
ext_anim->object_index, ext_anim->is_hrc);
if (!obj_mat)
return;
}
mat4 mat = mat4_identity;
int32_t chara_id = auth_3d_id(ext_anim->a3da_id).get_chara_id();
int32_t chara_id = auth_3d_detail::get_assign_rob_id(ext_anim->scene_handle);
if (chara_id >= 0 && chara_id < ROB_ID_MAX) {
RobManagement* rob_man = get_rob_management();
if (rob_man) {
+34 -34
View File
@@ -627,8 +627,8 @@ namespace Glitter {
key.type = KEY_CONSTANT;
key.frame = 0;
key.value = 0.0f;
key.tangent1 = 0.0f;
key.tangent2 = 0.0f;
key.l_slope = 0.0f;
key.r_slope = 0.0f;
key.random_range = 0.0f;
std::vector<Curve::Key>& keys = c->keys;
@@ -641,8 +641,8 @@ namespace Glitter {
key.type = (KeyType)load_reverse_endianness_int16_t((void*)d);
key.frame = load_reverse_endianness_int16_t((void*)(d + 2));
if (key.type == KEY_HERMITE) {
key.tangent1 = load_reverse_endianness_float_t((void*)(d + 4));
key.tangent2 = load_reverse_endianness_float_t((void*)(d + 8));
key.l_slope = load_reverse_endianness_float_t((void*)(d + 4));
key.r_slope = load_reverse_endianness_float_t((void*)(d + 8));
key.min_value = load_reverse_endianness_float_t((void*)(d + 12));
key.max_value = load_reverse_endianness_float_t((void*)(d + 16));
keys.push_back(key);
@@ -660,8 +660,8 @@ namespace Glitter {
key.type = (KeyType)load_reverse_endianness_int16_t((void*)d);
key.frame = load_reverse_endianness_int16_t((void*)(d + 2));
if (key.type == KEY_HERMITE) {
key.tangent1 = load_reverse_endianness_float_t((void*)(d + 4));
key.tangent2 = load_reverse_endianness_float_t((void*)(d + 8));
key.l_slope = load_reverse_endianness_float_t((void*)(d + 4));
key.r_slope = load_reverse_endianness_float_t((void*)(d + 8));
key.value = load_reverse_endianness_float_t((void*)(d + 12));
keys.push_back(key);
d += 16;
@@ -678,8 +678,8 @@ namespace Glitter {
key.type = (KeyType) * (int16_t*)d;
key.frame = *(int16_t*)(d + 2);
if (key.type == KEY_HERMITE) {
key.tangent1 = *(float_t*)(d + 4);
key.tangent2 = *(float_t*)(d + 8);
key.l_slope = *(float_t*)(d + 4);
key.r_slope = *(float_t*)(d + 8);
key.min_value = *(float_t*)(d + 12);
key.max_value = *(float_t*)(d + 16);
keys.push_back(key);
@@ -697,8 +697,8 @@ namespace Glitter {
key.type = (KeyType) * (int16_t*)d;
key.frame = *(int16_t*)(d + 2);
if (key.type == KEY_HERMITE) {
key.tangent1 = *(float_t*)(d + 4);
key.tangent2 = *(float_t*)(d + 8);
key.l_slope = *(float_t*)(d + 4);
key.r_slope = *(float_t*)(d + 8);
key.value = *(float_t*)(d + 12);
keys.push_back(key);
d += 16;
@@ -717,8 +717,8 @@ namespace Glitter {
key.type = (KeyType)load_reverse_endianness_int16_t((void*)d);
key.frame = load_reverse_endianness_int16_t((void*)(d + 2));
if (key.type == KEY_HERMITE) {
key.tangent1 = load_reverse_endianness_float_t((void*)(d + 16));
key.tangent2 = load_reverse_endianness_float_t((void*)(d + 20));
key.l_slope = load_reverse_endianness_float_t((void*)(d + 16));
key.r_slope = load_reverse_endianness_float_t((void*)(d + 20));
key.min_value = load_reverse_endianness_float_t((void*)(d + 24));
key.max_value = load_reverse_endianness_float_t((void*)(d + 28));
keys.push_back(key);
@@ -736,8 +736,8 @@ namespace Glitter {
key.type = (KeyType)load_reverse_endianness_int16_t((void*)d);
key.frame = load_reverse_endianness_int16_t((void*)(d + 2));
if (key.type == KEY_HERMITE) {
key.tangent1 = load_reverse_endianness_float_t((void*)(d + 4));
key.tangent2 = load_reverse_endianness_float_t((void*)(d + 8));
key.l_slope = load_reverse_endianness_float_t((void*)(d + 4));
key.r_slope = load_reverse_endianness_float_t((void*)(d + 8));
key.value = load_reverse_endianness_float_t((void*)(d + 12));
keys.push_back(key);
d += 16;
@@ -754,8 +754,8 @@ namespace Glitter {
key.type = (KeyType) * (int16_t*)d;
key.frame = *(int16_t*)(d + 2);
if (key.type == KEY_HERMITE) {
key.tangent1 = *(float_t*)(d + 16);
key.tangent2 = *(float_t*)(d + 20);
key.l_slope = *(float_t*)(d + 16);
key.r_slope = *(float_t*)(d + 20);
key.min_value = *(float_t*)(d + 24);
key.max_value = *(float_t*)(d + 28);
keys.push_back(key);
@@ -773,8 +773,8 @@ namespace Glitter {
key.type = (KeyType) * (int16_t*)d;
key.frame = *(int16_t*)(d + 2);
if (key.type == KEY_HERMITE) {
key.tangent1 = *(float_t*)(d + 4);
key.tangent2 = *(float_t*)(d + 8);
key.l_slope = *(float_t*)(d + 4);
key.r_slope = *(float_t*)(d + 8);
key.value = *(float_t*)(d + 12);
keys.push_back(key);
d += 16;
@@ -811,8 +811,8 @@ namespace Glitter {
key.type = (KeyType)load_reverse_endianness_int16_t((void*)d);
key.frame = load_reverse_endianness_int16_t((void*)(d + 2));
if (key.type == KEY_HERMITE) {
key.tangent1 = load_reverse_endianness_float_t((void*)(d + 4));
key.tangent2 = load_reverse_endianness_float_t((void*)(d + 8));
key.l_slope = load_reverse_endianness_float_t((void*)(d + 4));
key.r_slope = load_reverse_endianness_float_t((void*)(d + 8));
key.random_range = load_reverse_endianness_float_t((void*)(d + 12));
key.value = load_reverse_endianness_float_t((void*)(d + 16));
keys.push_back(key);
@@ -830,8 +830,8 @@ namespace Glitter {
key.type = (KeyType)load_reverse_endianness_int16_t((void*)d);
key.frame = load_reverse_endianness_int16_t((void*)(d + 2));
if (key.type == KEY_HERMITE) {
key.tangent1 = load_reverse_endianness_float_t((void*)(d + 4));
key.tangent2 = load_reverse_endianness_float_t((void*)(d + 8));
key.l_slope = load_reverse_endianness_float_t((void*)(d + 4));
key.r_slope = load_reverse_endianness_float_t((void*)(d + 8));
key.value = load_reverse_endianness_float_t((void*)(d + 12));
keys.push_back(key);
d += 16;
@@ -848,8 +848,8 @@ namespace Glitter {
key.type = (KeyType)load_reverse_endianness_int16_t((void*)d);
key.frame = load_reverse_endianness_int16_t((void*)(d + 2));
if (key.type == KEY_HERMITE) {
key.tangent1 = load_reverse_endianness_float_t((void*)(d + 4)) * scale;
key.tangent2 = load_reverse_endianness_float_t((void*)(d + 8)) * scale;
key.l_slope = load_reverse_endianness_float_t((void*)(d + 4)) * scale;
key.r_slope = load_reverse_endianness_float_t((void*)(d + 8)) * scale;
key.random_range = load_reverse_endianness_float_t((void*)(d + 12)) * scale;
key.value = load_reverse_endianness_float_t((void*)(d + 16)) * scale;
keys.push_back(key);
@@ -867,8 +867,8 @@ namespace Glitter {
key.type = (KeyType)load_reverse_endianness_int16_t((void*)d);
key.frame = load_reverse_endianness_int16_t((void*)(d + 2));
if (key.type == KEY_HERMITE) {
key.tangent1 = load_reverse_endianness_float_t((void*)(d + 4)) * scale;
key.tangent2 = load_reverse_endianness_float_t((void*)(d + 8)) * scale;
key.l_slope = load_reverse_endianness_float_t((void*)(d + 4)) * scale;
key.r_slope = load_reverse_endianness_float_t((void*)(d + 8)) * scale;
key.value = load_reverse_endianness_float_t((void*)(d + 12)) * scale;
keys.push_back(key);
d += 16;
@@ -886,8 +886,8 @@ namespace Glitter {
key.type = (KeyType) * (int16_t*)d;
key.frame = *(int16_t*)(d + 2);
if (key.type == KEY_HERMITE) {
key.tangent1 = *(float_t*)(d + 4);
key.tangent2 = *(float_t*)(d + 8);
key.l_slope = *(float_t*)(d + 4);
key.r_slope = *(float_t*)(d + 8);
key.random_range = *(float_t*)(d + 12);
key.value = *(float_t*)(d + 16);
keys.push_back(key);
@@ -905,8 +905,8 @@ namespace Glitter {
key.type = (KeyType) * (int16_t*)d;
key.frame = *(int16_t*)(d + 2);
if (key.type == KEY_HERMITE) {
key.tangent1 = *(float_t*)(d + 4);
key.tangent2 = *(float_t*)(d + 8);
key.l_slope = *(float_t*)(d + 4);
key.r_slope = *(float_t*)(d + 8);
key.value = *(float_t*)(d + 12);
keys.push_back(key);
d += 16;
@@ -923,8 +923,8 @@ namespace Glitter {
key.type = (KeyType) * (int16_t*)d;
key.frame = *(int16_t*)(d + 2);
if (key.type == KEY_HERMITE) {
key.tangent1 = *(float_t*)(d + 4) * scale;
key.tangent2 = *(float_t*)(d + 8) * scale;
key.l_slope = *(float_t*)(d + 4) * scale;
key.r_slope = *(float_t*)(d + 8) * scale;
key.random_range = *(float_t*)(d + 12) * scale;
key.value = *(float_t*)(d + 16) * scale;
keys.push_back(key);
@@ -942,8 +942,8 @@ namespace Glitter {
key.type = (KeyType) * (int16_t*)d;
key.frame = *(int16_t*)(d + 2);
if (key.type == KEY_HERMITE) {
key.tangent1 = *(float_t*)(d + 4) * scale;
key.tangent2 = *(float_t*)(d + 8) * scale;
key.l_slope = *(float_t*)(d + 4) * scale;
key.r_slope = *(float_t*)(d + 8) * scale;
key.value = *(float_t*)(d + 12) * scale;
keys.push_back(key);
d += 16;
+32 -32
View File
@@ -159,8 +159,8 @@ namespace Glitter {
store_reverse_endianness_int16_t((void*)d, (int16_t)i.type);
store_reverse_endianness_int16_t((void*)(d + 2), (int16_t)i.frame);
if (i.type == KEY_HERMITE) {
store_reverse_endianness_float_t((void*)(d + 4), i.tangent1);
store_reverse_endianness_float_t((void*)(d + 8), i.tangent2);
store_reverse_endianness_float_t((void*)(d + 4), i.l_slope);
store_reverse_endianness_float_t((void*)(d + 8), i.r_slope);
store_reverse_endianness_float_t((void*)(d + 12), i.min_value);
store_reverse_endianness_float_t((void*)(d + 16), i.max_value);
d += 20;
@@ -176,8 +176,8 @@ namespace Glitter {
store_reverse_endianness_int16_t((void*)d, (int16_t)i.type);
store_reverse_endianness_int16_t((void*)(d + 2), (int16_t)i.frame);
if (i.type == KEY_HERMITE) {
store_reverse_endianness_float_t((void*)(d + 4), i.tangent1);
store_reverse_endianness_float_t((void*)(d + 8), i.tangent2);
store_reverse_endianness_float_t((void*)(d + 4), i.l_slope);
store_reverse_endianness_float_t((void*)(d + 8), i.r_slope);
store_reverse_endianness_float_t((void*)(d + 12), i.value);
d += 16;
}
@@ -192,8 +192,8 @@ namespace Glitter {
*(int16_t*)d = (int16_t)i.type;
*(int16_t*)(d + 2) = (int16_t)i.frame;
if (i.type == KEY_HERMITE) {
*(float_t*)(d + 4) = i.tangent1;
*(float_t*)(d + 8) = i.tangent2;
*(float_t*)(d + 4) = i.l_slope;
*(float_t*)(d + 8) = i.r_slope;
*(float_t*)(d + 12) = i.min_value;
*(float_t*)(d + 16) = i.max_value;
d += 20;
@@ -209,8 +209,8 @@ namespace Glitter {
*(int16_t*)d = (int16_t)i.type;
*(int16_t*)(d + 2) = (int16_t)i.frame;
if (i.type == KEY_HERMITE) {
*(float_t*)(d + 4) = i.tangent1;
*(float_t*)(d + 8) = i.tangent2;
*(float_t*)(d + 4) = i.l_slope;
*(float_t*)(d + 8) = i.r_slope;
*(float_t*)(d + 12) = i.value;
d += 16;
}
@@ -227,8 +227,8 @@ namespace Glitter {
store_reverse_endianness_int16_t((void*)d, (int16_t)i.type);
store_reverse_endianness_int16_t((void*)(d + 2), (int16_t)i.frame);
if (i.type == KEY_HERMITE) {
store_reverse_endianness_float_t((void*)(d + 16), i.tangent1);
store_reverse_endianness_float_t((void*)(d + 20), i.tangent2);
store_reverse_endianness_float_t((void*)(d + 16), i.l_slope);
store_reverse_endianness_float_t((void*)(d + 20), i.r_slope);
store_reverse_endianness_float_t((void*)(d + 24), i.min_value);
store_reverse_endianness_float_t((void*)(d + 28), i.max_value);
d += 32;
@@ -244,8 +244,8 @@ namespace Glitter {
store_reverse_endianness_int16_t((void*)d, (int16_t)i.type);
store_reverse_endianness_int16_t((void*)(d + 2), (int16_t)i.frame);
if (i.type == KEY_HERMITE) {
store_reverse_endianness_float_t((void*)(d + 4), i.tangent1);
store_reverse_endianness_float_t((void*)(d + 8), i.tangent2);
store_reverse_endianness_float_t((void*)(d + 4), i.l_slope);
store_reverse_endianness_float_t((void*)(d + 8), i.r_slope);
store_reverse_endianness_float_t((void*)(d + 12), i.value);
d += 16;
}
@@ -260,8 +260,8 @@ namespace Glitter {
*(int16_t*)d = (int16_t)i.type;
*(int16_t*)(d + 2) = (int16_t)i.frame;
if (i.type == KEY_HERMITE) {
*(float_t*)(d + 16) = i.tangent1;
*(float_t*)(d + 20) = i.tangent2;
*(float_t*)(d + 16) = i.l_slope;
*(float_t*)(d + 20) = i.r_slope;
*(float_t*)(d + 24) = i.min_value;
*(float_t*)(d + 28) = i.max_value;
d += 32;
@@ -277,8 +277,8 @@ namespace Glitter {
*(int16_t*)d = (int16_t)i.type;
*(int16_t*)(d + 2) = (int16_t)i.frame;
if (i.type == KEY_HERMITE) {
*(float_t*)(d + 4) = i.tangent1;
*(float_t*)(d + 8) = i.tangent2;
*(float_t*)(d + 4) = i.l_slope;
*(float_t*)(d + 8) = i.r_slope;
*(float_t*)(d + 12) = i.value;
d += 16;
}
@@ -313,8 +313,8 @@ namespace Glitter {
store_reverse_endianness_int16_t((void*)d, (int16_t)i.type);
store_reverse_endianness_int16_t((void*)(d + 2), (int16_t)i.frame);
if (i.type == KEY_HERMITE) {
store_reverse_endianness_float_t((void*)(d + 4), i.tangent1);
store_reverse_endianness_float_t((void*)(d + 8), i.tangent2);
store_reverse_endianness_float_t((void*)(d + 4), i.l_slope);
store_reverse_endianness_float_t((void*)(d + 8), i.r_slope);
store_reverse_endianness_float_t((void*)(d + 12), i.random_range);
store_reverse_endianness_float_t((void*)(d + 16), i.value);
d += 20;
@@ -330,8 +330,8 @@ namespace Glitter {
store_reverse_endianness_int16_t((void*)d, (int16_t)i.type);
store_reverse_endianness_int16_t((void*)(d + 2), (int16_t)i.frame);
if (i.type == KEY_HERMITE) {
store_reverse_endianness_float_t((void*)(d + 4), i.tangent1);
store_reverse_endianness_float_t((void*)(d + 8), i.tangent2);
store_reverse_endianness_float_t((void*)(d + 4), i.l_slope);
store_reverse_endianness_float_t((void*)(d + 8), i.r_slope);
store_reverse_endianness_float_t((void*)(d + 12), i.value);
d += 16;
}
@@ -346,8 +346,8 @@ namespace Glitter {
*(int16_t*)d = (int16_t)i.type;
*(int16_t*)(d + 2) = (int16_t)i.frame;
if (i.type == KEY_HERMITE) {
*(float_t*)(d + 4) = i.tangent1;
*(float_t*)(d + 8) = i.tangent2;
*(float_t*)(d + 4) = i.l_slope;
*(float_t*)(d + 8) = i.r_slope;
*(float_t*)(d + 12) = i.random_range;
*(float_t*)(d + 16) = i.value;
d += 20;
@@ -363,8 +363,8 @@ namespace Glitter {
*(int16_t*)d = (int16_t)i.type;
*(int16_t*)(d + 2) = (int16_t)i.frame;
if (i.type == KEY_HERMITE) {
*(float_t*)(d + 4) = i.tangent1;
*(float_t*)(d + 8) = i.tangent2;
*(float_t*)(d + 4) = i.l_slope;
*(float_t*)(d + 8) = i.r_slope;
*(float_t*)(d + 12) = i.value;
d += 16;
}
@@ -381,8 +381,8 @@ namespace Glitter {
store_reverse_endianness_int16_t((void*)d, (int16_t)i.type);
store_reverse_endianness_int16_t((void*)(d + 2), (int16_t)i.frame);
if (i.type == KEY_HERMITE) {
store_reverse_endianness_float_t((void*)(d + 4), i.tangent1 * scale);
store_reverse_endianness_float_t((void*)(d + 8), i.tangent2 * scale);
store_reverse_endianness_float_t((void*)(d + 4), i.l_slope * scale);
store_reverse_endianness_float_t((void*)(d + 8), i.r_slope * scale);
store_reverse_endianness_float_t((void*)(d + 12), i.random_range * scale);
store_reverse_endianness_float_t((void*)(d + 16), i.value * scale);
d += 20;
@@ -398,8 +398,8 @@ namespace Glitter {
store_reverse_endianness_int16_t((void*)d, (int16_t)i.type);
store_reverse_endianness_int16_t((void*)(d + 2), (int16_t)i.frame);
if (i.type == KEY_HERMITE) {
store_reverse_endianness_float_t((void*)(d + 4), i.tangent1 * scale);
store_reverse_endianness_float_t((void*)(d + 8), i.tangent2 * scale);
store_reverse_endianness_float_t((void*)(d + 4), i.l_slope * scale);
store_reverse_endianness_float_t((void*)(d + 8), i.r_slope * scale);
store_reverse_endianness_float_t((void*)(d + 12), i.value * scale);
d += 16;
}
@@ -414,8 +414,8 @@ namespace Glitter {
*(int16_t*)d = (int16_t)i.type;
*(int16_t*)(d + 2) = (int16_t)i.frame;
if (i.type == KEY_HERMITE) {
*(float_t*)(d + 4) = i.tangent1 * scale;
*(float_t*)(d + 8) = i.tangent2 * scale;
*(float_t*)(d + 4) = i.l_slope * scale;
*(float_t*)(d + 8) = i.r_slope * scale;
*(float_t*)(d + 12) = i.random_range * scale;
*(float_t*)(d + 16) = i.value * scale;
d += 20;
@@ -431,8 +431,8 @@ namespace Glitter {
*(int16_t*)d = (int16_t)i.type;
*(int16_t*)(d + 2) = (int16_t)i.frame;
if (i.type == KEY_HERMITE) {
*(float_t*)(d + 4) = i.tangent1 * scale;
*(float_t*)(d + 8) = i.tangent2 * scale;
*(float_t*)(d + 4) = i.l_slope * scale;
*(float_t*)(d + 8) = i.r_slope * scale;
*(float_t*)(d + 12) = i.value * scale;
d += 16;
}
+13 -13
View File
@@ -515,8 +515,8 @@ namespace Glitter {
float_t value;
float_t max_value;
};
float_t tangent1;
float_t tangent2;
float_t l_slope;
float_t r_slope;
union {
float_t random_range;
float_t min_value;
@@ -525,21 +525,21 @@ namespace Glitter {
Key();
Key(KeyType type, int32_t frame, float_t value, float_t random_range);
Key(KeyType type, int32_t frame, float_t value,
float_t tangent1, float_t tangent2, float_t random_range);
float_t l_slope, float_t r_slope, float_t random_range);
};
struct KeyRev {
KeyType type;
int32_t frame;
double_t value;
double_t tangent1;
double_t tangent2;
double_t l_slope;
double_t r_slope;
double_t random_range;
KeyRev();
KeyRev(KeyType type, int32_t frame, double_t value, double_t random_range);
KeyRev(KeyType type, int32_t frame, double_t value,
double_t tangent1, double_t tangent2, double_t random_range);
double_t l_slope, double_t r_slope, double_t random_range);
};
CurveType type;
@@ -918,7 +918,7 @@ namespace Glitter {
EffectInstFlag flags;
size_t id;
uint32_t random;
float_t req_frame;
float_t frame_req;
vec4 ext_color;
float_t ext_scale;
vec3 ext_anim_scale;
@@ -953,8 +953,8 @@ namespace Glitter {
struct {
int32_t object_index;
int32_t mesh_index;
int32_t a3da_id;
bool object_is_hrc;
int32_t scene_handle;
bool is_hrc;
object_info object;
const char* mesh_name;
};
@@ -1015,8 +1015,8 @@ namespace Glitter {
struct {
int32_t object_index;
int32_t mesh_index;
int32_t a3da_id;
bool object_is_hrc;
int32_t scene_handle;
bool is_hrc;
uint32_t file_name_hash;
uint32_t object_hash;
int32_t instance_id;
@@ -1662,7 +1662,7 @@ namespace Glitter {
bool SetExtColorByID(float_t r, float_t g, float_t b, float_t a, bool set, size_t id);
void SetExtScale(float_t scale, size_t id);
void SetFrameRate(FrameRateControl* frame_rate);
void SetReqFrame(size_t id, float_t req_frame);
void SetFrameReq(size_t id, float_t frame_req);
};
class GltParticleManager : public app::Task {
@@ -1739,7 +1739,7 @@ namespace Glitter {
void SetSceneEffectExtColor(SceneCounter scene_counter,
float_t r, float_t g, float_t b, float_t a, bool set, uint64_t effect_hash);
void SetSceneEffectExtScale(SceneCounter scene_counter, float_t scale);
void SetSceneEffectReqFrame(SceneCounter scene_counter, float_t req_frame);
void SetSceneEffectFrameReq(SceneCounter scene_counter, float_t frame_req);
void SetSceneFrameRate(SceneCounter scene_counter, FrameRateControl* frame_rate);
void SetSceneName(uint64_t hash, const char* name);
void SetPause(bool value);
+2 -2
View File
@@ -920,10 +920,10 @@ namespace Glitter {
}
}
void GltParticleManager::SetSceneEffectReqFrame(SceneCounter scene_counter, float_t req_frame) {
void GltParticleManager::SetSceneEffectFrameReq(SceneCounter scene_counter, float_t frame_req) {
for (Scene*& i : scenes)
if (i && i->counter.counter == scene_counter.counter) {
i->SetReqFrame(scene_counter.index, req_frame);
i->SetFrameReq(scene_counter.index, frame_req);
break;
}
}
+6 -6
View File
@@ -138,10 +138,10 @@ namespace Glitter {
if (!just_init)
_delta_frame = delta_frame;
float_t req_frame = eff->req_frame;
eff->req_frame = 0.0f;
float_t frame_req = eff->frame_req;
eff->frame_req = 0.0f;
float_t remain_frame = req_frame - _delta_frame;
float_t remain_frame = frame_req - _delta_frame;
while (true) {
if (step || _delta_frame > 0.0f) {
eff->CtrlFlags(_delta_frame);
@@ -437,16 +437,16 @@ namespace Glitter {
this->frame_rate = frame_rate;
}
void Scene::SetReqFrame(size_t id, float_t req_frame) {
void Scene::SetFrameReq(size_t id, float_t frame_req) {
if (!id) {
for (SceneEffect& i : effects)
if (i.disp && i.ptr)
i.ptr->req_frame = req_frame;
i.ptr->frame_req = frame_req;
}
else
for (SceneEffect& i : effects)
if (i.disp && i.ptr && i.ptr->id == id) {
i.ptr->req_frame = req_frame;
i.ptr->frame_req = frame_req;
break;
}
}
+160 -10
View File
@@ -6,6 +6,7 @@
#include <map>
#include <vector>
#include "auth_2d.hpp"
#include "../KKdLib/prj/algorithm.hpp"
#include "../KKdLib/farc.hpp"
#include "../KKdLib/str_utils.hpp"
#include "data.hpp"
@@ -218,6 +219,164 @@ AetArgs& AetArgs::operator=(const AetArgs& other) {
return *this;
}
namespace aet {
// 0x14019CB90
void IdHandle::M_put() {
data_struct* aft_data = &data_list[DATA_AFT];
aet_database* aft_aet_db = &aft_data->data_ft.aet_db;
if (M_args.id.id < 0)
M_handle = -1;
else {
M_handle = aet_manager_init_aet_object(M_args, aft_aet_db);
if (M_handle != -1)
aet_manager_set_obj_play(M_handle, 1);
}
}
// 0x14019D540
void IdHandle::remove() {
if (M_handle != -1)
aet_manager_free_aet_object(M_handle);
M_handle = -1;
}
IdHandle::IdHandle(const IdHandle& other) : M_args(other.M_args), M_handle(other.M_handle) {
}
IdHandle::IdHandle() : M_handle(-1) {
}
IdHandle::~IdHandle() {
}
// 0x14019CC80
IdHandle& IdHandle::assign(const AetArgs& in_args) {
remove();
M_args = in_args;
return *this;
}
// Missing
void IdHandle::restart() {
if (isValid() && getReady()) {
remove();
M_put();
}
}
// 0x1401E5F10
void IdHandle::put() {
remove();
M_put();
}
// Inlined
void IdHandle::put_valid() {
if (isValid()) {
remove();
M_put();
}
}
// Inlined
void IdHandle::destroy() {
remove();
M_args = {};
}
// Missing
void IdHandle::setDisplay(bool flag) {
if (isValid())
aet_manager_set_obj_visible(M_handle, flag);
}
// Missing
void IdHandle::setPlay(bool flag) {
if (isValid())
aet_manager_set_obj_play(M_handle, flag);
}
// 0x1401D4F10
bool IdHandle::getReady() {
data_struct* aft_data = &data_list[DATA_AFT];
aet_database* aft_aet_db = &aft_data->data_ft.aet_db;
return aet_manager_get_set_ready(M_args.id.id, aft_aet_db);
}
// 0x14019CD00
void SetHandle::destroy() {
free();
M_set = -1;
M_spr_set = S_INVALID_SPR_SET;
}
SetHandle::SetHandle() : M_set(-1), M_spr_set(S_INVALID_SPR_SET), M_is_requested(false) {
}
SetHandle::~SetHandle() {
}
// 0x14019CCB0
SetHandle& SetHandle::assign(int32_t uid) {
destroy();
data_struct* aft_data = &data_list[DATA_AFT];
aet_database* aft_aet_db = &aft_data->data_ft.aet_db;
M_spr_set = S_INVALID_SPR_SET;
M_set = uid;
M_spr_set = aft_aet_db->get_aet_set_by_id(M_set)->sprite_set_id;
return *this;
}
// 0x14019D5C0
void SetHandle::request() {
if (!isValid())
return;
data_struct* aft_data = &data_list[DATA_AFT];
aet_database* aft_aet_db = &aft_data->data_ft.aet_db;
SprDb* aft_spr_db = &aft_data->data_ft.spr_db;
spr::request(M_spr_set, "", aft_data, aft_spr_db);
aet_manager_read_file(M_set, "", aft_data, aft_aet_db);
M_is_requested = true;
}
// 0x14019D920
bool SetHandle::wait() {
if (!isValid() || !M_is_requested)
return false;
data_struct* aft_data = &data_list[DATA_AFT];
aet_database* aft_aet_db = &aft_data->data_ft.aet_db;
SprDb* aft_spr_db = &aft_data->data_ft.spr_db;
return spr::wait(M_spr_set, aft_spr_db) || aet_manager_load_file(M_set, aft_aet_db);
}
// 0x14019CDA0
void SetHandle::free() {
if (!isValid() || !M_is_requested)
return;
data_struct* aft_data = &data_list[DATA_AFT];
aet_database* aft_aet_db = &aft_data->data_ft.aet_db;
SprDb* aft_spr_db = &aft_data->data_ft.spr_db;
aet_manager_unload_set(M_set, aft_aet_db);
spr::free(M_spr_set, aft_spr_db);
M_is_requested = false;
}
}
aet_layout_data::aet_layout_data() : width(), height() {
mat = mat4_identity;
opacity = 1.0f;
@@ -1579,16 +1738,7 @@ void AetMgr::FreeAetObject(uint32_t id) {
}
void AetMgr::FreeAetObject(std::map<uint32_t, AetObj>::iterator it) {
auto i = free_objects.begin();
auto i_end = free_objects.end();
while (i != i_end) {
if (it == *i) {
free_objects.erase(i);
break;
}
i++;
}
prj::find_and_erase(free_objects, it);
free_objects.push_back(it);
}
+53
View File
@@ -74,6 +74,59 @@ struct AetArgs {
AetArgs& operator=(const AetArgs& other);
};
namespace aet {
class IdHandle {
private:
AetArgs M_args;
int32_t M_handle;
void M_put();
void remove();
public:
IdHandle(const IdHandle& other);
IdHandle();
~IdHandle();
inline bool isValid() {
return M_handle != -1;
}
IdHandle& assign(const AetArgs& in_args);
void restart();
void put();
void put_valid();
void destroy();
void setDisplay(bool flag);
void setPlay(bool flag);
bool getReady();
};
class SetHandle {
private:
int32_t M_set;
int32_t M_spr_set;
bool M_is_requested;
void destroy();
static const uint32_t S_INVALID_SPR_SET = -1;
public:
SetHandle();
~SetHandle();
inline bool isValid() {
return M_set != -1;
}
SetHandle& assign(int32_t uid);
void request();
bool wait();
void free();
};
}
struct aet_layout_data {
mat4 mat;
vec3 position;
+7615 -6836
View File
File diff suppressed because it is too large Load Diff
+1866 -964
View File
File diff suppressed because it is too large Load Diff
+15 -15
View File
@@ -379,30 +379,30 @@ static void camera_calculate_view(camera* c) {
}
}
cam_struct::cam_struct() {
use_up = false;
view_point = { 0.0f, 1.0f, 6.0f };
interest = { 0.0f, 1.0f, 0.0f };
fov = (float_t)(32.2673416137695 * DEG_TO_RAD);
roll = 0.0f;
up = { 0.0f, 1.0f, 0.0f };
min_distance = 0.05f;
}
void cam_struct::get(camera* cam) {
void CameraParam::get(camera* cam) {
cam->get_view_point(view_point);
cam->get_interest(interest);
fov = (float_t)cam->get_fov() * DEG_TO_RAD_FLOAT;
v_fov = (float_t)cam->get_fov() * DEG_TO_RAD_FLOAT;
roll = (float_t)cam->get_roll() * DEG_TO_RAD_FLOAT;
}
void cam_struct::set(camera* cam) {
void CameraParam::init() {
use_up = false;
view_point = { 0.0f, 1.0f, 6.0f };
interest = { 0.0f, 1.0f, 0.0f };
v_fov = (float_t)(32.2673416137695 * DEG_TO_RAD);
roll = 0.0f;
up = { 0.0f, 1.0f, 0.0f };
clip_near = 0.05f;
}
void CameraParam::set(camera* cam) {
cam->set_view_point(view_point);
cam->set_interest(interest);
cam->set_fov(fov * RAD_TO_DEG_FLOAT);
cam->set_fov(v_fov * RAD_TO_DEG_FLOAT);
cam->set_roll(roll * RAD_TO_DEG_FLOAT);
cam->set_up(use_up, up);
cam->set_min_distance(min_distance);
cam->set_min_distance(clip_near);
}
cam_data::cam_data() : view_point(0.0f, 0.0f, 1.0f), interest(), up(0.0f, 1.0f, 0.0f),
+9 -4
View File
@@ -101,17 +101,22 @@ struct camera {
void update_data();
};
struct cam_struct {
struct CameraParam {
bool use_up;
vec3 view_point;
vec3 interest;
float_t fov;
float_t v_fov;
float_t roll;
vec3 up;
float_t min_distance;
float_t clip_near;
inline CameraParam() : use_up(), view_point(),
interest(), v_fov(), roll(), up(), clip_near() {
init();
}
cam_struct();
void get(camera* cam);
void init();
void set(camera* cam);
};
+44 -46
View File
@@ -143,7 +143,7 @@ public:
struct struc_621 {
uint32_t stage_hash; // Added
int32_t stage_index;
std::vector<auth_3d_id> auth_3d_ids;
std::vector<auth_3d_detail::Handle> auth_3d_ids;
struc_621();
~struc_621();
@@ -152,8 +152,8 @@ struct struc_621 {
struct EffectAuth3d {
size_t count;
size_t max_count;
auth_3d_id* auth_3d_ids_ptr;
auth_3d_id auth_3d_ids[TASK_STAGE_STAGE_COUNT];
auth_3d_detail::Handle* auth_3d_ids_ptr;
auth_3d_detail::Handle auth_3d_ids[TASK_STAGE_STAGE_COUNT];
EffectAuth3d();
};
@@ -193,7 +193,7 @@ public:
virtual void reset() override;
void reset_data();
void set_visibility(bool value);
void set_visible(bool value);
};
struct EffectFogAnim {
@@ -1934,8 +1934,6 @@ struc_621::~struc_621() {
EffectAuth3d::EffectAuth3d() : auth_3d_ids() {
count = 0;
max_count = TASK_STAGE_STAGE_COUNT;
for (auth_3d_id& i : auth_3d_ids)
i = -1;
auth_3d_ids_ptr = auth_3d_ids;
}
@@ -1957,15 +1955,15 @@ bool TaskEffectAuth3D::init() {
if (stage.count) {
for (int32_t i = 0; i < stage.count; i++)
if (!stage.auth_3d_ids_ptr[i].check_loaded())
if (!stage.auth_3d_ids_ptr[i].load_is_done())
return false;
}
for (int32_t i = 0; i < stage.count; i++) {
auth_3d_id& id = stage.auth_3d_ids_ptr[i];
id.set_repeat(true);
id.set_paused(false);
id.set_enable(true);
auth_3d_detail::Handle& id = stage.auth_3d_ids_ptr[i];
id.set_looped(true);
id.set_pause(false);
id.set_enabled(true);
}
//if (field_158)
@@ -2031,12 +2029,12 @@ void TaskEffectAuth3D::set_stage_hashes(const std::vector<uint32_t>& stage_hashe
if (stage.count == stage.max_count)
break;
auth_3d_id id = auth_3d_id(j, data, obj_db, tex_db);
if (!id.check_not_empty())
auth_3d_detail::Handle id = auth_3d_detail::Handle::create(j, data, obj_db, tex_db);
if (!id.is_valid())
break;
id.read_file_modern();
id.set_visibility(false);
id.load_req_modern();
id.set_visible(false);
if (stage.count + 1 <= stage.max_count)
stage.auth_3d_ids_ptr[stage.count++] = id;
v30.auth_3d_ids.push_back(id);
@@ -2066,12 +2064,12 @@ void TaskEffectAuth3D::set_stage_indices(const std::vector<int32_t>& stage_indic
if (stage.count == stage.max_count)
break;
auth_3d_id id = auth_3d_id(j, aft_auth_3d_db);
if (!id.check_not_empty())
auth_3d_detail::Handle id = auth_3d_detail::Handle::create(j, aft_auth_3d_db);
if (!id.is_valid())
break;
id.read_file(aft_auth_3d_db);
id.set_visibility(false);
id.load_req(aft_auth_3d_db);
id.set_visible(false);
if (stage.count + 1 <= stage.max_count)
stage.auth_3d_ids_ptr[stage.count++] = id;
v30.auth_3d_ids.push_back(id);
@@ -2084,14 +2082,14 @@ void TaskEffectAuth3D::set_stage_indices(const std::vector<int32_t>& stage_indic
void TaskEffectAuth3D::set_frame(int32_t value) {
double_t frame = (double_t)value;
for (int32_t i = 0; i < stage.count; i++) {
auth_3d_id& id = stage.auth_3d_ids_ptr[i];
float_t play_control_size = id.get_play_control_size();
float_t req_frame;
if (play_control_size != 0.0f)
req_frame = (float_t)fmod(frame, play_control_size);
auth_3d_detail::Handle& id = stage.auth_3d_ids_ptr[i];
float_t frame_size = id.get_frame_size();
float_t frame_req;
if (frame_size != 0.0f)
frame_req = (float_t)fmod(frame, frame_size);
else
req_frame = 0.0f;
id.set_req_frame(req_frame);
frame_req = 0.0f;
id.set_frame_req(frame_req);
}
}
@@ -2099,40 +2097,40 @@ void TaskEffectAuth3D::set_current_stage_hash(uint32_t value) {
if (current_stage_hash == value)
return;
set_visibility(false);
set_visible(false);
current_stage_hash = value;
set_visibility(enable);
set_visible(enable);
}
void TaskEffectAuth3D::set_current_stage_index(int32_t value) {
if (current_stage_index == value)
return;
set_visibility(false);
set_visible(false);
current_stage_index = value;
set_visibility(enable);
set_visible(enable);
}
void TaskEffectAuth3D::set_frame_rate_control(FrameRateControl* value) {
for (int32_t i = 0; i < stage.count; i++) {
auth_3d_id& id = stage.auth_3d_ids_ptr[i];
id.set_frame_rate(value);
auth_3d_detail::Handle& id = stage.auth_3d_ids_ptr[i];
id.set_frame_rate_control(value);
}
}
void TaskEffectAuth3D::reset() {
for (int32_t i = 0; i < stage.count; i++) {
auth_3d_id& id = stage.auth_3d_ids_ptr[i];
id.set_enable(true);
id.set_paused(false);
id.set_req_frame(0.0f);
auth_3d_detail::Handle& id = stage.auth_3d_ids_ptr[i];
id.set_enabled(true);
id.set_pause(false);
id.set_frame_req(0.0f);
}
}
void TaskEffectAuth3D::reset_data() {
for (int32_t i = 0; i < stage.count; i++) {
auth_3d_id& id = stage.auth_3d_ids_ptr[i];
id.unload(rctx_ptr);
auth_3d_detail::Handle& id = stage.auth_3d_ids_ptr[i];
id.destroy(rctx_ptr);
}
stage.count = 0;
enable = false;
@@ -2147,14 +2145,14 @@ void TaskEffectAuth3D::reset_data() {
frame = -1.0f;
}
void TaskEffectAuth3D::set_visibility(bool value) {
void TaskEffectAuth3D::set_visible(bool value) {
if (current_stage_index != -1)
for (struc_621& i : field_120) {
if (i.stage_index != current_stage_index)
continue;
for (auth_3d_id& j : i.auth_3d_ids)
j.set_visibility(value);
for (auth_3d_detail::Handle& j : i.auth_3d_ids)
j.set_visible(value);
break;
}
else if (current_stage_hash != -1 && current_stage_hash
@@ -2163,15 +2161,15 @@ void TaskEffectAuth3D::set_visibility(bool value) {
if (i.stage_hash != current_stage_hash)
continue;
for (auth_3d_id& j : i.auth_3d_ids)
j.set_visibility(value);
for (auth_3d_detail::Handle& j : i.auth_3d_ids)
j.set_visible(value);
break;
}
}
void TaskEffectAuth3D::set_enable(bool value) {
enable = value;
set_visibility(value);
set_visible(value);
}
EffectFogAnim::EffectFogAnim() : field_0(), field_4(), field_8(), field_C(),
@@ -5709,7 +5707,7 @@ void EffectManager::set_stage_hashes(const std::vector<uint32_t>& stage_hashes)
obj_set_ids.push_back(j);
}
prj::sort_unique(obj_set_ids);
prj::sort_and_erase_non_unique(obj_set_ids);
for (uint32_t i : obj_set_ids)
objset_info_storage_load_set_hash(data, i);
@@ -5745,7 +5743,7 @@ void EffectManager::set_stage_indices(const std::vector<int32_t>& stage_indices)
obj_set_ids.push_back(j);
}
prj::sort_unique(obj_set_ids);
prj::sort_and_erase_non_unique(obj_set_ids);
for (uint32_t i : obj_set_ids)
objset_info_storage_load_set(aft_data, aft_obj_db, i);
+19 -12
View File
@@ -45,10 +45,17 @@ material_list_struct::material_list_struct() : blend_color(), has_blend_color(),
hash = (uint32_t)-1;
}
material_list_struct::material_list_struct(uint32_t hash, vec4& blend_color,
vec4u8& has_blend_color, vec4& emission, vec4u8& has_emission) : hash(hash), blend_color(blend_color),
has_blend_color(has_blend_color), emission(emission), has_emission(has_emission) {
material_list_struct::material_list_struct(uint32_t in_hash, const vec4& in_blend_color,
const bool in_has_blend_color[4], const vec4& in_emission, const bool in_has_emission[4])
: hash(in_hash), blend_color(in_blend_color), emission(in_emission) {
has_blend_color[0] = in_has_blend_color[0];
has_blend_color[1] = in_has_blend_color[1];
has_blend_color[2] = in_has_blend_color[2];
has_blend_color[3] = in_has_blend_color[3];
has_emission[0] = in_has_emission[0];
has_emission[1] = in_has_emission[1];
has_emission[2] = in_has_emission[2];
has_emission[3] = in_has_emission[3];
}
TexChange::TexChange() {
@@ -2381,22 +2388,22 @@ namespace mdl {
if (mat_list) {
bool has_blend_color = false;
if (mat_list->has_blend_color.x) {
if (mat_list->has_blend_color[0]) {
_blend_color.x = mat_list->blend_color.x;
has_blend_color = true;
}
if (mat_list->has_blend_color.y) {
if (mat_list->has_blend_color[1]) {
_blend_color.y = mat_list->blend_color.y;
has_blend_color = true;
}
if (mat_list->has_blend_color.z) {
if (mat_list->has_blend_color[2]) {
_blend_color.z = mat_list->blend_color.z;
has_blend_color = true;
}
if (mat_list->has_blend_color.w) {
if (mat_list->has_blend_color[3]) {
_blend_color.w = mat_list->blend_color.w;
has_blend_color = true;
}
@@ -2409,22 +2416,22 @@ namespace mdl {
}
bool has_emission = false;
if (mat_list->has_emission.x) {
if (mat_list->has_emission[0]) {
_emission.x = mat_list->emission.x;
has_emission = true;
}
if (mat_list->has_emission.y) {
if (mat_list->has_emission[1]) {
_emission.y = mat_list->emission.y;
has_emission = true;
}
if (mat_list->has_emission.z) {
if (mat_list->has_emission[2]) {
_emission.z = mat_list->emission.z;
has_emission = true;
}
if (mat_list->has_emission.w) {
if (mat_list->has_emission[3]) {
_emission.w = mat_list->emission.w;
has_emission = true;
}
+4 -4
View File
@@ -31,13 +31,13 @@ struct RobSkinCol {
struct material_list_struct {
uint32_t hash;
vec4 blend_color;
vec4u8 has_blend_color;
bool has_blend_color[4];
vec4 emission;
vec4u8 has_emission;
bool has_emission[4];
material_list_struct();
material_list_struct(uint32_t hash, vec4& blend_color,
vec4u8& has_blend_color, vec4& emission, vec4u8& has_emission);
material_list_struct(uint32_t in_hash, const vec4& in_blend_color,
const bool in_has_blend_color[4], const vec4& in_emission, const bool in_has_emission[4]);
};
struct TexChange {
+2 -8
View File
@@ -4,6 +4,7 @@
*/
#include "ogg_vorbis.hpp"
#include "../KKdLib/prj/algorithm.hpp"
#include "../KKdLib/str_utils.hpp"
#include "../KKdLib/vec.hpp"
#include "data.hpp"
@@ -641,14 +642,7 @@ p_OggFileHandler::~p_OggFileHandler() {
ptr = 0;
}
std::list<p_OggFileHandler*>& list = ogg_file_handler_storage_ptr->list;
for (auto i = list.begin(); i != list.end();)
if (*i == this) {
list.erase(i);
break;
}
else
i++;
prj::find_and_erase(ogg_file_handler_storage_ptr->list, this);
}
int32_t p_OggFileHandler::GetChannelPairsCount() {
+8 -8
View File
@@ -3930,7 +3930,7 @@ void rob_chara::rob_motion_modifier_ctrl() {
rob_chara_bone_data_set_right_hand_scale(bone_data, right_hand_scale);
}
bool rob_chara::replace_rob_motion(uint32_t motnum, float_t frame,
bool rob_chara::replace_rob_motion(uint32_t motnum, float_t frame,
float_t blend_duration, bool blend, bool set_motion_reset_data, MotionBlendType blend_type,
const bone_database* bone_data, const motion_database* mot_db) {
if (!blend && rob_base.robmot.num == motnum)
@@ -5825,7 +5825,7 @@ bool RobManagement::get_colli_check_on() const {
return colli_check_on;
}
// 0x140531F50
// 0x140531F50
bool RobManagement::get_disp_on(ROB_ID id) const {
if (is_init(id))
return rob_impl[id].check_disp();
@@ -6260,7 +6260,7 @@ void OpdChecker::sub_140471020() {
SetIndexSize(++index, (int32_t)osage_play_data_database->map.size());
}
prj::sort_unique(objects);
prj::sort_and_erase_non_unique(objects);
SetState(3);
//if (!v63)
@@ -11149,7 +11149,7 @@ void opd_make_start_get_motion_ids(std::vector<int32_t>& motion_ids) {
opd_motion_ids++;
}*/
motion_ids.push_back(195); // CMN_MRA00_13_01
prj::sort_unique(motion_ids);
prj::sort_and_erase_non_unique(motion_ids);
}
void opd_make_stop() {
@@ -17159,7 +17159,7 @@ void OsagePlayDataManager::LoadOpdFileList() {
data_struct* aft_data = &data_list[DATA_AFT];
motion_database* aft_mot_db = &aft_data->data_ft.mot_db;
prj::sort_unique(req_data);
prj::sort_and_erase_non_unique(req_data);
auto i_begin = req_data.begin();
auto i_end = req_data.end();
@@ -17762,7 +17762,7 @@ void OpdMakeManager::CharaData::Reset() {
void OpdMakeManager::CharaData::SortUnique() {
for (int32_t i = 0; i < CN_MAX; i++)
for (int32_t j = 0; j < ROB_ITEM_EQUIP_SUB_ID_MAX; j++) {
prj::sort_unique(chara_costumes[i].items[j]);
prj::sort_and_erase_non_unique(chara_costumes[i].items[j]);
count += chara_costumes[i].items[j].size();
}
@@ -17832,7 +17832,7 @@ bool OpdMakeManager::ctrl() {
motion_set_ids.push_back(set_id);
}
prj::sort_unique(motion_set_ids);
prj::sort_and_erase_non_unique(motion_set_ids);
for (uint32_t& i : motion_set_ids) {
motion_set_load_motion(i, "", aft_mot_db);
@@ -18969,7 +18969,7 @@ void PvOsageManager::SetPvSetMotion(const std::vector<pv_data_set_motion>& set_m
}
void PvOsageManager::sub_1404F77E0() {
prj::sort_unique(pv_set_motion);
prj::sort_and_erase_non_unique(pv_set_motion);
pv_data_set_motion* i_begin = pv_set_motion.data();
pv_data_set_motion* i_end = pv_set_motion.data() + pv_set_motion.size();
+1 -1
View File
@@ -581,7 +581,7 @@ key_val* skin_param_storage_get_key_val(object_info obj_uid) {
void skin_param_storage_load(std::vector<object_info>& obj_infos,
void* data, const object_database* obj_db) {
prj::sort_unique(obj_infos);
prj::sort_and_erase_non_unique(obj_infos);
for (const object_info& i : obj_infos) {
if (i.is_null())
continue;
+3 -3
View File
@@ -36,7 +36,7 @@ public:
SPRSET(uint32_t in_id);
virtual ~SPRSET();
void request(const char* fname, const std::string mdata_dir, void* data);
void requestModern(uint32_t sethash, void* data); // Added
bool wait();
@@ -126,7 +126,7 @@ namespace spr {
void Clear();
void Update();
};
struct SprArgsDraw {
int32_t num_texture;
int32_t blend;
@@ -1483,7 +1483,7 @@ namespace spr {
SprMgr::sprmgr().request(spr_db->getSetIdFromUid(setid),
spr_db->getSetFileFromUid(setid), mdata_dir, data);
}
// Added
void requestModern(const std::vector<uint32_t>& sethashes, void* data, SprDb* spr_db) {
for (uint32_t sethash : sethashes)
+6 -6
View File
@@ -663,8 +663,8 @@ static void stage_free(stage* s) {
light_chara_ambient = false;
if (s->auth_3d_loaded) {
auth_3d_data_unload_category(s->stage_data->auth_3d_name.c_str());
auth_3d_data_unload_category(s->stage_data->name.c_str());
auth_3d_detail::category_free(s->stage_data->auth_3d_name.c_str());
auth_3d_detail::category_free(s->stage_data->name.c_str());
s->auth_3d_loaded = false;
}
@@ -694,15 +694,15 @@ static void stage_load(stage* s) {
object_database* aft_obj_db = &aft_data->data_ft.obj_db;
objset_info_storage_load_set(aft_data, aft_obj_db, s->stage_data->object_set_id);
auth_3d_data_load_category(s->stage_data->name.c_str());
auth_3d_data_load_category(s->stage_data->auth_3d_name.c_str());
auth_3d_detail::category_load_req(s->stage_data->name.c_str());
auth_3d_detail::category_load_req(s->stage_data->auth_3d_name.c_str());
s->auth_3d_loaded = true;
s->state = 4;
}
else if (s->state == 4) {
if (objset_info_storage_load_obj_set_check_not_read(s->stage_data->object_set_id)
|| !auth_3d_data_check_category_loaded(s->stage_data->name.c_str())
|| !auth_3d_data_check_category_loaded(s->stage_data->auth_3d_name.c_str()))
|| !auth_3d_detail::category_load_is_done(s->stage_data->name.c_str())
|| !auth_3d_detail::category_load_is_done(s->stage_data->auth_3d_name.c_str()))
return;
if (s->stage_data->render_texture != -1)
+3 -3
View File
@@ -581,7 +581,7 @@ static void stage_modern_free(stage_modern* s) {
light_chara_ambient = false;
if (s->auth_3d_loaded) {
auth_3d_data_unload_category(s->stage_data->auth_3d_name_hash);
auth_3d_detail::category_free(s->stage_data->auth_3d_name_hash);
s->auth_3d_loaded = false;
}
@@ -608,14 +608,14 @@ static void stage_modern_load(stage_modern* s, void* data, object_database* obj_
else if (s->state == 3) {
objset_info_storage_load_set_hash(data, s->stage_data->hash);
auth_3d_data_load_category(data, s->stage_data->auth_3d_name.c_str(),
auth_3d_detail::category_load_req(data, s->stage_data->auth_3d_name.c_str(),
s->stage_data->auth_3d_name_hash);
s->auth_3d_loaded = true;
s->state = 4;
}
else if (s->state == 4) {
if (objset_info_storage_load_obj_set_check_not_read(s->stage_data->hash, obj_db, tex_db)
|| !auth_3d_data_check_category_loaded(s->stage_data->auth_3d_name_hash))
|| !auth_3d_detail::category_load_is_done(s->stage_data->auth_3d_name_hash))
return;
if (s->stage_data->render_texture != -1 && s->stage_data->render_texture != hash_murmurhash_empty)
+2916 -2872
View File
File diff suppressed because it is too large Load Diff
+531 -508
View File
File diff suppressed because it is too large Load Diff
+24 -24
View File
@@ -23,7 +23,7 @@ static void auth_3d_database_file_write_inner(auth_3d_database_file* auth_3d_db_
static void auth_3d_database_file_read_text(auth_3d_database_file* auth_3d_db_file, void* data, size_t size);
static void auth_3d_database_file_write_text(auth_3d_database_file* auth_3d_db_file, void** data, size_t* size);
auth_3d_database_uid::auth_3d_database_uid() : enabled(), org_uid(), size() {
auth_3d_database_uid::auth_3d_database_uid() : enabled(), frame_size(), org_uid() {
category_hash = hash_murmurhash_empty;
name_hash = hash_murmurhash_empty;
}
@@ -32,7 +32,7 @@ auth_3d_database_uid::~auth_3d_database_uid() {
}
auth_3d_database_uid_file::auth_3d_database_uid_file() : flags(), org_uid(), size() {
auth_3d_database_uid_file::auth_3d_database_uid_file() : flag(), frame_size(), org_uid() {
}
@@ -197,8 +197,8 @@ void auth_3d_database::update() {
for (auth_3d_database_uid& i : uid)
uid_names.push_back(i.name_hash, &i);
category_names.sort_unique();
uid_names.sort_unique();
category_names.sort_and_erase_non_unique();
uid_names.sort_and_erase_non_unique();
}
int32_t auth_3d_database::get_category_index(const char* name) const {
@@ -281,7 +281,7 @@ static void auth_3d_database_load_uids(auth_3d_database* auth_3d_db,
int32_t org_uid;
if (!mdata)
org_uid = (int32_t)i;
else if (uid_file->flags & AUTH_3D_DATABASE_UID_ORG_UID)
else if (uid_file->flag & auth_3d_database_uid_file::FLAG_ORG_UID)
org_uid = uid_file->org_uid;
else
org_uid = (int32_t)(uid_count + i);
@@ -296,29 +296,29 @@ static void auth_3d_database_load_uids(auth_3d_database* auth_3d_db,
uid->name.assign(uid_file->value.substr(2, uid_file->value.size() - 2));
uid->name_hash = hash_string_murmurhash(uid->name);
uid->category.assign(uid_file->category);
uid->category_hash = hash_string_murmurhash(uid->category);
uid->category_name.assign(uid_file->category_name);
uid->category_hash = hash_string_murmurhash(uid->category_name);
}
if (uid->enabled) {
uid_file->category.assign(uid->category);
uid_file->category_name.assign(uid->category_name);
if (uid->category.size() > 0)
if (uid->category_name.size() > 0)
for (auth_3d_database_category& j : category)
if (!uid->category.compare(j.name)) {
if (!uid->category_name.compare(j.name)) {
j.uid.push_back(org_uid);
break;
}
}
if (uid_file->flags & AUTH_3D_DATABASE_UID_SIZE)
uid->size = uid_file->size;
if (uid_file->flag & auth_3d_database_uid_file::FLAG_FRAME_SIZE)
uid->frame_size = uid_file->frame_size;
else
uid->size = -1.0f;
uid->frame_size = -1.0f;
}
for (auth_3d_database_category& i : category)
prj::sort_unique(i.uid);
prj::sort_and_erase_non_unique(i.uid);
}
static void auth_3d_database_file_read_inner(auth_3d_database_file* auth_3d_db_file, stream& s) {
@@ -383,11 +383,11 @@ static void auth_3d_database_file_read_text(auth_3d_database_file* auth_3d_db_fi
continue;
auth_3d_database_uid_file* u = &vu[i];
kv.read("category", u->category);
kv.read("category", u->category_name);
if (kv.read("org_uid", u->org_uid))
enum_or(u->flags, AUTH_3D_DATABASE_UID_ORG_UID);
if (kv.read("size", u->size))
enum_or(u->flags, AUTH_3D_DATABASE_UID_SIZE);
u->flag |= auth_3d_database_uid_file::FLAG_ORG_UID;
if (kv.read("size", u->frame_size))
u->flag |= auth_3d_database_uid_file::FLAG_FRAME_SIZE;
kv.read("value", u->value);
kv.close_scope();
@@ -439,15 +439,15 @@ static void auth_3d_database_file_write_text(auth_3d_database_file* auth_3d_db_f
auth_3d_database_uid_file* u = &vu[sort_index_data[i]];
kv.write(s, "category", u->category);
if ((int32_t)(u->flags & AUTH_3D_DATABASE_UID_ORG_UID))
kv.write(s, "category", u->category_name);
if (u->flag & auth_3d_database_uid_file::FLAG_ORG_UID)
kv.write(s, "org_uid", u->org_uid);
if ((int32_t)(u->flags & AUTH_3D_DATABASE_UID_SIZE))
kv.write(s, "size", u->size);
if (u->flag & auth_3d_database_uid_file::FLAG_FRAME_SIZE)
kv.write(s, "size", u->frame_size);
kv.write(s, "value", u->value);
if ((int32_t)(u->flags & AUTH_3D_DATABASE_UID_ORG_UID) && u->org_uid > uid_max)
uid_max = u->org_uid;
if (u->flag & auth_3d_database_uid_file::FLAG_ORG_UID)
uid_max = max_def(uid_max, u->org_uid);
kv.close_scope();
}
+10 -10
View File
@@ -10,29 +10,29 @@
#include "../default.hpp"
#include "../prj/vector_pair.hpp"
enum auth_3d_database_uid_flags {
AUTH_3D_DATABASE_UID_ORG_UID = 0x01,
AUTH_3D_DATABASE_UID_SIZE = 0x02,
};
struct auth_3d_database_uid {
bool enabled;
std::string category;
std::string category_name;
uint32_t category_hash;
float_t frame_size;
std::string name;
uint32_t name_hash;
int32_t org_uid;
float_t size;
auth_3d_database_uid();
~auth_3d_database_uid();
};
struct auth_3d_database_uid_file {
auth_3d_database_uid_flags flags;
std::string category;
enum {
FLAG_FRAME_SIZE = 0x01,
FLAG_ORG_UID = 0x02,
};
uint32_t flag;
std::string category_name;
float_t frame_size;
int32_t org_uid;
float_t size;
std::string value;
auth_3d_database_uid_file();
+4 -4
View File
@@ -261,12 +261,12 @@ void bone_database::update() {
for (std::string& j : i.bone_node_name)
i.bone_node_name_map.push_back(hash_string_murmurhash(j), &j);
i.body_type_map.sort_unique();
i.bone_name_map.sort_unique();
i.bone_node_name_map.sort_unique();
i.body_type_map.sort_and_erase_non_unique();
i.bone_name_map.sort_and_erase_non_unique();
i.bone_node_name_map.sort_and_erase_non_unique();
}
bonedata_map.sort_unique();
bonedata_map.sort_and_erase_non_unique();
}
const BoneData* bone_database::get_bone_data(const char* kind_name) const {
+6 -6
View File
@@ -272,12 +272,12 @@ void motion_database::update() {
}
}
motion_set_ids.sort_unique();
motion_set_names.sort_unique();
motion_set_motion_ids.sort_unique();
motion_set_motion_names.sort_unique();
motion_ids.sort_unique();
motion_names.sort_unique();
motion_set_ids.sort_and_erase_non_unique();
motion_set_names.sort_and_erase_non_unique();
motion_set_motion_ids.sort_and_erase_non_unique();
motion_set_motion_names.sort_and_erase_non_unique();
motion_ids.sort_and_erase_non_unique();
motion_names.sort_and_erase_non_unique();
}
const motion_set_info* motion_database::get_motion_set_by_id(uint32_t id) const {
+10 -10
View File
@@ -370,16 +370,16 @@ void object_database::update() {
}
}
obj_set_ids.sort_unique();
obj_set_murmurhashes.sort_unique();
obj_set_names.sort_unique();
obj_infos.sort_unique();
obj_fnv1a64m_hashes.sort_unique();
obj_fnv1a64m_hashes_upper.sort_unique();
obj_murmurhashes.sort_unique();
obj_info_fnv1a64m_hashes.sort_unique();
obj_info_fnv1a64m_hashes_upper.sort_unique();
obj_info_murmurhashes.sort_unique();
obj_set_ids.sort_and_erase_non_unique();
obj_set_murmurhashes.sort_and_erase_non_unique();
obj_set_names.sort_and_erase_non_unique();
obj_infos.sort_and_erase_non_unique();
obj_fnv1a64m_hashes.sort_and_erase_non_unique();
obj_fnv1a64m_hashes_upper.sort_and_erase_non_unique();
obj_murmurhashes.sort_and_erase_non_unique();
obj_info_fnv1a64m_hashes.sort_and_erase_non_unique();
obj_info_fnv1a64m_hashes_upper.sort_and_erase_non_unique();
obj_info_murmurhashes.sort_and_erase_non_unique();
}
const object_set_info* object_database::get_object_set_info(const char* name) const {
+2 -2
View File
@@ -427,8 +427,8 @@ void stage_database::update() {
for (stage_data_modern& i : stage_modern)
stage_modern_names.push_back(i.hash, &i);
stage_data_names.sort_unique();
stage_modern_names.sort_unique();
stage_data_names.sort_and_erase_non_unique();
stage_modern_names.sort_and_erase_non_unique();
}
const ::stage_data* stage_database::get_stage_data(int32_t stage_index) const {
+2 -2
View File
@@ -299,8 +299,8 @@ void texture_database::update() {
texture_murmurhashes.push_back(i.name_hash, &i);
}
texture_ids.sort_unique();
texture_murmurhashes.sort_unique();
texture_ids.sort_and_erase_non_unique();
texture_murmurhashes.sort_and_erase_non_unique();
}
uint32_t texture_database::get_texture_id(const char* name) const {
+14 -14
View File
@@ -422,12 +422,12 @@ int32_t interpolate_chs_reverse_sequence(const std::vector<float_t>& values_src,
for (size_t i = 0; i < length - 3; i++)
if (*(uint32_t*)&keys[i + 0].value == *(uint32_t*)&keys[i + 1].value
&& *(uint32_t*)&keys[i + 1].value == *(uint32_t*)&keys[i + 2].value
&& *(uint32_t*)&keys[i + 0].tangent2 == 0
&& *(uint32_t*)&keys[i + 1].tangent1 == 0
&& *(uint32_t*)&keys[i + 1].tangent2 == 0
&& *(uint32_t*)&keys[i + 2].tangent1 == 0) {
&& *(uint32_t*)&keys[i + 0].r_slope == 0
&& *(uint32_t*)&keys[i + 1].l_slope == 0
&& *(uint32_t*)&keys[i + 1].r_slope == 0
&& *(uint32_t*)&keys[i + 2].l_slope == 0) {
keys[i + 1].frame = keys[i + 2].frame;
keys[i + 1].tangent2 = keys[i + 2].tangent2;
keys[i + 1].r_slope = keys[i + 2].r_slope;
values.erase(values.begin() + (i + 2));
keys = values.data();
length = values.size();
@@ -439,11 +439,11 @@ int32_t interpolate_chs_reverse_sequence(const std::vector<float_t>& values_src,
if (values.size() >= 2) {
kft3* keys = values.data();
if (*(uint32_t*)&keys[0].value == *(uint32_t*)&keys[1].value
&& *(uint32_t*)&keys[0].tangent1 == 0
&& *(uint32_t*)&keys[0].tangent2 == 0
&& *(uint32_t*)&keys[1].tangent1 == 0) {
&& *(uint32_t*)&keys[0].l_slope == 0
&& *(uint32_t*)&keys[0].r_slope == 0
&& *(uint32_t*)&keys[1].l_slope == 0) {
keys[0].frame = keys[1].frame;
keys[0].tangent2 = keys[1].tangent2;
keys[0].r_slope = keys[1].r_slope;
values.erase(values.begin() + 1);
}
}
@@ -452,9 +452,9 @@ int32_t interpolate_chs_reverse_sequence(const std::vector<float_t>& values_src,
kft3* keys = values.data();
size_t length = values.size();
if (*(uint32_t*)&keys[length - 2].value == *(uint32_t*)&keys[length - 1].value
&& *(uint32_t*)&keys[length - 2].tangent2 == 0
&& *(uint32_t*)&keys[length - 1].tangent1 == 0
&& *(uint32_t*)&keys[length - 1].tangent2 == 0) {
&& *(uint32_t*)&keys[length - 2].r_slope == 0
&& *(uint32_t*)&keys[length - 1].l_slope == 0
&& *(uint32_t*)&keys[length - 1].r_slope == 0) {
values.erase(values.begin() + (length - 1));
}
}
@@ -490,8 +490,8 @@ int32_t interpolate_chs_reverse_sequence(const std::vector<float_t>& values_src,
}
for (kft3& i : values) {
i.tangent1 = 0.0f;
i.tangent2 = 0.0f;
i.l_slope = 0.0f;
i.r_slope = 0.0f;
}
return 2;
}
+7 -7
View File
@@ -29,11 +29,11 @@ void kft_check(void* src_key, kf_type src_type, void* dst_key, kf_type* dst_type
} break;
case KEY_FRAME_TYPE_2: {
kft2* sk = (kft2*)src_key;
if (*(uint32_t*)&sk->tangent != 0) {
if (*(uint32_t*)&sk->slope != 0) {
kft2* dk = (kft2*)dst_key;
dk->frame = sk->frame;
dk->value = sk->value;
dk->tangent = sk->tangent;
dk->slope = sk->slope;
*dst_type = KEY_FRAME_TYPE_2;
}
else if (*(uint32_t*)&sk->value != 0) {
@@ -50,19 +50,19 @@ void kft_check(void* src_key, kf_type src_type, void* dst_key, kf_type* dst_type
} break;
case KEY_FRAME_TYPE_3: {
kft3* sk = (kft3*)src_key;
if (*(uint32_t*)&sk->tangent1 != *(uint32_t*)&sk->tangent2) {
if (*(uint32_t*)&sk->l_slope != *(uint32_t*)&sk->r_slope) {
kft3* dk = (kft3*)dst_key;
dk->frame = sk->frame;
dk->value = sk->value;
dk->tangent1 = sk->tangent1;
dk->tangent2 = sk->tangent2;
dk->l_slope = sk->l_slope;
dk->r_slope = sk->r_slope;
*dst_type = KEY_FRAME_TYPE_3;
}
else if (*(uint32_t*)&sk->tangent1 != 0) {
else if (*(uint32_t*)&sk->l_slope != 0) {
kft2* dk = (kft2*)dst_key;
dk->frame = sk->frame;
dk->value = sk->value;
dk->tangent = sk->tangent1;
dk->slope = sk->l_slope;
*dst_type = KEY_FRAME_TYPE_2;
}
else if (*(uint32_t*)&sk->value != 0) {
+3 -3
View File
@@ -26,14 +26,14 @@ struct kft1 {
struct kft2 {
float_t frame;
float_t value;
float_t tangent;
float_t slope;
};
struct kft3 {
float_t frame;
float_t value;
float_t tangent1;
float_t tangent2;
float_t l_slope;
float_t r_slope;
};
extern void kft_check(void* src_key, kf_type src_type, void* dst_key, kf_type* dst_type);
+18 -18
View File
@@ -569,7 +569,7 @@ mot_key_set_type mot_set::fit_keys_into_curve(std::vector<float_t>& values_src,
break;
if (arr != values.data() + count)
return MOT_KEY_SET_HERMITE_TANGENT;
return MOT_KEY_SET_HERMITE_SLOPE;
float_t* arr_src = values.data();
float_t* arr_dst = values.data();
@@ -660,19 +660,19 @@ static void mot_classic_read_inner(mot_set* ms, prj::shared_ptr<prj::stack_alloc
key_set->values[0] = s.read_float_t();
}
else {
bool has_tangents = key_set->type != MOT_KEY_SET_HERMITE;
bool has_slopes = key_set->type != MOT_KEY_SET_HERMITE;
uint16_t keys_count = s.read_uint16_t();
key_set->keys_count = keys_count;
uint16_t* frames = alloc->allocate<uint16_t>(keys_count);
float_t* values = alloc->allocate<float_t>(has_tangents ? keys_count * 2ULL : keys_count);
float_t* values = alloc->allocate<float_t>(has_slopes ? keys_count * 2ULL : keys_count);
key_set->frames = frames;
key_set->values = values;
s.read(frames, sizeof(uint16_t) * keys_count);
s.align_read(0x04);
if (!has_tangents)
if (!has_slopes)
s.read(values, sizeof(float_t) * keys_count);
else
s.read(values, sizeof(float_t) * keys_count * 2ULL);
@@ -730,7 +730,7 @@ static void mot_classic_write_inner(mot_set* ms, stream& s) {
s.write_float_t(key_set->values[0]);
}
else if (key_set->type != MOT_KEY_SET_NONE) {
bool has_tangents = key_set->type != MOT_KEY_SET_HERMITE;
bool has_slopes = key_set->type != MOT_KEY_SET_HERMITE;
uint16_t keys_count = key_set->keys_count;
s.write_uint16_t(keys_count);
@@ -739,7 +739,7 @@ static void mot_classic_write_inner(mot_set* ms, stream& s) {
s.align_write(0x04);
float_t* values = key_set->values;
if (!has_tangents)
if (!has_slopes)
s.write(values, sizeof(float_t) * keys_count);
else
s.write(values, sizeof(float_t) * keys_count * 2ULL);
@@ -872,7 +872,7 @@ static void mot_modern_read_inner(mot_set* ms, prj::shared_ptr<prj::stack_alloca
key_set->values[0] = s.read_float_t();
}
else {
bool has_tangents = key_set->type != MOT_KEY_SET_HERMITE;
bool has_slopes = key_set->type != MOT_KEY_SET_HERMITE;
uint16_t keys_count = s_motc.read_uint16_t_reverse_endianness();
mot_key_set_data_type data_type
= (mot_key_set_data_type)s_motc.read_uint16_t_reverse_endianness();
@@ -880,12 +880,12 @@ static void mot_modern_read_inner(mot_set* ms, prj::shared_ptr<prj::stack_alloca
key_set->data_type = data_type;
int16_t* frames = alloc->allocate<int16_t>(keys_count);
float_t* values = alloc->allocate<float_t>(has_tangents ? keys_count * 2ULL : keys_count);
float_t* values = alloc->allocate<float_t>(has_slopes ? keys_count * 2ULL : keys_count);
key_set->frames = (uint16_t*)frames;
key_set->values = values;
uint8_t step = has_tangents ? 2 : 1;
if (has_tangents) {
uint8_t step = has_slopes ? 2 : 1;
if (has_slopes) {
float_t* values = &key_set->values[1];
for (int32_t k = 0; k < keys_count; k++, values += step)
*values = s_motc.read_float_t_reverse_endianness();
@@ -977,8 +977,8 @@ static void mot_modern_write_inner(mot_set* ms, stream& s) {
}
}
else if (key_set->type != MOT_KEY_SET_NONE) {
bool has_tangents = key_set->type != MOT_KEY_SET_HERMITE;
if (has_tangents)
bool has_slopes = key_set->type != MOT_KEY_SET_HERMITE;
if (has_slopes)
ee = { o, 1, 4, 1 };
else
ee = { o, 1, 3, 1 };
@@ -986,7 +986,7 @@ static void mot_modern_write_inner(mot_set* ms, stream& s) {
uint16_t keys_count = key_set->keys_count;
mot_key_set_data_type data_type = key_set->data_type;
o = 4;
if (has_tangents)
if (has_slopes)
o += keys_count * 4;
if (data_type == MOT_KEY_SET_DATA_F16)
@@ -998,7 +998,7 @@ static void mot_modern_write_inner(mot_set* ms, stream& s) {
ee.size = o;
ee.append(0, 2, ENRS_WORD);
if (has_tangents)
if (has_slopes)
ee.append(0, keys_count, ENRS_DWORD);
if (data_type == MOT_KEY_SET_DATA_F16) {
ee.append(0, keys_count, ENRS_WORD);
@@ -1090,14 +1090,14 @@ static void mot_modern_write_inner(mot_set* ms, stream& s) {
s.write_float_t_reverse_endianness(key_set->values[0]);
}
else if (key_set->type != MOT_KEY_SET_NONE) {
bool has_tangents = key_set->type != MOT_KEY_SET_HERMITE;
bool has_slopes = key_set->type != MOT_KEY_SET_HERMITE;
uint16_t keys_count = key_set->keys_count;
mot_key_set_data_type data_type = key_set->data_type;
s_motc.write_uint16_t_reverse_endianness(keys_count);
s_motc.write_uint16_t_reverse_endianness((uint16_t)data_type);
uint8_t step = has_tangents ? 2 : 1;
if (has_tangents) {
uint8_t step = has_slopes ? 2 : 1;
if (has_slopes) {
float_t* values = &key_set->values[1];
for (int32_t k = 0; k < keys_count; k++, values += step)
s_motc.write_float_t_reverse_endianness(*values);
@@ -1263,7 +1263,7 @@ static void mot_data_move_data(mot_data* mot_dst, const mot_data* mot_src,
key_set_dst->frames = alloc->allocate<uint16_t>(key_set_src->frames, keys_count);
key_set_dst->values = alloc->allocate<float_t>(key_set_src->values, keys_count);
break;
case MOT_KEY_SET_HERMITE_TANGENT:
case MOT_KEY_SET_HERMITE_SLOPE:
key_set_dst->frames = alloc->allocate<uint16_t>(key_set_src->frames, keys_count);
key_set_dst->values = alloc->allocate<float_t>(key_set_src->values, keys_count * 2ULL);
break;
+4 -4
View File
@@ -13,10 +13,10 @@
#include "vec.hpp"
enum mot_key_set_type {
MOT_KEY_SET_NONE = 0x00,
MOT_KEY_SET_STATIC = 0x01,
MOT_KEY_SET_HERMITE = 0x02,
MOT_KEY_SET_HERMITE_TANGENT = 0x03,
MOT_KEY_SET_NONE = 0x00,
MOT_KEY_SET_STATIC = 0x01,
MOT_KEY_SET_HERMITE = 0x02,
MOT_KEY_SET_HERMITE_SLOPE = 0x03,
};
enum mot_key_set_data_type {
+1 -1
View File
@@ -2482,7 +2482,7 @@ static void obj_classic_write_skin(obj_skin* sk, stream& s, int64_t base_offset)
s.position_pop();
exh.osage_root_offset = obj_skin_strings_get_string_offset(strings,
string_offsets, ex->osage_root);
string_offsets, ex->osage_root);
s.position_push(exh.osage_joint_offset, SEEK_SET);
for (int32_t i = 0; i < ex->nb_jointX; i++) {
+37 -25
View File
@@ -12,40 +12,52 @@
#include <vector>
namespace prj {
template <class T>
bool find(std::vector<T>& vec, const T& value) {
auto begin = vec.begin();
auto end = vec.end();
for (auto i = begin; i != end; i++)
if (*i == value)
return true;
template <class T, class U>
inline bool find(T& in_c, const U& in_v) {
auto elem = std::find(in_c.begin(), in_c.end(), in_v);
return elem != in_c.end();
}
template <class T, class U>
inline bool find(T& in_c, const U&& in_v) {
auto elem = std::find(in_c.begin(), in_c.end(), in_v);
return elem != in_c.end();
}
template <class T, class U>
inline bool find_and_erase(T& in_c, const U& in_v) {
auto elem = std::find(in_c.begin(), in_c.end(), in_v);
if (elem != in_c.end()) {
in_c.erase(elem);
return true;
}
return false;
}
template <class T, class U>
inline bool find_and_erase(T& in_c, const U&& in_v) {
auto elem = std::find(in_c.begin(), in_c.end(), in_v);
if (elem != in_c.end()) {
in_c.erase(elem);
return true;
}
return false;
}
template <class T>
bool find(std::vector<T>& vec, const T&& value) {
auto begin = vec.begin();
auto end = vec.end();
for (auto i = begin; i != end; i++)
if (*i == value)
return true;
return false;
inline void sort(T& in_c) {
std::sort(in_c.begin(), in_c.end());
}
template <class T>
inline void sort(std::vector<T>& vec) {
std::sort(vec.begin(), vec.end());
inline void unique_and_erase(T& in_c) {
auto last = std::unique(in_c.begin(), in_c.end());
in_c.erase(last, in_c.end());
}
template <class T>
void unique(std::vector<T>& vec) {
auto last = std::unique(vec.begin(), vec.end());
vec.erase(last, vec.end());
}
template <class T>
inline void sort_unique(std::vector<T>& vec) {
sort(vec);
unique(vec);
inline void sort_and_erase_non_unique(T& in_c) {
sort(in_c);
unique_and_erase(in_c);
}
}
+2 -2
View File
@@ -73,7 +73,7 @@ namespace prj {
uint32_t* M_data() {
return M_core.M_pool;
}
const uint32_t* M_data() const {
return M_core.M_pool;
}
@@ -180,7 +180,7 @@ namespace prj {
return false;
return true;
}
void operator&=(const BitArrayBase<T>& right) {
for (size_t i = 0; i < num_blocks(); i++)
M_data()[i] &= right.M_data()[i];
+1 -1
View File
@@ -191,7 +191,7 @@ namespace prj {
return assign(ptr, npos);
}
template <bool rhs_fill_null = false>
__declspec(noinline) PodStringOnArray& assign(const PodStringOnArray<_Elem, _Traits, len, unk, rhs_fill_null>& rhs) {
if (c_str() == rhs.c_str())
+3 -3
View File
@@ -48,14 +48,14 @@ namespace prj {
});
}
void unique() {
void erase_non_unique() {
auto last = std::unique(this->begin(), this->end());
this->erase(last, this->end());
}
inline void sort_unique() {
inline void sort_and_erase_non_unique() {
sort();
unique();
erase_non_unique();
}
inline typename auto find(const T& key) {
+1 -1
View File
@@ -2204,7 +2204,7 @@ static int32_t app_create_logical_device() {
std::vector<uint32_t> unique_queue_families;
unique_queue_families.insert(unique_queue_families.end(), indices.first);
unique_queue_families.insert(unique_queue_families.end(), indices.second);
prj::sort_unique(unique_queue_families);
prj::sort_and_erase_non_unique(unique_queue_families);
std::vector<VkDeviceQueueCreateInfo> queue_create_infos;
queue_create_infos.reserve(unique_queue_families.size());
+104 -108
View File
@@ -26,257 +26,250 @@ FaceAnim::Auth3D::~Auth3D() {
}
inline static void set_data(auth_3d_key& key, const float_t value) {
key.reset();
key.type = value != 0.0f && value != -0.0f ? AUTH_3D_KEY_STATIC : AUTH_3D_KEY_NONE;
key.value = value;
}
inline static void set_data(auth_3d_object_model_transform& mt, const vec3 translation,
inline static void set_data(auth_3d_detail::MotionTransform& mt, const vec3 translation,
const vec3 rotation, const vec3 scale = 1.0f, const float_t visibility = 1.0f) {
set_data(mt.translation.x, translation.x);
set_data(mt.translation.y, translation.y);
set_data(mt.translation.z, translation.z);
set_data(mt.rotation.x, rotation.x);
set_data(mt.rotation.y, rotation.y);
set_data(mt.rotation.z, rotation.z);
set_data(mt.scale.x, scale.x);
set_data(mt.scale.y, scale.y);
set_data(mt.scale.z, scale.z);
set_data(mt.visibility, visibility);
mt.fcurve_translation.x.init(translation.x);
mt.fcurve_translation.y.init(translation.y);
mt.fcurve_translation.z.init(translation.z);
mt.fcurve_rotation.x.init(rotation.x);
mt.fcurve_rotation.y.init(rotation.y);
mt.fcurve_rotation.z.init(rotation.z);
mt.fcurve_scale.x.init(scale.x);
mt.fcurve_scale.y.init(scale.y);
mt.fcurve_scale.z.init(scale.z);
mt.fcurve_visibility.init(visibility);
}
void FaceAnim::Auth3D::patch() {
::auth_3d* auth = id.get_auth_3d();
auth_3d_object_hrc* objhrc = &auth->object_hrc[0];
auth_3d_object_node* nodes = objhrc->node.data();
auth_3d_detail::Scene* scene = id.get_scene();
auth_3d_detail::HierarchyObject* objhrc = scene->object_hrc_list[0];
auth_3d_detail::TransformNode* node_list = objhrc->node_list.data();
set_data(nodes[ 0].model_transform,
set_data(node_list[ 0].motion_transform,
vec3(0.0f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // OBJHRC_EFFCHRPV826MIK001_MOB
set_data(nodes[ 1].model_transform,
set_data(node_list[ 1].motion_transform,
vec3(0.0f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // gblctr
set_data(nodes[ 2].model_transform,
set_data(node_list[ 2].motion_transform,
vec3(0.0f, 1.055f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // n_hara
set_data(nodes[ 3].model_transform,
set_data(node_list[ 3].motion_transform,
vec3(0.0f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // n_hara_y
set_data(nodes[ 4].model_transform,
set_data(node_list[ 4].motion_transform,
vec3(0.0f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_hara_wj
set_data(nodes[ 5].model_transform,
set_data(node_list[ 5].motion_transform,
vec3(0.0f, 0.0f, 0.0f),
vec3(0.0f, 1.570796f, 0.0f)); // n_kosi
set_data(nodes[ 6].model_transform,
set_data(node_list[ 6].motion_transform,
vec3(0.0f, 0.11f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_mune_wj
set_data(nodes[ 7].model_transform,
set_data(node_list[ 7].motion_transform,
vec3(0.0f, 0.0f, 0.0f),
vec3(0.0f, -1.570796f, 0.0f)); // n_mune_kl
set_data(nodes[ 8].model_transform,
set_data(node_list[ 8].motion_transform,
vec3(0.0f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_mune_b_wj
set_data(nodes[ 9].model_transform,
set_data(node_list[ 9].motion_transform,
vec3(0.0f, 0.145f, -0.044f),
vec3(0.0f, 0.0f, 0.0f)); // j_kubi_wj
set_data(nodes[10].model_transform,
set_data(node_list[10].motion_transform,
vec3(0.0f, 0.079f, 0.004f),
vec3(1.570796f, 0.0f, 0.0f)); // n_kao
set_data(nodes[11].model_transform,
set_data(node_list[11].motion_transform,
vec3(0.0f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_kao_wj
set_data(nodes[12].model_transform,
set_data(node_list[12].motion_transform,
vec3(0.111f, -0.062f, -0.18f),
vec3(0.0f, -1.570796f, 1.221731f)); // j_hair_twin_l_000_wj
set_data(nodes[13].model_transform,
set_data(node_list[13].motion_transform,
vec3(0.222f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_hair_twin_l_001_wj
set_data(nodes[14].model_transform,
set_data(node_list[14].motion_transform,
vec3(0.222f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_hair_twin_l_002_wj
set_data(nodes[15].model_transform,
set_data(node_list[15].motion_transform,
vec3(0.222f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_hair_twin_l_003_wj
set_data(nodes[16].model_transform,
set_data(node_list[16].motion_transform,
vec3(0.222f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_hair_twin_l_004_wj
set_data(nodes[17].model_transform,
set_data(node_list[17].motion_transform,
vec3(0.222f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_hair_twin_l_005_wj
set_data(nodes[18].model_transform,
set_data(node_list[18].motion_transform,
vec3(-0.111f, -0.062f, -0.18f),
vec3(0.0f, -1.570796f, -1.221731f)); // j_hair_twin_r_000_wj
set_data(nodes[19].model_transform,
set_data(node_list[19].motion_transform,
vec3(0.222f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_hair_twin_r_001_wj
set_data(nodes[20].model_transform,
set_data(node_list[20].motion_transform,
vec3(0.222f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_hair_twin_r_002_wj
set_data(nodes[21].model_transform,
set_data(node_list[21].motion_transform,
vec3(0.222f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_hair_twin_r_003_wj
set_data(nodes[22].model_transform,
set_data(node_list[22].motion_transform,
vec3(0.222f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_hair_twin_r_004_wj
set_data(nodes[23].model_transform,
set_data(node_list[23].motion_transform,
vec3(0.222f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_hair_twin_r_005_wj
/*set_data(nodes[24].model_transform,
/*set_data(node_list[24].motion_transform,
vec3(0.0f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_kao_normal_wj
set_data(nodes[25].model_transform,
set_data(node_list[25].motion_transform,
vec3(0.0f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_kao_close_wj
set_data(nodes[26].model_transform,
set_data(node_list[26].motion_transform,
vec3(0.0f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_kao_smile_wj
set_data(nodes[27].model_transform,
set_data(node_list[27].motion_transform,
vec3(0.0f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_kao_close_half_wj
set_data(nodes[28].model_transform,
set_data(node_list[28].motion_transform,
vec3(0.0f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_kao_smile_half_wj
set_data(nodes[29].model_transform,
set_data(node_list[29].motion_transform,
vec3(0.0148f, -0.0018f, 0.079f),
vec3(0.0f, 0.0f, 0.0f)); // j_kuti_l_wj
set_data(nodes[30].model_transform,
set_data(node_list[30].motion_transform,
vec3(0.0f, 0.00048f, 0.088f),
vec3(0.0f, 0.0f, 0.0f)); // j_kuti_u_wj
set_data(nodes[31].model_transform,
set_data(node_list[31].motion_transform,
vec3(0.0f, -0.00672f, 0.082f),
vec3(0.0f, 0.0f, 0.0f)); // j_kuti_d_wj
set_data(nodes[32].model_transform,
set_data(node_list[32].motion_transform,
vec3(-0.0148f, -0.0018f, 0.079f),
vec3(0.0f, 0.0f, 0.0f)); // j_kuti_r_wj
set_data(nodes[33].model_transform,
set_data(node_list[33].motion_transform,
vec3(-0.027f, 0.061f, 0.015f),
vec3(-1.570796f, 0.0f, 0.0f)); // j_eye_r_wj
set_data(nodes[34].model_transform,
set_data(node_list[34].motion_transform,
vec3(0.027f, 0.061f, 0.015f),
vec3(-1.570796f, 0.0f, 0.0f)); // j_eye_l_wj*/
set_data(nodes[35].model_transform,
set_data(node_list[35].motion_transform,
vec3(0.02f, 0.129f, -0.053f),
vec3(1.570796f, 0.0f, 1.570796f)); // n_waki_l
set_data(nodes[36].model_transform,
set_data(node_list[36].motion_transform,
vec3(0.0f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_waki_l_wj
set_data(nodes[37].model_transform,
set_data(node_list[37].motion_transform,
vec3(-0.01f, 0.0f, 0.083f),
vec3(-0.037163f, -1.081817f, -3.108780f)); // n_kata_l
set_data(nodes[38].model_transform,
set_data(node_list[38].motion_transform,
vec3(0.0f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_kata_l_wj
set_data(nodes[39].model_transform,
set_data(node_list[39].motion_transform,
vec3(0.208f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_ude_l_wj
set_data(nodes[40].model_transform,
set_data(node_list[40].motion_transform,
vec3(0.21f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_te_l_wj
set_data(nodes[41].model_transform,
set_data(node_list[41].motion_transform,
vec3(0.0f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_te_sizen2_l_wj
set_data(nodes[42].model_transform,
set_data(node_list[42].motion_transform,
vec3(0.0f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_te_close_l_wj
set_data(nodes[43].model_transform,
set_data(node_list[43].motion_transform,
vec3(0.0f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_te_reset_l_wj
set_data(nodes[44].model_transform,
set_data(node_list[44].motion_transform,
vec3(-0.02f, 0.129f, -0.053f),
vec3(1.570796f, 0.0f, 1.570796f)); // n_waki_r
set_data(nodes[45].model_transform,
set_data(node_list[45].motion_transform,
vec3(0.0f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_waki_r_wj
set_data(nodes[46].model_transform,
set_data(node_list[46].motion_transform,
vec3(-0.01f, 0.0f, -0.083f),
vec3(0.037163f, 1.081817f, -3.108780f)); // n_kata_r
set_data(nodes[47].model_transform,
set_data(node_list[47].motion_transform,
vec3(0.0f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_kata_r_wj
set_data(nodes[48].model_transform,
set_data(node_list[48].motion_transform,
vec3(0.208f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_ude_r_wj
set_data(nodes[49].model_transform,
set_data(node_list[49].motion_transform,
vec3(0.21f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_te_r_wj
set_data(nodes[50].model_transform,
set_data(node_list[50].motion_transform,
vec3(0.0f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_te_sizen2_r_wj
set_data(nodes[51].model_transform,
set_data(node_list[51].motion_transform,
vec3(0.0f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_te_close_r_wj
set_data(nodes[52].model_transform,
set_data(node_list[52].motion_transform,
vec3(0.0f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_te_reset_r_wj
set_data(nodes[53].model_transform,
set_data(node_list[53].motion_transform,
vec3(0.0f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_te_one_r_wj
set_data(nodes[54].model_transform,
set_data(node_list[54].motion_transform,
vec3(0.0f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_kosi_wj
set_data(nodes[55].model_transform,
set_data(node_list[55].motion_transform,
vec3(0.046f, -0.15f, 0.065f),
vec3(0.0f, 0.0f, -1.570796f)); // n_momo_l
set_data(nodes[56].model_transform,
set_data(node_list[56].motion_transform,
vec3(0.0f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_momo_l_wj
set_data(nodes[57].model_transform,
set_data(node_list[57].motion_transform,
vec3(0.39f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_sune_l_wj
set_data(nodes[58].model_transform,
set_data(node_list[58].motion_transform,
vec3(0.38f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_asi_l_wj
set_data(nodes[59].model_transform,
set_data(node_list[59].motion_transform,
vec3(0.046f, -0.15f, -0.065f),
vec3(0.0f, 0.0f, -1.570796f)); // n_momo_r
set_data(nodes[60].model_transform,
set_data(node_list[60].motion_transform,
vec3(0.0f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_momo_r_wj
set_data(nodes[61].model_transform,
set_data(node_list[61].motion_transform,
vec3(0.39f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_sune_r_wj
set_data(nodes[62].model_transform,
set_data(node_list[62].motion_transform,
vec3(0.38f, 0.0f, 0.0f),
vec3(0.0f, 0.0f, 0.0f)); // j_asi_r_wj
set_data(nodes[63].model_transform,
set_data(node_list[63].motion_transform,
vec3(-0.060104f, -0.052047f, 0.0f),
vec3(0.0f, 0.0f, -1.762782f)); // j_cloth_skirt_f_000_wj
set_data(nodes[64].model_transform,
set_data(node_list[64].motion_transform,
vec3(-0.042834f, -0.052048f, 0.05915f),
vec3(-0.368869f, -0.220518f, -1.784135f)); // j_cloth_skirt_l_02_000_wj
set_data(nodes[65].model_transform,
set_data(node_list[65].motion_transform,
vec3(-0.013f, -0.052048f, 0.109621f),
vec3(-1.710423f, -0.331613f, -1.588249f)); // j_cloth_skirt_l_04_000_wj
set_data(nodes[66].model_transform,
set_data(node_list[66].motion_transform,
vec3(0.0927504f, -0.052048f, 0.08239f),
vec3(-2.356194f, -0.314159f, -1.308997f)); // j_cloth_skirt_l_06_000_wj
set_data(nodes[67].model_transform,
set_data(node_list[67].motion_transform,
vec3(-0.042834f, -0.052048f, -0.05915f),
vec3(0.368869f, 0.220518f, -1.784135f)); // j_cloth_skirt_r_02_000_wj
set_data(nodes[68].model_transform,
set_data(node_list[68].motion_transform,
vec3(0.013f, -0.052048f, -0.10962f),
vec3(1.710423f, 0.331613f, -1.588249f)); // j_cloth_skirt_r_04_000_wj
set_data(nodes[69].model_transform,
set_data(node_list[69].motion_transform,
vec3(0.09275f, -0.052048f, -0.08239f),
vec3(2.356194f, 0.314159f, -1.308997f)); // j_cloth_skirt_r_06_000_wj
set_data(nodes[70].model_transform,
set_data(node_list[70].motion_transform,
vec3(0.118331f, -0.052048f, 0.0f),
vec3(-3.141592f, 0.0f, -1.186823f)); // j_cloth_skirt_b_000_wj
objhrc->interpolate(0.0f);
objhrc->get(0.0f);
}
void FaceAnim::Auth3D::reset() {
auth_3d_data_unload_category(category.hash_murmurhash);
id.unload(rctx_ptr);
auth_3d_detail::category_free(category.hash_murmurhash);
id.destroy(rctx_ptr);
objset_info_storage_unload_set(object_set.hash_murmurhash);
category.clear();
file.clear();
object_set.clear();
id = -1;
obj_db.clear();
tex_db.clear();
@@ -316,43 +309,44 @@ bool FaceAnim::ctrl() {
auth_3d.file.assign("EFFCHRPV826MIK001");
auth_3d.object_set.assign("EFFCHRPV826MIK001");
auth_3d_data_load_category(x_data, auth_3d.category.c_str(), auth_3d.category.hash_murmurhash);
auth_3d_detail::category_load_req(x_data, auth_3d.category.c_str(), auth_3d.category.hash_murmurhash);
objset_info_storage_load_set_hash(x_data, auth_3d.object_set.hash_murmurhash);
state = 2;
} break;
case 2: {
if (!auth_3d_data_check_category_loaded(auth_3d.category.hash_murmurhash)
if (!auth_3d_detail::category_load_is_done(auth_3d.category.hash_murmurhash)
|| (objset_info_storage_get_objset_info(auth_3d.object_set.hash_murmurhash)
&& objset_info_storage_load_obj_set_check_not_read(
auth_3d.object_set.hash_murmurhash, &auth_3d.obj_db, &auth_3d.tex_db)))
break;
auth_3d.id = auth_3d_id(auth_3d.file.hash_murmurhash, x_data, &auth_3d.obj_db, &auth_3d.tex_db);
auth_3d.id.read_file_modern();
auth_3d.id = auth_3d_detail::Handle::create(auth_3d.file.hash_murmurhash,
x_data, &auth_3d.obj_db, &auth_3d.tex_db);
auth_3d.id.load_req_modern();
state = 3;
} break;
case 3: {
if (!auth_3d.id.check_not_empty() || !auth_3d.id.check_loaded())
if (!auth_3d.id.is_valid() || !auth_3d.id.load_is_done())
break;
auth_3d.id.set_enable(true);
auth_3d.id.set_paused(false);
auth_3d.id.set_repeat(false);
auth_3d.id.set_req_frame(0.0f);
auth_3d.id.set_visibility(true);
auth_3d.id.set_enabled(true);
auth_3d.id.set_pause(false);
auth_3d.id.set_looped(false);
auth_3d.id.set_frame_req(0.0f);
auth_3d.id.set_visible(true);
auth_3d.patch();
frame = 5000;
frame_max = (int32_t)auth_3d.id.get_last_frame();
frame_max = (int32_t)auth_3d.id.get_frame_size();
ogg_path.assign("H:\\C\\Documents\\A\\pv826\\lipsync\\01_rin.ogg");
//sound_work_play_stream(0, ogg_path.c_str(), (float_t)((double_t)frame / 60.0));
state = 4;
} break;
case 4: {
auth_3d.id.set_req_frame((float_t)frame);
auth_3d.id.set_frame_req((float_t)frame);
if (!play && sound_play) {
sound_work_release_stream(0);
@@ -400,7 +394,7 @@ void FaceAnim::window() {
ImGuiWindowFlags window_flags = 0;
window_flags |= ImGuiWindowFlags_NoResize;
focus = false;
reset_focus();
bool open = true;
if (!ImGui::Begin("Face Anim", &open, window_flags)) {
ImGui::End();
@@ -415,6 +409,8 @@ void FaceAnim::window() {
play ^= true;
ImGui::Text("% 5d/% 5d", frame, frame_max);
set_focus(ImGui::IsWindowFocused());
ImGui::End();
}
+1 -1
View File
@@ -19,7 +19,7 @@ public:
string_hash category;
string_hash file;
string_hash object_set;
auth_3d_id id;
auth_3d_detail::Handle id;
object_database obj_db;
texture_database tex_db;
+47 -47
View File
@@ -5310,7 +5310,7 @@ static void glitter_editor_curve_editor_property_window(GlitterEditor* glt_edt)
break;
case Glitter::KEY_HERMITE:
value = Glitter::Curve::InterpolateHermite(
c->value, n->value - c->value, c->tangent2, n->tangent1,
c->value, n->value - c->value, c->r_slope, n->l_slope,
(double_t)c->frame, (double_t)n->frame, (double_t)crv_edt->frame);
break;
}
@@ -5356,20 +5356,20 @@ static void glitter_editor_curve_editor_property_window(GlitterEditor* glt_edt)
ImGui::DisableElementPop(key_random_range);
if (n && c->type == Glitter::KEY_HERMITE) {
float_t tangent2 = (float_t)(c->tangent2 * scale);
if (ImGui::ColumnDragFloat("Tangent 1",
&tangent2, 0.0001f, -FLT_MAX, FLT_MAX, "%g",
float_t r_slope = (float_t)(c->r_slope * scale);
if (ImGui::ColumnDragFloat("R Slope",
&r_slope, 0.0001f, -FLT_MAX, FLT_MAX, "%g",
ImGuiSliderFlags_NoRoundToFormat)) {
c->tangent2 = tangent2 * inv_scale;
c->r_slope = r_slope * inv_scale;
changed = true;
}
key_edit |= ImGui::IsItemFocused();
float_t tangent1 = (float_t)(n->tangent1 * scale);
if (ImGui::ColumnDragFloat("Tangent 2",
&tangent1, 0.0001f, -FLT_MAX, FLT_MAX, "%g",
float_t l_slope = (float_t)(n->l_slope * scale);
if (ImGui::ColumnDragFloat("L Slope",
&l_slope, 0.0001f, -FLT_MAX, FLT_MAX, "%g",
ImGuiSliderFlags_NoRoundToFormat)) {
n->tangent1 = tangent1 * inv_scale;
n->l_slope = l_slope * inv_scale;
changed = true;
}
key_edit |= ImGui::IsItemFocused();
@@ -5892,11 +5892,11 @@ static void glitter_editor_curve_editor_window(GlitterEditor* glt_edt) {
case Glitter::KEY_HERMITE: {
int32_t df = n->frame - c->frame;
int32_t _df = key.frame - c->frame;
std::vector<double_t> v_arr = interpolate_chs(c->value, n->value, c->tangent2, n->tangent1, 0, df);
std::vector<double_t> v_arr = interpolate_chs(c->value, n->value, c->r_slope, n->l_slope, 0, df);
key.value = v_arr[_df];
key.random_range = lerp_def(c->random_range, n->random_range, (double_t)_df / (double_t)df);
interpolate_chs_reverse(v_arr.data(), v_arr.size(), c->tangent2, key.tangent1, 0, _df);
interpolate_chs_reverse(v_arr.data(), v_arr.size(), key.tangent2, n->tangent1, _df, df);
interpolate_chs_reverse(v_arr.data(), v_arr.size(), c->r_slope, key.l_slope, 0, _df);
interpolate_chs_reverse(v_arr.data(), v_arr.size(), key.r_slope, n->l_slope, _df, df);
} break;
}
keys->insert(keys->begin() + ++pos, key);
@@ -5939,18 +5939,18 @@ static void glitter_editor_curve_editor_window(GlitterEditor* glt_edt) {
int32_t df_n = n->frame - i->frame;
std::vector<double_t> v_arr_c = interpolate_chs(c->value,
i->value, c->tangent2, i->tangent1, 0, df_c);
i->value, c->r_slope, i->l_slope, 0, df_c);
std::vector<double_t> v_arr_n = i->type == Glitter::KEY_HERMITE
? interpolate_chs(i->value, n->value, i->tangent2, n->tangent1, 0, df_n)
? interpolate_chs(i->value, n->value, i->r_slope, n->l_slope, 0, df_n)
: interpolate_linear(i->value, n->value, 0, df_n);
size_t v_length = v_arr_c.size() + v_arr_n.size() - 1;
double_t* v_arr = new double_t[v_length];
memmove(v_arr, v_arr_c.data(), (v_arr_c.size() - 1) * sizeof(*v_arr));
memmove(v_arr + (v_arr_c.size() - 1), v_arr_n.data(), v_arr_n.size() * sizeof(*v_arr));
interpolate_chs_reverse(v_arr, v_length, c->tangent2,
n->tangent1, 0, (size_t)n->frame - c->frame);
interpolate_chs_reverse(v_arr, v_length, c->r_slope,
n->l_slope, 0, (size_t)n->frame - c->frame);
delete[] v_arr;
}
keys->erase(keys->begin() + (i - i_begin));
@@ -6524,70 +6524,70 @@ static void glitter_editor_curve_editor_window(GlitterEditor* glt_edt) {
}
if (i - i_begin > 0 && (i - 1)->type == Glitter::KEY_HERMITE) {
double_t tangent1 = i->tangent1;
double_t l_slope = i->l_slope;
ImVec2 circle_pos;
circle_pos.x = x - 25.0f;
circle_pos.y = y - base_line + convert_value_to_height(crv_edt,
(float_t)tangent1, canvas_pos.y, canvas_size.y, min, max);
(float_t)l_slope, canvas_pos.y, canvas_size.y, min, max);
draw_list->AddLine({ x, y }, circle_pos, default_color, 1.5f);
if ((circle_pos.x >= p3.x - 10.0f && circle_pos.x <= p3.x + canvas_size.x + 10.0f)
&& (circle_pos.y >= p3.y - 10.0f && circle_pos.y <= p3.y + canvas_size.y + 10.0f)) {
ImGui::SetCursorScreenPos({ circle_pos.x - 7.5f, circle_pos.y - 7.5f });
ImGui::InvisibleButton("tan1", { 15.0f, 15.0f }, 0);
ImGui::InvisibleButton("l slope", { 15.0f, 15.0f }, 0);
ImU32 tangent1_color;
ImU32 l_slope_color;
if (can_drag && ImGui::IsItemActive()) {
if (ImGui::IsMouseDragging(ImGuiMouseButton_Left)) {
i->tangent1 = convert_height_to_value(crv_edt,
i->l_slope = convert_height_to_value(crv_edt,
circle_pos.y + io.MouseDelta.y - y + base_line,
canvas_pos.y, canvas_size.y, min, max);
if (i->tangent1 != tangent1)
if (i->l_slope != l_slope)
changed = true;
}
holding_tan = true;
tangent1_color = selected_color;
l_slope_color = selected_color;
}
else
tangent1_color = default_color;
l_slope_color = default_color;
draw_list->AddCircleFilled(circle_pos,
crv_edt->key_radius_in, tangent1_color, 12);
crv_edt->key_radius_in, l_slope_color, 12);
}
}
if (i_end - i > 1 && i->type == Glitter::KEY_HERMITE) {
double_t tangent2 = i->tangent2;
double_t r_slope = i->r_slope;
ImVec2 circle_pos;
circle_pos.x = x + 25.0f;
circle_pos.y = y - base_line + convert_value_to_height(crv_edt,
(float_t)tangent2, canvas_pos.y, canvas_size.y, min, max);
(float_t)r_slope, canvas_pos.y, canvas_size.y, min, max);
draw_list->AddLine({ x, y }, circle_pos, default_color, 1.5f);
if ((circle_pos.x >= p3.x - 10.0f && circle_pos.x <= p3.x + canvas_size.x + 10.0f)
&& (circle_pos.y >= p3.y - 10.0f && circle_pos.y <= p3.y + canvas_size.y + 10.0f)) {
ImGui::SetCursorScreenPos({ circle_pos.x - 7.5f, circle_pos.y - 7.5f });
ImGui::InvisibleButton("tan2", { 15.0f, 15.0f }, 0);
ImGui::InvisibleButton("r slope", { 15.0f, 15.0f }, 0);
ImU32 tangent2_color;
ImU32 r_slope_color;
if (can_drag && ImGui::IsItemActive()) {
if (ImGui::IsMouseDragging(ImGuiMouseButton_Left)) {
i->tangent2 = convert_height_to_value(crv_edt,
i->r_slope = convert_height_to_value(crv_edt,
circle_pos.y + io.MouseDelta.y - y + base_line,
canvas_pos.y, canvas_size.y, min, max);
if (i->tangent2 != tangent2)
if (i->r_slope != r_slope)
changed = true;
}
holding_tan = true;
tangent2_color = selected_color;
r_slope_color = selected_color;
}
else
tangent2_color = default_color;
r_slope_color = default_color;
draw_list->AddCircleFilled(circle_pos,
crv_edt->key_radius_in, tangent2_color, 12);
crv_edt->key_radius_in, r_slope_color, 12);
}
}
@@ -6813,7 +6813,7 @@ static void glitter_editor_curve_editor_window_draw(GlitterEditor* glt_edt, cons
break;
case Glitter::KEY_HERMITE:
value = Glitter::Curve::InterpolateHermite(c_value_vec, n_value_vec - c_value_vec,
vec3((float_t)c->tangent2), vec3((float_t)n->tangent1),
vec3((float_t)c->r_slope), vec3((float_t)n->l_slope),
vec3((float_t)c->frame), vec3((float_t)n->frame), vec3((float_t)start_time));
break;
}
@@ -6862,7 +6862,7 @@ static void glitter_editor_curve_editor_window_draw(GlitterEditor* glt_edt, cons
break;
case Glitter::KEY_HERMITE:
value = Glitter::Curve::InterpolateHermite(c_value_vec, n_value_vec - c_value_vec,
vec3((float_t)c->tangent2), vec3((float_t)n->tangent1),
vec3((float_t)c->r_slope), vec3((float_t)n->l_slope),
vec3((float_t)c->frame), vec3((float_t)n->frame), vec3((float_t)end_time));
break;
}
@@ -6948,8 +6948,8 @@ static void glitter_editor_curve_editor_window_draw(GlitterEditor* glt_edt, cons
case Glitter::KEY_HERMITE: {
const float_t c_frame = (float_t)c->frame;
const float_t n_frame = (float_t)n->frame;
const float_t c_tangent2 = (float_t)c->tangent2;
const float_t n_tangent1 = (float_t)n->tangent1;
const float_t c_r_slope = (float_t)c->r_slope;
const float_t n_l_slope = (float_t)n->l_slope;
const vec3 c_frame_vec = c_frame;
const vec3 n_frame_vec = n_frame;
@@ -6957,8 +6957,8 @@ static void glitter_editor_curve_editor_window_draw(GlitterEditor* glt_edt, cons
(float_t)c_value, (float_t)(c_value - c_random_range) };
const vec3 n_value_vec = { (float_t)(n_value + n_random_range),
(float_t)n_value, (float_t)(n_value - n_random_range) };
const vec3 c_tangent2_vec = c_tangent2;
const vec3 n_tangent1_vec = n_tangent1;
const vec3 c_r_slope_vec = c_r_slope;
const vec3 n_l_slope_vec = n_l_slope;
const int32_t frame_width_int = (int32_t)prj::roundf(frame_width);
for (int32_t j = c->frame; j < n->frame; j++) {
if (j < start_time)
@@ -6971,7 +6971,7 @@ static void glitter_editor_curve_editor_window_draw(GlitterEditor* glt_edt, cons
const vec3 frame_vec = frame;
const vec3 value = Glitter::Curve::InterpolateHermite(c_value_vec, n_value_vec - c_value_vec,
c_tangent2_vec, n_tangent1_vec, c_frame_vec, n_frame_vec, frame_vec);
c_r_slope_vec, n_l_slope_vec, c_frame_vec, n_frame_vec, frame_vec);
const vec3 random = !random_range_mult
? random_range : glt_type_ft
? (random_range * value) : (random_range * value * 0.01f);
@@ -7019,7 +7019,7 @@ static void glitter_editor_curve_editor_window_draw(GlitterEditor* glt_edt, cons
break;
case Glitter::KEY_HERMITE:
value = Glitter::Curve::InterpolateHermite(c_value, n_value - c_value,
(double_t)c->tangent2, (double_t)n->tangent1,
(double_t)c->r_slope, (double_t)n->l_slope,
(double_t)c->frame, (double_t)n->frame, (double_t)start_time);
break;
}
@@ -7062,7 +7062,7 @@ static void glitter_editor_curve_editor_window_draw(GlitterEditor* glt_edt, cons
break;
case Glitter::KEY_HERMITE:
value = Glitter::Curve::InterpolateHermite(c_value, n_value - c_value,
(double_t)c->tangent2, (double_t)n->tangent1,
(double_t)c->r_slope, (double_t)n->l_slope,
(double_t)c->frame, (double_t)n->frame, (double_t)end_time);
break;
}
@@ -7142,11 +7142,11 @@ static void glitter_editor_curve_editor_window_draw(GlitterEditor* glt_edt, cons
else if (c->type == Glitter::KEY_HERMITE) {
const double_t c_frame = (double_t)c->frame;
const double_t n_frame = (double_t)n->frame;
const double_t c_tangent2 = c->tangent2;
const double_t n_tangent1 = n->tangent1;
const double_t c_r_slope = c->r_slope;
const double_t n_l_slope = n->l_slope;
double_t value = Glitter::Curve::InterpolateHermite(c_value, n_value - c_value,
c_tangent2, n_tangent1,
c_r_slope, n_l_slope,
c_frame, n_frame, (double_t)max_def(c->frame, start_time));
float_t x = canvas_pos.x + (float_t)(max_def(c->frame, start_time)
- base_start_time) * frame_width;
@@ -7164,7 +7164,7 @@ static void glitter_editor_curve_editor_window_draw(GlitterEditor* glt_edt, cons
for (int32_t k = 0; k < frame_width_int; k++) {
const double_t value = Glitter::Curve::InterpolateHermite(c_value, n_value - c_value,
c_tangent2, n_tangent1, c_frame, n_frame, (double_t)j + (double_t)k / frame_width);
c_r_slope, n_l_slope, c_frame, n_frame, (double_t)j + (double_t)k / frame_width);
float_t x = canvas_pos.x
+ (float_t)(j - base_start_time) * frame_width + (float_t)k;
+15 -13
View File
@@ -28,42 +28,44 @@ dft_dsc_data::~dft_dsc_data() {
}
static bool a3da_to_dof_data(const char* a3da_path, dft_dsc_data& data) {
a3da cam_a3da_file;
a3da::load_file(&cam_a3da_file, "DOF\\auth_3d\\", a3da_path, 0);
auth_3d_detail::SceneFile file;
a3d::Scene::load_file(&file.prop, "DOF\\auth_3d\\", a3da_path, 0);
if (!cam_a3da_file.dof.has_dof) {
if (!file.prop.dof.has_dof) {
data.frames = 0;
return false;
}
auth_3d cam_a3da;
cam_a3da.load(&cam_a3da_file, 0, 0);
auth_3d_detail::Scene scene;
scene.M_loadFromProperties(file, 0, 0);
data.frames = (int32_t)cam_a3da.play_control.size;
data.frames = (int32_t)scene.play_control.size;
data.dof.data.reserve(data.frames + 1ULL);
data.dof_index.reserve(data.frames);
data.dof.data.push_back({ (dof_flags)0, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f });
auth_3d_camera_root* cr = &cam_a3da.camera_root[0];
auth_3d_detail::CameraRoot& cr = scene.camera_root_list[0];
for (int32_t i = 0; i < data.frames; i++) {
cam_a3da.dof.model_transform.interpolate((float_t)i);
bool enable = fabsf(cam_a3da.dof.model_transform.rotation_value.z) > 0.000001f;
cr.view_point.model_transform.get((float_t)i);
scene.dof.get((float_t)i);
bool enable = fabsf(scene.dof.model_transform.rotation.z) > 0.000001f;
if (!enable) {
data.dof_index.push_back(0);
continue;
}
float_t focus = vec3::distance(cam_a3da.dof.model_transform.translation_value, cr->view_point_value);
float_t focus = vec3::distance(scene.dof.model_transform.translation,
cr.view_point.model_transform.translation);
dof_data d;
d.flags = (dof_flags)(DOF_QUALITY | DOF_RATIO | DOF_FUZZING_RANGE | DOF_FOCUS_RANGE | DOF_FOCUS);
d.focus = focus;
d.focus_range = cam_a3da.dof.model_transform.scale_value.x;
d.fuzzing_range = cam_a3da.dof.model_transform.rotation_value.x;
d.ratio = cam_a3da.dof.model_transform.rotation_value.y;
d.focus_range = scene.dof.model_transform.scale.x;
d.fuzzing_range = scene.dof.model_transform.rotation.x;
d.ratio = scene.dof.model_transform.rotation.y;
d.quality = 1.0f;
bool found = false;
@@ -10,6 +10,7 @@
#include "../../CRE/rob/rob.hpp"
#include "../../CRE/auth_3d.hpp"
#include "../../CRE/data.hpp"
#include "../../CRE/debug_print.hpp"
struct auth_3d_to_mot_keys {
std::vector<float_t> x;
@@ -21,7 +22,7 @@ struct auth_3d_to_mot_keys {
};
struct auth_3d_to_mot_data {
auth_3d_id id;
auth_3d_detail::Handle id;
int32_t gblctr;
int32_t n_hara;
int32_t n_hara_y;
@@ -59,10 +60,10 @@ struct auth_3d_to_mot_data {
std::map<BONE_BLK, auth_3d_to_mot_keys> bone_keys;
std::map<BONE_BLK, auth_3d_to_mot_keys> sec_bone_keys;
auth_3d_to_mot_data(auth_3d_id id);
auth_3d_to_mot_data(auth_3d_detail::Handle id);
~auth_3d_to_mot_data();
void get_bone_indices(const auth_3d_object_hrc* oh);
void get_bone_indices(const auth_3d_detail::HierarchyObject* ho);
};
struct mot_data_bake;
@@ -103,7 +104,7 @@ struct effchrpv_auth_3d_to_mot {
const ROB_ID* rob_ids;
std::unordered_map<std::string, string_hash> auth_3d_mot_names;
std::map<uint32_t, auth_3d_id> auth_3d_mot_ids;
std::map<uint32_t, auth_3d_detail::Handle> auth_3d_mot_ids;
std::vector<int32_t> rob_mot_ids;
std::map<int32_t, auth_3d_to_mot_data> auth_3d_rob_mot_ids;
@@ -129,7 +130,7 @@ struct effchrpv_auth_3d_to_mot {
effchrpv_auth_3d_to_mot();
~effchrpv_auth_3d_to_mot();
void add_chara_effect_auth_3d(uint32_t hash, int32_t id);
void add_chara_effect_auth_3d(uint32_t hash, auth_3d_detail::Handle handle);
void add_file_name(const std::string& file, const std::string& category);
void disp();
void get_body_anim(int32_t frame, bool add_keys);
@@ -154,8 +155,8 @@ void effchrpv_auth_3d_to_mot_init(int32_t pv_id, const ROB_ID* rob_ids) {
effchr_a2m->bake.pv_id = pv_id;
}
void effchrpv_auth_3d_to_mot_add_chara_effect_auth_3d(uint32_t hash, int32_t id) {
effchr_a2m->add_chara_effect_auth_3d(hash, id);
void effchrpv_auth_3d_to_mot_add_chara_effect_auth_3d(uint32_t hash, auth_3d_detail::Handle handle) {
effchr_a2m->add_chara_effect_auth_3d(hash, handle);
}
void effchrpv_auth_3d_to_mot_add_file_name(const std::string& file, const std::string& category) {
@@ -204,8 +205,8 @@ auth_3d_to_mot_keys::~auth_3d_to_mot_keys() {
}
auth_3d_to_mot_data::auth_3d_to_mot_data(auth_3d_id id) : id(id), gblctr(-1), n_hara(-1), n_hara_y(-1),
j_hara_wj(-1), n_kosi(-1), j_mune_wj(-1), n_mune_kl(-1), j_mune_b_wj(-1), j_kubi_wj(-1),
auth_3d_to_mot_data::auth_3d_to_mot_data(auth_3d_detail::Handle id) : id(id), gblctr(-1), n_hara(-1),
n_hara_y(-1), j_hara_wj(-1), n_kosi(-1), j_mune_wj(-1), n_mune_kl(-1), j_mune_b_wj(-1), j_kubi_wj(-1),
n_kao(-1), j_kao_wj(-1), j_eye_r_wj(-1), j_eye_l_wj(-1), n_waki_l(-1), j_waki_l_wj(-1),
n_kata_l(-1), j_kata_l_wj(-1), j_ude_l_wj(-1), j_te_l_wj(-1), n_waki_r(-1),
j_waki_r_wj(-1), n_kata_r(-1), j_kata_r_wj(-1), j_ude_r_wj(-1), j_te_r_wj(-1),
@@ -217,49 +218,41 @@ auth_3d_to_mot_data::~auth_3d_to_mot_data() {
}
static int32_t get_bone_index(const auth_3d_object_hrc* oh, const char* name) {
uint32_t name_hash = hash_utf8_murmurhash(name);
for (const auth_3d_object_node& i : oh->node)
if (hash_string_murmurhash(i.name) == name_hash)
return (int32_t)(&i - oh->node.data());
return -1;
}
void auth_3d_to_mot_data::get_bone_indices(const auth_3d_object_hrc* oh) {
gblctr = get_bone_index(oh, "gblctr");
n_hara = get_bone_index(oh, "n_hara");
n_hara_y = get_bone_index(oh, "n_hara_y");
j_hara_wj = get_bone_index(oh, "j_hara_wj");
n_kosi = get_bone_index(oh, "n_kosi");
j_mune_wj = get_bone_index(oh, "j_mune_wj");
n_mune_kl = get_bone_index(oh, "n_mune_kl");
j_mune_b_wj = get_bone_index(oh, "j_mune_b_wj");
j_kubi_wj = get_bone_index(oh, "j_kubi_wj");
n_kao = get_bone_index(oh, "n_kao");
j_kao_wj = get_bone_index(oh, "j_kao_wj");
j_eye_r_wj = get_bone_index(oh, "j_eye_r_wj");
j_eye_l_wj = get_bone_index(oh, "j_eye_l_wj");
n_waki_l = get_bone_index(oh, "n_waki_l");
j_waki_l_wj = get_bone_index(oh, "j_waki_l_wj");
n_kata_l = get_bone_index(oh, "n_kata_l");
j_kata_l_wj = get_bone_index(oh, "j_kata_l_wj");
j_ude_l_wj = get_bone_index(oh, "j_ude_l_wj");
j_te_l_wj = get_bone_index(oh, "j_te_l_wj");
n_waki_r = get_bone_index(oh, "n_waki_r");
j_waki_r_wj = get_bone_index(oh, "j_waki_r_wj");
n_kata_r = get_bone_index(oh, "n_kata_r");
j_kata_r_wj = get_bone_index(oh, "j_kata_r_wj");
j_ude_r_wj = get_bone_index(oh, "j_ude_r_wj");
j_te_r_wj = get_bone_index(oh, "j_te_r_wj");
j_kosi_wj = get_bone_index(oh, "j_kosi_wj");
n_momo_l = get_bone_index(oh, "n_momo_l");
j_momo_l_wj = get_bone_index(oh, "j_momo_l_wj");
j_sune_l_wj = get_bone_index(oh, "j_sune_l_wj");
j_asi_l_wj = get_bone_index(oh, "j_asi_l_wj");
n_momo_r = get_bone_index(oh, "n_momo_r");
j_momo_r_wj = get_bone_index(oh, "j_momo_r_wj");
j_sune_r_wj = get_bone_index(oh, "j_sune_r_wj");
j_asi_r_wj = get_bone_index(oh, "j_asi_r_wj");
void auth_3d_to_mot_data::get_bone_indices(const auth_3d_detail::HierarchyObject* ho) {
gblctr = ho->query_node_index("gblctr");
n_hara = ho->query_node_index("n_hara");
n_hara_y = ho->query_node_index("n_hara_y");
j_hara_wj = ho->query_node_index("j_hara_wj");
n_kosi = ho->query_node_index("n_kosi");
j_mune_wj = ho->query_node_index("j_mune_wj");
n_mune_kl = ho->query_node_index("n_mune_kl");
j_mune_b_wj = ho->query_node_index("j_mune_b_wj");
j_kubi_wj = ho->query_node_index("j_kubi_wj");
n_kao = ho->query_node_index("n_kao");
j_kao_wj = ho->query_node_index("j_kao_wj");
j_eye_r_wj = ho->query_node_index("j_eye_r_wj");
j_eye_l_wj = ho->query_node_index("j_eye_l_wj");
n_waki_l = ho->query_node_index("n_waki_l");
j_waki_l_wj = ho->query_node_index("j_waki_l_wj");
n_kata_l = ho->query_node_index("n_kata_l");
j_kata_l_wj = ho->query_node_index("j_kata_l_wj");
j_ude_l_wj = ho->query_node_index("j_ude_l_wj");
j_te_l_wj = ho->query_node_index("j_te_l_wj");
n_waki_r = ho->query_node_index("n_waki_r");
j_waki_r_wj = ho->query_node_index("j_waki_r_wj");
n_kata_r = ho->query_node_index("n_kata_r");
j_kata_r_wj = ho->query_node_index("j_kata_r_wj");
j_ude_r_wj = ho->query_node_index("j_ude_r_wj");
j_te_r_wj = ho->query_node_index("j_te_r_wj");
j_kosi_wj = ho->query_node_index("j_kosi_wj");
n_momo_l = ho->query_node_index("n_momo_l");
j_momo_l_wj = ho->query_node_index("j_momo_l_wj");
j_sune_l_wj = ho->query_node_index("j_sune_l_wj");
j_asi_l_wj = ho->query_node_index("j_asi_l_wj");
n_momo_r = ho->query_node_index("n_momo_r");
j_momo_r_wj = ho->query_node_index("j_momo_r_wj");
j_sune_r_wj = ho->query_node_index("j_sune_r_wj");
j_asi_r_wj = ho->query_node_index("j_asi_r_wj");
}
mot_data_bake::mot_data_bake() : pv_id(), threads_count(4), set_info(),
@@ -371,8 +364,8 @@ effchrpv_auth_3d_to_mot::~effchrpv_auth_3d_to_mot() {
}
void effchrpv_auth_3d_to_mot::add_chara_effect_auth_3d(uint32_t hash, int32_t id) {
auth_3d_mot_ids.insert({ hash, id });
void effchrpv_auth_3d_to_mot::add_chara_effect_auth_3d(uint32_t hash, auth_3d_detail::Handle handle) {
auth_3d_mot_ids.insert({ hash, handle });
}
void effchrpv_auth_3d_to_mot::add_file_name(const std::string& file, const std::string& category) {
@@ -381,17 +374,17 @@ void effchrpv_auth_3d_to_mot::add_file_name(const std::string& file, const std::
void effchrpv_auth_3d_to_mot::disp() {
/*for (auto& i : auth_3d_rob_mot_ids) {
rob_chara* rob_chr = rob_chara_array_get(rob_ids[i.first]);
rob_chara* impl = get_rob_management()->get_rob(rob_ids[i.first]);
auth_3d_to_mot_data& a2m = i.second;
auth_3d* auth = a2m.id.get_auth_3d();
auth_3d_object_hrc* oh = &auth->object_hrc[0];
auth_3d_detail::Scene* scene = a2m.id.get_scene();
auth_3d_detail::HierarchyObject* ho = &scene->object_hrc[0];
mat4 mat;
mat = oh->node[a2m.j_mune_wj].model_transform.mat;
mat = ho->node_list[a2m.j_mune_wj].motion_transform.matrix;
mat4_scale_rot(&mat, 0.1f, &mat);
debug_put_line_axis(mat);
mat = oh->node[a2m.j_kao_wj].model_transform.mat;
mat = ho->node_list[a2m.j_kao_wj].motion_transform.matrix;
mat4_scale_rot(&mat, 0.1f, &mat);
debug_put_line_axis(mat);
}*/
@@ -535,7 +528,7 @@ static void set_bone_key_set_ik_target_data(auth_3d_to_mot_data& a2m, const mat4
blk, curr_block_id, motion_body_type, fck, data, 2);
}
static void set_bone_key_set_arm_ik_target_data(auth_3d_to_mot_data& a2m, auth_3d_object_hrc* oh,
static void set_bone_key_set_arm_ik_target_data(auth_3d_to_mot_data& a2m, auth_3d_detail::HierarchyObject* ho,
const mat4& kata_mat, const mat4& ude_mat, const mat4& te_mat,
const vec3 c_kata_rotation, RobBlock* block_top, FcurveKey* fck, bool add_keys,
BONE_BLK tl_up_kata_index, BONE_BLK c_kata_index,
@@ -579,22 +572,22 @@ void effchrpv_auth_3d_to_mot::get_body_anim(int32_t frame, bool add_keys) {
static bool disable_cl_momo_rot[3] = { false, false, true };
for (auto& i : auth_3d_rob_mot_ids) {
rob_chara* rob_chr = get_rob_management()->get_rob(rob_ids[i.first]);
rob_chara* impl = get_rob_management()->get_rob(rob_ids[i.first]);
auth_3d_to_mot_data& a2m = i.second;
auth_3d* auth = a2m.id.get_auth_3d();
auth_3d_object_hrc* oh = &auth->object_hrc[0];
auth_3d_detail::Scene* scene = a2m.id.get_scene();
auth_3d_detail::HierarchyObject* ho = &scene->object_hrc_holder[0];
float_t auth_frame = auth->frame;
bool auth_frame_changed = auth->frame_changed;
bool auth_paused = auth->paused;
auth->frame = (float_t)frame;
auth->frame_changed = false;
auth->paused = true;
auth->ctrl(rctx_ptr);
float_t auth_frame = scene->M_frame;
bool auth_is_requested_frame = scene->is_requested_frame;
bool auth_paused = scene->now_pause;
scene->M_frame = (float_t)frame;
scene->is_requested_frame = false;
scene->now_pause = true;
scene->ctrl(rctx_ptr);
rob_chr->set_disp_flag(oh->node[0].model_transform.visible);
impl->set_disp_flag(ho->node_list[0].motion_transform.visibility);
motion_blend_mot* mot = rob_chr->bone_data->motion_loaded.front();
motion_blend_mot* mot = impl->bone_data->motion_loaded.front();
RobBlock* block_top = mot->bone_data.block_vec.data();
FcurveKey* fck = mot->mot_key_data.mot.fck_ptr;
int32_t curr_block_id = 0;
@@ -602,44 +595,44 @@ void effchrpv_auth_3d_to_mot::get_body_anim(int32_t frame, bool add_keys) {
vec3 data[2];
data[0] = 0.0f;
data[1] = oh->node[a2m.gblctr].model_transform.rotation_value;
data[1] = ho->node_list[a2m.gblctr].motion_transform.rotation;
set_bone_key_set_global_data(a2m.bone_keys, a2m.sec_bone_keys, add_keys,
mot, fck, data, 2);
data[0] = oh->node[a2m.gblctr].model_transform.translation_value;
data[0] += oh->node[a2m.n_hara].model_transform.translation_value;
data[1] = oh->node[a2m.n_hara].model_transform.rotation_value;
data[0] = ho->node_list[a2m.gblctr].motion_transform.translation;
data[0] += ho->node_list[a2m.n_hara].motion_transform.translation;
data[1] = ho->node_list[a2m.n_hara].motion_transform.rotation;
set_bone_key_set_data(block_top, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_N_HARA_CP, curr_block_id, motion_body_type, fck, data, 2);
data[0] = oh->node[a2m.n_hara_y].model_transform.rotation_value;
data[0] = ho->node_list[a2m.n_hara_y].motion_transform.rotation;
set_bone_key_set_data(block_top, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_KG_HARA_Y, curr_block_id, motion_body_type, fck, data);
data[0] = oh->node[a2m.j_hara_wj].model_transform.rotation_value;
data[0] = ho->node_list[a2m.j_hara_wj].motion_transform.rotation;
set_bone_key_set_data(block_top, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_KL_HARA_XZ, curr_block_id, motion_body_type, fck, data);
data[0] = oh->node[a2m.n_kosi].model_transform.rotation_value;
data[0] = ho->node_list[a2m.n_kosi].motion_transform.rotation;
set_bone_key_set_data(block_top, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_N_HARA, curr_block_id, motion_body_type, fck, data);
/*data[0] = { 0.0f, 0.945f, 0.0f };
mat4_transform_point(&oh->node[a2m.j_mune_wj].model_transform.mat, &data[0], &data[0]);
mat4_transform_point(&ho->node_list[a2m.j_mune_wj].motion_transform.matrix, &data[0], &data[0]);
data[1] = 0.0f;
set_bone_key_set_data(block_top, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_CL_MUNE, curr_block_id, motion_body_type, fck, data, 2);*/
set_bone_key_set_ik_target_data(a2m, oh->node[a2m.j_mune_wj].model_transform.mat,
oh->node[a2m.j_mune_wj].model_transform.rotation_value, block_top, fck, add_keys,
set_bone_key_set_ik_target_data(a2m, ho->node_list[a2m.j_mune_wj].motion_transform.matrix,
ho->node_list[a2m.j_mune_wj].motion_transform.rotation, block_top, fck, add_keys,
BLK_CL_MUNE, curr_block_id, motion_body_type,
{ 0.0f, 0.945f, 0.0f }, n_mune_b_src, n_mune_b_dst, disable_cl_mune_rot);
data[0] = oh->node[a2m.j_mune_b_wj].model_transform.rotation_value;
data[0] = ho->node_list[a2m.j_mune_b_wj].motion_transform.rotation;
set_bone_key_set_data(block_top, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_KL_MUNE_B_WJ, curr_block_id, motion_body_type, fck, data);
data[0] = oh->node[a2m.j_kubi_wj].model_transform.rotation_value;
data[0] = ho->node_list[a2m.j_kubi_wj].motion_transform.rotation;
set_bone_key_set_data(block_top, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_KL_KUBI, curr_block_id, motion_body_type, fck, data);
@@ -648,21 +641,21 @@ void effchrpv_auth_3d_to_mot::get_body_anim(int32_t frame, bool add_keys) {
BLK_N_KAO, curr_block_id, motion_body_type, fck, data);
/*data[0] = { 0.0f, 0.34f, 0.0f };
mat4_transform_point(&oh->node[a2m.j_kao_wj].model_transform.mat, &data[0], &data[0]);
data[1] = oh->node[a2m.j_kao_wj].model_transform.rotation_value;
mat4_transform_point(&ho->node_list[a2m.j_kao_wj].motion_transform.matrix, &data[0], &data[0]);
data[1] = ho->node_list[a2m.j_kao_wj].motion_transform.rotation;
//data[1].x = -data[1].x;
//data[1].z = -data[1].z;
//data[1] = 0.0f;
set_bone_key_set_data(block_top, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_CL_KAO, curr_block_id, motion_body_type, fck, data, 2);*/
set_bone_key_set_ik_target_data(a2m, oh->node[a2m.j_kao_wj].model_transform.mat,
oh->node[a2m.j_kao_wj].model_transform.rotation_value, block_top, fck, add_keys,
set_bone_key_set_ik_target_data(a2m, ho->node_list[a2m.j_kao_wj].motion_transform.matrix,
ho->node_list[a2m.j_kao_wj].motion_transform.rotation, block_top, fck, add_keys,
BLK_CL_KAO, curr_block_id, motion_body_type,
{ 0.0f, 0.34f, 0.0f }, n_kao_src, n_kao_dst, disable_cl_kao_rot);
if (a2m.j_eye_r_wj != -1) {
data[0] = oh->node[a2m.j_eye_r_wj].model_transform.rotation_value;
data[0] = ho->node_list[a2m.j_eye_r_wj].motion_transform.rotation;
data[0].x += (float_t)(M_PI / 2.0);
data[0].y = -data[0].z;
data[0].z = 0.0f;
@@ -671,7 +664,7 @@ void effchrpv_auth_3d_to_mot::get_body_anim(int32_t frame, bool add_keys) {
}
if (a2m.j_eye_l_wj != -1) {
data[0] = oh->node[a2m.j_eye_l_wj].model_transform.rotation_value;
data[0] = ho->node_list[a2m.j_eye_l_wj].motion_transform.rotation;
data[0].x += (float_t)(M_PI / 2.0);
data[0].y = -data[0].z;
data[0].z = 0.0f;
@@ -679,91 +672,91 @@ void effchrpv_auth_3d_to_mot::get_body_anim(int32_t frame, bool add_keys) {
BLK_KL_EYE_L, curr_block_id, motion_body_type, fck, data);
}
data[0] = oh->node[a2m.n_waki_l].model_transform.rotation_value;
data[0] = ho->node_list[a2m.n_waki_l].motion_transform.rotation;
set_bone_key_set_data(block_top, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_N_WAKI_L, curr_block_id, motion_body_type, fck, data);
data[0] = oh->node[a2m.j_waki_l_wj].model_transform.rotation_value;
data[0] = ho->node_list[a2m.j_waki_l_wj].motion_transform.rotation;
set_bone_key_set_data(block_top, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_KL_WAKI_L_WJ, curr_block_id, motion_body_type, fck, data);
set_bone_key_set_arm_ik_target_data(a2m, oh,
oh->node[a2m.j_kata_l_wj].model_transform.mat,
oh->node[a2m.j_ude_l_wj].model_transform.mat,
oh->node[a2m.j_te_l_wj].model_transform.mat,
set_bone_key_set_arm_ik_target_data(a2m, ho,
ho->node_list[a2m.j_kata_l_wj].motion_transform.matrix,
ho->node_list[a2m.j_ude_l_wj].motion_transform.matrix,
ho->node_list[a2m.j_te_l_wj].motion_transform.matrix,
{ -(float_t)(M_PI / 2.0), -(float_t)(M_PI / 2.0), -(float_t)(M_PI / 2.0) },
block_top, fck, add_keys, BLK_TL_UP_KATA_L, BLK_C_KATA_L,
curr_block_id, motion_body_type);
data[0] = oh->node[a2m.j_te_l_wj].model_transform.rotation_value;
data[0] = ho->node_list[a2m.j_te_l_wj].motion_transform.rotation;
set_bone_key_set_data(block_top, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_KL_TE_L_WJ, curr_block_id, motion_body_type, fck, data);
data[0] = oh->node[a2m.n_waki_r].model_transform.rotation_value;
data[0] = ho->node_list[a2m.n_waki_r].motion_transform.rotation;
set_bone_key_set_data(block_top, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_N_WAKI_R, curr_block_id, motion_body_type, fck, data);
data[0] = oh->node[a2m.j_waki_r_wj].model_transform.rotation_value;
data[0] = ho->node_list[a2m.j_waki_r_wj].motion_transform.rotation;
set_bone_key_set_data(block_top, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_KL_WAKI_R_WJ, curr_block_id, motion_body_type, fck, data);
set_bone_key_set_arm_ik_target_data(a2m, oh,
oh->node[a2m.j_kata_r_wj].model_transform.mat,
oh->node[a2m.j_ude_r_wj].model_transform.mat,
oh->node[a2m.j_te_r_wj].model_transform.mat,
set_bone_key_set_arm_ik_target_data(a2m, ho,
ho->node_list[a2m.j_kata_r_wj].motion_transform.matrix,
ho->node_list[a2m.j_ude_r_wj].motion_transform.matrix,
ho->node_list[a2m.j_te_r_wj].motion_transform.matrix,
{ -(float_t)(M_PI / 2.0), (float_t)(M_PI / 2.0), (float_t)(M_PI / 2.0) },
block_top, fck, add_keys, BLK_TL_UP_KATA_R, BLK_C_KATA_R,
curr_block_id, motion_body_type);
data[0] = oh->node[a2m.j_te_r_wj].model_transform.rotation_value;
data[0] = ho->node_list[a2m.j_te_r_wj].motion_transform.rotation;
set_bone_key_set_data(block_top, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_KL_TE_R_WJ, curr_block_id, motion_body_type, fck, data);
data[0] = oh->node[a2m.j_kosi_wj].model_transform.rotation_value;
data[0] = ho->node_list[a2m.j_kosi_wj].motion_transform.rotation;
set_bone_key_set_data(block_top, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_KL_KOSI_XZ, curr_block_id, motion_body_type, fck, data);
/*mat4_get_translation(&oh->node[a2m.j_asi_l_wj].model_transform.mat, &data[0]);
/*mat4_get_translation(&ho->node_list[a2m.j_asi_l_wj].motion_transform.matrix, &data[0]);
data[0].y -= 0.033f;
if (data[0].y < 0.103f)
data[0].y = 0.103f;
data[1] = oh->node[a2m.j_momo_l_wj].model_transform.rotation_value;
data[1] = ho->node_list[a2m.j_momo_l_wj].motion_transform.rotation;
data[1].z -= (float_t)(M_PI / 2.0);
set_bone_key_set_data(block_top, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_CL_MOMO_L, curr_block_id, motion_body_type, fck, data, 2);*/
mat4_get_translation(&oh->node[a2m.j_asi_l_wj].model_transform.mat, &data[0]);
mat4_get_translation(&ho->node_list[a2m.j_asi_l_wj].motion_transform.matrix, &data[0]);
data[0].y -= 0.033f;
if (data[0].y < 0.103f)
data[0].y = 0.103f;
set_bone_key_set_ik_target_data(a2m, oh->node[a2m.j_momo_l_wj].model_transform.mat,
oh->node[a2m.j_momo_l_wj].model_transform.rotation_value, block_top, fck, add_keys,
set_bone_key_set_ik_target_data(a2m, ho->node_list[a2m.j_momo_l_wj].motion_transform.matrix,
ho->node_list[a2m.j_momo_l_wj].motion_transform.rotation, block_top, fck, add_keys,
BLK_CL_MOMO_L, curr_block_id, motion_body_type,
data[0], n_momo_l_src, cl_momo_l_dst, disable_cl_momo_rot, false);
/*mat4_get_translation(&oh->node[a2m.j_asi_r_wj].model_transform.mat, &data[0]);
/*mat4_get_translation(&ho->node_list[a2m.j_asi_r_wj].motion_transform.matrix, &data[0]);
data[0].y -= 0.033f;
if (data[0].y < 0.103f)
data[0].y = 0.103f;
data[1] = oh->node[a2m.j_momo_r_wj].model_transform.rotation_value;
data[1] = ho->node_list[a2m.j_momo_r_wj].motion_transform.rotation;
data[1].z -= (float_t)(M_PI / 2.0);
set_bone_key_set_data(block_top, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_CL_MOMO_R, curr_block_id, motion_body_type, fck, data, 2);*/
mat4_get_translation(&oh->node[a2m.j_asi_r_wj].model_transform.mat, &data[0]);
mat4_get_translation(&ho->node_list[a2m.j_asi_r_wj].motion_transform.matrix, &data[0]);
data[0].y -= 0.033f;
if (data[0].y < 0.103f)
data[0].y = 0.103f;
set_bone_key_set_ik_target_data(a2m, oh->node[a2m.j_momo_r_wj].model_transform.mat,
oh->node[a2m.j_momo_r_wj].model_transform.rotation_value, block_top, fck, add_keys,
set_bone_key_set_ik_target_data(a2m, ho->node_list[a2m.j_momo_r_wj].motion_transform.matrix,
ho->node_list[a2m.j_momo_r_wj].motion_transform.rotation, block_top, fck, add_keys,
BLK_CL_MOMO_R, curr_block_id, motion_body_type,
data[0], n_momo_r_src, cl_momo_r_dst, disable_cl_momo_rot, false);
data[0] = oh->node[a2m.j_asi_l_wj].model_transform.rotation_value;
data[0] = ho->node_list[a2m.j_asi_l_wj].motion_transform.rotation;
set_bone_key_set_data(block_top, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_KL_ASI_L_WJ_CO, curr_block_id, motion_body_type, fck, data);
data[0] = oh->node[a2m.j_asi_r_wj].model_transform.rotation_value;
data[0] = ho->node_list[a2m.j_asi_r_wj].motion_transform.rotation;
set_bone_key_set_data(block_top, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_KL_ASI_R_WJ_CO, curr_block_id, motion_body_type, fck, data);
@@ -775,18 +768,18 @@ void effchrpv_auth_3d_to_mot::get_body_anim(int32_t frame, bool add_keys) {
set_bone_key_set_data(block_top, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_N_KUBI_WJ_EX, curr_block_id, motion_body_type, fck, data);
//auth->frame = auth_frame;
//auth->frame_changed = auth_frame_changed;
//auth->paused = auth_paused;
//scene->M_frame = auth_frame;
//scene->is_requested_frame = auth_is_requested_frame;
//scene->now_pause = auth_now_pause;
}
}
void effchrpv_auth_3d_to_mot::get_hand_anim(int32_t frame) {
for (auto& i : auth_3d_rob_mot_ids) {
rob_chara* rob_chr = get_rob_management()->get_rob(rob_ids[i.first]);
rob_chara* impl = get_rob_management()->get_rob(rob_ids[i.first]);
auth_3d_to_mot_data& a2m = i.second;
rob_chara_bone_data* rob_bone_data = rob_chr->bone_data;
rob_chara_bone_data* rob_bone_data = impl->bone_data;
BONE_KIND kind = rob_bone_data->kind;
motion_blend_mot* mot = rob_bone_data->motion_loaded.front();
@@ -829,11 +822,11 @@ void effchrpv_auth_3d_to_mot::load(int32_t frame) {
char buf[0x100];
sprintf_s(buf, sizeof(buf), "PV826_OST_P%d_00", i + 1);
uint32_t motion_id = aft_mot_db->get_motion_id(buf);
rob_chara* rob_chr = get_rob_management()->get_rob(rob_ids[i]);
rob_chr->replace_rob_motion(motion_id, 0.0f,
rob_chara* impl = get_rob_management()->get_rob(rob_ids[i]);
impl->replace_rob_motion(motion_id, 0.0f,
0.0f, false, false, MOTION_BLEND_CROSS, aft_bone_data, aft_mot_db);
rob_chr->set_motion_reset_data(motion_id, 0.0f);
rob_chr->set_motion_skin_param(motion_id, 0.0f);
impl->set_motion_reset_data(motion_id, 0.0f);
impl->set_motion_skin_param(motion_id, 0.0f);
sprintf_s(buf, sizeof(buf), "A3D_EFFCHRPV%03dMIK%03d", pv_id, i);
uint32_t hash = hash_utf8_murmurhash(buf);
@@ -847,18 +840,18 @@ void effchrpv_auth_3d_to_mot::load(int32_t frame) {
for (auto& i : auth_3d_rob_mot_ids) {
auth_3d_to_mot_data& a2m = i.second;
auth_3d* auth = a2m.id.get_auth_3d();
a2m.get_bone_indices(&auth->object_hrc[0]);
auth_3d_detail::Scene* scene = a2m.id.get_scene();
a2m.get_bone_indices(&scene->object_hrc_holder[0]);
}
for (auto& i : auth_3d_mot_ids) {
auth_3d_id& id = i.second;
id.set_repeat(false);
id.set_camera_root_update(false);
id.set_enable(true);
id.set_paused(false);
id.set_visibility(true);
id.set_req_frame(0.0f);
auth_3d_detail::Handle& id = i.second;
id.set_looped(false);
id.camera_set_enabled(false);
id.set_enabled(true);
id.set_pause(false);
id.set_visible(true);
id.set_frame_req(0.0f);
}
auto round_mat = [](mat4& mat) {
@@ -1022,7 +1015,7 @@ static mot_key_set_type mot_write_motion_fit_keys_into_curve(mot_data_bake* bake
memcpy(frames, _frames.data(), sizeof(uint16_t) * keys_count);
memcpy(values, _values.data(), sizeof(float_t) * keys_count);
break;
case MOT_KEY_SET_HERMITE_TANGENT:
case MOT_KEY_SET_HERMITE_SLOPE:
keys_count = _frames.size();
{
std::unique_lock<std::mutex> u_lock(*bake->alloc_mutex);
@@ -8,8 +8,12 @@
#include "../../KKdLib/default.hpp"
#include <string>
namespace auth_3d_detail {
class Handle;
}
extern void effchrpv_auth_3d_to_mot_init(int32_t pv_id, const enum ROB_ID* rob_ids);
extern void effchrpv_auth_3d_to_mot_add_chara_effect_auth_3d(uint32_t hash, int32_t id);
extern void effchrpv_auth_3d_to_mot_add_chara_effect_auth_3d(uint32_t hash, auth_3d_detail::Handle handle);
extern void effchrpv_auth_3d_to_mot_add_file_name(const std::string& file, const std::string& category);
extern void effchrpv_auth_3d_to_mot_disp();
extern void effchrpv_auth_3d_to_mot_get_body_anim(int32_t frame, bool add_keys);
+1 -1
View File
@@ -119,7 +119,7 @@ bool DtmAet::ctrl() {
comp_layers.clear();
aet_manager_get_scene_comp_layer_names(comp_layers, aet_id, aft_aet_db);
prj::sort_unique(comp_layers);
prj::sort_and_erase_non_unique(comp_layers);
auto i = comp_layers.begin();
auto i_end = comp_layers.end();
+81 -85
View File
@@ -291,7 +291,7 @@ public:
static void CategoryCharaMenuInit(dw::Button* button, dw::Menu*& menu,
std::vector<std::string>& items, dw::SelectionListener* selection_listener);
static void LeftRightReverseCallback(bool value);
static void ReverseSideCallback(bool value);
static void PosCallback(bool value);
static void RepeatCallback(bool value);
};
@@ -505,21 +505,21 @@ Auth3dTestTask::DataEventListener::~DataEventListener() {
}
void Auth3dTestTask::DataEventListener::OnLoad(::auth_3d_id& id) {
size_t chara_count = id.get_chara_count();
if (chara_count)
{
chara_count = min_def(chara_count, 2);
for (size_t i = 0; i < chara_count; i++) {
auth_3d_chara* chara = id.get_chara(i);
if (chara) {
CHARA_NUM chara_index = get_chara_num_from_char_id(chara->name.c_str());
void Auth3dTestTask::DataEventListener::loadFinished(auth_3d_detail::Handle& in_handle) {
size_t chara_size = in_handle.get_chara_size();
if (chara_size) {
chara_size = min_def(chara_size, 2);
for (size_t i = 0; i < chara_size; i++) {
const std::string* name = in_handle.chara_get_name(i);
if (name) {
CHARA_NUM chara_index = get_chara_num_from_char_id(name->c_str());
if (chara_index != CN_MAX) {
auth_3d_test_task->data_event_listener.data.chara_num[i ? 1 : 0] = chara_index;
auth_3d_test_task->data_event_listener.data.field_C = true;
id.set_chara_num(i, i ? 1 : 0);
in_handle.chara_bind_rob(i, i ? ROB_ID_2P : ROB_ID_1P);
auth_3d_test_window->rob_window->chara_list[i]->SetItemIndex(chara_index);
auth_3d_test_task->DispAuth3dChara(id);
auth_3d_test_task->DispAuth3dChara(in_handle);
}
}
}
@@ -530,14 +530,11 @@ void Auth3dTestTask::DataEventListener::OnLoad(::auth_3d_id& id) {
//auth_3d_test_task->LoadTransValue();
//auth_3d_test_task->LoadRotYValue();
auth_3d_test_window->frame_slider->SetValue(0.0f);
auth_3d_test_window->SetMaxFrame(id.get_play_control_size());
auth_3d_test_window->SetMaxFrame(in_handle.get_frame_size());
}
void Auth3dTestTask::DataEventListener::OnPostCtrl(::auth_3d_id& id) {
if (auth_3d_test_task->aet.id != -1) {
auth_3d_test_task->aet.Free();
auth_3d_test_task->aet.Init();
}
void Auth3dTestTask::DataEventListener::playLoopJumpAfter(auth_3d_detail::Handle& in_handle) {
auth_3d_test_task->aet_id_handle.put();
}
Auth3dTestTask::Auth3dTestTask::Window::Window() {
@@ -555,7 +552,7 @@ Auth3dTestTask::Auth3dTestTask() {
auth_3d_id = {};
auth_3d_uid = -1;
repeat = true;
mirror = false;
reverse_side = false;
pos = false;
snap_shot = false;
snap_shot_state = 0;
@@ -593,7 +590,7 @@ bool Auth3dTestTask::init() {
auth_3d_id = {};
auth_3d_uid = -1;
repeat = true;
mirror = false;
reverse_side = false;
pos = false;
snap_shot = false;
snap_shot_state = 0;
@@ -604,7 +601,7 @@ bool Auth3dTestTask::init() {
effcmn_obj_set = aft_obj_db->get_object_set_id("EFFCMN");
aet_state = 1;
aet_id = -1;
aet.Free();
aet_id_handle.destroy();
plane_above_floor = false;
stg_auth_display = true;
stg_display = true;
@@ -637,9 +634,8 @@ bool Auth3dTestTask::init() {
bool Auth3dTestTask::ctrl() {
const InputState* input_state = input_state_get(0);
if (auth_3d_test_task->auth_3d_id.check_not_empty() && input_state->CheckTapped(INPUT_BUTTON_0))
auth_3d_test_task->auth_3d_id.set_paused(
!auth_3d_test_task->auth_3d_id.get_paused());
if (auth_3d_test_task->auth_3d_id.is_valid() && input_state->CheckTapped(INPUT_BUTTON_0))
auth_3d_test_task->auth_3d_id.set_pause(!auth_3d_test_task->auth_3d_id.get_pause());
SetStage();
SetAuth3dId();
@@ -649,19 +645,19 @@ bool Auth3dTestTask::ctrl() {
if (effcmn_obj_set_state == 1 && !objset_info_storage_load_obj_set_check_not_read(effcmn_obj_set))
effcmn_obj_set_state = 4;
if (state == 1 && auth_3d_id.check_loaded())
if (state == 1 && auth_3d_id.load_is_done())
state = 2;
if (state == 2 && data_event_listener.data.state == 4 && !data_event_listener.data.field_C) {
auth_3d_id.set_enable(true);
auth_3d_id.set_paused(false);
auth_3d_id.set_repeat(auth_3d_test_task->repeat);
auth_3d_id.set_mirror(auth_3d_test_task->mirror);
auth_3d_id.set_pos(auth_3d_test_task->pos);
auth_3d_id.set_enabled(true);
auth_3d_id.set_pause(false);
auth_3d_id.set_looped(auth_3d_test_task->repeat);
auth_3d_id.set_reverse_side(auth_3d_test_task->reverse_side);
auth_3d_id.set_debug(auth_3d_test_task->pos ? 1 : 0);
state = 4;
}
if (auth_3d_id.check_not_empty()) {
if (auth_3d_id.is_valid()) {
float_t frame = auth_3d_id.get_frame();
if (auth_3d_test_window) {
auth_3d_test_window->frame_slider->SetValue(frame);
@@ -675,7 +671,7 @@ bool Auth3dTestTask::ctrl() {
mat4 mat;
mat4_translate(&trans_value, &mat);
mat4_mul_rotate_y(&mat, rot_y_value * DEG_TO_RAD_FLOAT, &mat);
auth_3d_id.set_mat(mat);
auth_3d_id.set_base_matrix(mat);
if (!snap_shot_state && ::snap_shot && snap_shot)
snap_shot_state = 1;
@@ -690,7 +686,7 @@ bool Auth3dTestTask::ctrl() {
data_struct* aft_data = &data_list[DATA_AFT];
auth_3d_database* aft_auth_3d_db = &aft_data->data_ft.auth_3d_db;
const char* name = auth_3d_data_get_uid_name(auth_3d_id.get_uid(), aft_auth_3d_db);
const char* name = auth_3d_detail::get_name_uid(auth_3d_id.get_uid(), aft_auth_3d_db);
std::string path(get_dev_ram_ss_dir());
path.append("/");
@@ -698,7 +694,7 @@ bool Auth3dTestTask::ctrl() {
//screen_shot_impl_ptr->capture_window_frame(path, auth_3d_id.get_frame());
if (auth_3d_id.get_ended())
if (auth_3d_id.is_finished())
snap_shot_state = 2;
}
}
@@ -708,8 +704,8 @@ bool Auth3dTestTask::ctrl() {
}
bool Auth3dTestTask::dest() {
aet.Free();
auth_3d_id.unload(rctx_ptr);
aet_id_handle.destroy();
auth_3d_id.destroy(rctx_ptr);
objset_info_storage_unload_set(effcmn_obj_set);
task_stage_close();
data_event_listener.data.dest();
@@ -717,7 +713,7 @@ bool Auth3dTestTask::dest() {
clear_color = color_black;
shadow_ptr_get()->self_shadow = true;
if (category.size())
auth_3d_data_unload_category(category.c_str());
auth_3d_detail::category_free(category.c_str());
category.clear();
category.shrink_to_fit();
load_category.clear();
@@ -734,9 +730,9 @@ void Auth3dTestTask::disp() {
debug_put_plane_zx(vec3(0.0f, 0.25f, 0.0f), 20.0f, 20.0f);
}
void Auth3dTestTask::DispAuth3dChara(::auth_3d_id& id) {
void Auth3dTestTask::DispAuth3dChara(auth_3d_detail::Handle& in_handle) {
RobManagement* rob_man = get_rob_management();
id.get_uid(); // ???
in_handle.get_uid(); // ???
RobDisp* rob_disp = rob_man->get_rob_robdisp_work(ROB_ID_1P);
if (!rob_disp)
return;
@@ -746,7 +742,7 @@ void Auth3dTestTask::DispAuth3dChara(::auth_3d_id& id) {
}
void Auth3dTestTask::DispChara() {
if (auth_3d_id.check_not_empty())
if (auth_3d_id.is_valid())
Auth3dTestTask::DispAuth3dChara(auth_3d_id);
}
@@ -757,18 +753,18 @@ void Auth3dTestTask::SetAuth3dId() {
if (load_category.compare(category)) {
if (category.size()) {
auth_3d_data_unload_category(category.c_str());
auth_3d_detail::category_free(category.c_str());
for (uint32_t& i : obj_sets)
objset_info_storage_unload_set(i);
obj_sets.clear();
}
auth_3d_data_load_category(load_category.c_str());
auth_3d_detail::category_load_req(load_category.c_str());
category.assign(load_category);
if (window.obj_link)
load_state = 1;
}
if (!auth_3d_data_check_category_loaded(category.c_str()))
if (!auth_3d_detail::category_load_is_done(category.c_str()))
return;
if (load_state == 1) {
@@ -799,12 +795,12 @@ void Auth3dTestTask::SetAuth3dId() {
data_event_listener.data.sub_140249A40(false);
data_event_listener.data.sub_140249A40(true);
auth_3d_id.unload(rctx_ptr);
auth_3d_id = ::auth_3d_id(auth_3d_uid, aft_auth_3d_db);
if (auth_3d_id.check_not_empty()) {
auth_3d_id.set_enable(false);
auth_3d_id.add_event_adapter(&data_event_listener);
auth_3d_id.read_file(aft_auth_3d_db);
auth_3d_id.destroy(rctx_ptr);
auth_3d_id = auth_3d_detail::Handle::create(auth_3d_uid, aft_auth_3d_db);
if (auth_3d_id.is_valid()) {
auth_3d_id.set_enabled(false);
auth_3d_id.add_event_listener(&data_event_listener);
auth_3d_id.load_req(aft_auth_3d_db);
state = 1;
}
auth_3d_uid = -1;
@@ -837,7 +833,7 @@ void Auth3dTestTask::SetStage() {
auth_3d_database* aft_auth_3d_db = &aft_data->data_ft.auth_3d_db;
stage_database* aft_stage_data = &aft_data->data_ft.stage_data;
const char* name = auth_3d_data_get_uid_name(auth_3d_uid, aft_auth_3d_db);
const char* name = auth_3d_detail::get_name_uid(auth_3d_uid, aft_auth_3d_db);
size_t name_length = utf8_length(name);
if (name && name_length >= 3) {
size_t v5 = name_length - 2;
@@ -980,7 +976,7 @@ void Auth3dTestRobWindow::SelectionListDispStyle::Callback(dw::SelectionListener
auth_3d_test_task->data_event_listener.data.cos_id[chara_id] = cos;
int32_t uid = auth_3d_test_task->auth_3d_id.get_uid();
auth_3d_test_task->auth_3d_id.unload(rctx_ptr);
auth_3d_test_task->auth_3d_id.destroy(rctx_ptr);
auth_3d_test_task->SetAuth3dUid(uid);
}
}
@@ -1253,10 +1249,10 @@ void Auth3dTestWindow::SelectionSliderFrame::Callback(dw::SelectionListener::Cal
dw::Slider* slider = dynamic_cast<dw::Slider*>(data->widget);
if (slider) {
Auth3dTestWindow* test_window = dynamic_cast<Auth3dTestWindow*>(slider->parent_shell);
if (test_window && auth_3d_test_task->auth_3d_id.check_not_empty()) {
auth_3d_test_task->auth_3d_id.set_paused(true);
if (test_window && auth_3d_test_task->auth_3d_id.is_valid()) {
auth_3d_test_task->auth_3d_id.set_pause(true);
test_window->UpdatePlayButton();
auth_3d_test_task->auth_3d_id.set_req_frame(slider->GetValue());
auth_3d_test_task->auth_3d_id.set_frame_req(slider->GetValue());
}
}
}
@@ -1301,8 +1297,8 @@ void Auth3dTestWindow::SelectionButtonPlay::Callback(dw::SelectionListener::Call
dw::Button* button = dynamic_cast<dw::Button*>(data->widget);
if (button) {
Auth3dTestWindow* test_window = dynamic_cast<Auth3dTestWindow*>(button->parent_shell);
if (test_window && auth_3d_test_task->auth_3d_id.check_not_empty()) {
auth_3d_test_task->auth_3d_id.set_paused(!auth_3d_test_task->auth_3d_id.get_paused());
if (test_window && auth_3d_test_task->auth_3d_id.is_valid()) {
auth_3d_test_task->auth_3d_id.set_pause(!auth_3d_test_task->auth_3d_id.get_pause());
test_window->UpdatePlayButton();
}
}
@@ -1317,16 +1313,16 @@ Auth3dTestWindow::SelectionButtonBegin::~SelectionButtonBegin() {
}
void Auth3dTestWindow::SelectionButtonBegin::Callback(dw::SelectionListener::CallbackData* data) {
if (!auth_3d_test_task->auth_3d_id.check_not_empty())
if (!auth_3d_test_task->auth_3d_id.is_valid())
return;
dw::Button* button = dynamic_cast<dw::Button*>(data->widget);
if (button) {
Auth3dTestWindow* test_window = dynamic_cast<Auth3dTestWindow*>(button->parent_shell);
if (test_window && auth_3d_test_task->auth_3d_id.check_not_empty()) {
auth_3d_test_task->auth_3d_id.set_paused(false);
if (test_window && auth_3d_test_task->auth_3d_id.is_valid()) {
auth_3d_test_task->auth_3d_id.set_pause(false);
test_window->UpdatePlayButton();
auth_3d_test_task->auth_3d_id.set_req_frame(0.0f);
auth_3d_test_task->auth_3d_id.set_frame_req(0.0f);
if (::snap_shot) {
auth_3d_test_task->snap_shot = true;
sub_140194880(0);
@@ -1344,17 +1340,17 @@ Auth3dTestWindow::SelectionButtonEnd::~SelectionButtonEnd() {
}
void Auth3dTestWindow::SelectionButtonEnd::Callback(dw::SelectionListener::CallbackData* data) {
if (!auth_3d_test_task->auth_3d_id.check_not_empty())
if (!auth_3d_test_task->auth_3d_id.is_valid())
return;
dw::Button* button = dynamic_cast<dw::Button*>(data->widget);
if (button) {
Auth3dTestWindow* test_window = dynamic_cast<Auth3dTestWindow*>(button->parent_shell);
if (test_window && auth_3d_test_task->auth_3d_id.check_not_empty()) {
auth_3d_test_task->auth_3d_id.set_paused(false);
if (test_window && auth_3d_test_task->auth_3d_id.is_valid()) {
auth_3d_test_task->auth_3d_id.set_pause(false);
test_window->UpdatePlayButton();
auth_3d_test_task->auth_3d_id.set_req_frame(
auth_3d_test_task->auth_3d_id.get_play_control_size());
auth_3d_test_task->auth_3d_id.set_frame_req(
auth_3d_test_task->auth_3d_id.get_frame_size());
}
}
}
@@ -1442,7 +1438,7 @@ Auth3dTestWindow::SelectionButtonCamReset::~SelectionButtonCamReset() {
}
void Auth3dTestWindow::SelectionButtonCamReset::Callback(dw::SelectionListener::CallbackData* data) {
cam_struct cam;
CameraParam cam;
cam.set(rctx_ptr->camera);
}
@@ -1463,7 +1459,7 @@ Auth3dTestWindow::Auth3dTestWindow() {
const char* nage_text;
const char* obj_link_text;
const char* mirror_text;
const char* reverse_side_text;
const char* snap_shot_text;
const char* self_shadow_off_text;
const char* black_mask_text;
@@ -1471,7 +1467,7 @@ Auth3dTestWindow::Auth3dTestWindow() {
if (dw::translate) {
nage_text = u8"NAGE▽";
obj_link_text = u8"OBJ Link";
mirror_text = u8"Mirror";
reverse_side_text = u8"Reverse Side";
snap_shot_text = u8"ss capture";
self_shadow_off_text = u8"Self Shadow Off";
black_mask_text = u8"Black Mask";
@@ -1480,7 +1476,7 @@ Auth3dTestWindow::Auth3dTestWindow() {
else {
nage_text = u8"投▽";
obj_link_text = u8"OBJ連動";
mirror_text = u8"左右逆";
reverse_side_text = u8"左右逆";
snap_shot_text = u8"ss画撮";
self_shadow_off_text = u8"セルフ影OFF";
black_mask_text = u8"黒mask";
@@ -1595,9 +1591,9 @@ Auth3dTestWindow::Auth3dTestWindow() {
repeat->AddSelectionListener(&repeat_listener);
mirror = new dw::Button(this, dw::CHECKBOX);
mirror->SetText(mirror_text);
mirror->SetValue(auth_3d_test_task->mirror);
mirror_listener.callback = Auth3dTestWindow::LeftRightReverseCallback;
mirror->SetText(reverse_side_text);
mirror->SetValue(auth_3d_test_task->reverse_side);
mirror_listener.callback = Auth3dTestWindow::ReverseSideCallback;
mirror->AddSelectionListener(&mirror_listener);
dw::Composite* v79 = new dw::Composite(this);
@@ -1729,8 +1725,8 @@ void Auth3dTestWindow::SetAuth3dCategoryIndex(size_t index) {
void Auth3dTestWindow::SetAuth3dIndex(size_t index) {
id_list->SetItemIndex(index);
if (auth_3d_test_task->auth_3d_id.check_not_empty()) {
auth_3d_test_task->auth_3d_id.set_paused(true);
if (auth_3d_test_task->auth_3d_id.is_valid()) {
auth_3d_test_task->auth_3d_id.set_pause(true);
UpdatePlayButton();
}
@@ -1755,8 +1751,8 @@ void Auth3dTestWindow::SetMaxFrame(float_t max_frame) {
}
void Auth3dTestWindow::UpdatePlayButton() {
if (auth_3d_test_task->auth_3d_id.check_not_empty())
play->SetText(auth_3d_test_task->auth_3d_id.get_paused() ? " > " : "||");
if (auth_3d_test_task->auth_3d_id.is_valid())
play->SetText(auth_3d_test_task->auth_3d_id.get_pause() ? " > " : "||");
}
void Auth3dTestWindow::CategoryCharaMenuInit(dw::Button* button, dw::Menu*& menu,
@@ -1779,24 +1775,24 @@ void Auth3dTestWindow::CategoryCharaMenuInit(dw::Button* button, dw::Menu*& menu
button->SetParentMenu(menu);*/
}
void Auth3dTestWindow::LeftRightReverseCallback(bool value) {
auth_3d_test_task->mirror = value;
if (auth_3d_test_task->auth_3d_id.check_not_empty()) {
auth_3d_test_task->auth_3d_id.set_req_frame(0.0f);
auth_3d_test_task->auth_3d_id.set_mirror(value);
void Auth3dTestWindow::ReverseSideCallback(bool value) {
auth_3d_test_task->reverse_side = value;
if (auth_3d_test_task->auth_3d_id.is_valid()) {
auth_3d_test_task->auth_3d_id.set_frame_req(0.0f);
auth_3d_test_task->auth_3d_id.set_reverse_side(value);
}
}
void Auth3dTestWindow::PosCallback(bool value) {
auth_3d_test_task->pos = value;
if (auth_3d_test_task->auth_3d_id.check_not_empty())
auth_3d_test_task->auth_3d_id.set_pos(value);
if (auth_3d_test_task->auth_3d_id.is_valid())
auth_3d_test_task->auth_3d_id.set_debug(value ? 1 : 0);
}
void Auth3dTestWindow::RepeatCallback(bool value) {
auth_3d_test_task->repeat = value;
if (auth_3d_test_task->auth_3d_id.check_not_empty())
auth_3d_test_task->auth_3d_id.set_repeat(value);
if (auth_3d_test_task->auth_3d_id.is_valid())
auth_3d_test_task->auth_3d_id.set_looped(value);
}
SelectionButtonBool::SelectionButtonBool() {
+7 -6
View File
@@ -46,8 +46,8 @@ public:
DataEventListener();
virtual ~DataEventListener() override;
virtual void OnLoad(::auth_3d_id& id) override;
virtual void OnPostCtrl(::auth_3d_id& id) override;
virtual void loadFinished(auth_3d_detail::Handle& in_handle) override;
virtual void playLoopJumpAfter(auth_3d_detail::Handle& in_handle) override;
} data_event_listener;
int32_t field_1C0;
@@ -56,10 +56,10 @@ public:
int32_t field_1CC;
bool field_1D0;
int32_t state;
::auth_3d_id auth_3d_id;
auth_3d_detail::Handle auth_3d_id;
int32_t auth_3d_uid;
bool repeat;
bool mirror;
bool reverse_side;
bool pos;
bool snap_shot;
int32_t snap_shot_state;
@@ -69,9 +69,10 @@ public:
bool stage_link_change;
int32_t effcmn_obj_set_state;
uint32_t effcmn_obj_set;
std::vector<aet::SetHandle> aet_set_handle;
int32_t aet_state;
int32_t aet_id;
auth_3d_detail::EventA2d::Aet aet;
aet::IdHandle aet_id_handle;
bool plane_above_floor;
bool stg_auth_display;
bool stg_display;
@@ -103,7 +104,7 @@ public:
virtual bool dest() override;
virtual void disp() override;
void DispAuth3dChara(::auth_3d_id& id);
void DispAuth3dChara(auth_3d_detail::Handle& in_handle);
void DispChara();
void SetAuth3dId();
void SetAuth3dUid(int32_t value);
+23 -23
View File
@@ -614,16 +614,16 @@ bool DataTestMot::ctrl() {
if (data.reset_cam) {
data.reset_cam = false;
cam_struct cam;
CameraParam cam;
if (data.field_A9) {
cam.view_point = { -3.79f, 0.71f, 1.0f };
cam.interest = { 0.0f, 0.96f, 0.0f };
cam.fov = 0.57268613576889f;
cam.v_fov = 0.57268613576889f;
}
else {
cam.view_point = { 0.0f, 1.0f, 3.45f };
cam.interest = { 0.0f, 1.0f, 0.0f };
cam.fov = 0.563171327114105f;
cam.v_fov = 0.563171327114105f;
}
cam.set(rctx_ptr->camera);
}
@@ -730,7 +730,7 @@ bool DataTestMotA3d::ctrl() {
break;
for (std::string& i : categories)
auth_3d_data_load_category(i.c_str());
auth_3d_detail::category_load_req(i.c_str());
state = 4;
} break;
@@ -738,7 +738,7 @@ bool DataTestMotA3d::ctrl() {
bool wait_load = false;
for (std::string& i : categories)
if (!auth_3d_data_check_category_loaded(i.c_str()))
if (!auth_3d_detail::category_load_is_done(i.c_str()))
wait_load |= true;
if (wait_load)
@@ -747,23 +747,23 @@ bool DataTestMotA3d::ctrl() {
data_struct* aft_data = &data_list[DATA_AFT];
auth_3d_database* aft_auth_3d_db = &aft_data->data_ft.auth_3d_db;
for (auth_3d_id& i : auth_3d_ids)
i.read_file(aft_auth_3d_db);
for (auth_3d_detail::Handle& i : auth_3d_ids)
i.load_req(aft_auth_3d_db);
state = 5;
} break;
case 5: {
bool wait_load = false;
for (auth_3d_id& i : auth_3d_ids)
if (!i.check_loaded())
for (auth_3d_detail::Handle& i : auth_3d_ids)
if (!i.load_is_done())
wait_load |= true;
if (wait_load)
break;
for (auth_3d_id& i : auth_3d_ids)
i.set_enable(true);
for (auth_3d_detail::Handle& i : auth_3d_ids)
i.set_enabled(true);
state = 1;
} break;
@@ -833,12 +833,12 @@ void DataTestMotA3d::LoadAuth3d(std::string&& name) {
if (uid == -1)
return;
auth_3d_id id = auth_3d_id(uid, aft_auth_3d_db);
if (!id.check_not_empty())
auth_3d_detail::Handle id = auth_3d_detail::Handle::create(uid, aft_auth_3d_db);
if (!id.is_valid())
return;
id.set_enable(false);
id.set_repeat(true);
id.set_enabled(false);
id.set_looped(true);
auth_3d_ids.push_back(id);
@@ -851,19 +851,19 @@ void DataTestMotA3d::LoadAuth3d(std::string&& name) {
camera = false;
}
std::string category(aft_auth_3d_db->uid[uid].category.c_str());
std::string category(aft_auth_3d_db->uid[uid].category_name.c_str());
categories.push_back(category);
auth_3d_data_get_obj_sets_from_category(category, obj_sets, aft_auth_3d_db, aft_obj_db);
}
void DataTestMotA3d::Reset() {
for (std::string& i : categories)
auth_3d_data_unload_category(i.c_str());
auth_3d_detail::category_free(i.c_str());
categories.clear();
for (auth_3d_id& i : auth_3d_ids)
i.unload(rctx_ptr);
for (auth_3d_detail::Handle& i : auth_3d_ids)
i.destroy(rctx_ptr);
auth_3d_ids.clear();
@@ -889,8 +889,8 @@ void DataTestMotA3d::Sync1pFrame() {
if (get_pause())
frame -= dtm_mot_array[ROB_ID_1P].GetStep();
for (auth_3d_id& i : auth_3d_ids)
i.set_req_frame(frame);
for (auth_3d_detail::Handle& i : auth_3d_ids)
i.set_frame_req(frame);
}
DtmMot::DtmMot() : rob_man(), motion(), assign(), rot(), pre_offset(), post_offset(), div(),
@@ -1262,7 +1262,7 @@ bool DtmMot::ctrl() {
if (rob_man->get_disp_on(rctrl) != display)
rob_man->set_disp_on(rctrl, display);
rob_chr->rob_info_ctrl();
rob_chr->ctrl_rob_info_main();
while (set_motion_index < set_motion.size()) {
if (set_motion.data()[set_motion_index].motnum != uid) {
@@ -3050,7 +3050,7 @@ static void motion_test_objset_load() {
motion_test_objset.push_back(hnd_itm.obj_right.set_id);
}
prj::sort_unique(motion_test_objset);
prj::sort_and_erase_non_unique(motion_test_objset);
data_struct* aft_data = &data_list[DATA_AFT];
object_database* aft_obj_db = &aft_data->data_ft.obj_db;
+1 -1
View File
@@ -80,7 +80,7 @@ public:
int32_t state;
std::string auth_3d;
std::vector<std::string> categories;
std::vector<auth_3d_id> auth_3d_ids;
std::vector<auth_3d_detail::Handle> auth_3d_ids;
std::vector<uint32_t> obj_sets;
bool camera;
+2 -2
View File
@@ -217,7 +217,7 @@ void TaskDataTestOpd::BeginDataCreation() {
opd_make_start_get_motion_ids(motion_ids);
motion_ids.push_back(195); // CMN_MRA00_13_01
prj::sort_unique(motion_ids);
prj::sort_and_erase_non_unique(motion_ids);
OpdMakeManagerArgs args;
args.motion_ids = &motion_ids;
@@ -648,7 +648,7 @@ static void task_data_test_opd_dw_add_module() {
data.modules.push_back(i.first);
} break;
}
prj::sort_unique(data.modules);
prj::sort_and_erase_non_unique(data.modules);
}
static void task_data_test_opd_dw_add_modules() {
+1 -11
View File
@@ -2546,17 +2546,7 @@ void RobOsageTestDw::Collision::Init(dw::Composite* parent) {
void RobOsageTestDw::Collision::Update() {
if (element_comp) {
Composite* parent_comp = element_comp->parent_comp;
auto i_begin = parent_comp->controls.begin();
auto i_end = parent_comp->controls.end();
for (auto i = i_begin; i != i_end; )
if (*i == element_comp) {
parent_comp->controls.erase(i);
break;
}
else
i++;
prj::find_and_erase(element_comp->parent_comp->controls, element_comp);
element_comp->Free();
element_comp = 0;
}
File diff suppressed because it is too large Load Diff
+13 -68
View File
@@ -4,6 +4,7 @@
*/
#include "dw.hpp"
#include "../KKdLib/prj/algorithm.hpp"
#include "../CRE/prj/memory_manager.hpp"
#include "../CRE/app_system_detail.hpp"
#include "../CRE/data.hpp"
@@ -1033,15 +1034,8 @@ namespace dw {
if (parent_comp) {
Shell* parent_shell = dynamic_cast<Shell*>(parent_comp);
if (parent_shell) {
auto i = parent_shell->children.begin();
auto i_end = parent_shell->children.end();
while (i != i_end)
if (*i == this) {
parent_shell->children.erase(i);
break;
}
}
if (parent_shell)
prj::find_and_erase(parent_shell->children, this);
}
dw_gui_detail_display->RemoveShell(this);
@@ -3867,7 +3861,7 @@ void dw_sys_menu_init(dw::Shell* shell) {
}
PrintWorkDebug::PrintWorkDebug() {
prio = spr::SPR_PRIO_29;
prio = spr::SPR_PRIO_DW;
set_screen_mode(SCREEN_MODE_MAX);
}
@@ -3929,18 +3923,8 @@ namespace dw {
}
void DragBoundsData::RemoveDragBoundsListener(DragBoundsListener* value) {
if (!value)
return;
auto i = drag_bounds_listeners.begin();
auto i_end = drag_bounds_listeners.end();
while (i != i_end)
if (*i == value) {
drag_bounds_listeners.erase(i);
break;
}
else
i++;
if (value)
prj::find_and_erase(drag_bounds_listeners, value);
}
// 0x1402E5020
@@ -4519,7 +4503,7 @@ void dw_gui_detail::Input::Draw() {
else if (field_20 < 300) {
spr::SprArgs args;
args.id = 3343;
args.prio = spr::SPR_PRIO_29;
args.prio = spr::SPR_PRIO_DW;
args.trans.x = mouse_pos.x;
args.trans.y = mouse_pos.y;
args.screen_trans = SCREEN_MODE_MAX;
@@ -4809,7 +4793,6 @@ int32_t dw_gui_detail::Display::GetActiveShell() {
active_shell->KeyCallback(key_callback_data);
}
else {
bool found = false;
for (dw::Shell*& i : shells)
if (i->GetDisp()) {
@@ -4862,62 +4845,24 @@ void dw_gui_detail::Display::HideMenus() {
}
void dw_gui_detail::Display::MakeShellFirst(dw::Shell* value) {
if (!value)
return;
auto i = shells.begin();
auto i_end = shells.end();
while (i != i_end)
if (*i == value) {
shells.erase(i);
shells.push_back(value);
break;
}
else
i++;
if (value && prj::find_and_erase(shells, value))
shells.push_back(value);
}
void dw_gui_detail::Display::MakeShellLast(dw::Shell* value) {
if (!value)
return;
auto i = shells.begin();
auto i_end = shells.end();
while (i != i_end)
if (*i == value) {
shells.erase(i);
shells.insert(shells.begin(), value);
break;
}
else
i++;
if (value && prj::find_and_erase(shells, value))
shells.insert(shells.begin(), value);
}
void dw_gui_detail::Display::RemoveMenu(dw::Menu* value) {
auto i = menus.begin();
auto i_end = menus.end();
while (i != i_end)
if (*i == value) {
menus.erase(i);
break;
}
else
i++;
prj::find_and_erase(menus, value);
if (active_menu == value)
active_menu = 0;
}
void dw_gui_detail::Display::RemoveShell(dw::Shell* value) {
auto i = shells.begin();
auto i_end = shells.end();
while (i != i_end)
if (*i == value) {
shells.erase(i);
break;
}
else
i++;
prj::find_and_erase(shells, value);
if (active_shell == value) {
active_shell = 0;
+1 -1
View File
@@ -130,7 +130,7 @@ namespace dw_gui_user_detail {
UpdateLayout();
}
FontListWindow::~FontListWindow() {
}
+216 -217
View File
@@ -1373,22 +1373,22 @@ void pv_game::change_field(size_t field, ssize_t dsc_time, ssize_t curr_time) {
data.play_data.set_spr_set_back_id(next_field_data.spr_set_back_id);
std::vector<auth_3d_id> auth_3d_end;
std::vector<auth_3d_detail::Handle> auth_3d_end;
std::set_difference(
curr_field_data.auth_3d_ids.begin(), curr_field_data.auth_3d_ids.end(),
next_field_data.auth_3d_ids.begin(), next_field_data.auth_3d_ids.end(), std::back_inserter(auth_3d_end));
std::vector<auth_3d_id> auth_3d_start;
std::vector<auth_3d_detail::Handle> auth_3d_start;
std::set_difference(
next_field_data.auth_3d_ids.begin(), next_field_data.auth_3d_ids.end(),
curr_field_data.auth_3d_ids.begin(), curr_field_data.auth_3d_ids.end(), std::back_inserter(auth_3d_start));
std::vector<auth_3d_id> auth_3d_cont;
std::vector<auth_3d_detail::Handle> auth_3d_cont;
std::set_intersection(
curr_field_data.auth_3d_ids.begin(), curr_field_data.auth_3d_ids.end(),
next_field_data.auth_3d_ids.begin(), next_field_data.auth_3d_ids.end(), std::back_inserter(auth_3d_cont));
for (auth_3d_id& i : auth_3d_end) {
i.set_visibility(false);
i.set_enable(false);
for (auth_3d_detail::Handle& i : auth_3d_end) {
i.set_visible(false);
i.set_enabled(false);
}
bool disp = true;
@@ -1399,78 +1399,78 @@ void pv_game::change_field(size_t field, ssize_t dsc_time, ssize_t curr_time) {
disp = field > pv_disp2d->title_end_3d_field;
}
for (auth_3d_id& i : auth_3d_start) {
float_t req_frame = 0.0f;
float_t max_frame = -1.0f;
for (auth_3d_detail::Handle& i : auth_3d_start) {
float_t frame_req = 0.0f;
float_t frame_max = -1.0f;
if (data.has_auth_3d_frame) {
int32_t auth_3d_frame = get_field_auth_3d_frame(next_field_data, i.get_uid(), 0);
req_frame = pv_game::get_auth_3d_frame_max_frame(get_frame(auth_3d_frame,
dsc_time, curr_time), i.get_uid(), dsc_time, curr_time, 0, &max_frame);
req_frame = max_def(req_frame, 0.0f);
frame_req = pv_game::get_scene_frame_max_frame(get_frame(auth_3d_frame,
dsc_time, curr_time), i.get_uid(), dsc_time, curr_time, 0, &frame_max);
frame_req = max_def(frame_req, 0.0f);
}
i.set_enable(true);
i.set_req_frame(req_frame);
i.set_max_frame(max_frame);
i.set_paused(false);
i.set_visibility(disp);
i.set_enabled(true);
i.set_frame_req(frame_req);
i.set_frame_max(frame_max);
i.set_pause(false);
i.set_visible(disp);
}
for (auth_3d_id& i : auth_3d_cont) {
float_t max_frame = -1.0f;
for (auth_3d_detail::Handle& i : auth_3d_cont) {
float_t frame_max = -1.0f;
if (data.has_auth_3d_frame) {
int32_t auth_3d_frame = get_field_auth_3d_frame(next_field_data, i.get_uid(), 0);
float_t req_frame = get_auth_3d_frame_max_frame(get_frame_continue(auth_3d_frame),
i.get_uid(), dsc_time, curr_time, 0, &max_frame);
if (req_frame >= 0.0f)
i.set_req_frame(req_frame);
float_t frame_req = get_scene_frame_max_frame(get_frame_continue(auth_3d_frame),
i.get_uid(), dsc_time, curr_time, 0, &frame_max);
if (frame_req >= 0.0f)
i.set_frame_req(frame_req);
}
i.set_max_frame(max_frame);
i.set_frame_max(frame_max);
}
if (next_field_data.light_auth_3d_id == curr_field_data.light_auth_3d_id) {
auth_3d_id& light_auth = next_field_data.light_auth_3d_id;
if (light_auth.check_not_empty()) {
float_t max_frame = -1.0f;
auth_3d_detail::Handle& light_auth = next_field_data.light_auth_3d_id;
if (light_auth.is_valid()) {
float_t frame_max = -1.0f;
if (data.has_light_frame) {
int32_t light_frame = get_field_auth_3d_frame(next_field_data, light_auth.get_uid(), 1);
float_t req_frame = get_auth_3d_frame_max_frame(get_frame_continue(light_frame),
light_auth.get_uid(), dsc_time, curr_time, 1, &max_frame);
if (req_frame >= 0.0f)
light_auth.set_req_frame(req_frame);
float_t frame_req = get_scene_frame_max_frame(get_frame_continue(light_frame),
light_auth.get_uid(), dsc_time, curr_time, 1, &frame_max);
if (frame_req >= 0.0f)
light_auth.set_frame_req(frame_req);
}
light_auth.set_max_frame(max_frame);
light_auth.set_frame_max(frame_max);
}
}
else {
auth_3d_id& prev_light_auth = curr_field_data.light_auth_3d_id;
if (prev_light_auth.check_not_empty()) {
prev_light_auth.set_visibility(false);
prev_light_auth.set_enable(false);
auth_3d_detail::Handle& prev_light_auth = curr_field_data.light_auth_3d_id;
if (prev_light_auth.is_valid()) {
prev_light_auth.set_visible(false);
prev_light_auth.set_enabled(false);
}
auth_3d_id& next_light_auth = next_field_data.light_auth_3d_id;
if (next_light_auth.check_not_empty()) {
float_t req_frame = 0.0f;
float_t max_frame = -1.0f;
auth_3d_detail::Handle& next_light_auth = next_field_data.light_auth_3d_id;
if (next_light_auth.is_valid()) {
float_t frame_req = 0.0f;
float_t frame_max = -1.0f;
if (data.has_light_frame) {
int32_t light_frame = get_field_auth_3d_frame(next_field_data, next_light_auth.get_uid(), 1);
req_frame = get_auth_3d_frame_max_frame(get_frame(light_frame,
dsc_time, curr_time), next_light_auth.get_uid(), dsc_time, curr_time, 1, &max_frame);
req_frame = max_def(req_frame, 0.0f);
frame_req = get_scene_frame_max_frame(get_frame(light_frame,
dsc_time, curr_time), next_light_auth.get_uid(), dsc_time, curr_time, 1, &frame_max);
frame_req = max_def(frame_req, 0.0f);
}
next_light_auth.set_enable(true);
next_light_auth.set_req_frame(req_frame);
next_light_auth.set_max_frame(req_frame);
next_light_auth.set_paused(false);
next_light_auth.set_visibility(true);
next_light_auth.set_enabled(true);
next_light_auth.set_frame_req(frame_req);
next_light_auth.set_frame_max(frame_max);
next_light_auth.set_pause(false);
next_light_auth.set_visible(true);
}
}
@@ -1864,7 +1864,7 @@ int32_t pv_game::ctrl_end(float_t delta_time) {
void pv_game::data_itmpv_disable() {
for (auto& i : data.itmpv)
for (auto& j : i)
j.second.first.set_enable(false);
j.second.first.set_enabled(false);
}
void pv_game::disp() {
@@ -1942,16 +1942,16 @@ void pv_game::edit_effect_set(int32_t index, float_t speed, float_t delta_time)
void pv_game::edit_instrument_reset() {
for (pv_game_edit_instrument& i : data.edit_instrument)
for (auth_3d_id& j : i.auth_3d_ids)
j.set_enable(false);
for (auth_3d_detail::Handle& j : i.auth_3d_ids)
j.set_enabled(false);
}
void pv_game::edit_instrument_set_disp(int32_t rob_id, bool value) {
pv_game_edit_instrument& v4 = data.edit_instrument[rob_id];
if (v4.index >= 0 && v4.auth_3d_ids.size()) {
auth_3d_id& id = v4.auth_3d_ids[v4.index];
if (id.check_not_empty())
id.set_visibility(value);
auth_3d_detail::Handle& id = v4.auth_3d_ids[v4.index];
if (id.is_valid())
id.set_visible(value);
}
}
@@ -1979,11 +1979,11 @@ void pv_game::end(bool complete, bool set_fade) {
}
float_t pv_game::get_aet_frame_max_frame(int32_t aet_frame, int32_t aet_index, std::pair<std::string,
std::string>& aet_name_id, int64_t dsc_time, int64_t curr_time, float_t* max_frame) {
if (!max_frame)
std::string>& aet_name_id, int64_t dsc_time, int64_t curr_time, float_t* frame_max) {
if (!frame_max)
return -1.0f;
*max_frame = -1.0f;
*frame_max = -1.0f;
if (dsc_time < 0 || curr_time < 0)
return 0.0f;
@@ -1991,9 +1991,9 @@ float_t pv_game::get_aet_frame_max_frame(int32_t aet_frame, int32_t aet_index, s
data.aet_time[aet_index].insert_or_assign(aet_name_id, dsc_time);
if (!aet_frame) {
*max_frame = get_aet_frame_max_frame_change_field(aet_index, aet_name_id, dsc_time);
if (*max_frame < 0.0f)
*max_frame = get_next_aet_max_frame_change_field(aet_index, aet_name_id, dsc_time, curr_time);
*frame_max = get_aet_frame_max_frame_change_field(aet_index, aet_name_id, dsc_time);
if (*frame_max < 0.0f)
*frame_max = get_next_aet_max_frame_change_field(aet_index, aet_name_id, dsc_time, curr_time);
}
return 0.0f;
}
@@ -2007,19 +2007,19 @@ float_t pv_game::get_aet_frame_max_frame(int32_t aet_frame, int32_t aet_index, s
}
if (aet_frame == -1) {
*max_frame = get_aet_frame_max_frame_change_field(aet_index, aet_name_id, dsc_time);
if (*max_frame < 0.0f)
*max_frame = get_next_aet_max_frame_change_field(aet_index, aet_name_id, dsc_time, curr_time);
*frame_max = get_aet_frame_max_frame_change_field(aet_index, aet_name_id, dsc_time);
if (*frame_max < 0.0f)
*frame_max = get_next_aet_max_frame_change_field(aet_index, aet_name_id, dsc_time, curr_time);
}
return frame;
}
else if (!((aet_frame + 6) & ~4u) && aet_frame == -2)
*max_frame = get_aet_frame_max_frame_change_field(aet_index, aet_name_id, dsc_time);
*frame_max = get_aet_frame_max_frame_change_field(aet_index, aet_name_id, dsc_time);
return -1.0f;
}
void pv_game::get_aet_frame_max_frame_by_name(float_t& frame, float_t& max_frame, std::pair<std::string, std::string>& aet_name_id) {
if (frame < 0.0f && max_frame < 0.0f || !data.pv_disp2d)
void pv_game::get_aet_frame_max_frame_by_name(float_t& frame, float_t& frame_max, std::pair<std::string, std::string>& aet_name_id) {
if (frame < 0.0f && frame_max < 0.0f || !data.pv_disp2d)
return;
data_struct* aft_data = &data_list[DATA_AFT];
@@ -2038,10 +2038,10 @@ void pv_game::get_aet_frame_max_frame_by_name(float_t& frame, float_t& max_frame
frame = end_frame;
}
if (max_frame >= 0.0f) {
max_frame += start_frame;
if (end_frame >= 0.0f && max_frame > end_frame)
max_frame = end_frame;
if (frame_max >= 0.0f) {
frame_max += start_frame;
if (end_frame >= 0.0f && frame_max > end_frame)
frame_max = end_frame;
}
}
@@ -2065,12 +2065,12 @@ int64_t pv_game::get_aet_time(int32_t aet_index, std::pair<std::string, std::str
return -1;
}
float_t pv_game::get_auth_3d_frame_max_frame(int32_t auth_3d_frame, int32_t auth_3d_uid,
int64_t dsc_time, int64_t curr_time, uint8_t type, float_t* max_frame) {
if (!max_frame || type != 0 && type != 1)
float_t pv_game::get_scene_frame_max_frame(int32_t auth_3d_frame, int32_t auth_3d_uid,
int64_t dsc_time, int64_t curr_time, uint8_t type, float_t* frame_max) {
if (!frame_max || type != 0 && type != 1)
return -1.0f;
*max_frame = -1.0f;
*frame_max = -1.0f;
if (dsc_time < 0 || curr_time < 0)
return 0.0f;
@@ -2081,15 +2081,15 @@ float_t pv_game::get_auth_3d_frame_max_frame(int32_t auth_3d_frame, int32_t auth
data.auth_3d_time.insert_or_assign(auth_3d_uid, dsc_time);
if (!auth_3d_frame) {
*max_frame = get_auth_3d_frame_max_frame_change_field(auth_3d_uid, dsc_time, type);
if (*max_frame < 0.0f)
*max_frame = get_next_auth_3d_max_frame_change_field(auth_3d_uid, dsc_time, curr_time, type);
*frame_max = get_scene_frame_max_frame_change_field(auth_3d_uid, dsc_time, type);
if (*frame_max < 0.0f)
*frame_max = get_next_auth_3d_max_frame_change_field(auth_3d_uid, dsc_time, curr_time, type);
}
return 0.0f;
}
else if (!((auth_3d_frame + 5) & ~4u)) {
float_t frame = -1.0f;
int64_t auth_3d_time = get_auth_3d_time(auth_3d_uid, type);
int64_t auth_3d_time = get_scene_time(auth_3d_uid, type);
if (auth_3d_time >= 0) {
frame = dsc_time_to_frame(curr_time - auth_3d_time);
float_t dsc_frame = prj::roundf(dsc_time_to_frame(dsc_time - auth_3d_time));
@@ -2097,18 +2097,18 @@ float_t pv_game::get_auth_3d_frame_max_frame(int32_t auth_3d_frame, int32_t auth
}
if (auth_3d_frame == -1) {
*max_frame = get_auth_3d_frame_max_frame_change_field(auth_3d_uid, dsc_time, type);
if (*max_frame < 0.0f)
*max_frame = get_next_auth_3d_max_frame_change_field(auth_3d_uid, dsc_time, curr_time, type);
*frame_max = get_scene_frame_max_frame_change_field(auth_3d_uid, dsc_time, type);
if (*frame_max < 0.0f)
*frame_max = get_next_auth_3d_max_frame_change_field(auth_3d_uid, dsc_time, curr_time, type);
}
return frame;
}
else if (!((auth_3d_frame + 6) & ~4u) && auth_3d_frame == -2)
*max_frame = get_auth_3d_frame_max_frame_change_field(auth_3d_uid, dsc_time, type);
*frame_max = get_scene_frame_max_frame_change_field(auth_3d_uid, dsc_time, type);
return -1.0f;
}
float_t pv_game::get_auth_3d_frame_max_frame_change_field(uint32_t auth_3d_uid, int64_t time, uint8_t type) {
float_t pv_game::get_scene_frame_max_frame_change_field(uint32_t auth_3d_uid, int64_t time, uint8_t type) {
if (time < 0)
return -1.0f;
@@ -2116,18 +2116,18 @@ float_t pv_game::get_auth_3d_frame_max_frame_change_field(uint32_t auth_3d_uid,
? data.pv_data.change_field_branch_fail
: data.pv_data.change_field_branch_success;
if (time == 10000LL * change_field.back().first)
return prj::roundf(dsc_time_to_frame(data.max_time - get_auth_3d_time(auth_3d_uid, type))) - 1.0f;
return prj::roundf(dsc_time_to_frame(data.max_time - get_scene_time(auth_3d_uid, type))) - 1.0f;
return -1.0f;
}
auth_3d_id pv_game::get_auth_3d_id(int32_t uid) {
auth_3d_detail::Handle pv_game::get_scene_id(int32_t uid) {
auto elem = data.auth_3d.find(uid);
if (elem != data.auth_3d.end())
return elem->second;
return {};
}
int64_t pv_game::get_auth_3d_time(int32_t uid, uint8_t type) {
int64_t pv_game::get_scene_time(int32_t uid, uint8_t type) {
switch (type) {
case 0: {
auto elem = data.auth_3d_time.find(uid);
@@ -2164,7 +2164,7 @@ uint32_t pv_game::get_chreff_auth_3d_object_set(int32_t& uid) {
}
if (obj_set == -1 && uid >= 0 && uid < aft_auth_3d_db->uid.size()) {
std::string& category = aft_auth_3d_db->uid[uid].category;
const std::string& category = aft_auth_3d_db->uid[uid].category_name;
if (!category.find("EFFCHRPV"))
return aft_obj_db->get_object_set_id(category.c_str());
}
@@ -2201,7 +2201,7 @@ int32_t pv_game::get_field_aet_frame_by_name_id(pv_game_field& field,
int32_t pv_game::get_field_aet_index_by_name_id(pv_game_field& field,
int32_t aet_index, std::pair<std::string, std::string>& aet_name_id) {
int32_t index = 0;
for (std::string& i : field.aet_names[aet_index]) {
for (const std::string& i : field.aet_names[aet_index]) {
std::string* id = 0;
if (index < field.aet_ids[aet_index].size())
id = &field.aet_ids[aet_index][index];
@@ -2263,18 +2263,18 @@ float_t pv_game::get_next_aet_max_frame_change_field(int32_t aet_index, std::pai
aet_name_id, dsc_time, &max_time, curr_time, change_field);
}
float_t max_frame_fail = get_next_aet_max_time_max_frame_change_field(aet_index,
float_t frame_max_fail = get_next_aet_max_time_max_frame_change_field(aet_index,
aet_name_id, dsc_time, &max_time, curr_time, data.pv_data.change_field_branch_fail);
if (max_frame_fail < 0.0f)
if (frame_max_fail < 0.0f)
return get_next_aet_max_time_max_frame_change_field(aet_index,
aet_name_id, dsc_time, &max_time, curr_time, data.pv_data.change_field_branch_success);
else if (max_time > data.pv_data.change_field_branch_time) {
float_t max_frame_success = get_next_aet_max_time_max_frame_change_field(aet_index,
float_t frame_max_success = get_next_aet_max_time_max_frame_change_field(aet_index,
aet_name_id, dsc_time, &max_time, curr_time, data.pv_data.change_field_branch_success);
if (max_frame_success >= 0.0f && max_frame_success < max_frame_fail)
return max_frame_success;
if (frame_max_success >= 0.0f && frame_max_success < frame_max_fail)
return frame_max_success;
}
return max_frame_fail;
return frame_max_fail;
}
float_t pv_game::get_next_aet_max_time_max_frame_change_field(int32_t aet_index,
@@ -2308,18 +2308,18 @@ float_t pv_game::get_next_auth_3d_max_frame_change_field(uint32_t auth_3d_uid,
dsc_time, &max_time, curr_time, change_field, type);
}
float_t max_frame_fail = get_next_auth_3d_max_time_max_frame_change_field(auth_3d_uid,
float_t frame_max_fail = get_next_auth_3d_max_time_max_frame_change_field(auth_3d_uid,
dsc_time, &max_time, curr_time, data.pv_data.change_field_branch_fail, type);
if (max_frame_fail < 0.0f)
if (frame_max_fail < 0.0f)
return get_next_auth_3d_max_time_max_frame_change_field(auth_3d_uid,
dsc_time, &max_time, curr_time, data.pv_data.change_field_branch_success, type);
else if (max_time > data.pv_data.change_field_branch_time) {
float_t max_frame_success = get_next_auth_3d_max_time_max_frame_change_field(auth_3d_uid,
float_t frame_max_success = get_next_auth_3d_max_time_max_frame_change_field(auth_3d_uid,
dsc_time, &max_time, curr_time, data.pv_data.change_field_branch_success, type);
if (max_frame_success >= 0.0f && max_frame_success < max_frame_fail)
return max_frame_success;
if (frame_max_success >= 0.0f && frame_max_success < frame_max_fail)
return frame_max_success;
}
return max_frame_fail;
return frame_max_fail;
}
float_t pv_game::get_next_auth_3d_max_time_max_frame_change_field(uint32_t auth_3d_uid, int64_t dsc_time,
@@ -2332,7 +2332,7 @@ float_t pv_game::get_next_auth_3d_max_time_max_frame_change_field(uint32_t auth_
if (time > dsc_time && i.second >= 0 && i.second < data.field_data.size()
&& ((get_field_auth_3d_frame(data.field_data[i.second], auth_3d_uid, type) + 5) & -6) == 0) {
*max_time = time;
return prj::roundf(dsc_time_to_frame(time - get_auth_3d_time(auth_3d_uid, type))) - 1.0f;
return prj::roundf(dsc_time_to_frame(time - get_scene_time(auth_3d_uid, type))) - 1.0f;
}
}
return -1.0f;
@@ -2455,14 +2455,14 @@ bool pv_game::is_play_data_option_3() {
void pv_game::itmpv_reset() {
for (auto& i : data.itmpv)
for (auto& j : i) {
auth_3d_id& id = j.second.first;
id.set_repeat(0);
id.set_enable(0);
id.set_camera_root_update(0);
id.set_visibility(1);
id.set_frame_rate(get_diva_pv_frame_rate());
auth_3d_detail::Handle& id = j.second.first;
id.set_looped(false);
id.set_enabled(false);;
id.camera_set_enabled(false);
id.set_visible(true);
id.set_frame_rate_control(get_diva_pv_frame_rate());
id.set_shadow(true);
id.set_chara_id((int32_t)(&i - data.itmpv));
id.assign_rob_id((int32_t)(&i - data.itmpv));
j.second.second = -1;
}
}
@@ -2955,11 +2955,11 @@ bool pv_game::load() {
chreff.src_auth_3d_uid = aft_auth_3d_db->get_uid(chreff.src_auth_3d.c_str());
chreff.dst_auth_3d_uid = aft_auth_3d_db->get_uid(chreff.dst_auth_3d.c_str());
std::string& src_category = aft_auth_3d_db->uid[chreff.src_auth_3d_uid].category;
const std::string& src_category = aft_auth_3d_db->uid[chreff.src_auth_3d_uid].category_name;
if (src_category.size())
chreff.src_auth_3d_category.assign(src_category);
std::string& dst_category = aft_auth_3d_db->uid[chreff.dst_auth_3d_uid].category;
const std::string& dst_category = aft_auth_3d_db->uid[chreff.dst_auth_3d_uid].category_name;
if (dst_category.size())
chreff.dst_auth_3d_category.assign(dst_category);
@@ -3041,8 +3041,8 @@ bool pv_game::load() {
field.auth_3d_uids.push_back(auth_3d_uid);
data.loaded_auth_3d_uids.push_back(auth_3d_uid);
if (aft_auth_3d_db->uid[auth_3d_uid].category.size())
data.auth_3d_categories.push_back(aft_auth_3d_db->uid[auth_3d_uid].category);
if (aft_auth_3d_db->uid[auth_3d_uid].category_name.size())
data.auth_3d_categories.push_back(aft_auth_3d_db->uid[auth_3d_uid].category_name);
if (chreff_auth_3d_obj_set_id != -1)
data.chreff_auth_3d_obj_set_ids.push_back(chreff_auth_3d_obj_set_id);
@@ -3070,8 +3070,8 @@ bool pv_game::load() {
if (i.light_frame_set)
data.has_light_frame = true;
if (aft_auth_3d_db->uid[light_uid].category.size())
data.auth_3d_categories.push_back(aft_auth_3d_db->uid[light_uid].category);
if (aft_auth_3d_db->uid[light_uid].category_name.size())
data.auth_3d_categories.push_back(aft_auth_3d_db->uid[light_uid].category_name);
size_t pos = i.light.find('_');
if (pos != -1) {
@@ -3150,7 +3150,7 @@ bool pv_game::load() {
data.field_data.push_back(field);
}
prj::sort_unique(data.chreff_auth_3d_obj_set_ids);
prj::sort_and_erase_non_unique(data.chreff_auth_3d_obj_set_ids);
for (uint32_t& i : data.chreff_auth_3d_obj_set_ids)
objset_info_storage_load_set(aft_data, aft_obj_db, i);
@@ -3174,7 +3174,7 @@ bool pv_game::load() {
if (data.itmpv_auth_3d_uids.size()) {
data.auth_3d_categories.push_back(data.itmpv_string);
for (int32_t& i : data.itmpv_auth_3d_uids)
check_auth_replace_by_module(auth_3d_data_get_uid_name(i, aft_auth_3d_db), i);
check_auth_replace_by_module(auth_3d_detail::get_name_uid(i, aft_auth_3d_db), i);
data.loaded_auth_3d_uids.insert(data.loaded_auth_3d_uids.end(),
data.itmpv_auth_3d_uids.begin(), data.itmpv_auth_3d_uids.end());
@@ -3184,11 +3184,11 @@ bool pv_game::load() {
for (int32_t i = 0; i < 3; i++) {
v261 |= !!diff->field_228[i].size();
for (auto& j : diff->field_228[i])
data.itmpv_uids.push_back(auth_3d_data_get_uid_name(j.second.second, aft_auth_3d_db));
data.itmpv_uids.push_back(auth_3d_detail::get_name_uid(j.second.second, aft_auth_3d_db));
}
if (v261)
for (std::string& i : data.itmpv_uids)
for (const std::string& i : data.itmpv_uids)
data.auth_3d_categories.push_back(i);
data.field_2D770.clear();
@@ -3196,7 +3196,7 @@ bool pv_game::load() {
for (auto& j : diff->field_228[i])
data.field_2D770.push_back(j.second.first.set_id);
prj::sort_unique(data.field_2D770);
prj::sort_and_erase_non_unique(data.field_2D770);
for (uint32_t& i : data.field_2D770)
objset_info_storage_load_set(aft_data, aft_obj_db, i);
@@ -3205,7 +3205,7 @@ bool pv_game::load() {
for (const pv_db_pv_ex_song_ex_auth& j : i.ex_auth) {
uint32_t uid = aft_auth_3d_db->get_uid(j.org_name.c_str());
data.loaded_auth_3d_uids.push_back(uid);
const char* category_name = aft_auth_3d_db->uid[uid].category.c_str();
const char* category_name = aft_auth_3d_db->uid[uid].category_name.c_str();
if (category_name) {
uint32_t obj_set_id = aft_obj_db->get_object_set_id(category_name);
if (obj_set_id != -1)
@@ -3213,11 +3213,11 @@ bool pv_game::load() {
}
}
prj::sort_unique(data.ex_song_ex_auth_obj_set_ids);
prj::sort_and_erase_non_unique(data.ex_song_ex_auth_obj_set_ids);
for (uint32_t& i : data.ex_song_ex_auth_obj_set_ids)
objset_info_storage_load_set(aft_data, aft_obj_db, i);
prj::sort_unique(data.stage_indices);
prj::sort_and_erase_non_unique(data.stage_indices);
if (!data.stage_indices.size())
data.stage_indices.push_back(0);
@@ -3238,7 +3238,7 @@ bool pv_game::load() {
data.stgpvhrc_obj_set_ids.push_back(obj_set_id);
}
prj::sort_unique(data.stgpvhrc_obj_set_ids);
prj::sort_and_erase_non_unique(data.stgpvhrc_obj_set_ids);
for (uint32_t& i : data.stgpvhrc_obj_set_ids)
objset_info_storage_load_set(aft_data, aft_obj_db, i);
@@ -3271,38 +3271,38 @@ bool pv_game::load() {
state = 2;
} break;
case 8: {
prj::sort_unique(data.spr_set_back_ids);
prj::sort_and_erase_non_unique(data.spr_set_back_ids);
for (uint32_t& i : data.spr_set_back_ids)
spr::request(i, std::string(data.pv->mdata.dir), aft_data, aft_spr_db);
data.field_2D7E8 = true;
prj::sort_unique(data.auth_3d_categories);
for (std::string& i : data.auth_3d_categories)
auth_3d_data_load_category(i.c_str(), data.pv->mdata.dir.c_str());
prj::sort_and_erase_non_unique(data.auth_3d_categories);
for (const std::string& i : data.auth_3d_categories)
auth_3d_detail::category_load_req(i.c_str(), data.pv->mdata.dir.c_str());
data.field_2DAC8 = true;
prj::sort_unique(data.loaded_auth_3d_uids);
prj::sort_and_erase_non_unique(data.loaded_auth_3d_uids);
for (int32_t& i : data.loaded_auth_3d_uids) {
auth_3d_id id = auth_3d_id(i, aft_auth_3d_db);
if (!id.check_not_empty())
auth_3d_detail::Handle id = auth_3d_detail::Handle::create(i, aft_auth_3d_db);
if (!id.is_valid())
continue;
id.set_enable(false);
id.set_repeat(true);
id.set_paused(false);
id.set_enabled(false);
id.set_looped(true);
id.set_pause(false);
data.auth_3d.insert_or_assign(i, id);
}
for (pv_game_field& i : data.field_data) {
for (int32_t& j : i.auth_3d_uids) {
auth_3d_id id = get_auth_3d_id(j);
if (!id.check_not_empty())
auth_3d_detail::Handle id = get_scene_id(j);
if (!id.is_valid())
continue;
for (pv_game_chreff& k : data.chreff_auth_3d_obj)
if (k.dst_auth_3d_uid == j) {
id.set_src_dst_chara(k.src_chara_num, k.dst_chara_num);
id.replace_chara(k.src_chara_num, k.dst_chara_num);
break;
}
@@ -3311,15 +3311,15 @@ bool pv_game::load() {
prj::sort(i.auth_3d_ids);
auth_3d_id light_auth_3d_id = get_auth_3d_id(i.light_auth_3d_uid);
if (light_auth_3d_id.check_not_empty())
auth_3d_detail::Handle light_auth_3d_id = get_scene_id(i.light_auth_3d_uid);
if (light_auth_3d_id.is_valid())
i.light_auth_3d_id = light_auth_3d_id;
else
i.light_auth_3d_id = {};
}
for (int32_t& i : data.campv_auth_3d_uids) {
const char* name = auth_3d_data_get_uid_name(i, aft_auth_3d_db);
const char* name = auth_3d_detail::get_name_uid(i, aft_auth_3d_db);
if (!name)
continue;
@@ -3329,17 +3329,17 @@ bool pv_game::load() {
auto elem = data.auth_3d.find(i);
if (elem != data.auth_3d.end()) {
auth_3d_id& id = elem->second;
id.set_camera_root_update(true);
id.set_repeat(false);
id.set_frame_rate(get_diva_pv_frame_rate());
auth_3d_detail::Handle& id = elem->second;
id.camera_set_enabled(true);
id.set_looped(false);
id.set_frame_rate_control(get_diva_pv_frame_rate());
data.campv.insert_or_assign(cam_index, id);
}
}
data.campv_index = 0;
for (int32_t& i : data.itmpv_auth_3d_uids) {
const char* name = auth_3d_data_get_uid_name(i, aft_auth_3d_db);
const char* name = auth_3d_detail::get_name_uid(i, aft_auth_3d_db);
if (!name)
continue;
@@ -3368,22 +3368,22 @@ bool pv_game::load() {
auto elem = data.auth_3d.find(i);
if (elem != data.auth_3d.end())
data.itmpv[chara_id].insert_or_assign(itm_index,
std::pair<auth_3d_id, int64_t>(elem->second, -1));
std::pair<auth_3d_detail::Handle, int64_t>(elem->second, -1));
}
}
itmpv_reset();
for (pv_game_edit_instrument& i : data.edit_instrument) {
for (auto& j : i.data) {
auth_3d_id id = auth_3d_id(j.second, aft_auth_3d_db);
if (!id.check_not_empty())
auth_3d_detail::Handle id = auth_3d_detail::Handle::create(j.second, aft_auth_3d_db);
if (!id.is_valid())
continue;
id.set_enable(false);
id.set_repeat(true);
id.set_paused(false);
id.set_camera_root_update(false);
//id.set_object_info(j.first);
id.set_enabled(false);
id.set_looped(true);
id.set_pause(false);
id.camera_set_enabled(false);
id.set_obj_uid(j.first);
i.auth_3d_ids.push_back(id);
}
}
@@ -3441,7 +3441,7 @@ bool pv_game::load() {
if (itmpv_obj_set != -1)
data.obj_set_itmpv.push_back(itmpv_obj_set);
prj::sort_unique(data.obj_set_itmpv);
prj::sort_and_erase_non_unique(data.obj_set_itmpv);
for (uint32_t& i : data.obj_set_itmpv)
objset_info_storage_load_set(aft_data, aft_obj_db, i);
@@ -3465,7 +3465,7 @@ bool pv_game::load() {
}
}
prj::sort_unique(data.obj_set_handitem);
prj::sort_and_erase_non_unique(data.obj_set_handitem);
for (uint32_t& i : data.obj_set_handitem)
objset_info_storage_load_set(aft_data, aft_obj_db, i);
@@ -3483,8 +3483,8 @@ bool pv_game::load() {
if (spr::wait(i, aft_spr_db))
wait_load |= true;
for (std::string& i : data.auth_3d_categories)
if (!auth_3d_data_check_category_loaded(i.c_str()))
for (const std::string& i : data.auth_3d_categories)
if (!auth_3d_detail::category_load_is_done(i.c_str()))
wait_load |= true;
for (uint32_t& i : data.edit_effect.aet_set_ids)
@@ -3528,11 +3528,11 @@ bool pv_game::load() {
} break;
case 10: {
for (auto& i : data.auth_3d)
i.second.read_file(aft_auth_3d_db);
i.second.load_req(aft_auth_3d_db);
for (pv_game_edit_instrument& i : data.edit_instrument)
for (auth_3d_id& j : i.auth_3d_ids)
j.read_file(aft_auth_3d_db);
for (auth_3d_detail::Handle& j : i.auth_3d_ids)
j.load_req(aft_auth_3d_db);
if (Glitter::glt_particle_manager) {
Glitter::counter.Reset();
@@ -3549,12 +3549,12 @@ bool pv_game::load() {
bool wait_load = false;
for (auto& i : data.auth_3d)
if (!i.second.check_loaded())
if (!i.second.load_is_done())
wait_load |= true;
for (pv_game_edit_instrument& i : data.edit_instrument)
for (auth_3d_id& j : i.auth_3d_ids)
if (!j.check_loaded())
for (auth_3d_detail::Handle& j : i.auth_3d_ids)
if (!j.load_is_done())
wait_load |= true;
if (!wait_load)
@@ -3628,7 +3628,7 @@ bool pv_game::load() {
}
for (pv_game_field& j : data.field_data)
for (auth_3d_id& k : j.auth_3d_ids)
for (auth_3d_detail::Handle& k : j.auth_3d_ids)
if (k.get_uid() == org_uid) {
auto elem = data.auth_3d.find(uid);
if (elem != data.auth_3d.end()) {
@@ -3884,13 +3884,13 @@ bool pv_game::load() {
}
for (int32_t& i : data.campv_auth_3d_uids) {
const char* name = auth_3d_data_get_uid_name(i, aft_auth_3d_db);
const char* name = auth_3d_detail::get_name_uid(i, aft_auth_3d_db);
if (!name || !check_chrcam(name, i))
continue;
auto elem = data.auth_3d.find(i);
if (elem != data.auth_3d.end())
elem->second.set_enable(false);
elem->second.set_enabled(false);
}
itmpv_reset();
@@ -3899,18 +3899,18 @@ bool pv_game::load() {
for (pv_game_field& i : data.field_data) {
for (int32_t& j : i.auth_3d_uids) {
auth_3d_id id = get_auth_3d_id(j);
id.set_enable(false);
id.set_visibility(false);
id.set_paused(false);
id.set_req_frame(0.0f);
auth_3d_detail::Handle id = get_scene_id(j);
id.set_enabled(false);
id.set_visible(false);
id.set_pause(false);
id.set_frame_req(0.0f);
}
if (i.light_auth_3d_id.check_not_empty()) {
i.light_auth_3d_id.set_enable(false);
i.light_auth_3d_id.set_visibility(false);
i.light_auth_3d_id.set_paused(false);
i.light_auth_3d_id.set_req_frame(0.0f);
if (i.light_auth_3d_id.is_valid()) {
i.light_auth_3d_id.set_enabled(false);
i.light_auth_3d_id.set_visible(false);
i.light_auth_3d_id.set_pause(false);
i.light_auth_3d_id.set_frame_req(0.0f);
}
}
@@ -4235,11 +4235,11 @@ void pv_game::reset_field() {
if (data.current_field) {
pv_game_field& curr_field_data = data.field_data[data.current_field];
for (auth_3d_id& i : curr_field_data.auth_3d_ids)
i.set_enable(false);
for (auth_3d_detail::Handle& i : curr_field_data.auth_3d_ids)
i.set_enabled(false);
if (curr_field_data.light_auth_3d_id.check_not_empty())
curr_field_data.light_auth_3d_id.set_enable(false);
if (curr_field_data.light_auth_3d_id.is_valid())
curr_field_data.light_auth_3d_id.set_enabled(false);
data.current_field = 0;
}
@@ -4336,15 +4336,14 @@ void pv_game::restart() {
auth_3d_database* aft_auth_3d_db = &aft_data->data_ft.auth_3d_db;
for (int32_t& i : data.campv_auth_3d_uids) {
int32_t uid = i;
const char* name = auth_3d_data_get_uid_name(uid, aft_auth_3d_db);
if (!name)
const char* name = auth_3d_detail::get_name_uid(i, aft_auth_3d_db);
continue;
int32_t uid = i;
if (check_chrcam(name, uid)) {
auto elem = data.auth_3d.find(uid);
if (elem != data.auth_3d.end())
elem->second.set_enable(false);
elem->second.set_enabled(false);
}
}
@@ -4382,16 +4381,16 @@ void pv_game::set_data_campv(int32_t type, int32_t index, float_t frame) {
if (campv_index) {
auto elem = data.campv.find(campv_index);
if (elem != data.campv.end())
elem->second.set_enable(false);
elem->second.set_enabled(false);
}
data.campv_index = index;
auth_3d_id& id = elem->second;
id.set_enable(true);
auth_3d_detail::Handle& id = elem->second;
id.set_enabled(true);
data.camera_auth_3d_uid = id.get_uid();
if (type == 0 || type == 1) {
id.set_req_frame(frame);
id.set_paused(false);
id.set_frame_req(frame);
id.set_pause(false);
}
}
@@ -4400,15 +4399,15 @@ void pv_game::set_data_itmpv(int32_t rob_id, int32_t index, bool enable, int64_t
if (elem == data.itmpv[rob_id].end())
return;
auth_3d_id& id = elem->second.first;
auth_3d_detail::Handle& id = elem->second.first;
if (enable) {
id.set_enable(true);
id.set_paused(false);
id.set_req_frame(0.0f);
id.set_enabled(true);
id.set_pause(false);
id.set_frame_req(0.0f);
elem->second.second = time;
}
else {
id.set_enable(false);
id.set_enabled(false);
elem->second.second = -1;
}
}
@@ -4416,35 +4415,35 @@ void pv_game::set_data_itmpv(int32_t rob_id, int32_t index, bool enable, int64_t
void pv_game::set_data_itmpv_chara_id(int32_t rob_id, int32_t index, bool attach) {
auto elem = data.itmpv[rob_id].find(index);
if (elem != data.itmpv[rob_id].end())
elem->second.first.set_chara_id(attach ? rob_id : ROB_ID_NULL);
elem->second.first.assign_rob_id(attach ? rob_id : ROB_ID_NULL);
}
void pv_game::set_data_itmpv_req_frame(int32_t rob_id, int32_t index, float_t value) {
auto elem = data.itmpv[rob_id].find(index);
if (elem != data.itmpv[rob_id].end())
elem->second.first.set_req_frame(value);
elem->second.first.set_frame_req(value);
}
void pv_game::set_data_itmpv_max_frame(int32_t rob_id, float_t value) {
for (auto& i : data.itmpv[rob_id])
i.second.first.set_max_frame(value);
i.second.first.set_frame_max(value);
}
void pv_game::set_data_itmpv_max_frame(int32_t rob_id, int32_t index, float_t value) {
auto elem = data.itmpv[rob_id].find(index);
if (elem != data.itmpv[rob_id].end())
elem->second.first.set_max_frame(value);
elem->second.first.set_frame_max(value);
}
void pv_game::set_data_itmpv_visibility(int32_t rob_id, bool value) {
for (auto& i : data.itmpv[rob_id])
i.second.first.set_visibility(value);
i.second.first.set_visible(value);
}
void pv_game::set_data_itmpv_visibility(int32_t rob_id, int32_t index, bool value) {
auto elem = data.itmpv[rob_id].find(index);
if (elem != data.itmpv[rob_id].end())
elem->second.first.set_visibility(value);
elem->second.first.set_visible(value);
}
void pv_game::set_edit_instrument(int32_t rob_id, bool disp, int32_t index, float_t frame, float_t frame_speed) {
@@ -4456,26 +4455,26 @@ void pv_game::set_edit_instrument(int32_t rob_id, bool disp, int32_t index, floa
if (edit_instrument.index >= edit_instrument.auth_3d_ids.size())
return;
auth_3d_id& id = edit_instrument.auth_3d_ids[edit_instrument.index];
id.set_enable(false);
auth_3d_detail::Handle& id = edit_instrument.auth_3d_ids[edit_instrument.index];
id.set_enabled(false);
}
if (index >= 0) {
if (index >= edit_instrument.auth_3d_ids.size())
return;
auth_3d_id& id = edit_instrument.auth_3d_ids[index];
if (id.check_not_empty()) {
id.set_enable(true);
id.set_visibility(disp);
id.set_paused(false);
id.set_req_frame(frame);
id.set_chara_id(rob_id);
id.set_last_frame(id.get_play_control_size() - 1.0f);
auth_3d_detail::Handle& id = edit_instrument.auth_3d_ids[index];
if (id.is_valid()) {
id.set_enabled(true);
id.set_visible(disp);
id.set_pause(false);
id.set_frame_req(frame);
id.assign_rob_id(rob_id);
id.set_frame_loop_end(id.get_frame_size() - 1.0f);
FrameRateControl* sys_frame_rate = sys_frame_rate_get(rob_id);
sys_frame_rate->set_frame_speed(frame_speed);
id.set_frame_rate(sys_frame_rate);
id.set_frame_rate_control(sys_frame_rate);
}
}
edit_instrument.index = index;
@@ -4765,15 +4764,15 @@ bool pv_game::unload() {
data.enable_movie = true;
for (auto& i : data.auth_3d)
i.second.unload(rctx_ptr);
i.second.destroy(rctx_ptr);
for (auto& i : data.edit_instrument)
for (auto& j : i.auth_3d_ids)
j.unload(rctx_ptr);
j.destroy(rctx_ptr);
if (data.field_2DAC8)
for (std::string& i : data.auth_3d_categories)
auth_3d_data_unload_category(i.c_str());
for (const std::string& i : data.auth_3d_categories)
auth_3d_detail::category_free(i.c_str());
data.camera_auth_3d_uid = -1;
data.campv_string.clear();
@@ -5045,7 +5044,7 @@ void pv_game::chara_item_alpha_callback(void* data, ROB_ID rob_id, int32_t type,
}
for (auto& i : ((pv_game*)data)->data.itmpv[rob_id])
i.second.first.set_alpha_obj_flags(alpha, flags);
i.second.first.set_trnsl(alpha, flags);
}
void pv_game::get_item_mask(pv_performer_type type,
@@ -5266,7 +5265,7 @@ bool TaskPvGame::init() {
#endif
load(data);
//touch_util::touch_reaction_set_enable(false);
//touch_util::touch_reaction_set_enabled(false);
return true;
}
@@ -5280,7 +5279,7 @@ bool TaskPvGame::dest() {
set_next_frame_speed(1.0f);
//touch_util::touch_reaction_set_enable(true);
//touch_util::touch_reaction_set_enabled(true);
return true;
}
+10 -10
View File
@@ -84,10 +84,10 @@ struct pv_game_edit_effect {
struct pv_game_field {
int32_t stage_index;
std::vector<int32_t> auth_3d_uids;
std::vector<auth_3d_id> auth_3d_ids;
std::vector<auth_3d_detail::Handle> auth_3d_ids;
std::map<int32_t, int32_t> auth_3d_frame_list;
int32_t light_auth_3d_uid;
auth_3d_id light_auth_3d_id;
auth_3d_detail::Handle light_auth_3d_id;
int32_t light_frame;
std::vector<std::string> aet_names[4];
std::vector<std::string> aet_ids[4];
@@ -107,7 +107,7 @@ struct pv_game_field {
struct pv_game_edit_instrument {
prj::vector_pair<object_info, int32_t> data;
std::vector<auth_3d_id> auth_3d_ids;
std::vector<auth_3d_detail::Handle> auth_3d_ids;
int32_t index;
pv_game_edit_instrument();
@@ -277,19 +277,19 @@ struct pv_game_data {
std::map<std::pair<std::string, std::string>, int64_t> aet_time[4];
std::string campv_string;
std::vector<int32_t> campv_auth_3d_uids;
std::map<int32_t, auth_3d_id> campv;
std::map<int32_t, auth_3d_detail::Handle> campv;
int32_t campv_index;
int32_t field_2D954;
std::string itmpv_string;
std::vector<int32_t> itmpv_auth_3d_uids;
std::map<int32_t, std::pair<auth_3d_id, int64_t>> itmpv[ROB_ID_MAX];
std::map<int32_t, std::pair<auth_3d_detail::Handle, int64_t>> itmpv[ROB_ID_MAX];
std::vector<std::string> itmpv_uids;
pv_game_edit_instrument edit_instrument[3];
std::vector<int32_t> loaded_auth_3d_uids;
bool field_2DAC8;
int32_t field_2DACC;
std::vector<std::string> auth_3d_categories;
std::map<int32_t, auth_3d_id> auth_3d;
std::map<int32_t, auth_3d_detail::Handle> auth_3d;
std::vector<pv_game_chreff> chreff_auth_3d;
std::vector<pv_game_chreff> chreff_auth_3d_obj;
bool height_adjust;
@@ -386,11 +386,11 @@ struct pv_game {
float_t get_aet_frame_max_frame_change_field(int32_t aet_index,
std::pair<std::string, std::string>& aet_name_id, int64_t time);
int64_t get_aet_time(int32_t aet_index, std::pair<std::string, std::string>& aet_name_id);
float_t get_auth_3d_frame_max_frame(int32_t auth_3d_frame, int32_t auth_3d_uid,
float_t get_scene_frame_max_frame(int32_t auth_3d_frame, int32_t auth_3d_uid,
int64_t dsc_time, int64_t curr_time, uint8_t type, float_t* max_frame);
float_t get_auth_3d_frame_max_frame_change_field(uint32_t auth_3d_uid, int64_t time, uint8_t type);
auth_3d_id get_auth_3d_id(int32_t uid);
int64_t get_auth_3d_time(int32_t uid, uint8_t type);
float_t get_scene_frame_max_frame_change_field(uint32_t auth_3d_uid, int64_t time, uint8_t type);
auth_3d_detail::Handle get_scene_id(int32_t uid);
int64_t get_scene_time(int32_t uid, uint8_t type);
uint32_t get_chreff_auth_3d_object_set(int32_t& uid);
int64_t get_data_itmpv_time(int32_t rob_id, int32_t index);
float_t get_data_rival_percentage();
+7 -7
View File
@@ -43,8 +43,8 @@ extern render_context* rctx_ptr;
pv_game_camera pv_game_camera_data;
static float_t pv_game_camera_get_acceleration();
static bool pv_game_camera_get_edit_camera(cam_struct* cam, float_t delta_time);
static bool pv_game_camera_get_move_camera(cam_struct* cam, float_t delta_time);
static bool pv_game_camera_get_edit_camera(CameraParam* cam, float_t delta_time);
static bool pv_game_camera_get_move_camera(CameraParam* cam, float_t delta_time);
pv_game_camera::pv_game_camera() : enable(), follow_chara(), edit_camera(), duration(), curr_time(),
start_distance(), end_distance(), fov(), min_dist(), rob_id(), chara_follow_point(),
@@ -86,14 +86,14 @@ void pv_game_camera_ctrl(float_t delta_time) {
return;
bool in_transition;
cam_struct cam;
CameraParam cam;
if (pv_game_camera_data.edit_camera)
in_transition = pv_game_camera_get_edit_camera(&cam, delta_time);
else
in_transition = pv_game_camera_get_move_camera(&cam, delta_time);
cam.fov = pv_game_camera_data.fov * DEG_TO_RAD_FLOAT;
cam.min_distance = pv_game_camera_data.min_dist;
cam.v_fov = pv_game_camera_data.fov * DEG_TO_RAD_FLOAT;
cam.clip_near = pv_game_camera_data.min_dist;
cam.set(rctx_ptr->camera);
if (!in_transition)
@@ -212,7 +212,7 @@ static float_t pv_game_camera_get_acceleration() {
return min_def(acceleration, 1.0f);
}
static bool pv_game_camera_get_edit_camera(cam_struct* cam, float_t delta_time) {
static bool pv_game_camera_get_edit_camera(CameraParam* cam, float_t delta_time) {
if (!cam)
return false;
@@ -248,7 +248,7 @@ static bool pv_game_camera_get_edit_camera(cam_struct* cam, float_t delta_time)
return in_transition;
}
static bool pv_game_camera_get_move_camera(cam_struct* cam, float_t delta_time) {
static bool pv_game_camera_get_move_camera(CameraParam* cam, float_t delta_time) {
if (!cam)
return false;
+13 -13
View File
@@ -517,7 +517,7 @@ bool pv_game_pv_data::dsc_ctrl(float_t delta_time, int64_t curr_time,
pv_expression_file_name.c_str(), rob_id, i.motion_id);
if (!pv_game->data.pv->disable_calc_motfrm_limit)
set_motion_max_frame(rob_id, i.motion_index, i.dsc_time);
set_motion_frame_max(rob_id, i.motion_index, i.dsc_time);
}
playdata->set_motion.clear();
}
@@ -641,7 +641,7 @@ bool pv_game_pv_data::dsc_ctrl(float_t delta_time, int64_t curr_time,
pv_expression_file_name.c_str(), rob_id, motion_id);
if (!pv_game->data.pv->disable_calc_motfrm_limit)
set_motion_max_frame(rob_id, motion_index, motion ? motion->time : 0);
set_motion_frame_max(rob_id, motion_index, motion ? motion->time : 0);
}
else {
playdata->set_motion.clear();
@@ -701,7 +701,7 @@ bool pv_game_pv_data::dsc_ctrl(float_t delta_time, int64_t curr_time,
pv_game->set_data_campv(0, index, frame);
rctx_ptr->camera->set_fast_change_hist0(true);
set_camera_max_frame(data_camera[0].time);
set_camera_frame_max(data_camera[0].time);
} break;
case 1: {
if (data_camera[1].index != index - 1) {
@@ -726,7 +726,7 @@ bool pv_game_pv_data::dsc_ctrl(float_t delta_time, int64_t curr_time,
pv_game->set_data_campv(1, index, frame);
rctx_ptr->camera->set_fast_change_hist0(true);
set_camera_max_frame(data_camera[1].time);
set_camera_frame_max(data_camera[1].time);
} break;
case 2: {
pv_game->set_data_campv(2, index, 0.0f);
@@ -1658,12 +1658,12 @@ bool pv_game_pv_data::dsc_ctrl(float_t delta_time, int64_t curr_time,
if (frame < dsc_frame)
frame = dsc_frame;
pv_game->set_data_itmpv_req_frame(rob_id, index, frame);
set_item_anim_max_frame(rob_id, index, time);
set_item_anim_frame_max(rob_id, index, time);
}
}
else if (v290 >= 0) {
pv_game->set_data_itmpv(rob_id, index, v290 != 0, dsc_time);
set_item_anim_max_frame(rob_id, index, dsc_time);
set_item_anim_frame_max(rob_id, index, dsc_time);
}
if (disp >= 0)
@@ -2582,7 +2582,7 @@ void pv_game_pv_data::scene_fade_ctrl(float_t delta_time) {
scene_fade.ctrl(delta_time);
}
void pv_game_pv_data::set_camera_max_frame(int64_t time) {
void pv_game_pv_data::set_camera_frame_max(int64_t time) {
std::vector<int32_t>& data_camera = branch_mode != 2
? data_camera_branch_fail
: data_camera_branch_success;
@@ -2590,17 +2590,17 @@ void pv_game_pv_data::set_camera_max_frame(int64_t time) {
if (10000LL * i <= dsc_time)
continue;
float_t max_frame = prj::roundf(dsc_time_to_frame(10000LL * i - time));
float_t frame_max = prj::roundf(dsc_time_to_frame(10000LL * i - time));
if (pv_game->data.camera_auth_3d_uid != -1) {
auth_3d_id id = pv_game->get_auth_3d_id(pv_game->data.camera_auth_3d_uid);
if (id.check_not_empty())
id.set_max_frame(max_frame - 1.0f);
auth_3d_detail::Handle id = pv_game->get_scene_id(pv_game->data.camera_auth_3d_uid);
if (id.is_valid())
id.set_frame_max(frame_max - 1.0f);
}
break;
}
}
void pv_game_pv_data::set_item_anim_max_frame(int32_t rob_id, int32_t index, int64_t time) {
void pv_game_pv_data::set_item_anim_frame_max(int32_t rob_id, int32_t index, int64_t time) {
if (rob_id < 0 || rob_id >= ROB_ID_MAX || index < 0)
return;
@@ -2612,7 +2612,7 @@ void pv_game_pv_data::set_item_anim_max_frame(int32_t rob_id, int32_t index, int
}
}
void pv_game_pv_data::set_motion_max_frame(int32_t rob_id, int32_t motion_index, int64_t time) {
void pv_game_pv_data::set_motion_frame_max(int32_t rob_id, int32_t motion_index, int64_t time) {
if (rob_id < 0 || rob_id >= ROB_ID_MAX || motion_index < 0)
return;
+3 -3
View File
@@ -344,7 +344,7 @@ struct pv_game_pv_data {
void reset();
void reset_camera_post_process();
void scene_fade_ctrl(float_t delta_time);
void set_camera_max_frame(int64_t time);
void set_item_anim_max_frame(int32_t rob_id, int32_t index, int64_t time);
void set_motion_max_frame(int32_t rob_id, int32_t motion_index, int64_t time);
void set_camera_frame_max(int64_t time);
void set_item_anim_frame_max(int32_t rob_id, int32_t index, int64_t time);
void set_motion_frame_max(int32_t rob_id, int32_t motion_index, int64_t time);
};
+442 -451
View File
File diff suppressed because it is too large Load Diff
+11 -11
View File
@@ -163,10 +163,10 @@ struct x_pv_play_data {
};
struct x_pv_game_song_effect_auth_3d {
auth_3d_id id;
auth_3d_detail::Handle id;
x_pv_game_song_effect_auth_3d();
x_pv_game_song_effect_auth_3d(auth_3d_id id);
x_pv_game_song_effect_auth_3d(auth_3d_detail::Handle id);
void reset();
};
@@ -200,7 +200,7 @@ struct x_pv_game_camera {
int32_t state;
string_hash category;
string_hash file;
auth_3d_id id;
auth_3d_detail::Handle id;
FrameRateControl* frame_rate_control;
x_pv_game_camera();
@@ -229,11 +229,11 @@ struct x_pv_game_effect {
x_pv_game_effect();
~x_pv_game_effect();
void assign_rob_id(int32_t index, ROB_ID rob_id, bool chara_scale);
void ctrl(object_database* obj_db, texture_database* tex_db);
void load(int32_t pv_id, pvpp* play_param, FrameRateControl* frame_rate_control);
void load_data(int32_t pv_id, object_database* obj_db, texture_database* tex_db);
void reset();
void set_chara_id(int32_t index, ROB_ID rob_id, bool chara_scale);
void set_song_effect(int32_t index, int64_t time);
void set_song_effect_time(int32_t index, int64_t time, bool glitter);
void set_song_effect_time_inner(int32_t index, int64_t time, bool glitter);
@@ -246,12 +246,12 @@ struct x_pv_game_effect {
struct x_pv_game_chara_effect_auth_3d {
bool field_0;
CHARA_NUM src_chara;
CHARA_NUM dst_chara;
CHARA_NUM cn_src;
CHARA_NUM cn_dst;
string_hash file;
string_hash category;
string_hash object_set;
auth_3d_id id;
auth_3d_detail::Handle id;
int64_t time;
std::string node_name;
int32_t objhrc_index;
@@ -570,7 +570,7 @@ public:
};
struct x_pv_game_stage_env_data {
auth_3d_id light_auth_3d_id;
auth_3d_detail::Handle light_auth_3d_id;
aet_obj_data data[5][8];
x_pv_game_stage_env_data();
@@ -620,7 +620,7 @@ struct x_pv_game_stage_env {
struct x_pv_game_stage_effect_auth_3d {
bool repeat;
bool field_1;
auth_3d_id id;
auth_3d_detail::Handle id;
x_pv_game_stage_effect_auth_3d();
@@ -716,7 +716,7 @@ struct x_pv_game_stage {
object_database obj_db;
texture_database tex_db;
std::map<uint32_t, auth_3d_id> auth_3d_ids;
std::map<uint32_t, auth_3d_detail::Handle> auth_3d_ids;
x_pv_game_stage();
~x_pv_game_stage();
@@ -760,7 +760,7 @@ public:
std::string light_category;
auth_3d_id light_auth_3d_id;
auth_3d_detail::Handle light_auth_3d_id;
bool success;
bool task_effect_init;