Part 1 of ? of massive overhaul of Rob

This commit is contained in:
korenkonder
2026-04-27 01:43:32 +03:00
parent 3c41f098cf
commit eef24aed83
80 changed files with 14014 additions and 11293 deletions
+46 -32
View File
@@ -68,7 +68,7 @@ namespace Glitter {
enum_or(flags, EFFECT_INST_EXT_SCALE);
}
int32_t EffectInst::GetExtAnimBoneIndex(GPM, EffectExtAnimCharaNode node) {
int32_t EffectInst::GetExtAnimNodeIndex(GPM, EffectExtAnimCharaNode node) {
if (node < EFFECT_EXT_ANIM_CHARA_HEAD || node > EFFECT_EXT_ANIM_CHARA_RIGHT_TOE)
return -1;
@@ -136,8 +136,8 @@ namespace Glitter {
enum_or(flags, EFFECT_INST_EXT_ANIM_TRANS_ONLY);
if (ext_anim->flags & EFFECT_EXT_ANIM_CHARA) {
inst_ext_anim->chara_index = ext_anim->chara_index;
inst_ext_anim->bone_index = GetExtAnimBoneIndex(GPM_VAL, ext_anim->node_index);
inst_ext_anim->rob_id = ext_anim->rob_id;
inst_ext_anim->node_index = GetExtAnimNodeIndex(GPM_VAL, ext_anim->node_index);
enum_or(flags, EFFECT_INST_EXT_ANIM_CHARA);
inst_ext_anim->mesh_name = 0;
}
@@ -379,11 +379,15 @@ namespace Glitter {
int32_t chara_id;
if (flags & EFFECT_INST_EXT_ANIM_CHARA) {
rob_chara* rob_chr = rob_chara_array_get(ext_anim->chara_index);
RobManagement* rob_man = get_rob_management();
if (!rob_man)
return;
rob_chara* rob_chr = rob_man->get_rob((ROB_ID)ext_anim->rob_id);
if (!rob_chr)
return;
mat4 mat = rob_chr->data.adjust_data.mat;
mat4 mat = rob_chr->rob_base.adjust.mat;
vec3 scale;
mat4_get_scale(&mat, &scale);
@@ -391,9 +395,9 @@ namespace Glitter {
ext_anim_scale.z = 0.0f;
enum_or(flags, EFFECT_INST_EXT_SCALE);
int32_t bone_index = ext_anim->bone_index;
if (bone_index != -1) {
mat4* bone_mat = rob_chr->get_bone_data_mat(bone_index);
int32_t node_index = ext_anim->node_index;
if (node_index != -1) {
mat4* bone_mat = rob_chr->get_bone_data_mat(node_index);
if (!bone_mat)
return;
@@ -430,15 +434,18 @@ namespace Glitter {
mat4 mat = mat4_identity;
chara_id = auth_3d_id(ext_anim->a3da_id).get_chara_id();
if (chara_id >= 0 && chara_id < ROB_ID_MAX) {
rob_chara* rob_chr = rob_chara_array_get(chara_id);
if (rob_chr) {
mat = rob_chr->data.adjust_data.mat;
RobManagement* rob_man = get_rob_management();
if (rob_man) {
rob_chara* rob_chr = rob_man->get_rob((ROB_ID)ext_anim->rob_id);
if (rob_chr) {
mat = rob_chr->rob_base.adjust.mat;
vec3 scale;
mat4_get_scale(&mat, &scale);
ext_anim_scale = scale - 1.0f;
ext_anim_scale.z = 0.0f;
enum_or(flags, EFFECT_INST_EXT_SCALE);
vec3 scale;
mat4_get_scale(&mat, &scale);
ext_anim_scale = scale - 1.0f;
ext_anim_scale.z = 0.0f;
enum_or(flags, EFFECT_INST_EXT_SCALE);
}
}
}
@@ -715,8 +722,8 @@ namespace Glitter {
enum_or(flags, EFFECT_INST_EXT_ANIM_GET_THEN_UPDATE);
if (ext_anim->flags & EFFECT_EXT_ANIM_CHARA) {
inst_ext_anim->chara_index = ext_anim->chara_index;
inst_ext_anim->bone_index = GetExtAnimBoneIndex(GPM_VAL, ext_anim->node_index);
inst_ext_anim->rob_id = ext_anim->rob_id;
inst_ext_anim->node_index = GetExtAnimNodeIndex(GPM_VAL, ext_anim->node_index);
enum_or(flags, EFFECT_INST_EXT_ANIM_CHARA);
}
else {
@@ -1074,11 +1081,15 @@ namespace Glitter {
enum_or(flags, EFFECT_INST_EXT_ANIM_NON_INIT);
if (flags & EFFECT_INST_EXT_ANIM_CHARA) {
rob_chara* rob_chr = rob_chara_array_get(ext_anim->chara_index);
RobManagement* rob_man = get_rob_management();
if (!rob_man)
return;
rob_chara* rob_chr = rob_man->get_rob((ROB_ID)ext_anim->rob_id);
if (!rob_chr)
return;
mat4* mat = &rob_chr->data.adjust_data.mat;
mat4* mat = &rob_chr->rob_base.adjust.mat;
vec3 scale;
mat4_get_scale(mat, &scale);
@@ -1086,14 +1097,14 @@ namespace Glitter {
ext_anim_scale.z = 0.0f;
enum_or(flags, EFFECT_INST_EXT_SCALE);
if (rob_chr->is_visible() || !(data.ext_anim_x->flags & EFFECT_EXT_ANIM_NO_DRAW_IF_NO_DATA))
if (rob_chr->get_disp_flag() || !(data.ext_anim_x->flags & EFFECT_EXT_ANIM_NO_DRAW_IF_NO_DATA))
set_flags = true;
else
set_flags = false;
int32_t bone_index = ext_anim->bone_index;
if (bone_index != -1) {
mat4* bone_mat = rob_chr->get_bone_data_mat(bone_index);
int32_t node_index = ext_anim->node_index;
if (node_index != -1) {
mat4* bone_mat = rob_chr->get_bone_data_mat(node_index);
if (bone_mat)
SetExtAnim(mat, bone_mat, 0, set_flags);
}
@@ -1124,15 +1135,18 @@ namespace Glitter {
int32_t chara_id = auth_3d_id(ext_anim->a3da_id).get_chara_id();
if (chara_id >= 0 && chara_id < ROB_ID_MAX) {
rob_chara* rob_chr = rob_chara_array_get(chara_id);
if (rob_chr) {
mat = rob_chr->data.adjust_data.mat;
RobManagement* rob_man = get_rob_management();
if (rob_man) {
rob_chara* rob_chr = rob_man->get_rob((ROB_ID)ext_anim->rob_id);
if (rob_chr) {
mat = rob_chr->rob_base.adjust.mat;
vec3 scale;
mat4_get_scale(&mat, &scale);
ext_anim_scale = scale - 1.0f;
ext_anim_scale.z = 0.0f;
enum_or(flags, EFFECT_INST_EXT_SCALE);
vec3 scale;
mat4_get_scale(&mat, &scale);
ext_anim_scale = scale - 1.0f;
ext_anim_scale.z = 0.0f;
enum_or(flags, EFFECT_INST_EXT_SCALE);
}
}
}
+4 -4
View File
@@ -1189,14 +1189,14 @@ namespace Glitter {
eff->data.ext_anim_x = ext_anim_x;
if (ext_anim_x) {
if (big_endian) {
ext_anim_x->chara_index = load_reverse_endianness_int32_t((void*)d);
ext_anim_x->rob_id = load_reverse_endianness_int32_t((void*)d);
ext_anim_x->flags = (EffectExtAnimFlag)
load_reverse_endianness_int32_t((void*)(d + 4));
ext_anim_x->node_index = (EffectExtAnimCharaNode)
load_reverse_endianness_int32_t((void*)(d + 8));
}
else {
ext_anim_x->chara_index = *(int32_t*)d;
ext_anim_x->rob_id = *(int32_t*)d;
ext_anim_x->flags = (EffectExtAnimFlag) * (int32_t*)(d + 4);
ext_anim_x->node_index = (EffectExtAnimCharaNode) * (int32_t*)(d + 8);
}
@@ -1367,14 +1367,14 @@ namespace Glitter {
eff->data.ext_anim = ext_anim;
if (ext_anim) {
if (big_endian) {
ext_anim->chara_index = load_reverse_endianness_int32_t((void*)d);
ext_anim->rob_id = load_reverse_endianness_int32_t((void*)d);
ext_anim->flags = (EffectExtAnimFlag)
load_reverse_endianness_int32_t((void*)(d + 4));
ext_anim->node_index = (EffectExtAnimCharaNode)
load_reverse_endianness_int32_t((void*)(d + 8));
}
else {
ext_anim->chara_index = *(int32_t*)d;
ext_anim->rob_id = *(int32_t*)d;
ext_anim->flags = (EffectExtAnimFlag) * (int32_t*)(d + 4);
ext_anim->node_index = (EffectExtAnimCharaNode) * (int32_t*)(d + 8);
}
+4 -4
View File
@@ -789,12 +789,12 @@ namespace Glitter {
enum_and(ext_anim_flag, ~EFFECT_EXT_ANIM_CHARA);
if (big_endian) {
store_reverse_endianness_int32_t((void*)d, ext_anim_x->chara_index);
store_reverse_endianness_int32_t((void*)d, ext_anim_x->rob_id);
store_reverse_endianness_int32_t((void*)(d + 4), ext_anim_flag);
store_reverse_endianness_int32_t((void*)(d + 8), ext_anim_x->node_index);
}
else {
*(int32_t*)d = ext_anim_x->chara_index;
*(int32_t*)d = ext_anim_x->rob_id;
*(int32_t*)(d + 4) = ext_anim_flag;
*(int32_t*)(d + 8) = ext_anim_x->node_index;
}
@@ -913,12 +913,12 @@ namespace Glitter {
enum_and(ext_anim_flag, ~EFFECT_EXT_ANIM_CHARA);
if (big_endian) {
store_reverse_endianness_int32_t((void*)d, ext_anim->chara_index);
store_reverse_endianness_int32_t((void*)d, ext_anim->rob_id);
store_reverse_endianness_int32_t((void*)(d + 4), ext_anim_flag);
store_reverse_endianness_int32_t((void*)(d + 8), ext_anim->node_index);
}
else {
*(int32_t*)d = ext_anim->chara_index;
*(int32_t*)d = ext_anim->rob_id;
*(int32_t*)(d + 4) = ext_anim_flag;
*(int32_t*)(d + 8) = ext_anim->node_index;
}
+1 -1
View File
@@ -121,7 +121,7 @@ namespace Glitter {
PIVOT_TOP_LEFT,
};
const char* effect_ext_anim_index_name[] = {
const char* effect_ext_anim_rob_id_name[] = {
"P1",
"P2",
"P3",
+8 -8
View File
@@ -473,7 +473,7 @@ namespace Glitter {
extern const ParticleBlendMask particle_blend_mask_default;
extern const Pivot pivot_reverse[];
extern const char* effect_ext_anim_index_name[];
extern const char* effect_ext_anim_rob_id_name[];
extern const char* effect_ext_anim_node_index_name[];
extern const char* effect_type_name[];
extern const char* emitter_name[];
@@ -657,7 +657,7 @@ namespace Glitter {
char mesh_name[0x80];
};
struct {
int32_t chara_index;
int32_t rob_id;
EffectExtAnimCharaNode node_index;
};
};
@@ -673,7 +673,7 @@ namespace Glitter {
char mesh_name[0x80];
};
struct {
int32_t chara_index;
int32_t rob_id;
EffectExtAnimCharaNode node_index;
};
};
@@ -943,7 +943,7 @@ namespace Glitter {
void SetExtColor(float_t r, float_t g, float_t b, float_t a, bool set);
void SetExtScale(float_t scale);
static int32_t GetExtAnimBoneIndex(GPM, EffectExtAnimCharaNode node);
static int32_t GetExtAnimNodeIndex(GPM, EffectExtAnimCharaNode node);
};
class EffectInstF2 : public EffectInst {
@@ -959,8 +959,8 @@ namespace Glitter {
const char* mesh_name;
};
struct {
int32_t chara_index;
int32_t bone_index;
int32_t rob_id;
int32_t node_index;
};
};
mat4 mat;
@@ -1023,8 +1023,8 @@ namespace Glitter {
const char* mesh_name;
};
struct {
int32_t chara_index;
int32_t bone_index;
int32_t rob_id;
int32_t node_index;
};
};
mat4 mat;
+2 -2
View File
@@ -2232,7 +2232,7 @@ namespace Glitter {
int32_t tex_trans_count = 0;
for (texture_transform_struct& i : tex_trans) {
tex_trans->id = hash_murmurhash_empty;
tex_trans->texid = hash_murmurhash_empty;
tex_trans->mat = mat4_identity;
}
@@ -2242,7 +2242,7 @@ namespace Glitter {
if (i.tex_index == hash_murmurhash_empty || i.tex_index == hash_murmurhash_null)
continue;
tex_trans[tex_trans_count].id = i.tex_index;
tex_trans[tex_trans_count].texid = i.tex_index;
tex_trans[tex_trans_count].mat = mat4_identity;
tex_trans_count++;
+82 -67
View File
@@ -118,6 +118,7 @@ static void auth_3d_camera_root_view_point_store(auth_3d* auth, auth_3d_camera_r
auth_3d_camera_root_view_point_file* crvpf);
static void auth_3d_chara_disp(auth_3d_chara* c, auth_3d* auth, render_context* rctx);
static void auth_3d_chara_load(auth_3d* auth, auth_3d_chara* c, auth_3d_chara_file* cf);
static void auth_3d_chara_set(auth_3d_chara* c, auth_3d* auth, render_context* rctx);
static void auth_3d_chara_store(auth_3d* auth, auth_3d_chara* c, auth_3d_chara_file* cf);
static void auth_3d_curve_load(auth_3d* auth, auth_3d_curve* c, auth_3d_curve_file* cf);
static void auth_3d_curve_store(auth_3d* auth, auth_3d_curve* c, auth_3d_curve_file* cf);
@@ -231,15 +232,13 @@ static size_t auth_3d_time_event_radix_index_func_frame(auth_3d_time_event* data
auth_3d_data_struct* auth_3d_data;
auth_3d_detail::TaskAuth3d* task_auth_3d;
bool auth_3d_chara_visible = true;
static int16_t auth_3d_load_counter;
static auth_3d_detail::FrameRateTimeStop frame_rate_time_stop;
extern render_context* rctx_ptr;
auth_3d::auth_3d() : uid(), id(), mat(), enable(), camera_root_update(), visible(), repeat(), field_C(), ended(),
left_right_reverse(), once(), alpha(), chara_id(), chara_item(), shadow(), reflect(), pos(), frame_rate(), frame(),
mirror(), once(), alpha(), rob_id(), chara_item(), shadow(), reflect(), pos(), frame_rate(), frame(),
req_frame(), max_frame(), frame_changed(), frame_offset(), last_frame(), paused(), event_time_next() {
hash = hash_murmurhash_empty;
src_chara = CN_MAX;
@@ -331,6 +330,9 @@ void auth_3d::ctrl(render_context* rctx) {
post_process.interpolate(frame);
auth_3d_post_process_set(&post_process, rctx);
for (auth_3d_chara& i : chara)
auth_3d_chara_set(&i, this, rctx);
auth_3d_time_event* i_event = event_time_next;
auth_3d_time_event* i_event_end = event_time.data() + event_time.size();
for (; i_event != i_event_end && frame >= i_event->frame; i_event++) {
@@ -370,7 +372,7 @@ void auth_3d::ctrl(render_context* rctx) {
cam.fov = i.fov_value;
cam.roll = i.roll_value;
if (left_right_reverse) {
if (mirror) {
cam.interest.x = -cam.interest.x;
cam.view_point.x = -cam.view_point.x;
cam.roll = -cam.roll;
@@ -806,12 +808,12 @@ void auth_3d::reset() {
repeat = false;
field_C = false;
ended = false;
left_right_reverse = false;
mirror = false;
once = false;
mat = mat4_identity;
alpha = 1.0f;
obj_flags = mdl::OBJ_ALPHA_ORDER_POST_GLITTER;
chara_id = -1;
rob_id = ROB_ID_NULL;
chara_item = false;
shadow = false;
reflect = false;
@@ -1204,7 +1206,7 @@ namespace auth_3d_detail {
auth_3d_point& point = auth->point[index];
vec3 pos = point.model_transform.translation_value;
if (auth->left_right_reverse)
if (auth->mirror)
pos.x = -pos.x;
mat4_transform_point(&auth->mat, &pos, &pos);
@@ -1243,10 +1245,10 @@ namespace auth_3d_detail {
if (cam || !auth->chara.size() || index >= auth->chara.size())
return;
int32_t chr_index = auth->chara[index].index;
rob_chara* rob_chr = rob_chara_array_get(chr_index);
ROB_ID rob_id = (ROB_ID)auth->chara[index].rob_id;
rob_chara* rob_chr = get_rob_management()->get_rob(rob_id);
if (rob_chr)
rob_chr->field_C = true;
rob_chr->disp_pos_reset = true;
}
void EventFXSmoothCut::End(auth_3d* auth, int32_t flags, render_context* rctx) {
@@ -1312,18 +1314,18 @@ namespace auth_3d_detail {
void EventFilterTimeStop::Begin(auth_3d* auth, int32_t flags, render_context* rctx) {
for (auth_3d_chara& i : auth->chara) {
rob_chara* rob_chr = rob_chara_array_get(i.index);
rob_chara* rob_chr = get_rob_management()->get_rob((ROB_ID)i.rob_id);
if (rob_chr)
rob_chr->rob_disp->disable_update = true;
rob_chr->disp->disable_update = true;
}
effect_manager_set_frame_rate_control(&frame_rate_time_stop);
}
void EventFilterTimeStop::End(auth_3d* auth, int32_t flags, render_context* rctx) {
for (auth_3d_chara& i : auth->chara) {
rob_chara* rob_chr = rob_chara_array_get(i.index);
rob_chara* rob_chr = get_rob_management()->get_rob((ROB_ID)i.rob_id);
if (rob_chr)
rob_chr->rob_disp->disable_update = true;
rob_chr->disp->disable_update = true;
}
effect_manager_set_frame_rate_control(get_sys_frame_rate());
}
@@ -1377,7 +1379,7 @@ namespace auth_3d_detail {
}
static void sub_140532980(int32_t chara_id, const char* name) {
static void sub_140532980(ROB_ID rob_id, const char* name) {
}
@@ -1386,12 +1388,12 @@ namespace auth_3d_detail {
if (begin > frame || frame >= end || ((flags & 0x02) && fabsf(frame - begin) > 0.1f))
return;
int32_t index = -1;
ROB_ID rob_id = ROB_ID_NULL;
if (auth->chara.size())
index = auth->chara.front().index;
rob_id = (ROB_ID)auth->chara.front().rob_id;
if (index >= 0 && index < ROB_ID_MAX)
sub_140532980(index, param1.c_str());
if (rob_id >= 0 && rob_id < ROB_ID_MAX)
sub_140532980(rob_id, param1.c_str());
else if (sound_work_has_property(param1.c_str()))
sound_work_play_se(1, param1.c_str());
}
@@ -1738,7 +1740,7 @@ void auth_3d_camera_root_view_point::reset() {
roll.reset();
}
auth_3d_chara::auth_3d_chara() : index() {
auth_3d_chara::auth_3d_chara() : rob_id() {
reset();
}
@@ -1754,7 +1756,7 @@ void auth_3d_chara::reset() {
model_transform.reset();
name.clear();
name.shrink_to_fit();
index = -1;
rob_id = ROB_ID_NULL;
}
auth_3d_curve::auth_3d_curve() : value() {
@@ -2643,9 +2645,9 @@ int32_t auth_3d_id::get_chara_id() {
if (id >= 0 && ((id & 0x7FFF) < AUTH_3D_DATA_COUNT)) {
auth_3d* auth = &auth_3d_data->data[id & 0x7FFF];
if (auth->id == id)
return auth->chara_id;
return auth->rob_id;
}
return -1;
return ROB_ID_NULL;
}
bool auth_3d_id::get_enable() {
@@ -2693,11 +2695,11 @@ float_t auth_3d_id::get_last_frame() {
return 0.0f;
}
bool auth_3d_id::get_left_right_reverse() {
bool auth_3d_id::get_mirror() {
if (id >= 0 && ((id & 0x7FFF) < AUTH_3D_DATA_COUNT)) {
auth_3d* auth = &auth_3d_data->data[id & 0x7FFF];
if (auth->id == id)
return auth->left_right_reverse;
return auth->mirror;
}
return false;
}
@@ -2785,7 +2787,7 @@ void auth_3d_id::set_chara_id(int32_t value) {
if (id >= 0 && ((id & 0x7FFF) < AUTH_3D_DATA_COUNT)) {
auth_3d* auth = &auth_3d_data->data[id & 0x7FFF];
if (auth->id == id)
auth->chara_id = value;
auth->rob_id = value;
}
}
@@ -2794,7 +2796,7 @@ void auth_3d_id::set_chara_num(size_t auth_chara_id, int32_t index) {
auth_3d* auth = &auth_3d_data->data[id & 0x7FFF];
if (auth->id == id)
if (auth_chara_id < auth->chara.size())
auth->chara[auth_chara_id].index = index;
auth->chara[auth_chara_id].rob_id = index;
}
}
@@ -2833,14 +2835,6 @@ void auth_3d_id::set_last_frame(float_t value) {
}
}
void auth_3d_id::set_left_right_reverse(bool value) {
if (id >= 0 && ((id & 0x7FFF) < AUTH_3D_DATA_COUNT)) {
auth_3d* auth = &auth_3d_data->data[id & 0x7FFF];
if (auth->id == id)
auth->left_right_reverse = value;
}
}
void auth_3d_id::set_mat(const mat4& value) {
if (id >= 0 && ((id & 0x7FFF) < AUTH_3D_DATA_COUNT)) {
auth_3d* auth = &auth_3d_data->data[id & 0x7FFF];
@@ -2857,6 +2851,14 @@ void auth_3d_id::set_max_frame(float_t value) {
}
}
void auth_3d_id::set_mirror(bool value) {
if (id >= 0 && ((id & 0x7FFF) < AUTH_3D_DATA_COUNT)) {
auth_3d* auth = &auth_3d_data->data[id & 0x7FFF];
if (auth->id == id)
auth->mirror = value;
}
}
void auth_3d_id::set_paused(bool value) {
if (id >= 0 && ((id & 0x7FFF) < AUTH_3D_DATA_COUNT)) {
auth_3d* auth = &auth_3d_data->data[id & 0x7FFF];
@@ -3201,18 +3203,6 @@ void auth_3d_data_free() {
}
}
void auth_3d_check_chara_visible(int32_t chara_id, const struct rob_chara_pv_data* pv_data) {
data_struct* aft_data = &data_list[DATA_AFT];
bone_database* aft_bone_data = &aft_data->data_ft.bone_data;
motion_database* aft_mot_db = &aft_data->data_ft.mot_db;
rob_chara_array_get(chara_id)->reset_data(pv_data, aft_bone_data, aft_mot_db);
if (rob_chara_array_check_visibility(0) || rob_chara_array_check_visibility(1))
auth_3d_chara_visible = true;
else
auth_3d_chara_visible = false;
}
void task_auth_3d_init() {
if (!task_auth_3d)
task_auth_3d = new auth_3d_detail::TaskAuth3d;
@@ -4411,8 +4401,8 @@ static void auth_3d_camera_root_view_point_store(auth_3d* auth, auth_3d_camera_r
}
static void auth_3d_chara_disp(auth_3d_chara* c, auth_3d* auth, render_context* rctx) {
if (c->index <= ROB_ID_MAX)
rob_chara_array_set_visibility(c->index, c->model_transform.visible);
if (c->rob_id >= 0 && c->rob_id <= ROB_ID_MAX)
get_rob_management()->set_disp_on((ROB_ID)c->rob_id, c->model_transform.visible);
if (auth->pos) {
c->model_transform.set_mat(&auth->mat);
@@ -4425,6 +4415,29 @@ static void auth_3d_chara_load(auth_3d* auth, auth_3d_chara* c, auth_3d_chara_fi
c->name.assign(cf->name);
}
static void auth_3d_chara_set(auth_3d_chara* c, auth_3d* auth, render_context* rctx) {
mat4 mat = auth->mat;
vec3 pos = c->model_transform.translation_value;
if (auth->mirror)
pos.x = -pos.x;
mat4_transform_point(&mat, &pos, &pos);
RobAngle chr_ang;
chr_ang.set_rad(c->model_transform.rotation_value.y);
if (auth->mirror)
chr_ang = -chr_ang;
RobAngle ang;
ang.set_rad(atan2f(mat.row2.x, mat.row2.z));
ang += chr_ang;
if (c->rob_id >= 0 && c->rob_id < ROB_ID_MAX) {
RobManagement* rob_man = get_rob_management();
rob_man->set_rob_pos((ROB_ID)c->rob_id, pos);
rob_man->set_rob_yang((ROB_ID)c->rob_id, ang);
}
}
static void auth_3d_chara_store(auth_3d* auth, auth_3d_chara* c, auth_3d_chara_file* cf) {
auth_3d_model_transform_store(auth, &c->model_transform, &cf->model_transform);
cf->name.assign(c->name);
@@ -6533,16 +6546,17 @@ static void auth_3d_object_disp(auth_3d_object* o, auth_3d* auth, render_context
object_database* obj_db = auth->obj_db;
texture_database* tex_db = auth->tex_db;
if (auth->chara_id >= 0 && auth->chara_id < ROB_ID_MAX) {
if (rob_chara_pv_data_array_check_chara_id(auth->chara_id)) {
rob_chara* rob_chr = rob_chara_array_get(auth->chara_id);
if (auth->rob_id >= 0 && auth->rob_id < ROB_ID_MAX) {
RobManagement* rob_man = get_rob_management();
if (rob_man->is_init((ROB_ID)auth->rob_id)) {
rob_chara* rob_chr = rob_man->get_rob((ROB_ID)auth->rob_id);
mat4 m;
mat4_mul(&rob_chr->data.position.rob_mat,
mat4_mul(&rob_chr->rob_base.position.rob_mat,
auth->chara_item
? &rob_chr->data.adjust_data.item_mat
: &rob_chr->data.adjust_data.mat, &m);
? &rob_chr->rob_base.adjust.item_mat
: &rob_chr->rob_base.adjust.mat, &m);
mat4_mul(&mat, &m, &mat);
disp_manager.set_shadow_group(auth->chara_id ? SHADOW_GROUP_STAGE : SHADOW_GROUP_CHARA);
disp_manager.set_shadow_group(auth->rob_id ? SHADOW_GROUP_STAGE : SHADOW_GROUP_CHARA);
}
}
@@ -6558,7 +6572,7 @@ static void auth_3d_object_disp(auth_3d_object* o, auth_3d* auth, render_context
char buf[0x80];
int32_t tex_pat_count = 0;
texture_pattern_struct tex_pat[TEXTURE_PATTERN_COUNT];
TexChange tex_pat[TEXTURE_PATTERN_COUNT];
for (auth_3d_object_texture_pattern& i : o->texture_pattern) {
if (!i.pattern.curve || i.name.size() <= 3)
@@ -6569,8 +6583,8 @@ static void auth_3d_object_disp(auth_3d_object* o, auth_3d* auth, render_context
sprintf_s(buf, sizeof(buf), "%.*s%03d",
(int32_t)(i.name.size() - 3), i.name.c_str(), (int32_t)prj::roundf(i.pattern.value));
tex_pat[tex_pat_count].src = texture_id(0x00, i.texture_id);
tex_pat[tex_pat_count].dst = texture_id(0x00, tex_db->get_texture_id(buf));
tex_pat[tex_pat_count].org_texid = texture_id(0x00, i.texture_id);
tex_pat[tex_pat_count].change_texid = texture_id(0x00, tex_db->get_texture_id(buf));
tex_pat_count++;
}
@@ -6585,7 +6599,7 @@ static void auth_3d_object_disp(auth_3d_object* o, auth_3d* auth, render_context
|| !texture_manager_get_texture(i.texture_id))
continue;
tex_trans[tex_trans_count].id = i.texture_id;
tex_trans[tex_trans_count].texid = i.texture_id;
tex_trans[tex_trans_count].mat = i.mat;
tex_trans_count++;
}
@@ -6830,14 +6844,15 @@ static void auth_3d_object_hrc_disp(auth_3d_object_hrc* oh, auth_3d* auth, rende
disp_manager.set_shadow_group(SHADOW_GROUP_CHARA);
mat4 mat = mat4_identity;
if (auth->chara_id >= 0 && auth->chara_id < ROB_ID_MAX) {
if (rob_chara_pv_data_array_check_chara_id(auth->chara_id)) {
rob_chara* rob_chr = rob_chara_array_get(auth->chara_id);
mat4_mul(&rob_chr->data.position.rob_mat,
if (auth->rob_id >= 0 && auth->rob_id < ROB_ID_MAX) {
RobManagement* rob_man = get_rob_management();
if (rob_man->is_init((ROB_ID)auth->rob_id)) {
rob_chara* rob_chr = rob_man->get_rob((ROB_ID)auth->rob_id);
mat4_mul(&rob_chr->rob_base.position.rob_mat,
auth->chara_item
? &rob_chr->data.adjust_data.item_mat
: &rob_chr->data.adjust_data.mat, &mat);
if (auth->chara_id)
? &rob_chr->rob_base.adjust.item_mat
: &rob_chr->rob_base.adjust.mat, &mat);
if (auth->rob_id)
disp_manager.set_shadow_group(SHADOW_GROUP_STAGE);
}
}
+5 -7
View File
@@ -481,7 +481,7 @@ struct auth_3d_camera_root {
struct auth_3d_chara {
auth_3d_model_transform model_transform;
std::string name;
int32_t index;
int32_t rob_id;
auth_3d_chara();
~auth_3d_chara();
@@ -865,7 +865,7 @@ struct auth_3d_id {
float_t get_frame();
float_t get_frame_offset();
float_t get_last_frame();
bool get_left_right_reverse();
bool get_mirror();
bool get_paused();
float_t get_play_control_begin();
float_t get_play_control_size();
@@ -881,9 +881,9 @@ struct auth_3d_id {
void set_enable(bool value);
void set_frame_rate(FrameRateControl* value);
void set_last_frame(float_t value);
void set_left_right_reverse(bool value);
void set_mat(const mat4& value);
void set_max_frame(float_t value);
void set_mirror(bool value);
void set_paused(bool value);
void set_pos(int32_t value);
void set_reflect(bool value);
@@ -928,12 +928,12 @@ struct auth_3d {
bool repeat;
bool field_C;
bool ended;
bool left_right_reverse;
bool mirror;
bool once;
mat4 mat;
float_t alpha;
mdl::ObjFlags obj_flags;
int32_t chara_id;
int32_t rob_id;
bool chara_item;
bool shadow;
bool reflect;
@@ -1074,8 +1074,6 @@ extern void auth_3d_data_unload_category(const char* category_name);
extern void auth_3d_data_unload_category(uint32_t category_hash);
extern void auth_3d_data_free();
extern void auth_3d_check_chara_visible(int32_t chara_id, const struct rob_chara_pv_data* pv_data);
extern void task_auth_3d_init();
extern bool task_auth_3d_add_task();
extern bool task_auth_3d_check_task_ready();
+7 -7
View File
@@ -38,10 +38,10 @@ struct customize_item_data_handler {
~customize_item_data_handler();
void add_all_customize_items();
void get_chara_item(const std::string& name, CHARA_NUM& chara_num, int32_t& item_no);
void get_chara_item(const std::string& name, CHARA_NUM& chara_num, uint32_t& item_no);
void add_customize_items();
bool get_customize_item(int32_t id, customize_item_data& data);
int32_t get_customize_item_obj_id(int32_t id);
uint32_t get_customize_item_obj_id(int32_t id);
};
customize_item_table_handler* customize_item_table_handler_data;
@@ -120,7 +120,7 @@ void customize_item_data_handler_data_add_all_customize_items() {
}
void customize_item_table_handler_data_get_chara_item(
const std::string& name, CHARA_NUM& chara_num, int32_t& item_no) {
const std::string& name, CHARA_NUM& chara_num, uint32_t& item_no) {
customize_item_data_handler_data->get_chara_item(name, chara_num, item_no);
}
@@ -128,7 +128,7 @@ bool customize_item_data_handler_data_get_customize_item(int32_t id, customize_i
return customize_item_data_handler_data->get_customize_item(id, data);
}
int32_t customize_item_data_handler_data_get_customize_item_obj_id(int32_t id) {
uint32_t customize_item_data_handler_data_get_customize_item_obj_id(int32_t id) {
return customize_item_data_handler_data->get_customize_item_obj_id(id);
}
@@ -316,7 +316,7 @@ void customize_item_data_handler::add_all_customize_items() {
}
void customize_item_data_handler::get_chara_item(
const std::string& name, CHARA_NUM& chara_num, int32_t& item_no) {
const std::string& name, CHARA_NUM& chara_num, uint32_t& item_no) {
size_t pos = name.find('_');
if (pos < 6)
return;
@@ -326,7 +326,7 @@ void customize_item_data_handler::get_chara_item(
if (!_item_no)
return;
item_no = _item_no;
item_no = (uint32_t)_item_no;
std::string chara(name.substr(0, 3));
if (chara.compare("CMN"))
@@ -394,7 +394,7 @@ bool customize_item_data_handler::get_customize_item(int32_t id, customize_item_
return false;
}
int32_t customize_item_data_handler::get_customize_item_obj_id(int32_t id) {
uint32_t customize_item_data_handler::get_customize_item_obj_id(int32_t id) {
for (customize_item_data& i : customize_items)
if (i.id == id)
return i.obj_id;
+2 -2
View File
@@ -55,7 +55,7 @@ extern void customize_item_table_handler_data_free();
extern void customize_item_data_handler_data_init();
extern void customize_item_data_handler_data_add_all_customize_items();
extern void customize_item_table_handler_data_get_chara_item(
const std::string& name, CHARA_NUM& chara_num, int32_t& item_no);
const std::string& name, CHARA_NUM& chara_num, uint32_t& item_no);
extern bool customize_item_data_handler_data_get_customize_item(int32_t id, customize_item_data& data);
extern int32_t customize_item_data_handler_data_get_customize_item_obj_id(int32_t id);
extern uint32_t customize_item_data_handler_data_get_customize_item_obj_id(int32_t id);
extern void customize_item_data_handler_data_free();
+174 -149
View File
@@ -435,17 +435,11 @@ struct ripple_emit_draw_data {
ripple_emit_draw_data();
};
struct struc_192 {
int32_t index;
vec3 pos;
struct RippleRobColli {
ROB_COLLI_ID colli_id;
vec3 old_pos;
struc_192();
};
struct struc_207 {
struc_192 field_0[18];
struc_207();
RippleRobColli();
};
struct EffectRipple {
@@ -480,8 +474,8 @@ struct EffectRipple {
ripple_emit_draw_data field_178;
ripple_emit_draw_data field_2A0;
ripple_emit_draw_data field_3C8;
int32_t field_4F0;
struc_207 field_4F4[6];
int32_t num_rob_colli;
RippleRobColli rob_colli[ROB_ID_MAX][18];
int32_t field_BB4;
RenderTexture ripple_texture;
int32_t counter;
@@ -590,15 +584,16 @@ struct splash_particle {
void restart();
};
struct ParticleEmitter {
splash_particle* splash;
vec3 pos;
int32_t field_1C;
float_t field_20;
int field_24;
float_t field_28;
float_t particle_size;
class ParticleEmitter {
friend class ParticleEmitterRob;
private:
splash_particle* m_particle_set;
vec3 m_pos;
vec3 m_dir;
float_t m_initial_life;
float_t m_initial_size;
public:
ParticleEmitter();
virtual ~ParticleEmitter();
@@ -608,19 +603,21 @@ struct ParticleEmitter {
void reset_data();
};
struct ParticleEmitterRob : ParticleEmitter {
int32_t chara_id;
int32_t bone_index;
vec3 prev_pos;
vec3 velocity;
vec3 prev_velocity;
int32_t emit_num;
float_t field_60;
float_t emission_ratio_attn;
float_t emission_velocity_scale;
bool in_water;
bool init_trans;
class ParticleEmitterRob : public ParticleEmitter {
private:
ROB_ID m_rob_id;
ROB_COLLI_ID m_colli_id;
vec3 m_old_pos;
vec3 m_velocity;
vec3 m_old_velocity;
int32_t m_emit_num;
float_t m_emission_ratio;
float_t m_emission_ratio_attn;
float_t m_emission_velocity_scale;
bool m_flag_in_water;
bool m_set_old_pos;
public:
ParticleEmitterRob();
virtual ~ParticleEmitterRob() override;
@@ -631,7 +628,12 @@ struct ParticleEmitterRob : ParticleEmitter {
void get_trans();
void reset_data();
void reset_data_base();
void set_chara(int32_t chara_id, int32_t bone_index, bool in_water);
void set_chara(ROB_ID rob_id, ROB_COLLI_ID colli_id, bool in_water);
void set_emit_num(int32_t value);
void set_emission_ratio_attn(float_t value);
void set_emission_velocity_scale(float_t value);
void set_initial_life(float_t value);
void set_initial_size(float_t value);
void set_splash(splash_particle* value);
};
@@ -2595,12 +2597,13 @@ float_t EffectFogRing::ptcl_random(float_t value) {
void EffectFogRing::sub_140347B40(float_t delta_time) {
field_124 = 0;
RobManagement* rob_man = get_rob_management();
struc_573(*v5)[5] = field_5C;
for (int32_t i = 0; i < 2; i++, v5++) {
if (!rob_chara_array_get(i) || !rob_chara_array_check_visibility(i))
for (int32_t i = 0; i <= ROB_ID_2P; i++, v5++) {
if (!rob_man->get_rob((ROB_ID)i) || !rob_man->get_disp_on((ROB_ID)i))
continue;
rob_chara_bone_data* rob_bone_data = rob_chara_array_get_bone_data(i);
rob_chara_bone_data* rob_bone_data = get_rob_management()->get_rob_motion_work((ROB_ID)i);
if (!rob_bone_data)
continue;
@@ -3185,12 +3188,8 @@ ripple_emit_draw_data::ripple_emit_draw_data() : data() {
}
struc_192::struc_192() {
index = -1;
}
struc_207::struc_207() {
RippleRobColli::RippleRobColli() {
colli_id = ROB_COLLI_ID_DUMMY;
}
EffectRipple::Params::Params() {
@@ -3203,7 +3202,7 @@ EffectRipple::Params::Params() {
EffectRipple::EffectRipple() : delta_frame(), update(), rain_ripple_num(), rain_ripple_min_value(),
rain_ripple_max_value(), field_14(), emit_pos_scale(), emit_pos_ofs_x(), emit_pos_ofs_z(), ripple_tex_id(),
use_float_ripplemap(), field_30(), rob_emitter_size(), emitter_num(), emitter_size(), field_4C(), field_50(),
field_178(), field_2A0(), field_3C8(), field_4F0(), field_BB4(), counter(), field_BEC(), stage_set() {
field_178(), field_2A0(), field_3C8(), num_rob_colli(), field_BB4(), counter(), field_BEC(), stage_set() {
ground_y = -1001.0f;
emitter_list = 0;
current_stage_index = -1;
@@ -3356,10 +3355,10 @@ void EffectRipple::draw(render_data_context& rend_data_ctx, const cam_data& cam)
}
void EffectRipple::reset() {
field_4F0 = 18;
for (struc_207& i : field_4F4)
for (int32_t j = 0; j < field_4F0; j++)
i.field_0[j].pos = 0.0f;
num_rob_colli = 18;
for (auto& i : rob_colli)
for (int32_t j = 0; j < num_rob_colli; j++)
i[j].old_pos = 0.0f;
field_30 = 60;
@@ -3387,8 +3386,12 @@ void EffectRipple::set_stage_index(int32_t stage_index) {
}
void EffectRipple::set_stage_indices(const std::vector<int32_t>& stage_indices) {
static const int32_t dword_1409E5330[] = {
0, 1, 2, 4, 10, 5, 12, 7, 14, 9, 21, 15, 23, 17, 25, 19, 26, 20
static const ROB_COLLI_ID ripple_colli_id[] = {
ROB_COLLI_ID_KOSHI, ROB_COLLI_ID_MUNE_L, ROB_COLLI_ID_MUNE_R, ROB_COLLI_ID_KAO,
ROB_COLLI_ID_KATA_L1, ROB_COLLI_ID_KATA_R1, ROB_COLLI_ID_UDE_L1, ROB_COLLI_ID_UDE_R1,
ROB_COLLI_ID_TE_L, ROB_COLLI_ID_TE_R, ROB_COLLI_ID_MOMO_L1, ROB_COLLI_ID_MOMO_R1,
ROB_COLLI_ID_SUNE_L1, ROB_COLLI_ID_SUNE_R1,
ROB_COLLI_ID_ASI_L, ROB_COLLI_ID_ASI_R, ROB_COLLI_ID_TOE_L, ROB_COLLI_ID_TOE_R
};
stage_set = false;
@@ -3423,11 +3426,11 @@ void EffectRipple::set_stage_indices(const std::vector<int32_t>& stage_indices)
rctx_ptr->render_manager->set_pass_sw(rndr::RND_PASSID_PRE_PROCESS, true);
rctx_ptr->render_manager->add_pre_process(0, EffectRipple::draw_static, this);
field_4F0 = 18;
for (struc_207& i : field_4F4)
for (int32_t j = 0; j < field_4F0; j++) {
i.field_0[j].index = dword_1409E5330[j];
i.field_0[j].pos = 0.0f;
num_rob_colli = 18;
for (auto& i : rob_colli)
for (int32_t j = 0; j < num_rob_colli; j++) {
i[j].colli_id = ripple_colli_id[j];
i[j].old_pos = 0.0f;
}
update = false;
@@ -3601,26 +3604,26 @@ void EffectRipple::sub_14035AED0() {
ripple_emit_draw_data& v2 = field_178;
ripple_emit_draw_data& v3 = field_2A0;
int32_t chara_id = 0;
for (struc_207& i : field_4F4) {
if (!rob_chara_array_check_visibility(chara_id)) {
chara_id++;
int32_t rob_id = 0;
for (auto& i : rob_colli) {
if (!get_rob_management()->get_disp_on((ROB_ID)rob_id)) {
rob_id++;
continue;
}
rob_chara* rob_chr = rob_chara_array_get(chara_id);
rob_chara* rob_chr = get_rob_management()->get_rob((ROB_ID)rob_id);
if (!rob_chr) {
chara_id++;
rob_id++;
continue;
}
for (int32_t j = 0; j < field_4F0; j++) {
struc_192& v4 = i.field_0[j];
for (int32_t j = 0; j < num_rob_colli; j++) {
RippleRobColli& rob_colli = i[j];
vec3 pos = 0.0f;
float_t scale = rob_chr->get_pos_scale(v4.index, pos);
float_t scale = rob_chr->get_pos_scale(rob_colli.colli_id, pos);
if (pos.y - ground_y < scale) {
if (use_float_ripplemap)
sub_1403587C0(pos, v4.pos, scale, v2.data, v3.data);
sub_1403587C0(pos, rob_colli.old_pos, scale, v2.data, v3.data);
else if (v2.data.count < 16) {
v2.data.position[v2.data.count].x = ((rand_state_array_get_float(4) - 0.5f)
* 0.02f + pos.x) * emit_pos_scale + emit_pos_ofs_x;
@@ -3631,10 +3634,10 @@ void EffectRipple::sub_14035AED0() {
v2.data.count++;
}
}
v4.pos = pos;
rob_colli.old_pos = pos;
}
chara_id++;
rob_id++;
}
if (use_float_ripplemap) {
@@ -3934,8 +3937,7 @@ void splash_particle::restart() {
alive = 0;
}
ParticleEmitter::ParticleEmitter() : splash(), field_1C(),
field_20(), field_24(), field_28(), particle_size() {
ParticleEmitter::ParticleEmitter() : m_particle_set(), m_initial_life(), m_initial_size() {
reset_data();
}
@@ -3952,17 +3954,16 @@ void ParticleEmitter::restart() {
}
void ParticleEmitter::reset_data() {
splash = 0;
pos = 0.0f;
field_1C = 0;
field_20 = 1.0f;
field_24 = 0;
particle_size = 1.0f;
field_28 = 1.0f;
m_particle_set = 0;
m_pos = 0.0f;
m_dir = { 0.0f, 1.0f, 0.0f };
m_initial_life = 1.0f;
m_initial_size = 1.0f;
}
ParticleEmitterRob::ParticleEmitterRob() : chara_id(), bone_index(), emit_num(),
field_60(), emission_ratio_attn(), emission_velocity_scale(), in_water(), init_trans() {
ParticleEmitterRob::ParticleEmitterRob() : m_rob_id(), m_colli_id(),
m_emit_num(), m_emission_ratio(), m_emission_ratio_attn(),
m_emission_velocity_scale(), m_flag_in_water(), m_set_old_pos() {
reset_data();
}
@@ -3995,53 +3996,56 @@ static inline vec3 rand_b_get_float() {
}
void ParticleEmitterRob::ctrl(float_t delta_time) {
if (fabsf(delta_time) <= 0.000001f || !splash
|| !rob_chara_array_get(chara_id) || !rob_chara_array_check_visibility(chara_id))
if (fabsf(delta_time) <= 0.000001f || !m_particle_set)
return;
RobManagement* rob_man = get_rob_management();
if (!rob_man->get_rob(m_rob_id) || !rob_man->get_disp_on(m_rob_id))
return;
get_trans();
get_velocity(delta_time);
float_t v8 = vec3::length(velocity);
float_t v8 = vec3::length(m_velocity);
if (v8 > 100.0f)
return;
if (pos.y >= 0.3f)
field_60 = max_def(field_60 - delta_time * emission_ratio_attn, 0.0f);
if (m_pos.y >= 0.3f)
m_emission_ratio = max_def(m_emission_ratio - delta_time * m_emission_ratio_attn, 0.0f);
else
field_60 = 1.0f;
m_emission_ratio = 1.0f;
if (v8 < 1.0f)
return;
float_t v27 = min_def(v8 * 0.05f, 1.0f);
int32_t emit_num = (int32_t)((float_t)this->emit_num * (v27 * v27) * field_60);
int32_t emit_num = (int32_t)((float_t)m_emit_num * (v27 * v27) * m_emission_ratio);
if (emit_num <= 0)
return;
vec3 prev_velocity = this->prev_velocity * emission_velocity_scale;
vec3 velocity = this->velocity * emission_velocity_scale;
vec3 trans_diff = pos - prev_pos;
vec3 velocity_diff = velocity - prev_velocity;
vec3 old_velocity = m_old_velocity * m_emission_velocity_scale;
vec3 velocity = m_velocity * m_emission_velocity_scale;
vec3 pos_diff = m_pos - m_old_pos;
vec3 velocity_diff = velocity - m_old_velocity;
float_t v41 = flt_140C9A588;
for (int32_t i = 0; i < emit_num; i++) {
splash_particle_data* ptcl = splash->emit();
splash_particle_data* ptcl = m_particle_set->emit();
if (!ptcl)
break;
float_t diff_scale = rand_a_get_float();
vec3 rand_vec = rand_b_get_float();
ptcl->position = rand_vec * 0.05f + (trans_diff * diff_scale + prev_pos);
ptcl->direction = rand_vec * 0.65f + (velocity_diff * diff_scale + prev_velocity);
ptcl->position = rand_vec * 0.05f + (pos_diff * diff_scale + m_old_pos);
ptcl->direction = rand_vec * 0.65f + (velocity_diff * diff_scale + old_velocity);
float_t size_scale = rand_a_get_float();
ptcl->flags = 0x01;
ptcl->size = max_def(size_scale * size_scale * particle_size, 1.0f);
ptcl->size = max_def(size_scale * size_scale * m_initial_size, 1.0f);
if (in_water && (trans_diff.y * diff_scale) + prev_pos.y < 0.3f) {
if (m_flag_in_water && (pos_diff.y * diff_scale) + m_old_pos.y < 0.3f) {
ptcl->flags = 0x00;
ptcl->size += v41;
ptcl->direction.y += 0.8f;
@@ -4056,69 +4060,89 @@ void ParticleEmitterRob::ctrl(float_t delta_time) {
}
void ParticleEmitterRob::restart() {
velocity = 0.0f;
prev_velocity = 0.0f;
init_trans = true;
field_60 = 0.0f;
m_velocity = 0.0f;
m_old_velocity = 0.0f;
m_set_old_pos = true;
m_emission_ratio = 0.0f;
}
void ParticleEmitterRob::get_trans() {
vec3 pos;
rob_chara_array_get(chara_id)->get_pos_scale(bone_index, pos);
get_rob_management()->get_rob(m_rob_id)->get_pos_scale(m_colli_id, pos);
if (init_trans) {
prev_pos = pos;
init_trans = false;
if (m_set_old_pos) {
m_old_pos = pos;
m_set_old_pos = false;
}
else
prev_pos = this->pos;
m_old_pos = m_pos;
this->pos = pos;
m_pos = pos;
}
void ParticleEmitterRob::get_velocity(float_t delta_time) {
prev_velocity = velocity;
velocity = (pos - prev_pos) * (1.0f / delta_time);
m_old_velocity = m_velocity;
m_velocity = (m_pos - m_old_pos) * (1.0f / delta_time);
}
void ParticleEmitterRob::reset_data() {
bone_index = -1;
chara_id = 0;
prev_pos = 0.0f;
velocity = 0.0f;
prev_velocity = 0.0f;
emit_num = 0;
field_60 = 0.0f;
emission_ratio_attn = 0.0f;
emission_velocity_scale = 0.0f;
in_water = true;
init_trans = true;
m_rob_id = (ROB_ID)0;
m_colli_id = ROB_COLLI_ID_DUMMY;
m_old_pos = 0.0f;
m_velocity = 0.0f;
m_old_velocity = 0.0f;
m_emit_num = 0;
m_emission_ratio = 0.0f;
m_emission_ratio_attn = 0.0f;
m_emission_velocity_scale = 0.0f;
m_flag_in_water = true;
m_set_old_pos = true;
}
void ParticleEmitterRob::reset_data_base() {
ParticleEmitter::reset_data();
}
void ParticleEmitterRob::set_chara(int32_t chara_id, int32_t bone_index, bool in_water) {
void ParticleEmitterRob::set_chara(ROB_ID rob_id, ROB_COLLI_ID colli_id, bool in_water) {
reset_data_base();
reset_data();
this->chara_id = chara_id;
this->bone_index = bone_index;
prev_pos = 0.0f;
velocity = 0.0f;
prev_velocity = 0.0f;
emit_num = 0;
field_60 = 0.0f;
emission_ratio_attn = 0.2f;
emission_velocity_scale = 0.08f;
this->in_water = in_water;
init_trans = true;
m_rob_id = rob_id;
m_colli_id = colli_id;
m_old_pos = 0.0f;
m_velocity = 0.0f;
m_old_velocity = 0.0f;
m_emit_num = 0;
m_emission_ratio = 0.0f;
m_emission_ratio_attn = 0.2f;
m_emission_velocity_scale = 0.08f;
m_flag_in_water = in_water;
m_set_old_pos = true;
}
void ParticleEmitterRob::set_emit_num(int32_t value) {
m_emit_num = value;
}
void ParticleEmitterRob::set_emission_ratio_attn(float_t value) {
m_emission_ratio_attn = value;
}
void ParticleEmitterRob::set_emission_velocity_scale(float_t value) {
m_emission_velocity_scale = value;
}
void ParticleEmitterRob::set_initial_life(float_t value) {
m_initial_life = value;
}
void ParticleEmitterRob::set_initial_size(float_t value) {
m_initial_size = value;
}
void ParticleEmitterRob::set_splash(splash_particle* value) {
splash = value;
m_particle_set = value;
}
water_particle_vertex_data::water_particle_vertex_data() : size() {
@@ -4419,11 +4443,12 @@ void EffectSplashParticle::disp() {
}
bool EffectSplashParticle::init(int32_t splash_tex_id, object_info splash_obj_id, bool in_water, bool blink) {
static const int32_t dword_1409E59A8[5] = {
26, 20, 14, 9, 0,
static const ROB_COLLI_ID splash_colli_id[] = {
ROB_COLLI_ID_TOE_L, ROB_COLLI_ID_TOE_R,
ROB_COLLI_ID_TE_L, ROB_COLLI_ID_TE_R, ROB_COLLI_ID_KOSHI,
};
static const int32_t dword_1409E59A8_size = sizeof(dword_1409E59A8) / sizeof(int32_t);
static const int32_t splash_colli_id_count = sizeof(splash_colli_id) / sizeof(BONE_ID);
splash_count = 1;
splash = new splash_particle[splash_count];
@@ -4431,7 +4456,7 @@ bool EffectSplashParticle::init(int32_t splash_tex_id, object_info splash_obj_id
if (!splash)
return false;
emitter_rob_count = dword_1409E59A8_size * ROB_ID_MAX;
emitter_rob_count = splash_colli_id_count * ROB_ID_MAX;
emitter_rob = new ParticleEmitterRob[emitter_rob_count];
if (!emitter_rob)
@@ -4446,10 +4471,10 @@ bool EffectSplashParticle::init(int32_t splash_tex_id, object_info splash_obj_id
for (int32_t i = 0; i < splash_count; i++)
splash[i].init(5000);
for (int32_t i = 0, j = 0; i < ROB_ID_MAX; i++)
for (const int32_t& l : dword_1409E59A8) {
for (int32_t rob_id = 0, j = 0; rob_id < ROB_ID_MAX; rob_id++)
for (const ROB_COLLI_ID colli_id : splash_colli_id) {
ParticleEmitterRob& ptcl_emit_rob = emitter_rob[j++];
ptcl_emit_rob.set_chara(i, l, in_water);
ptcl_emit_rob.set_chara((ROB_ID)rob_id, colli_id, in_water);
ptcl_emit_rob.set_splash(splash);
}
@@ -4461,20 +4486,20 @@ bool EffectSplashParticle::init(int32_t splash_tex_id, object_info splash_obj_id
if (splash_obj_id.not_null()) {
splash_object.init(100);
object_emitter_rob_count = dword_1409E59A8_size * ROB_ID_MAX;
object_emitter_rob_count = splash_colli_id_count * ROB_ID_MAX;
object_emitter_rob = new ParticleEmitterRob[object_emitter_rob_count];
if (!object_emitter_rob)
return false;
for (int32_t i = 0, j = 0; i < ROB_ID_MAX; i++)
for (const int32_t& l : dword_1409E59A8) {
for (int32_t rob_id = 0, j = 0; rob_id < ROB_ID_MAX; rob_id++)
for (const ROB_COLLI_ID colli_id : splash_colli_id) {
ParticleEmitterRob& ptcl_emit_rob = object_emitter_rob[j++];
ptcl_emit_rob.set_chara(i, l, in_water);
ptcl_emit_rob.set_chara((ROB_ID)rob_id, colli_id, in_water);
ptcl_emit_rob.set_splash(&splash_object);
ptcl_emit_rob.emit_num = 10;
ptcl_emit_rob.particle_size = 1.0f;
ptcl_emit_rob.field_28 = 1.0f;
ptcl_emit_rob.set_emit_num(10);
ptcl_emit_rob.set_initial_life(1.0f);
ptcl_emit_rob.set_initial_size(1.0f);
}
particle_disp_obj.init(&splash_object, splash_obj_id);
@@ -4546,22 +4571,22 @@ void EffectSplashParticle::set_color(const vec4& value) {
void EffectSplashParticle::set_emission_ratio_attn(float_t value) {
for (int32_t i = 0; i < emitter_rob_count; i++)
emitter_rob[i].emission_ratio_attn = value;
emitter_rob[i].set_emission_ratio_attn(value);
if (has_splash_object)
for (int32_t i = 0; i < object_emitter_rob_count; i++)
object_emitter_rob[i].emission_ratio_attn = value;
object_emitter_rob[i].set_emission_ratio_attn(value);
emission_ratio_attn = value;
}
void EffectSplashParticle::set_emission_velocity_scale(float_t value) {
for (int32_t i = 0; i < emitter_rob_count; i++)
emitter_rob[i].emission_velocity_scale = value;
emitter_rob[i].set_emission_velocity_scale(value);
if (has_splash_object)
for (int32_t i = 0; i < object_emitter_rob_count; i++)
object_emitter_rob[i].emission_velocity_scale = value;
object_emitter_rob[i].set_emission_velocity_scale(value);
emission_velocity_scale = value;
}
@@ -4570,7 +4595,7 @@ void EffectSplashParticle::set_emit_num(int32_t value) {
emit_num = value;
for (int32_t i = 0; i < emitter_rob_count; i++)
emitter_rob[i].emit_num = value;
emitter_rob[i].set_emit_num(value);
}
void EffectSplashParticle::set_particle_size(float_t value) {
@@ -4580,7 +4605,7 @@ void EffectSplashParticle::set_particle_size(float_t value) {
water_ptcl[i].particle_size = value;
for (int32_t i = 0; i < emitter_rob_count; i++)
emitter_rob[i].particle_size = value;
emitter_rob[i].set_initial_size(value);
}
void EffectSplashParticle::set_ripple_emission(float_t value) {
+32 -31
View File
@@ -8,6 +8,7 @@
#include "../KKdLib/database/object.hpp"
#include "../KKdLib/io/path.hpp"
#include "../KKdLib/str_utils.hpp"
#include "rob/rob.hpp"
#include "data.hpp"
#include "file_handler.hpp"
#include "mdata_manager.hpp"
@@ -32,11 +33,11 @@ struct hand_item_handler {
static void hand_item_load(const object_database* obj_db,
std::map<std::pair<int32_t, CHARA_NUM>, hand_item>& hand_items, hnd_itm& hnd_itm_file);
static int32_t mtp_hand_array_get_mottbl_index(const char* str);
static uint32_t mtp_hand_array_get_mottbl_type(const char* str);
hand_item_handler* hand_item_handler_data;
hand_item::hand_item() : file_size(), hand_mottbl_index(), hand_scale(), uid() {
hand_item::hand_item() : file_size(), mottbl_type(), scale(), uid() {
}
@@ -174,43 +175,43 @@ static void hand_item_load(const object_database* obj_db,
itm.item_str.assign(i.item_str);
itm.item_name.assign(i.item_name);
itm.file_size = i.file_size;
itm.hand_scale = i.hand_scale;
itm.scale = i.hand_scale;
itm.uid = i.uid;
uint32_t hand_motion_id = mtp_hand_array_get_mottbl_index(i.hand_motion.c_str());
if (hand_motion_id == -1)
uint32_t mottbl_type = mtp_hand_array_get_mottbl_type(i.hand_motion.c_str());
if (mottbl_type == MTP_NONE)
continue;
itm.hand_mottbl_index = hand_motion_id;
itm.mottbl_type = mottbl_type;
hand_items.insert({ { itm.uid, CN_NONE }, itm });
}
}
static int32_t mtp_hand_array_get_mottbl_index(const char* str) {
static const std::pair<const char*, int32_t> mtp_hand_array[] = {
{ "MTP_HAND_NULL" , 0xC0 },
{ "MTP_HAND_RESET" , 0xC1 },
{ "MTP_HAND_NORMAL" , 0xC2 },
{ "MTP_HAND_OPEN" , 0xC3 },
{ "MTP_HAND_CLOSE" , 0xC4 },
{ "MTP_HAND_PEACE" , 0xC5 },
{ "MTP_HAND_GOOD" , 0xC6 },
{ "MTP_HAND_ONE" , 0xC7 },
{ "MTP_HAND_THREE" , 0xC8 },
{ "MTP_HAND_NEGI" , 0xC9 },
{ "MTP_HAND_SIZEN" , 0xCA },
{ "MTP_HAND_PICK" , 0xCB },
{ "MTP_HAND_MIC" , 0xCC },
{ "MTP_HAND_FAN" , 0xCD },
{ "MTP_HAND_BOTTLE" , 0xCE },
{ "MTP_HAND_PHONE" , 0xCF },
{ "MTP_HAND_HOLD" , 0xD0 },
{ "MTP_HAND_FLASHLIGHT", 0xD1 },
{ "MTP_HAND_MIC_BLK" , 0xD2 },
{ "MTP_HAND_MIC_SLV" , 0xD3 },
{ "MTP_HAND_CUPICE" , 0xD4 },
{ "MTP_HAND_ICEBAR" , 0xD5 },
{ 0 , 0 },
static uint32_t mtp_hand_array_get_mottbl_type(const char* str) {
static const std::pair<const char*, MOTTABLE_TYPE> mtp_hand_array[] = {
{ "MTP_HAND_NULL" , MTP_HAND_NULL },
{ "MTP_HAND_RESET" , MTP_HAND_RESET },
{ "MTP_HAND_NORMAL" , MTP_HAND_NORMAL },
{ "MTP_HAND_OPEN" , MTP_HAND_OPEN },
{ "MTP_HAND_CLOSE" , MTP_HAND_CLOSE },
{ "MTP_HAND_PEACE" , MTP_HAND_PEACE },
{ "MTP_HAND_GOOD" , MTP_HAND_GOOD },
{ "MTP_HAND_ONE" , MTP_HAND_ONE },
{ "MTP_HAND_THREE" , MTP_HAND_THREE },
{ "MTP_HAND_NEGI" , MTP_HAND_NEGI },
{ "MTP_HAND_SIZEN" , MTP_HAND_SIZEN },
{ "MTP_HAND_PICK" , MTP_HAND_PICK },
{ "MTP_HAND_MIC" , MTP_HAND_MIC },
{ "MTP_HAND_FAN" , MTP_HAND_FAN },
{ "MTP_HAND_BOTTLE" , MTP_HAND_BOTTLE },
{ "MTP_HAND_PHONE" , MTP_HAND_PHONE },
{ "MTP_HAND_HOLD" , MTP_HAND_HOLD },
{ "MTP_HAND_FLASHLIGHT", MTP_HAND_FLASHLIGHT },
{ "MTP_HAND_MIC_BLK" , MTP_HAND_MIC_BLK },
{ "MTP_HAND_MIC_SLV" , MTP_HAND_MIC_SLV },
{ "MTP_HAND_CUPICE" , MTP_HAND_CUPICE },
{ "MTP_HAND_ICEBAR" , MTP_HAND_ICEBAR },
{ 0 , MTP_NONE },
};
auto mtp_hand = mtp_hand_array;
+2 -2
View File
@@ -17,8 +17,8 @@ struct hand_item {
std::string item_str;
std::string item_name;
uint32_t file_size;
uint32_t hand_mottbl_index;
float_t hand_scale;
uint32_t mottbl_type;
float_t scale;
int32_t uid;
hand_item();
+89 -87
View File
@@ -7,6 +7,7 @@
#include "../KKdLib/io/memory_stream.hpp"
#include "../KKdLib/io/path.hpp"
#include "../KKdLib/str_utils.hpp"
#include "rob/rob.hpp"
#include "data.hpp"
#include "file_handler.hpp"
#include "mdata_manager.hpp"
@@ -16,54 +17,58 @@ struct item_table_handler {
std::list<p_file_handler*> file_handlers;
bool ready;
const char* file;
item_table table;
RobItemHeader table;
item_table_handler();
~item_table_handler();
void clear();
const item_table_item* get_item(int32_t item_no);
const RobItemTable* get_item(uint32_t item_no);
bool load();
void parse(p_file_handler* pfhndl);
void read();
void set_path(CHARA_NUM chara_num);
};
static void item_table_load(data_struct* data, item_table& itm_tbl, itm_table& itm_tbl_file);
static void item_table_load(data_struct* data, RobItemHeader& itm_tbl, itm_table& itm_tbl_file);
item_table_handler* item_table_handler_array;
item_table_item_data_obj::item_table_item_data_obj() : rpk() {
RobItemDataObj::RobItemDataObj() : replace_id() {
}
item_table_item_data_ofs::item_table_item_data_ofs() : sub_id(), no() {
RobItemDataOfs::RobItemDataOfs() : equip_sub_id(), item_no() {
}
item_table_item_data_tex::item_table_item_data_tex() {
org = -1;
chg = -1;
RobItemDataTex::RobItemDataTex() {
org_uid = -1;
chg_uid = -1;
}
item_table_item_data_col::item_table_item_data_col() : flag() {
tex_id = -1;
RobItemDataCol::RobItemDataCol() : flag() {
tex_uid = -1;
}
item_table_item_data::item_table_item_data() {
RobItemData::RobItemData() {
}
item_table_item_data::~item_table_item_data() {
RobItemData::~RobItemData() {
}
item_table_item::item_table_item() : flag(), type(), attr(), des_id(),
sub_id(), exclusion(), point(), org_itm(), npr_flag(), face_depth() {
RobItemTable::RobItemTable() : flag(), type(), attr(), equip_des_id(),
equip_sub_id(), exclusion(), point(), org_itm(), npr_flag(), face_depth() {
}
item_table_item::~item_table_item() {
RobItemTable::~RobItemTable() {
}
RobItemEquip::RobItemEquip() : item_no() {
}
@@ -75,17 +80,17 @@ item_table_dbgset::~item_table_dbgset() {
}
item_table::item_table() {
RobItemHeader::RobItemHeader() {
}
item_table::~item_table() {
RobItemHeader::~RobItemHeader() {
}
const item_table_item* item_table::get_item(int32_t item_no) {
auto elem = item.find(item_no);
if (elem != item.end() && elem->second.type != -1)
const RobItemTable* RobItemHeader::get_item(uint32_t item_no) {
auto elem = table.find(item_no);
if (elem != table.end() && elem->second.type != ROB_ITEM_TYPE_NONE)
return &elem->second;
return 0;
}
@@ -96,47 +101,44 @@ void item_table_handler_array_init() {
item_table_handler_array[i].set_path((CHARA_NUM)i);
}
const item_cos_data* item_table_handler_array_get_item_cos_data(CHARA_NUM cn, int32_t cos_id) {
const item_table* table = item_table_handler_array_get_table(cn);
if (!table)
const RobItemEquip* get_default_costume_data(CHARA_NUM cn, int32_t cos_id) {
const RobItemHeader* tbl = get_rob_item_header(cn);
if (!tbl)
return 0;
auto elem = table->cos.find(cos_id);
if (elem != table->cos.end())
auto elem = tbl->defset.find(cos_id);
if (elem != tbl->defset.end())
return &elem->second;
else if (table->cos.size())
return &table->cos.begin()->second;
else if (tbl->defset.size())
return &tbl->defset.begin()->second;
return 0;
}
const item_table_item* item_table_handler_array_get_item(CHARA_NUM cn, int32_t item_no) {
const RobItemTable* get_rob_item_table(CHARA_NUM cn, uint32_t item_no) {
if (cn >= 0 && cn < CN_MAX)
return item_table_handler_array[cn].get_item(item_no);
return 0;
}
std::string item_table_handler_array_get_item_name(CHARA_NUM cn, int32_t item_no) {
const item_table_item* item = item_table_handler_array_get_item(cn, item_no);
if (item)
return item->name;
std::string get_rob_item_table_name(CHARA_NUM cn, uint32_t item_no) {
const RobItemTable* tbl = get_rob_item_table(cn, item_no);
if (tbl) {
std::string name = RobItem::s_check_ng_item_name(cn, item_no);
if (name.size())
return name;
return tbl->name;
}
return {};
}
item_sub_id item_table_handler_array_get_item_sub_id(CHARA_NUM cn, int32_t item_no) {
const item_table_item* item = item_table_handler_array_get_item(cn, item_no);
if (item)
return item->sub_id;
return ITEM_SUB_NONE;
}
const std::vector<uint32_t>* item_table_handler_array_get_item_objset(CHARA_NUM cn, int32_t item_no) {
const item_table_item* item = item_table_handler_array_get_item(cn, item_no);
if (item)
return &item->objset;
const std::vector<uint32_t>* get_rob_item_table_objset(CHARA_NUM cn, uint32_t item_no) {
const RobItemTable* tbl = get_rob_item_table(cn, item_no);
if (tbl)
return &tbl->objset;
return 0;
}
const item_table* item_table_handler_array_get_table(CHARA_NUM cn) {
const RobItemHeader* get_rob_item_header(CHARA_NUM cn) {
if (cn < 0 || cn >= CN_MAX)
return 0;
return &item_table_handler_array[cn].table;
@@ -176,7 +178,7 @@ void item_table_handler::clear() {
ready = false;
}
const item_table_item* item_table_handler::get_item(int32_t item_no) {
const RobItemTable* item_table_handler::get_item(uint32_t item_no) {
return table.get_item(item_no);
}
@@ -254,13 +256,13 @@ void item_table_handler::set_path(CHARA_NUM chara_num) {
this->file = item_table_paths[chara_num];
}
static void item_table_load(data_struct* data, item_table& itm_tbl, itm_table& itm_tbl_file) {
static void item_table_load(data_struct* data, RobItemHeader& itm_tbl, itm_table& itm_tbl_file) {
object_database* aft_obj_db = &data->data_ft.obj_db;
texture_database* aft_tex_db = &data->data_ft.tex_db;
for (itm_table_item& i : itm_tbl_file.item) {
item_table_item itm;
itm.flag = i.flag;
RobItemTable itm;
itm.flag.w = i.flag.w;
itm.name.assign(i.name);
itm.objset.reserve(i.objset.size());
@@ -272,54 +274,54 @@ static void item_table_load(data_struct* data, item_table& itm_tbl, itm_table& i
itm.type = i.type;
itm.attr = i.attr;
itm.des_id = i.des_id;
itm.sub_id = (item_sub_id)i.sub_id;
itm.equip_des_id = i.equip_des_id;
itm.equip_sub_id = i.equip_sub_id;
for (itm_table_item_data_obj& j : i.data.obj) {
object_info obj_info;
object_info uid;
if (j.uid.compare("NULL")) {
obj_info = aft_obj_db->get_object_info(j.uid.c_str());
if (obj_info.is_null())
uid = aft_obj_db->get_object_info(j.uid.c_str());
if (uid.is_null())
continue;
}
item_table_item_data_obj obj;
obj.obj_info = obj_info;
obj.rpk = j.rpk;
RobItemDataObj obj;
obj.uid = uid;
obj.replace_id = j.rpk;
itm.data.obj.push_back(obj);
}
for (itm_table_item_data_ofs& j : i.data.ofs) {
item_table_item_data_ofs ofs;
ofs.sub_id = j.sub_id;
ofs.no = j.no;
ofs.position = j.position;
ofs.rotation = j.rotation;
RobItemDataOfs ofs;
ofs.equip_sub_id = j.sub_id;
ofs.item_no = j.item_no;
ofs.trans = j.trans;
ofs.rot = j.rot;
ofs.scale = j.scale;
itm.data.ofs.push_back(ofs);
}
for (itm_table_item_data_tex& j : i.data.tex) {
uint32_t org = aft_tex_db->get_texture_id(j.org.c_str());
uint32_t chg = aft_tex_db->get_texture_id(j.chg.c_str());
if (org == -1 || chg == -1)
uint32_t org_uid = aft_tex_db->get_texture_id(j.org.c_str());
uint32_t chg_uid = aft_tex_db->get_texture_id(j.chg.c_str());
if (org_uid == -1 || chg_uid == -1)
continue;
item_table_item_data_tex tex;
tex.org = org;
tex.chg = chg;
RobItemDataTex tex;
tex.org_uid = org_uid;
tex.chg_uid = chg_uid;
itm.data.tex.push_back(tex);
}
for (itm_table_item_data_col& j : i.data.col) {
uint32_t tex_id = aft_tex_db->get_texture_id(j.tex.c_str());
if (tex_id == -1)
uint32_t tex_uid = aft_tex_db->get_texture_id(j.tex.c_str());
if (tex_uid == -1)
continue;
item_table_item_data_col col;
col.tex_id = tex_id;
col.flag = j.flag;
col.col_tone = j.col_tone;
RobItemDataCol col;
col.tex_uid = tex_uid;
col.flag.w = j.flag.w;
col.color = j.color;
itm.data.col.push_back(col);
}
@@ -328,23 +330,23 @@ static void item_table_load(data_struct* data, item_table& itm_tbl, itm_table& i
itm.org_itm = i.org_itm;
itm.npr_flag = i.npr_flag;
itm.face_depth = i.face_depth;
itm_tbl.item.push_back(i.no, itm);
itm_tbl.table.push_back(i.no, itm);
}
itm_tbl.item.combine();
itm_tbl.table.combine();
for (itm_table_dbgset& i : itm_tbl_file.dbgset) {
if (aft_obj_db->get_object_set_id(i.name.c_str()) == -1)
continue;
item_cos_data cos = {};
RobItemEquip equip = {};
for (int32_t j : i.item) {
const item_table_item* item = itm_tbl.get_item(j);
if (item)
cos.arr[item->sub_id] = j;
const RobItemTable* tbl = itm_tbl.get_item(j);
if (tbl)
equip.item_no[tbl->equip_sub_id] = j;
}
itm_tbl.dbgset.push_back(i.name, cos);
itm_tbl.dbgset.push_back(i.name, equip);
}
itm_tbl.dbgset.combine();
@@ -353,15 +355,15 @@ static void item_table_load(data_struct* data, item_table& itm_tbl, itm_table& i
if (!i.item.size())
continue;
item_cos_data cos = {};
RobItemEquip equip = {};
for (int32_t j : i.item) {
const item_table_item* item = itm_tbl.get_item(j);
if (item)
cos.arr[item->sub_id] = j;
const RobItemTable* tbl = itm_tbl.get_item(j);
if (tbl)
equip.item_no[tbl->equip_sub_id] = j;
}
itm_tbl.cos.push_back(i.id, cos);
itm_tbl.defset.push_back(i.id, equip);
}
itm_tbl.cos.push_back(499, {});
itm_tbl.cos.combine();
itm_tbl.defset.push_back(499, {});
itm_tbl.defset.combine();
}
+80 -82
View File
@@ -12,96 +12,94 @@
#include "object.hpp"
#include "texture.hpp"
struct item_table_item_data_obj {
object_info obj_info;
ROB_PARTS_KIND rpk;
struct RobItemDataObj {
object_info uid;
ROB_PARTS_KIND replace_id;
item_table_item_data_obj();
RobItemDataObj();
};
struct item_table_item_data_ofs {
item_sub_id sub_id;
int32_t no;
vec3 position;
vec3 rotation;
struct RobItemDataOfs {
ROB_ITEM_EQUIP_SUB_ID equip_sub_id;
uint32_t item_no;
vec3 trans;
vec3 rot;
vec3 scale;
item_table_item_data_ofs();
RobItemDataOfs();
};
struct item_table_item_data_tex {
uint32_t org;
uint32_t chg;
struct RobItemDataTex {
uint32_t org_uid;
uint32_t chg_uid;
item_table_item_data_tex();
RobItemDataTex();
};
struct item_table_item_data_col {
uint32_t tex_id;
int32_t flag;
color_tone col_tone;
item_table_item_data_col();
struct RobItemDataColFlagMember {
uint32_t is_available : 1;
uint32_t reserve : 31;
};
struct item_table_item_data {
std::vector<item_table_item_data_obj> obj;
std::vector<item_table_item_data_ofs> ofs;
std::vector<item_table_item_data_tex> tex;
std::vector<item_table_item_data_col> col;
item_table_item_data();
~item_table_item_data();
union RobItemDataColFlag {
uint32_t w;
RobItemDataColFlagMember m;
};
struct item_table_item {
int32_t flag;
struct RobItemDataCol {
uint32_t tex_uid;
RobItemDataColFlag flag;
ImgfColorToneParam color;
RobItemDataCol();
};
struct RobItemData {
std::vector<RobItemDataObj> obj;
std::vector<RobItemDataOfs> ofs;
std::vector<RobItemDataTex> tex;
std::vector<RobItemDataCol> col;
RobItemData();
~RobItemData();
};
struct RobItemTableFlagMember {
uint32_t is_dummy : 1;
uint32_t is_present : 1;
uint32_t is_texorg : 1;
uint32_t is_objorg : 1;
uint32_t reserve : 28;
};
union RobItemTableFlag {
uint32_t w;
RobItemTableFlagMember m;
};
struct RobItemTable {
RobItemTableFlag flag;
std::string name;
std::vector<uint32_t> objset;
int32_t type;
int32_t attr;
int32_t des_id;
item_sub_id sub_id;
item_table_item_data data;
int32_t exclusion;
int32_t point;
int32_t org_itm;
ROB_ITEM_TYPE type;
uint32_t attr;
ROB_ITEM_EQUIP_DES_ID equip_des_id;
ROB_ITEM_EQUIP_SUB_ID equip_sub_id;
RobItemData data;
uint32_t exclusion;
uint32_t point;
uint32_t org_itm;
bool npr_flag;
float_t face_depth;
item_table_item();
~item_table_item();
RobItemTable();
~RobItemTable();
};
union item_cos_data {
struct {
int32_t zujo;
int32_t kami;
int32_t hitai;
int32_t me;
int32_t megane;
int32_t mimi;
int32_t kuchi;
int32_t maki;
int32_t kubi;
int32_t inner;
int32_t outer;
int32_t joha_mae;
int32_t joha_ushiro;
int32_t hada;
int32_t kata;
int32_t u_ude;
int32_t l_ude;
int32_t te;
int32_t belt;
int32_t cosi;
int32_t pants;
int32_t asi;
int32_t sune;
int32_t kutsu;
int32_t head;
} data;
int32_t arr[ITEM_SUB_MAX];
struct RobItemEquip {
uint32_t item_no[ROB_ITEM_EQUIP_SUB_ID_MAX];
RobItemEquip();
};
struct item_table_dbgset {
@@ -109,24 +107,24 @@ struct item_table_dbgset {
~item_table_dbgset();
};
struct item_table {
prj::vector_pair_combine<int32_t, item_table_item> item;
prj::vector_pair_combine<int32_t, item_cos_data> cos;
prj::vector_pair_combine<std::string, item_cos_data> dbgset;
struct RobItemHeader {
prj::vector_pair_combine<uint32_t, RobItemTable> table;
prj::vector_pair_combine<uint32_t, RobItemEquip> defset;
prj::vector_pair_combine<std::string, RobItemEquip> dbgset;
item_table();
~item_table();
RobItemHeader();
~RobItemHeader();
const item_table_item* get_item(int32_t item_no);
const RobItemTable* get_item(uint32_t item_no);
};
extern void item_table_handler_array_init();
extern const item_cos_data* item_table_handler_array_get_item_cos_data(CHARA_NUM cn, int32_t cos_id);
extern const item_table_item* item_table_handler_array_get_item(CHARA_NUM cn, int32_t item_no);
extern std::string item_table_handler_array_get_item_name(CHARA_NUM cn, int32_t item_no);
extern item_sub_id item_table_handler_array_get_item_sub_id(CHARA_NUM cn, int32_t item_no);
extern const std::vector<uint32_t>* item_table_handler_array_get_item_objset(CHARA_NUM cn, int32_t item_no);
extern const item_table* item_table_handler_array_get_table(CHARA_NUM cn);
extern bool item_table_handler_array_load();
extern void item_table_handler_array_read();
extern void item_table_handler_array_free();
extern const RobItemEquip* get_default_costume_data(CHARA_NUM cn, int32_t cos_id);
extern const RobItemHeader* get_rob_item_header(CHARA_NUM cn);
extern const RobItemTable* get_rob_item_table(CHARA_NUM cn, uint32_t item_no);
extern std::string get_rob_item_table_name(CHARA_NUM cn, uint32_t item_no);
extern const std::vector<uint32_t>* get_rob_item_table_objset(CHARA_NUM cn, uint32_t item_no);
+2 -1
View File
@@ -4,11 +4,12 @@
*/
#include "wind.hpp"
#include "../rob/rob.hpp"
#include "../app_system_detail.hpp"
TaskWind* task_wind;
extern bool pv_osage_manager_array_get_disp();
Wind::Wind() : scale(), cycle(), yrot(), zrot(),
bias(), spectrum(), val(), frame(), strength() {
count = 16;
+13 -10
View File
@@ -51,20 +51,21 @@ material_list_struct::material_list_struct(uint32_t hash, vec4& blend_color,
}
texture_pattern_struct::texture_pattern_struct() {
TexChange::TexChange() {
}
texture_pattern_struct::texture_pattern_struct(texture_id src, texture_id dst) : src(src), dst(dst) {
TexChange::TexChange(texture_id org_texid, texture_id change_texid)
: org_texid(org_texid), change_texid(change_texid) {
}
texture_transform_struct::texture_transform_struct() {
id = (uint32_t)-1;
texid = (uint32_t)-1;
mat = mat4_identity;
}
texture_transform_struct::texture_transform_struct(uint32_t id, const mat4& mat) : id(id), mat(mat) {
texture_transform_struct::texture_transform_struct(uint32_t texid, const mat4& mat) : texid(texid), mat(mat) {
}
@@ -2833,14 +2834,16 @@ namespace mdl {
}
void DispManager::entry_obj_by_object_info_object_skin(object_info obj_info,
const std::vector<texture_pattern_struct>* texture_pattern,
const std::vector<TexChange>* texture_pattern,
const RobSkinCol* skin_col, float_t alpha,
const mat4* matrices, const mat4* ex_data_matrices, const mat4* mat, const mat4& global_mat) {
obj_skin* skin = objset_info_storage_get_obj_skin(obj_info);
if (!skin)
return;
obj_skin_set_matrix_buffer(skin, matrices, ex_data_matrices, rctx_ptr->matrix_buffer, mat, global_mat);
static mat4 env_mtx[MATRIX_BUFFER_COUNT];
obj_skin_set_matrix_buffer(skin, matrices, ex_data_matrices, env_mtx, mat, global_mat);
vec4 blend_color;
vec4 offset_color;
@@ -2874,9 +2877,9 @@ namespace mdl {
set_texture_pattern((int32_t)texture_pattern_count, texture_pattern->data());
if (fabsf(alpha - 1.0f) > 0.000001f)
entry_obj_by_object_info(global_mat, obj_info, alpha, rctx_ptr->matrix_buffer);
entry_obj_by_object_info(global_mat, obj_info, alpha, env_mtx);
else
entry_obj_by_object_info(global_mat, obj_info, rctx_ptr->matrix_buffer);
entry_obj_by_object_info(global_mat, obj_info, env_mtx);
if (texture_pattern && texture_pattern_count)
set_texture_pattern();
@@ -2995,7 +2998,7 @@ namespace mdl {
value = texture_color_offset;
}
void DispManager::get_texture_pattern(int32_t& count, texture_pattern_struct*& value) {
void DispManager::get_texture_pattern(int32_t& count, TexChange*& value) {
count = texture_pattern_count;
for (int32_t i = 0; i < count; i++)
@@ -3253,7 +3256,7 @@ namespace mdl {
texture_color_offset = value;
}
void DispManager::set_texture_pattern(int32_t count, const texture_pattern_struct* value) {
void DispManager::set_texture_pattern(int32_t count, const TexChange* value) {
if (count > TEXTURE_PATTERN_COUNT)
return;
+12 -12
View File
@@ -40,20 +40,20 @@ struct material_list_struct {
vec4u8& has_blend_color, vec4& emission, vec4u8& has_emission);
};
struct texture_pattern_struct {
texture_id src;
texture_id dst;
struct TexChange {
texture_id org_texid;
texture_id change_texid;
texture_pattern_struct();
texture_pattern_struct(texture_id src, texture_id dst);
TexChange();
TexChange(texture_id org_texid, texture_id change_texid);
};
struct texture_transform_struct {
uint32_t id;
uint32_t texid;
mat4 mat;
texture_transform_struct();
texture_transform_struct(uint32_t id, const mat4& mat);
texture_transform_struct(uint32_t texid, const mat4& mat);
};
struct morph_struct {
@@ -203,7 +203,7 @@ namespace mdl {
size_t morph_vertex_buffer_offset;
float_t morph_weight;
int32_t texture_pattern_count;
texture_pattern_struct texture_pattern_array[TEXTURE_PATTERN_COUNT];
TexChange texture_pattern_array[TEXTURE_PATTERN_COUNT];
vec4 texture_color_coefficients;
vec4 texture_color_offset;
vec4 texture_specular_coefficients;
@@ -505,7 +505,7 @@ namespace mdl {
void* buff;
morph_struct morph;
int32_t texture_pattern_count;
texture_pattern_struct texture_pattern_array[TEXTURE_PATTERN_COUNT];
TexChange texture_pattern_array[TEXTURE_PATTERN_COUNT];
vec4 texture_color_coefficients;
vec4 texture_color_offset;
vec4 texture_specular_coefficients;
@@ -565,7 +565,7 @@ namespace mdl {
bool entry_obj_by_object_info_instanced(object_info obj_info,
const std::vector<mat4>& instances, float_t r, float_t g, float_t b, float_t a);
void entry_obj_by_object_info_object_skin(object_info obj_info,
const std::vector<texture_pattern_struct>* texture_pattern,
const std::vector<TexChange>* texture_pattern,
const RobSkinCol* skin_col, float_t alpha,
const mat4* matrices, const mat4* ex_data_matrices, const mat4* mat, const mat4& global_mat);
void entry_obj_etc(const mat4& mat, const EtcObj& etc);
@@ -582,7 +582,7 @@ namespace mdl {
SHADOW_GROUP get_shadow_group();
void get_texture_color_coeff(vec4& value);
void get_texture_color_offset(vec4& value);
void get_texture_pattern(int32_t& count, texture_pattern_struct*& value);
void get_texture_pattern(int32_t& count, TexChange*& value);
void get_texture_specular_coeff(vec4& value);
void get_texture_specular_offset(vec4& value);
void get_texture_transform(int32_t& count, texture_transform_struct*& value);
@@ -605,7 +605,7 @@ namespace mdl {
void set_shadow_group(SHADOW_GROUP value = SHADOW_GROUP_CHARA);
void set_texture_color_coefficients(const vec4& value);
void set_texture_color_offset(const vec4& value);
void set_texture_pattern(int32_t count = 0, const texture_pattern_struct* value = 0);
void set_texture_pattern(int32_t count = 0, const TexChange* value = 0);
void set_texture_specular_coefficients(const vec4& value);
void set_texture_specular_offset(const vec4& value);
void set_texture_transform(int32_t count = 0, const texture_transform_struct* value = 0);
+8 -8
View File
@@ -318,8 +318,8 @@ namespace mdl {
if (texture_id != -1) {
for (int32_t j = 0; j < args->texture_pattern_count; j++)
if (args->texture_pattern_array[j].src == ::texture_id(0x00, texture_id)) {
texture* tex = texture_manager_get_texture(args->texture_pattern_array[j].dst);
if (args->texture_pattern_array[j].org_texid == ::texture_id(0x00, texture_id)) {
texture* tex = texture_manager_get_texture(args->texture_pattern_array[j].change_texid);
if (tex)
tex_id = tex->glid;
break;
@@ -592,8 +592,8 @@ static void draw_object_material_set_cheap(
GLuint tex_id = -1;
for (int32_t j = 0; j < args->texture_pattern_count; j++)
if (args->texture_pattern_array[j].src == ::texture_id(0x00, texture_id)) {
texture* tex = texture_manager_get_texture(args->texture_pattern_array[j].dst);
if (args->texture_pattern_array[j].org_texid == ::texture_id(0x00, texture_id)) {
texture* tex = texture_manager_get_texture(args->texture_pattern_array[j].change_texid);
if (tex)
tex_id = tex->glid;
break;
@@ -681,8 +681,8 @@ static void draw_object_material_set_default(render_data_context& rend_data_ctx,
GLuint tex_id = -1;
uint32_t texture_id = texdata->tex_index;
for (int32_t j = 0; j < args->texture_pattern_count; j++)
if (args->texture_pattern_array[j].src == ::texture_id(0x00, texture_id)) {
texture* tex = texture_manager_get_texture(args->texture_pattern_array[j].dst);
if (args->texture_pattern_array[j].org_texid == ::texture_id(0x00, texture_id)) {
texture* tex = texture_manager_get_texture(args->texture_pattern_array[j].change_texid);
if (tex)
tex_id = tex->glid;
break;
@@ -1012,7 +1012,7 @@ static void draw_object_vertex_attrib_set_cheap(
mats[0] = material->material.texdata[0].tex_coord_mat;
if (material->material.texdata[0].shader_info.m.tex_type == OBJ_MATERIAL_TEXTURE_COLOR)
for (int32_t j = 0; j < args->texture_transform_count; j++)
if (args->texture_transform_array[j].id == tex_index) {
if (args->texture_transform_array[j].texid == tex_index) {
mats[0] = args->texture_transform_array[j].mat;
break;
}
@@ -1074,7 +1074,7 @@ static void draw_object_vertex_attrib_set_default(
mats[texcoord_index] = texdata->tex_coord_mat;
if (texdata->shader_info.m.tex_type == OBJ_MATERIAL_TEXTURE_COLOR)
for (int32_t k = 0; k < args->texture_transform_count; k++)
if (args->texture_transform_array[k].id == texture_id) {
if (args->texture_transform_array[k].texid == texture_id) {
mats[texcoord_index] = args->texture_transform_array[k].mat;
texcoord_mat_set[texcoord_index] = true;
break;
+5 -4
View File
@@ -2257,14 +2257,15 @@ ROB_PARTS_KIND pv_performer_item_to_rob_parts_kind(pv_performer_item item) {
return RPK_NONE;
}
item_sub_id pv_performer_item_to_item_sub_id(pv_performer_item item) {
static const item_sub_id pv_performer_item_id_to_item_sub_id_table[] = {
ITEM_SUB_ZUJO, ITEM_SUB_MEGANE, ITEM_SUB_KUBI, ITEM_SUB_JOHA_USHIRO,
ROB_ITEM_EQUIP_SUB_ID pv_performer_item_to_item_sub_id(pv_performer_item item) {
static const ROB_ITEM_EQUIP_SUB_ID pv_performer_item_id_to_item_sub_id_table[] = {
ROB_ITEM_EQUIP_SUB_ID_ZUJO, ROB_ITEM_EQUIP_SUB_ID_MEGANE,
ROB_ITEM_EQUIP_SUB_ID_KUBI, ROB_ITEM_EQUIP_SUB_ID_JOHA_USHIRO,
};
if (item >= 0 && item < PV_PERFORMER_ITEM_MAX)
return pv_performer_item_id_to_item_sub_id_table[item];
return ITEM_SUB_NONE;
return ROB_ITEM_EQUIP_SUB_ID_NONE;
}
void task_pv_db_init() {
+1 -1
View File
@@ -556,7 +556,7 @@ namespace pv_db {
}
extern ROB_PARTS_KIND pv_performer_item_to_rob_parts_kind(pv_performer_item item);
extern item_sub_id pv_performer_item_to_item_sub_id(pv_performer_item item);
extern ROB_ITEM_EQUIP_SUB_ID pv_performer_item_to_item_sub_id(pv_performer_item item);
extern void task_pv_db_init();
extern void task_pv_db_add_paths();
+5 -4
View File
@@ -275,7 +275,7 @@ pv_expression::~pv_expression() {
}
bool pv_expression::ctrl() {
if (!rob_chr || rob_chr->data.motion.motion_id != motion_id)
if (!rob_chr || rob_chr->rob_base.robmot.num != motion_id)
return false;
float_t frame = rob_chr->get_frame();
@@ -435,9 +435,10 @@ void pv_expression::face_set_data(float_t frame) {
data_struct* aft_data = &data_list[DATA_AFT];
motion_database* aft_mot_db = &aft_data->data_ft.mot_db;
int32_t mottbl_index = expression_id_to_mottbl_index(expression_id);
rob_chr->set_face_mottbl_motion(0, mottbl_index, value,
mottbl_index >= 214 && mottbl_index <= 223 ? ROB_PARTIAL_MOTION_PLAYBACK_CHARA_MOTION : ROB_PARTIAL_MOTION_PLAYBACK_STOP,
MOTTABLE_TYPE mottbl_type = expression_id_to_mottbl_type(expression_id);
rob_chr->set_face_mottbl_motion(0, mottbl_type, value,
mottbl_type >= MTP_FACE_MOT_SLOT_1 && mottbl_type <= MTP_FACE_MOT_SLOT_10
? ROB_PARTIAL_MOTION_PLAYBACK_CHARA_MOTION : ROB_PARTIAL_MOTION_PLAYBACK_STOP,
duration, 0.0f, 1.0f, ROB_PARTIAL_MOTION_LOOP_NONE, offset, false, aft_mot_db);
}
+19 -19
View File
@@ -90,7 +90,7 @@ namespace pv_param {
fuzzing_range = 2.0f;
ratio = 0.0f;
quality = 1.0f;
chara_id = -1;
rob_id = -1;
}
chara_alpha::chara_alpha() {
@@ -648,7 +648,7 @@ namespace pv_param {
if (i.flags & DOF_QUALITY)
d.quality = i.quality;
if (i.flags & DOF_AUTO_FOCUS)
d.chara_id = i.chara_id;
d.rob_id = i.rob_id;
dof.push_back(d);
}
}
@@ -836,9 +836,9 @@ namespace pv_param_task {
}
void post_process_task_set_chara_alpha(
int32_t chara_id, int32_t type, float_t alpha, float_t duration) {
ROB_ID rob_id, int32_t type, float_t alpha, float_t duration) {
PostProcessCtrlCharaAlpha& chara_alpha = post_process_task.chara_alpha;
pv_param::chara_alpha& chara_alpha_data = chara_alpha.data.data[chara_id];
pv_param::chara_alpha& chara_alpha_data = chara_alpha.data.data[rob_id];
chara_alpha_data.type = type;
chara_alpha_data.frame = 0.0f;
chara_alpha_data.alpha = alpha;
@@ -846,17 +846,17 @@ namespace pv_param_task {
}
void post_process_task_set_chara_item_alpha(
int32_t chara_id, int32_t type, float_t alpha, float_t duration,
ROB_ID rob_id, int32_t type, float_t alpha, float_t duration,
post_process_task_set_chara_item_alpha_callback callback, void* callback_data) {
PostProcessCtrlCharaItemAlpha& chara_item_alpha = post_process_task.chara_item_alpha;
pv_param::chara_alpha& chara_item_alpha_data = chara_item_alpha.data.data[chara_id];
pv_param::chara_alpha& chara_item_alpha_data = chara_item_alpha.data.data[rob_id];
chara_item_alpha_data.type = type;
chara_item_alpha_data.frame = 0.0f;
chara_item_alpha_data.alpha = alpha;
chara_item_alpha_data.duration = duration;
chara_item_alpha.callback[chara_id] = callback;
chara_item_alpha.callback_data[chara_id] = callback_data;
chara_item_alpha.callback[rob_id] = callback;
chara_item_alpha.callback_data[rob_id] = callback_data;
}
bool post_process_task_del_task() {
@@ -1007,10 +1007,10 @@ namespace pv_param_task {
}
void PostProcessCtrlCharaAlpha::Set() {
int32_t index = 0;
int32_t rob_id = 0;
for (pv_param::chara_alpha& i : data.data) {
if (i.frame < 0.0f) {
index++;
rob_id++;
continue;
}
@@ -1036,14 +1036,14 @@ namespace pv_param_task {
break;
}
rob_chara_array_set_alpha_obj_flags(index, value, obj_flags);
rob_chara_array_set_alpha_obj_flags((ROB_ID)rob_id, value, obj_flags);
i.frame += get_delta_frame();
if (i.frame > i.duration) {
i.frame = -1.0f;
i.prev_alpha = i.alpha;
}
index++;
rob_id++;
}
}
@@ -1067,10 +1067,10 @@ namespace pv_param_task {
}
void PostProcessCtrlCharaItemAlpha::Set() {
int32_t index = 0;
int32_t rob_id = 0;
for (pv_param::chara_alpha& i : data.data) {
if (i.frame < 0.0f) {
index++;
rob_id++;
continue;
}
@@ -1083,14 +1083,14 @@ namespace pv_param_task {
value = lerp_def(i.prev_alpha, i.alpha, i.frame / i.duration);
if (callback)
callback[index](callback_data[index], index, i.type, value);
callback[rob_id](callback_data[rob_id], (ROB_ID)rob_id, i.type, value);
i.frame += get_delta_frame();
if (i.frame > i.duration) {
i.frame = -1.0f;
i.prev_alpha = i.alpha;
}
index++;
rob_id++;
}
}
@@ -1145,16 +1145,16 @@ namespace pv_param_task {
}
void PostProcessCtrlDof::Set() {
bool autofocus = data.data.chara_id != -1;
bool autofocus = data.data.rob_id != ROB_ID_NULL;
if (autofocus) {
if (!rctx_ptr->render.get_dof_update())
return;
vec3 trans = 0.0f;
if (callback)
trans = callback(callback_data, data.data.chara_id);
trans = callback(callback_data, (ROB_ID)data.data.rob_id);
else {
rob_chara* rob_chr = rob_chara_array_get(data.data.chara_id);
rob_chara* rob_chr = get_rob_management()->get_rob((ROB_ID)data.data.rob_id);
if (rob_chr)
mat4_get_translation(rob_chr->get_bone_data_mat(BLK_CL_KAO), &trans);
}
+5 -5
View File
@@ -32,7 +32,7 @@ namespace pv_param {
float_t fuzzing_range;
float_t ratio;
float_t quality;
int32_t chara_id;
int32_t rob_id;
dof();
};
@@ -74,9 +74,9 @@ namespace pv_param {
namespace pv_param_task {
typedef void (*post_process_task_set_chara_item_alpha_callback)
(void* data, int32_t chara_id, int32_t type, float_t alpha);
(void* data, ROB_ID rob_id, int32_t type, float_t alpha);
typedef vec3(*post_process_task_set_dof_callback)
(void* data, int32_t chara_id);
(void* data, ROB_ID rob_id);
extern bool post_process_task_add_task();
extern void post_process_task_set_bloom_data(
@@ -89,9 +89,9 @@ namespace pv_param_task {
pv_param::dof& data, float_t duration,
post_process_task_set_dof_callback callback, void* callback_data);
extern void post_process_task_set_chara_alpha(
int32_t chara_id, int32_t type, float_t alpha, float_t duration);
ROB_ID rob_id, int32_t type, float_t alpha, float_t duration);
extern void post_process_task_set_chara_item_alpha(
int32_t chara_id, int32_t type, float_t alpha, float_t duration,
ROB_ID rob_id, int32_t type, float_t alpha, float_t duration,
post_process_task_set_chara_item_alpha_callback callback, void* callback_data);
extern bool post_process_task_del_task();
}
+5 -5
View File
@@ -324,11 +324,11 @@ namespace rndr {
this->exposure_query_index = query_index;
int32_t next_query_index = (query_index + 2) % 3;
for (int32_t i = 0; i < ROB_ID_MAX; i++, chara_data++) {
rob_chara* rob_chr = rob_chara_array_get(i);
if (!rob_chr || !rob_chr->is_visible())
rob_chara* rob_chr = get_rob_management()->get_rob((ROB_ID)i);
if (!rob_chr || !rob_chr->get_disp_flag())
continue;
float_t max_face_depth = rob_chr->get_max_face_depth();
float_t max_face_depth = rob_chr->get_face_depth();
mat4 mat = mat4_identity;
rob_chr->sub_1405163C0(4, mat);
@@ -1889,8 +1889,8 @@ namespace rndr {
if (!reset_exposure) {
ExposureCharaData* chara_data = exposure_chara_data;
for (int32_t i = 0; i < ROB_ID_MAX; i++, chara_data++) {
rob_chara* rob_chr = rob_chara_array_get(i);
if (!rob_chr || !rob_chr->is_visible())
rob_chara* rob_chr = get_rob_management()->get_rob((ROB_ID)i);
if (!rob_chr || !rob_chr->get_disp_flag())
continue;
vec4 v34 = { 0.05f, 0.0f, -0.04f, 1.0f };
-2
View File
@@ -563,8 +563,6 @@ struct render_context {
bool chara_reflect;
bool chara_refract;
mat4 matrix_buffer[MATRIX_BUFFER_COUNT];
GLuint box_vao;
GL::ArrayBuffer box_vbo;
+5 -4
View File
@@ -75,10 +75,11 @@ namespace renderer {
if (dof_debug_data.flags & DOF_DEBUG_ENABLE_PHYS_DOF) {
float_t focus = dof_debug_data.focus;
if (dof_debug_data.flags & DOF_DEBUG_AUTO_FOCUS) {
rob_chara* rob_chr = 0;
for (int32_t i = 0; i < ROB_ID_MAX; i++) {
rob_chara* rob_chr = rob_chara_array_get(i);
if (!rob_chr || !rob_chr->is_visible())
RobManagement* rob_man = get_rob_management();
size_t rob_num = rob_man->get_rob_num();
for (int32_t i = 0; i < rob_num; i++) {
rob_chara* rob_chr = rob_man->get_rob((ROB_ID)i);
if (!rob_chr || !rob_chr->get_disp_flag())
continue;
mat4 mat = mat4_identity;
+74 -57
View File
@@ -78,6 +78,7 @@ static void closest_pt_segment_segment(vec3& vec, const vec3& p0, const vec3& q0
static void length_limit(vec3& p, const vec3& r, const float_t rr);
static bool make_axis_matrix(mat4& mat, const vec3& axis,
const skin_param_hinge* hinge, vec3* rot, const ROTTYPE& rottype);
static void make_direction_matrix(mat4& mat, const vec3& v0, const vec3& v1);
static void modify_cloth_object(obj_mesh* mesh, obj_mesh_vertex_buffer* vb,
CLOTH_VERTEX* vtxarg, float_t sgn, int32_t num_idx, uint16_t* idxtbl, bool do_ura);
@@ -185,7 +186,7 @@ void ExNodeBlock::init_members() {
// 0x1405EEB80
void ExNodeBlock::set_data(RobNode* node, ExNodeType type,
const char* name, const rob_chara_item_equip_object* skin_disp) {
const char* name, const RobSkinDisp* skin_disp) {
init_members();
dst_node = node;
@@ -195,6 +196,11 @@ void ExNodeBlock::set_data(RobNode* node, ExNodeType type,
this->skin_disp = skin_disp;
}
// 0x1405F92B0
void ExNodeBlock::set_name(const char* name) {
this->name = name;
}
ExNullBlock::ExNullBlock() {
init();
}
@@ -251,7 +257,7 @@ void ExNullBlock::pos_init_cont() {
}
void ExNullBlock::set_data(const rob_chara_item_equip_object* skin_disp,
void ExNullBlock::set_data(const RobSkinDisp* skin_disp,
const obj_skin_ex_node_constraint* data, const char* name, const bone_database* bone_data) {
RobNode* node = (RobNode*)skin_disp->get_node(name, bone_data);
type = EX_NODE_TYPE_NULL;
@@ -1231,10 +1237,10 @@ void RobCloth::dest() {
reset_data_list = 0;
}
void RobCloth::AddMotionResetData(uint32_t motion_id, float_t frame) {
void RobCloth::AddMotionResetData(uint32_t motnum, float_t frame) {
int32_t frame_int = (int32_t)prj::roundf(frame * 1000.0f);
auto elem = motion_reset_data.find({ motion_id, frame_int });
auto elem = motion_reset_data.find({ motnum, frame_int });
if (elem != motion_reset_data.end())
motion_reset_data.erase(elem);
@@ -1244,7 +1250,7 @@ void RobCloth::AddMotionResetData(uint32_t motion_id, float_t frame) {
for (CLOTH_VERTEX* i = i_begin; i != i_end; i++)
reset_data_list.push_back(i->reset_data);
motion_reset_data.insert({ { motion_id, frame_int }, reset_data_list });
motion_reset_data.insert({ { motnum, frame_int }, reset_data_list });
}
// 0x1402196D0
@@ -1282,20 +1288,20 @@ void RobCloth::CtrlOsagePlayData(const std::vector<opd_blend_data>& opd_blend_da
float_t frame = i->frame;
#if OPD_PLAY_GEN
if (frame >= i->frame_count)
frame = i->no_loop ? i->frame_count - 1.0f : 0.0f;
if (frame >= i->frame_max)
frame = i->no_loop ? i->frame_max - 1.0f : 0.0f;
#else
if (frame >= i->frame_count)
if (frame >= i->frame_max)
frame = 0.0f;
#endif
int32_t curr_key = (int32_t)(int64_t)prj::floorf(frame);
int32_t next_key = curr_key + 1;
#if OPD_PLAY_GEN
if ((float_t)next_key >= i->frame_count)
next_key = i->no_loop ? (int32_t)i->frame_count - 1 : 0;
if ((float_t)next_key >= i->frame_max)
next_key = i->no_loop ? (int32_t)i->frame_max - 1 : 0;
#else
if ((float_t)next_key >= i->frame_count)
if ((float_t)next_key >= i->frame_max)
next_key = 0;
#endif
@@ -1402,9 +1408,9 @@ void RobCloth::LoadSkinParam(void* kv, const char* name, const bone_database* bo
SetSkinParamOsageRoot(root);
}
void RobCloth::SetMotionResetData(uint32_t motion_id, float_t frame) {
void RobCloth::SetMotionResetData(uint32_t motnum, float_t frame) {
osage_reset = true;
auto elem = motion_reset_data.find({ motion_id, (int32_t)prj::roundf(frame * 1000.0f) });
auto elem = motion_reset_data.find({ motnum, (int32_t)prj::roundf(frame * 1000.0f) });
if (elem != motion_reset_data.end() && elem->second.size() + width == vtxarg.size()) {
this->reset_data_list = &elem->second;
@@ -1798,7 +1804,7 @@ void RobCloth::modify_obj() {
// 0x14021E460
void RobCloth::set_data(size_t w, size_t h, const obj_skin_ex_node_cloth_root * rt_data,
const obj_skin_ex_node_cloth_point* move, const mat4* lcl_mat, uint32_t ring_flag,
const rob_chara_item_equip_object* skin, const bone_database* bone_data) {
const RobSkinDisp* skin, const bone_database* bone_data) {
skin_disp = skin;
obj* obj = objset_info_storage_get_obj(skin_disp->obj_uid);
@@ -1937,7 +1943,7 @@ void RobCloth::set_data(size_t w, size_t h, const obj_skin_ex_node_cloth_root *
// 0x14021EEB0
void RobCloth::set_data(const obj_skin_ex_node_cloth* cldata,
const rob_chara_item_equip_object* skin, const bone_database* bone_data) {
const RobSkinDisp* skin, const bone_database* bone_data) {
dest();
data = cldata;
set_data(cldata->width, cldata->height, cldata->fix_point,
@@ -2072,7 +2078,7 @@ void ExClothBlock::CtrlStep(int32_t stage, bool disable_ex_force) {
void ExClothBlock::ctrl() {
set_param();
const rob_chara_item_equip* rob_disp = skin_disp->rob_disp;
const RobDisp* rob_disp = skin_disp->rob_disp;
float_t delta_frame = get_delta_frame();
#if OPD_PLAY_GEN
if (opd_play_gen_run)
@@ -2112,16 +2118,16 @@ void ExClothBlock::pos_init_cont() {
cloth_work.pos_init_cont();
}
void ExClothBlock::AddMotionResetData(uint32_t motion_id, float_t frame) {
cloth_work.AddMotionResetData(motion_id, frame);
void ExClothBlock::AddMotionResetData(const uint32_t& motnum, const float_t& frame) {
cloth_work.AddMotionResetData(motnum, frame);
}
const float_t* ExClothBlock::LoadOpdData(size_t node_index, const float_t* opd_data, size_t opd_count) {
return cloth_work.LoadOpdData(node_index, opd_data, opd_count);
}
void ExClothBlock::SetMotionResetData(uint32_t motion_id, float_t frame) {
cloth_work.SetMotionResetData(motion_id, frame);
void ExClothBlock::SetMotionResetData(const uint32_t& motnum, const float_t& frame) {
cloth_work.SetMotionResetData(motnum, frame);
}
const float_t* ExClothBlock::SetOsagePlayDataInit(const float_t* opdi_data) {
@@ -2155,7 +2161,7 @@ void ExClothBlock::reset_ex_force() {
cloth_work.reset_ex_force();
}
void ExClothBlock::set_data(const rob_chara_item_equip_object* skin_disp,
void ExClothBlock::set_data(const RobSkinDisp* skin_disp,
const obj_skin_ex_node_cloth* data, const skin_param_osage_root* skp_root, const bone_database* bone_data) {
type = EX_NODE_TYPE_CLOTH;
dst_node = 0;
@@ -2194,10 +2200,10 @@ RobOsage::~RobOsage() {
}
void RobOsage::AddMotionResetData(uint32_t motion_id, float_t frame) {
void RobOsage::AddMotionResetData(const uint32_t& motnum, const float_t& frame) {
int32_t frame_int = (int32_t)prj::roundf(frame * 1000.0f);
auto elem = motion_reset_data.find({ motion_id, frame_int });
auto elem = motion_reset_data.find({ motnum, frame_int });
if (elem != motion_reset_data.end())
motion_reset_data.erase(elem);
@@ -2207,7 +2213,7 @@ void RobOsage::AddMotionResetData(uint32_t motion_id, float_t frame) {
for (RobJointNode* i = i_begin; i != i_end; i++)
reset_data_list.push_back(i->reset_data);
motion_reset_data.insert({ { motion_id, frame_int }, reset_data_list });
motion_reset_data.insert({ { motnum, frame_int }, reset_data_list });
}
// 0x14047D620
@@ -2638,20 +2644,20 @@ void RobOsage::CtrlOsagePlayData(const mat4& root_matrix,
float_t frame = i->frame;
#if OPD_PLAY_GEN
if (frame >= i->frame_count)
frame = i->no_loop ? i->frame_count - 1.0f : 0.0f;
if (frame >= i->frame_max)
frame = i->no_loop ? i->frame_max - 1.0f : 0.0f;
#else
if (frame >= i->frame_count)
if (frame >= i->frame_max)
frame = 0.0f;
#endif
int32_t curr_key = (int32_t)(int64_t)prj::floorf(frame);
int32_t next_key = curr_key + 1;
#if OPD_PLAY_GEN
if ((float_t)next_key >= i->frame_count)
next_key = i->no_loop ? (int32_t)i->frame_count - 1 : 0;
if ((float_t)next_key >= i->frame_max)
next_key = i->no_loop ? (int32_t)i->frame_max - 1 : 0;
#else
if ((float_t)next_key >= i->frame_count)
if ((float_t)next_key >= i->frame_max)
next_key = 0;
#endif
@@ -2810,9 +2816,9 @@ void RobOsage::SetDisableCollision(const bool& value) {
disable_collision = value;
}
void RobOsage::SetMotionResetData(uint32_t motion_id, float_t frame) {
void RobOsage::SetMotionResetData(const uint32_t& motnum, const float_t& frame) {
osage_reset = true;
auto elem = motion_reset_data.find({ motion_id, (int32_t)prj::roundf(frame * 1000.0f) });
auto elem = motion_reset_data.find({ motnum, (int32_t)prj::roundf(frame * 1000.0f) });
if (elem != motion_reset_data.end() && elem->second.size() + 1 == joint_node_vec.size())
reset_data_list = &elem->second;
}
@@ -3236,7 +3242,7 @@ void ExOsageBlock::CtrlBegin() {
}
void ExOsageBlock::CtrlStep(int32_t stage, bool disable_ex_force) {
const rob_chara_item_equip* rob_disp = skin_disp->rob_disp;
const RobDisp* rob_disp = skin_disp->rob_disp;
float_t delta_frame = get_delta_frame();
#if OPD_PLAY_GEN
if (opd_play_gen_run)
@@ -3282,7 +3288,7 @@ void ExOsageBlock::ctrl() {
return;
}
const rob_chara_item_equip* rob_disp = skin_disp->rob_disp;
const RobDisp* rob_disp = skin_disp->rob_disp;
float_t delta_frame = get_delta_frame();
#if OPD_PLAY_GEN
if (opd_play_gen_run)
@@ -3358,8 +3364,8 @@ void ExOsageBlock::CtrlEnd() {
done = false;
}
void ExOsageBlock::AddMotionResetData(uint32_t motion_id, float_t frame) {
osage_work.AddMotionResetData(motion_id, frame);
void ExOsageBlock::AddMotionResetData(const uint32_t& motnum, const float_t& frame) {
osage_work.AddMotionResetData(motnum, frame);
}
const float_t* ExOsageBlock::LoadOpdData(size_t node_index, const float_t* opd_data, size_t opd_count) {
@@ -3371,8 +3377,8 @@ void ExOsageBlock::SetDisableCollision(const bool& value) {
osage_work.SetDisableCollision(value);
}
void ExOsageBlock::SetMotionResetData(uint32_t motion_id, float_t frame) {
osage_work.SetMotionResetData(motion_id, frame);
void ExOsageBlock::SetMotionResetData(const uint32_t& motnum, const float_t& frame) {
osage_work.SetMotionResetData(motnum, frame);
}
const float_t* ExOsageBlock::SetOsagePlayDataInit(const float_t* opdi_data) {
@@ -3398,37 +3404,36 @@ void ExOsageBlock::SetWindDirection() {
}
// 0x1405F3E10
void ExOsageBlock::get_node_list(
const obj_skin_ex_node_osage* osg_data, const obj_skin_osage_joint* joint,
prj::vector_pair<uint32_t, RobJointNode*>& joint_node_list,
std::map<std::string, ExNodeBlock*>& ex_node_list) {
void ExOsageBlock::make_joint_map(const obj_skin_ex_node_osage* root,
const obj_skin_osage_joint* joint, prj::vector_pair<uint32_t, RobJointNode*>& joint_map,
std::map<std::string, ExNodeBlock*>& node_name_map) {
RobJointNode* root_node = osage_work.get_joint_node(0);
joint_node_list.push_back(osg_data->root_idx, root_node);
joint_map.push_back(root->root_idx, root_node);
for (uint32_t i = 0; i < osg_data->nb_joint; i++) {
for (uint32_t i = 0; i < root->nb_joint; i++) {
RobJointNode* node = osage_work.get_joint_node(i + 1ULL);
joint_node_list.push_back(joint[i].nid, node);
joint_map.push_back(joint[i].nid, node);
if (node->dst_node && node->dst_node->name)
ex_node_list.insert({ node->dst_node->name, this });
node_name_map.insert({ node->dst_node->name, this });
}
RobJointNode* effector_node = osage_work.get_joint_node(osg_data->nb_joint + 1ULL);
joint_node_list.push_back(osg_data->efc_idx, effector_node);
RobJointNode* effector_node = osage_work.get_joint_node(root->nb_joint + 1ULL);
joint_map.push_back(root->efc_idx, effector_node);
if (effector_node->dst_node && effector_node->dst_node->name)
ex_node_list.insert({ effector_node->dst_node->name, this });
node_name_map.insert({ effector_node->dst_node->name, this });
}
void ExOsageBlock::reset_ex_force() {
osage_work.reset_ex_force();
}
// 0x140
void ExOsageBlock::set_data(const rob_chara_item_equip_object* skp,
const obj_skin_ex_node_osage* root, const char* name, const obj_skin_osage_joint* joint,
// 0x1405F7E10
void ExOsageBlock::set_data(const RobSkinDisp* skp,
const obj_skin_ex_node_osage* root, const obj_skin_osage_joint* joint,
const RobNode* mot_node, RobNode* ex_node, const obj_skin* skin) {
ExNodeBlock::set_data(&ex_node[root->root_idx & 0x7FFF], EX_NODE_TYPE_OSAGE, name, skp);
ExNodeBlock::set_data(&ex_node[root->root_idx & 0x7FFF], EX_NODE_TYPE_OSAGE, 0, skp);
osage_work.init(root, joint, ex_node, skin);
flag.pos_init = 0;
motion_matrix = mot_node->mat_ptr;
@@ -3569,7 +3574,7 @@ inline void ExConstraintBlock::CalcConstraintDirection(mat4 mat) {
return;
mat4 rot_mat;
RobBlock::orient_to_target(rot_mat, align_axis, v51);
make_direction_matrix(rot_mat, align_axis, v51);
if (upvector_node) {
vec3 affected_axis = direction->up_vector.affected_axis;
@@ -3645,7 +3650,7 @@ void ExConstraintBlock::CalcConstraintPosition(mat4 mat) {
mat4_inverse_transform_point(&mat, &up_vector_trans, &up_vector_trans);
mat4 rot_mat;
RobBlock::orient_to_target(rot_mat, position->up_vector.affected_axis, up_vector_trans);
make_direction_matrix(rot_mat, position->up_vector.affected_axis, up_vector_trans);
mat4_mul(&rot_mat, &mat, &mat);
}
@@ -3681,7 +3686,7 @@ void ExConstraintBlock::CalcMatrixHS() {
}
void ExConstraintBlock::set_data(const rob_chara_item_equip_object* skin_disp,
void ExConstraintBlock::set_data(const RobSkinDisp* skin_disp,
const obj_skin_ex_node_constraint* data, const char* name, const bone_database* bone_data) {
RobNode* node = (RobNode*)skin_disp->get_node(name, bone_data);
type = EX_NODE_TYPE_CONSTRAINT;
@@ -3864,7 +3869,7 @@ void ExExpressionBlock::CalcMatrixHS() {
*dst_node->no_scale_mat = mat;
}
void ExExpressionBlock::set_data(const rob_chara_item_equip_object* skin_disp,
void ExExpressionBlock::set_data(const RobSkinDisp* skin_disp,
const obj_skin_ex_node_expression* data, const char* node_name, object_info objuid,
size_t index, const bone_database* bone_data) {
Expr_node* stack_buf[28];
@@ -4312,6 +4317,18 @@ static bool make_axis_matrix(mat4& mat, const vec3& axis,
return rot_clamped;
}
// 0x1401EB410
static void make_direction_matrix(mat4& mat, const vec3& v0, const vec3& v1) {
vec3 v0_norm = vec3::normalize(v0);
vec3 v1_norm = vec3::normalize(v1);
vec3 axis = vec3::cross(v1_norm, v0_norm);
float_t c = clamp_def(vec3::dot(v1_norm, v0_norm), -1.0f, 1.0f);
float_t s = sqrtf(clamp_def(1.0f - c * c, 0.0f, 1.0f));
mat4_set(&axis, -s, c, &mat);
}
static void modify_cloth_object(obj_mesh* mesh, obj_mesh_vertex_buffer* vb,
CLOTH_VERTEX* vtxarg, float_t sgn, int32_t num_idx, uint16_t* idxtbl, bool do_ura) {
if (!mesh || !vb || (mesh->vertex_format
+100 -112
View File
@@ -7,10 +7,10 @@
#include "../../KKdLib/io/path.hpp"
#include "../data.hpp"
static const mothead_mot mothead_mot_null;
static const MhdData mothead_mot_null;
std::map<uint32_t, MhdFile> mothead_storage_data;
std::map<uint32_t, MotFile> motion_storage_data;
std::map<uint32_t, MotFile> sp_mot_data;
MhdFile::MhdFile() : data(), set(), load_count() {
FreeData();
@@ -49,88 +49,73 @@ void MhdFile::LoadFile(const char* path, const char* file, uint32_t set) {
void MhdFile::ParseFile(const void* data) {
alloc_handler = prj::shared_ptr<prj::stack_allocator>(new prj::stack_allocator);
mothead_file* mhdf = (mothead_file*)((size_t)data + ((uint32_t*)data)[1]);
MhdFileHeaderFile* mhdf = (MhdFileHeaderFile*)((size_t)data + ((uint32_t*)data)[1]);
this->data = MhdFile::ParseMothead(mhdf, (size_t)mhdf);
}
mothead* MhdFile::ParseMothead(mothead_file* mhdf, size_t data) {
mothead* mhd = alloc_handler->allocate<mothead>();
mhd->mot_set_id = mhdf->mot_set_id;
mhd->first_mot_id = mhdf->first_mot_id;
mhd->last_mot_id = mhdf->last_mot_id;
uint32_t* mot_offsets = (uint32_t*)(data + mhdf->mot_offsets_offset);
size_t mot_count = (size_t)mhdf->last_mot_id - mhdf->first_mot_id + 1;
mhd->mots = alloc_handler->allocate<mothead_mot*>(mot_count);
mothead_mot** mots = mhd->mots;
for (; mot_count; mot_count--) {
*mots = 0;
if (*mot_offsets)
*mots = ParseMotheadMot((mothead_mot_file*)(data + *mot_offsets), data);
mots++;
mot_offsets++;
MhdFileHeader* MhdFile::ParseMothead(MhdFileHeaderFile* mhdf, size_t data) {
MhdFileHeader* mhd = alloc_handler->allocate<MhdFileHeader>();
mhd->file_id = mhdf->file_id;
mhd->min_mot_id = mhdf->min_mot_id;
mhd->max_mot_id = mhdf->max_mot_id;
uint32_t* data_list_offsets = (uint32_t*)(data + mhdf->data_list_offsets_offset);
size_t mot_count = (size_t)mhdf->max_mot_id - mhdf->min_mot_id + 1;
mhd->data_list = alloc_handler->allocate<MhdData*>(mot_count);
MhdData** data_list = mhd->data_list;
for (; mot_count; mot_count--, data_list_offsets++, data_list++) {
*data_list = 0;
if (*data_list_offsets)
*data_list = ParseMotheadMot((MhdDataFile*)(data + *data_list_offsets), data);
}
return mhd;
}
mothead_mot* MhdFile::ParseMotheadMot(mothead_mot_file* mhdsf, size_t data) {
struct mothead_mot_data_file {
int32_t type;
uint32_t offset;
};
MhdData* MhdFile::ParseMotheadMot(MhdDataFile* mhdf, size_t data) {
MhdData* mhdm = alloc_handler->allocate<MhdData>();
mhdm->mot_kind = mhdf->mot_kind;
mhdm->start_style = mhdf->start_style;
mhdm->end_style = mhdf->end_style;
struct mothead_data_file {
mothead_data_type type;
int32_t frame;
uint32_t offset;
};
if (mhdf->mh_list_offset) {
MhdListFile* mh_list_file = (MhdListFile*)(data + mhdf->mh_list_offset);
MhdListFile* mh_list_file_end = mh_list_file;
while ((mh_list_file_end++)->type >= 0);
mothead_mot* mhdm = alloc_handler->allocate<mothead_mot>();
mhdm->field_0.field_0 = mhdsf->field_0;
mhdm->field_0.field_4 = mhdsf->field_4;
mhdm->field_0.field_8 = mhdsf->field_8;
mhdm->field_0.field_C = mhdsf->field_C;
mhdm->field_10 = mhdsf->field_10;
mhdm->field_12 = mhdsf->field_12;
if (mhdsf->mot_data_offset) {
mothead_mot_data_file* mot_data_file = (mothead_mot_data_file*)(data + mhdsf->mot_data_offset);
mothead_mot_data_file* mot_data_file_end = mot_data_file;
while ((mot_data_file_end++)->type >= 0);
size_t count = mot_data_file_end - mot_data_file;
mhdm->mot_data = alloc_handler->allocate<mothead_mot_data>(count);
mothead_mot_data* mot_data = mhdm->mot_data;
for (size_t i = count; i; i--, mot_data_file++, mot_data++) {
mot_data->type = mot_data_file->type;
mot_data->data = (void*)(data + mot_data_file->offset);
size_t count = mh_list_file_end - mh_list_file;
mhdm->mh_list = alloc_handler->allocate<MhdList>(count);
MhdList* mh_list = mhdm->mh_list;
for (size_t i = count; i; i--, mh_list_file++, mh_list++) {
mh_list->type = mh_list_file->type;
mh_list->data = (void*)(data + mh_list_file->data_offset);
}
}
if (mhdsf->data_offset) {
mothead_data_file* data_file = (mothead_data_file*)(data + mhdsf->data_offset);
mothead_data_file* data_file_end = data_file;
while ((data_file_end++)->type >= 0);
if (mhdf->pp_list_offset) {
MhpListFile* pp_list_file = (MhpListFile*)(data + mhdf->pp_list_offset);
MhpListFile* pp_list_file_end = pp_list_file;
while ((pp_list_file_end++)->type >= 0);
size_t count = data_file_end - data_file;
mhdm->data = alloc_handler->allocate<mothead_data>(count);
mothead_data* _data = mhdm->data;
for (size_t i = count; i; i--, data_file++, _data++) {
_data->type = data_file->type;
_data->frame = data_file->frame;
_data->data = (void*)(data + data_file->offset);
size_t count = pp_list_file_end - pp_list_file;
mhdm->pp_list = alloc_handler->allocate<MhpList>(count);
MhpList* pp_list = mhdm->pp_list;
for (size_t i = count; i; i--, pp_list_file++, pp_list++) {
pp_list->type = pp_list_file->type;
pp_list->frame = pp_list_file->frame;
pp_list->data = (void*)(data + pp_list_file->data_offset);
}
}
if (mhdsf->field_1C) {
uint32_t* v29 = (uint32_t*)(data + mhdsf->field_1C);
uint32_t* v30 = v29;
while (*v30++);
if (mhdf->cm_list_offset) {
MhcListFile* cm_list_file = (MhcListFile*)(data + mhdf->cm_list_offset);
MhcListFile* cm_list_file_end = cm_list_file;
while ((cm_list_file_end++)->data_offset);
size_t count = v30 - v29;
mhdm->field_28 = alloc_handler->allocate<int64_t>(count);
int64_t* v33 = mhdm->field_28;
for (size_t i = count; i; i--)
*v33++ = data + *v29++;
size_t count = cm_list_file_end - cm_list_file;
mhdm->cm_list = alloc_handler->allocate<MhcList>(count);
MhcList* cm_list = mhdm->cm_list;
for (size_t i = count; i; i--, cm_list_file++, cm_list++)
cm_list->data = (void*)(data + cm_list_file->data_offset);
}
return mhdm;
}
@@ -243,6 +228,36 @@ void MotFile::ParseFileParent(MotFile* mot, const void* file_data, size_t size)
mot->ParseFile(file_data, size);
}
const mot_data* get_motiondata_address(uint32_t motnum, const motion_database* mot_db) {
if (motnum == -1) // It should be motnum < 0, but we're dealing with unsigned value, so there it is
return 0;
const motion_set_info* set_info = mot_db->get_motion_set_by_motion_id(motnum);
if (!set_info) {
printf_debug_info("%08x : illegal motfile Num.\n", motnum);
return 0;
}
for (const motion_info& i : set_info->motion) {
if (i.id != motnum)
continue;
auto elem = sp_mot_data.find(set_info->id);
if (elem != sp_mot_data.end())
return &elem->second.mot_set->mot_data[&i - set_info->motion.data()];
return 0;
}
return 0;
}
float_t get_mot_frame_max(uint32_t mot_id, const motion_database* mot_db) {
const mot_data* mot = get_motiondata_address(mot_id, mot_db);
if (mot)
return mot->frame_max;
return 0.0f;
}
void motion_set_load_mothead(uint32_t set, std::string&& mdata_dir, const motion_database* mot_db) {
const motion_set_info* set_info = mot_db->get_motion_set_by_id(set);
if (!set_info) {
@@ -277,9 +292,9 @@ void motion_set_load_motion(uint32_t set, std::string&& mdata_dir, const motion_
if (!set_info)
return;
auto elem = motion_storage_data.find(set);
if (elem == motion_storage_data.end())
elem = motion_storage_data.insert({ set, {} }).first;
auto elem = sp_mot_data.find(set);
if (elem == sp_mot_data.end())
elem = sp_mot_data.insert({ set, {} }).first;
elem->second.mot_set_info = set_info;
elem->second.LoadFile(std::string(mdata_dir), set);
@@ -292,9 +307,9 @@ void motion_set_unload_mothead(uint32_t set) {
}
void motion_set_unload_motion(uint32_t set) {
auto elem = motion_storage_data.find(set);
if (elem != motion_storage_data.end() && elem->second.Unload())
motion_storage_data.erase(elem);
auto elem = sp_mot_data.find(set);
if (elem != sp_mot_data.end() && elem->second.Unload())
sp_mot_data.erase(elem);
}
bool mothead_storage_check_mhd_file_not_ready(uint32_t set_id) {
@@ -311,7 +326,7 @@ MhdFile* mothead_storage_get_mhd_file(uint32_t set_id) {
return 0;
}
const mothead_mot* mothead_storage_get_mot_by_motion_id(
const MhdData* mothead_storage_get_mot_by_motion_id(
uint32_t motion_id, const motion_database* mot_db) {
uint32_t set_id = mot_db->get_motion_set_id_by_motion_id(motion_id);
if (set_id == -1)
@@ -321,70 +336,43 @@ const mothead_mot* mothead_storage_get_mot_by_motion_id(
if (elem == mothead_storage_data.end() || !elem->second.data)
return &mothead_mot_null;
mothead* mhd = elem->second.data;
if ((int32_t)motion_id < mhd->first_mot_id || (int32_t)motion_id > mhd->last_mot_id)
MhdFileHeader* mhd = elem->second.data;
if (motion_id < mhd->min_mot_id || motion_id > mhd->max_mot_id)
return &mothead_mot_null;
mothead_mot* mot = mhd->mots[(ssize_t)(int32_t)motion_id - mhd->first_mot_id];
MhdData* mot = mhd->data_list[(ssize_t)motion_id - mhd->min_mot_id];
if (!mot)
return &mothead_mot_null;
return mot;
}
bool motion_storage_check_mot_file_not_ready(uint32_t set_id) {
auto elem = motion_storage_data.find(set_id);
if (elem != motion_storage_data.end())
auto elem = sp_mot_data.find(set_id);
if (elem != sp_mot_data.end())
return elem->second.CheckNotReady();
return false;
}
MotFile* motion_storage_get_mot_file(uint32_t set_id) {
auto elem = motion_storage_data.find(set_id);
if (elem != motion_storage_data.end())
auto elem = sp_mot_data.find(set_id);
if (elem != sp_mot_data.end())
return &elem->second;
return 0;
}
const mot_data* motion_storage_get_mot_data(uint32_t motion_id, const motion_database* mot_db) {
const motion_set_info* set_info = mot_db->get_motion_set_by_motion_id(motion_id);
if (!set_info) {
printf_debug_info("%08x : illegal motfile Num.\n", motion_id);
return 0;
}
for (const motion_info& i : set_info->motion) {
if (i.id != motion_id)
continue;
auto elem = motion_storage_data.find(set_info->id);
if (elem != motion_storage_data.end())
return &elem->second.mot_set->mot_data[&i - set_info->motion.data()];
return 0;
}
return 0;
}
float_t motion_storage_get_mot_data_frame_count(uint32_t motion_id, const motion_database* mot_db) {
const mot_data* mot = motion_storage_get_mot_data(motion_id, mot_db);
if (mot)
return mot->frame_count;
return 0.0f;
}
const mot_set* motion_storage_get_motion_set(uint32_t set_id) {
auto elem = motion_storage_data.find(set_id);
if (elem != motion_storage_data.end())
auto elem = sp_mot_data.find(set_id);
if (elem != sp_mot_data.end())
return elem->second.mot_set;
return 0;
}
void motion_init() {
mothead_storage_data = {};
motion_storage_data = {};
sp_mot_data = {};
}
void motion_free() {
motion_storage_data.clear();
sp_mot_data.clear();
mothead_storage_data.clear();
}
+45 -6
View File
@@ -7,8 +7,46 @@
#include "rob.hpp"
struct MhdListFile {
int32_t type;
uint32_t data_offset;
};
struct MhpListFile {
int32_t type;
int32_t frame;
uint32_t data_offset;
};
struct MhcListFile {
uint32_t data_offset;
};
struct MhdDataFile {
MhdKind mot_kind;
uint16_t start_style;
uint16_t end_style;
uint32_t mh_list_offset;
uint32_t pp_list_offset;
uint32_t cm_list_offset;
};
struct MhdFileHeaderFile {
uint32_t file_id;
uint32_t min_mot_id;
uint32_t max_mot_id;
uint32_t data_list_offsets_offset;
};
/*struct MhdFileHeaderFileModern {
uint32_t file_id;
uint32_t num_mot;
int64_t ids_offset;
int64_t data_list_offsets_offset;
};*/
struct MhdFile {
mothead* data;
MhdFileHeader* data;
uint32_t set;
std::string file_path; // Added
p_file_handler file_handler;
@@ -22,8 +60,8 @@ struct MhdFile {
void FreeData();
void LoadFile(const char* path, const char* file, uint32_t set);
void ParseFile(const void* data);
mothead* ParseMothead(mothead_file* mhdsf, size_t data);
mothead_mot* ParseMotheadMot(mothead_mot_file* mhdsf, size_t data);
MhdFileHeader* ParseMothead(MhdFileHeaderFile* mhdf, size_t data);
MhdData* ParseMotheadMot(MhdDataFile* mhdf, size_t data);
bool Unload();
static void ParseFileParent(MhdFile* mhd, const void* file_data, size_t size);
@@ -48,6 +86,9 @@ struct MotFile {
static void ParseFileParent(MotFile* mot, const void* file_data, size_t size);
};
extern const mot_data* get_motiondata_address(uint32_t mot_id, const motion_database* mot_db);
extern float_t get_mot_frame_max(uint32_t mot_id, const motion_database* mot_db);
extern void motion_set_load_mothead(uint32_t set, std::string&& mdata_dir, const motion_database* mot_db);
extern void motion_set_load_motion(uint32_t set, std::string&& mdata_dir, const motion_database* mot_db);
extern void motion_set_unload_mothead(uint32_t set);
@@ -55,12 +96,10 @@ extern void motion_set_unload_motion(uint32_t set);
extern bool mothead_storage_check_mhd_file_not_ready(uint32_t set_id);
extern MhdFile* mothead_storage_get_mhd_file(uint32_t set_id);
extern const mothead_mot* mothead_storage_get_mot_by_motion_id(
extern const MhdData* mothead_storage_get_mot_by_motion_id(
uint32_t motion_id, const motion_database* mot_db);
extern bool motion_storage_check_mot_file_not_ready(uint32_t set_id);
extern MotFile* motion_storage_get_mot_file(uint32_t set_id);
extern const mot_data* motion_storage_get_mot_data(uint32_t motion_id, const motion_database* mot_db);
extern float_t motion_storage_get_mot_data_frame_count(uint32_t motion_id, const motion_database* mot_db);
extern const mot_set* motion_storage_get_motion_set(uint32_t set_id);
extern void motion_init();
+8036 -7155
View File
File diff suppressed because it is too large Load Diff
+2595 -1105
View File
File diff suppressed because it is too large Load Diff
+56 -56
View File
@@ -19,7 +19,7 @@ struct osage_setting {
void clear();
const osage_setting_osg_cat* get_cat_value(
const object_info& obj_info, const char* root_node);
const object_info& obj_uid, const char* root_node);
void load();
void parse(key_val* kv);
rob_osage_parts parse_parts_string(std::string& s);
@@ -37,36 +37,36 @@ struct skin_param_file {
};
struct skin_param_key {
object_info obj_info;
uint32_t motion_id;
object_info obj_uid;
uint32_t motnum;
int32_t frame;
inline skin_param_key() {
motion_id = -1;
motnum = -1;
frame = -1;
}
inline skin_param_key(object_info obj_info) {
this->obj_info = obj_info;
motion_id = -1;
inline skin_param_key(object_info obj_uid) {
this->obj_uid = obj_uid;
motnum = -1;
frame = -1;
}
inline skin_param_key(object_info obj_info, uint32_t motion_id) {
this->obj_info = obj_info;
this->motion_id = motion_id;
inline skin_param_key(object_info obj_uid, uint32_t motnum) {
this->obj_uid = obj_uid;
this->motnum = motnum;
frame = -1;
}
inline skin_param_key(object_info obj_info, uint32_t motion_id, int32_t frame) {
this->obj_info = obj_info;
this->motion_id = motion_id;
inline skin_param_key(object_info obj_uid, uint32_t motnum, int32_t frame) {
this->obj_uid = obj_uid;
this->motnum = motnum;
this->frame = frame;
}
};
constexpr bool operator==(const skin_param_key& left, const skin_param_key& right) {
return left.obj_info == right.obj_info && left.motion_id == right.motion_id && left.frame == right.frame;
return left.obj_uid == right.obj_uid && left.motnum == right.motnum && left.frame == right.frame;
}
constexpr bool operator!=(const skin_param_key& left, const skin_param_key& right) {
@@ -74,10 +74,10 @@ constexpr bool operator!=(const skin_param_key& left, const skin_param_key& righ
}
constexpr bool operator<(const skin_param_key& left, const skin_param_key& right) {
if (left.obj_info != right.obj_info)
return left.obj_info < right.obj_info;
else if (left.motion_id != right.motion_id)
return left.motion_id < right.motion_id;
if (left.obj_uid != right.obj_uid)
return left.obj_uid < right.obj_uid;
else if (left.motnum != right.motnum)
return left.motnum < right.motnum;
else if (left.frame != right.frame)
return left.frame < right.frame;
else
@@ -120,7 +120,7 @@ struct SkinParamManager : public app::Task {
int32_t GetExtSkpFile(const osage_init_data& osage_init,
const std::string& dir, std::string& file, void* data, const motion_database* mot_db);
std::vector<skin_param_file_data>* GetSkinParamFileData(
object_info obj_info, uint32_t motion_id, int32_t frame);
object_info obj_uid, uint32_t motnum, int32_t frame);
void Reset();
};
@@ -138,7 +138,7 @@ struct sp_skp_db {
void parse(key_val* kv);
int32_t get_ext_skp_file(const osage_init_data& osage_init,
const object_info obj_info, std::string& file, std::string& farc,
const object_info obj_uid, std::string& file, std::string& farc,
void* data, const motion_database* mot_db);
};
@@ -236,8 +236,8 @@ osage_setting_osg_cat::osage_setting_osg_cat() : exf() {
}
const osage_setting_osg_cat* osage_setting_data_get_cat_value(
const object_info& obj_info, const char* root_node) {
return osage_setting_data->get_cat_value(obj_info, root_node);
const object_info& obj_uid, const char* root_node) {
return osage_setting_data->get_cat_value(obj_uid, root_node);
}
bool osage_setting_data_obj_has_key(object_info key) {
@@ -303,8 +303,8 @@ int32_t skin_param_manager_get_ext_skp_file(
}
std::vector<skin_param_file_data>* skin_param_manager_get_skin_param_file_data(
int32_t chara_id, object_info obj_info, uint32_t motion_id, int32_t frame) {
return skin_param_manager_get(chara_id)->GetSkinParamFileData(obj_info, motion_id, frame);
int32_t chara_id, object_info obj_uid, uint32_t motnum, int32_t frame) {
return skin_param_manager_get(chara_id)->GetSkinParamFileData(obj_uid, motnum, frame);
}
void skin_param_manager_reset(int32_t chara_id) {
@@ -572,8 +572,8 @@ void skin_param_osage_root_parse(void* kv, const char* name,
_kv->close_scope();
}
key_val* skin_param_storage_get_key_val(object_info obj_info) {
auto elem = skin_param_storage.find(obj_info);
key_val* skin_param_storage_get_key_val(object_info obj_uid) {
auto elem = skin_param_storage.find(obj_uid);
if (elem != skin_param_storage.end())
return elem->second.get();
return 0;
@@ -618,8 +618,8 @@ void osage_setting::clear() {
}
const osage_setting_osg_cat* osage_setting::get_cat_value(
const object_info& obj_info, const char* root_node) {
auto elem_obj = osage_setting_data->obj.find(obj_info);
const object_info& obj_uid, const char* root_node) {
auto elem_obj = osage_setting_data->obj.find(obj_uid);
if (elem_obj == osage_setting_data->obj.end())
return 0;
@@ -781,17 +781,17 @@ void SkinParamManager::AddFiles() {
files.clear();
for (osage_init_data& i : osage_init) {
rob_chara_item_equip* rob_disp = i.rob_chr->rob_disp;
RobDisp* rob_disp = i.rob_chr->disp;
for (int32_t j = RPK_ITEM_BEGIN; j <= RPK_ITEM_END; j++) {
object_info obj_info = rob_disp->get_object_info((ROB_PARTS_KIND)j);
if (obj_info.is_null())
object_info obj_uid = rob_disp->get_objid((ROB_PARTS_KIND)j);
if (obj_uid.is_null())
continue;
const char* obj_name = objset_info_storage_get_obj_name(obj_info);
const char* obj_name = objset_info_storage_get_obj_name(obj_uid);
if (!obj_name)
continue;
obj_skin_ex_data* ex_data = objset_info_storage_get_obj_skin_ex_data(obj_info);
obj_skin_ex_data* ex_data = objset_info_storage_get_obj_skin_ex_data(obj_uid);
if (!ex_data)
continue;
@@ -837,7 +837,7 @@ void SkinParamManager::AddFiles() {
bool read_farc = false;
if (skp_file->type == -1) {
skp_file->type = sp_skp_db_data->get_ext_skp_file(i,
obj_info, file, farc_file, aft_data, aft_mot_db);
obj_uid, file, farc_file, aft_data, aft_mot_db);
if (skp_file->type == -1) {
delete skp_file;
continue;
@@ -854,7 +854,7 @@ void SkinParamManager::AddFiles() {
std::vector<skin_param_file_data>* skp_file_data = 0;
switch (skp_file->type) {
case 0: {
skin_param_key key(obj_info, i.motion_id, i.frame);
skin_param_key key(obj_uid, i.motnum, i.frame);
auto elem = object_motion_frame.find(key);
if (elem != object_motion_frame.end()) {
delete skp_file;
@@ -865,7 +865,7 @@ void SkinParamManager::AddFiles() {
object_motion_frame.insert({ key, skp_file_data });
} break;
case 1: {
skin_param_key key(obj_info, i.motion_id);
skin_param_key key(obj_uid, i.motnum);
auto elem = object_motion.find(key);
if (elem != object_motion.end()) {
delete skp_file;
@@ -876,7 +876,7 @@ void SkinParamManager::AddFiles() {
object_motion.insert({ key, skp_file_data });
} break;
case 2: {
skin_param_key key(obj_info);
skin_param_key key(obj_uid);
auto elem = object.find(key);
if (elem != object.end()) {
delete skp_file;
@@ -922,18 +922,18 @@ bool SkinParamManager::CtrlFiles() {
continue;
}
rob_chara_item_equip* rob_disp = skp_file->rob_chr->rob_disp;
RobDisp* rob_disp = skp_file->rob_chr->disp;
key_val kv;
kv.parse(skp_file->file_handler->get_data(), skp_file->file_handler->get_size());
object_info obj_info = rob_disp->get_object_info(skp_file->rpk);
if (!obj_info.not_null()) {
object_info obj_uid = rob_disp->get_objid(skp_file->rpk);
if (!obj_uid.not_null()) {
i = files.erase(i);
continue;
}
rob_chara_item_equip_object* skin_disp = &rob_disp->skin_disp[skp_file->rpk];
RobSkinDisp* skin_disp = &rob_disp->skin_disp[skp_file->rpk];
skin_param_file_data* skp_file_data = skp_file->data->data();
for (ExNodeBlock* j : skin_disp->ex_node_block) {
@@ -966,8 +966,8 @@ int32_t SkinParamManager::GetExtSkpFile(const osage_init_data& osage_init,
std::string buf1;
std::string buf2;
if (osage_init.motion_id != -1) {
const char* motion_name = mot_db->get_motion_name(osage_init.motion_id);
if (osage_init.motnum != -1) {
const char* motion_name = mot_db->get_motion_name(osage_init.motnum);
if (!motion_name)
return -1;
@@ -1008,25 +1008,25 @@ int32_t SkinParamManager::GetExtSkpFile(const osage_init_data& osage_init,
}
std::vector<skin_param_file_data>* SkinParamManager::GetSkinParamFileData(
object_info obj_info, uint32_t motion_id, int32_t frame) {
object_info obj_uid, uint32_t motnum, int32_t frame) {
if (object_motion_frame.size()) {
auto elem_frame = object_motion_frame.find({ obj_info, motion_id, frame });
auto elem_frame = object_motion_frame.find({ obj_uid, motnum, frame });
if (elem_frame != object_motion_frame.end())
return elem_frame->second;
auto elem = object_motion_frame.find({ obj_info, motion_id });
auto elem = object_motion_frame.find({ obj_uid, motnum });
if (elem != object_motion_frame.end())
return elem->second;
}
if (object_motion.size()) {
auto elem = object_motion.find({ obj_info, motion_id });
auto elem = object_motion.find({ obj_uid, motnum });
if (elem != object_motion.end())
return elem->second;
}
if (object.size()) {
auto elem = object.find({ obj_info });
auto elem = object.find({ obj_uid });
if (elem != object.end())
return elem->second;
}
@@ -1199,9 +1199,9 @@ void sp_skp_db::parse(key_val* kv) {
}
int32_t sp_skp_db::get_ext_skp_file(const osage_init_data& osage_init,
const object_info obj_info, std::string& file, std::string& farc,
const object_info obj_uid, std::string& file, std::string& farc,
void* data, const motion_database* mot_db) {
if (obj_info.is_null())
if (obj_uid.is_null())
return 2;
int32_t type = 2;
@@ -1209,7 +1209,7 @@ int32_t sp_skp_db::get_ext_skp_file(const osage_init_data& osage_init,
if (osage_init.pv_id > -1) {
auto elem0 = pv.find(osage_init.pv_id);
if (elem0 != pv.end()) {
auto elem1 = elem0->second->find(obj_info);
auto elem1 = elem0->second->find(obj_uid);
if (elem1 != elem0->second->end()) {
type = 1;
farc.assign(farc_list[elem1->second]);
@@ -1217,8 +1217,8 @@ int32_t sp_skp_db::get_ext_skp_file(const osage_init_data& osage_init,
}
}
if (osage_init.motion_id != -1) {
const char* motion_name = mot_db->get_motion_name(osage_init.motion_id);
if (osage_init.motnum != -1) {
const char* motion_name = mot_db->get_motion_name(osage_init.motnum);
if (motion_name) {
std::string buf(motion_name);
if (osage_init.frame > -1)
@@ -1226,7 +1226,7 @@ int32_t sp_skp_db::get_ext_skp_file(const osage_init_data& osage_init,
auto elem0 = motion.find(buf);
if (elem0 != motion.end()) {
auto elem1 = elem0->second->find(obj_info);
auto elem1 = elem0->second->find(obj_uid);
if (elem1 != elem0->second->end()) {
type = 0;
farc.assign(farc_list[elem1->second]);
@@ -1235,12 +1235,12 @@ int32_t sp_skp_db::get_ext_skp_file(const osage_init_data& osage_init,
}
}
const char* obj_name = objset_info_storage_get_obj_name(obj_info);
const char* obj_name = objset_info_storage_get_obj_name(obj_uid);
std::string skp_file = sprintf_s_string("ext_skp_%s.txt", obj_name);
switch (type) {
case 0: {
std::string motion_name(mot_db->get_motion_name(osage_init.motion_id));
std::string motion_name(mot_db->get_motion_name(osage_init.motnum));
if (osage_init.frame > -1)
motion_name = sprintf_s_string("%s_%d", motion_name.c_str(), osage_init.frame);
+3 -3
View File
@@ -9,7 +9,7 @@
#include "../../KKdLib/key_val.hpp"
extern const osage_setting_osg_cat* osage_setting_data_get_cat_value(
const object_info& obj_info, const char* root_node);
const object_info& obj_uid, const char* root_node);
extern bool osage_setting_data_obj_has_key(object_info key);
extern void skin_param_data_init();
@@ -24,7 +24,7 @@ extern int32_t skin_param_manager_get_ext_skp_file(
int32_t chara_id, const osage_init_data& osage_init, const std::string& dir,
std::string& file, void* data, const motion_database* mot_db);
extern std::vector<skin_param_file_data>* skin_param_manager_get_skin_param_file_data(
int32_t chara_id, object_info obj_info, uint32_t motion_id, int32_t frame);
int32_t chara_id, object_info obj_uid, uint32_t motion_id, int32_t frame);
extern void skin_param_manager_reset(int32_t chara_id);
extern void skin_param_osage_node_parse(void* kv, const char* name,
@@ -33,7 +33,7 @@ extern void skin_param_osage_node_parse(void* kv, const char* name,
extern void skin_param_osage_root_parse(void* kv, const char* name,
skin_param_osage_root& skp_root, const bone_database* bone_data);
extern key_val* skin_param_storage_get_key_val(object_info obj_info);
extern key_val* skin_param_storage_get_key_val(object_info obj_uid);
extern void skin_param_storage_load(std::vector<object_info>& obj_infos,
void* data, const object_database* obj_db);
extern void skin_param_storage_reset();
+3 -2
View File
@@ -122,6 +122,7 @@ void sss_data::pre_proc(const struct cam_data& cam) {
vec3 interest = rctx->camera->interest;
vec3 view_point = rctx->camera->view_point;
RobManagement* rob_man = get_rob_management();
vec3 chara_position[2];
chara_position[0] = 0.0f;
chara_position[1] = 0.0f;
@@ -129,8 +130,8 @@ void sss_data::pre_proc(const struct cam_data& cam) {
for (int32_t i = 0; i < 2; i++) {
chara_position[i] = interest;
chara_distance[i] = 999999.0f;
rob_chara_bone_data* rob_bone_data = rob_chara_array_get_bone_data(i);
if (rob_chara_pv_data_array_check_chara_id(i) && rob_chara_array_check_visibility(i)) {
rob_chara_bone_data* rob_bone_data = rob_man->get_rob_motion_work((ROB_ID)i);
if (rob_man->is_init((ROB_ID)i) && rob_man->get_disp_on((ROB_ID)i)) {
mat4* mat = rob_bone_data->get_mats_mat(BLK_N_HARA_CP);
if (mat) {
mat4_get_translation(mat, &chara_position[i]);
+1 -1
View File
@@ -803,7 +803,7 @@ static void stage_set(stage* s, stage* other) {
if (!pv_osage_manager_array_get_disp() && other)
for (int32_t i = 0; i < ROB_ID_MAX; i++) {
rob_chara* rob_chr = rob_chara_array_get(i);
rob_chara* rob_chr = get_rob_management()->get_rob((ROB_ID)i);
if (rob_chr)
rob_chr->set_stage_data_ring(other->index);
}
+2 -2
View File
@@ -686,9 +686,9 @@ static void stage_modern_set(stage_modern* s, stage_modern* other) {
if (pv_osage_manager_array_get_disp() && other)
for (int32_t i = 0; i < ROB_ID_MAX; i++) {
rob_chara* rob_chr = rob_chara_array_get(i);
rob_chara* rob_chr = get_rob_management()->get_rob((ROB_ID)i);
//if (rob_chr)
//rob_chara_set_stage_data_ring(rob_chr, &other->index);
//rob_chr->set_stage_data_ring(other->index);
}
}
+17 -9
View File
@@ -129,21 +129,29 @@ namespace app {
}
void Task::set_name(const char* name) {
if (!name) {
this->name[0] = 0;
return;
}
size_t len = utf8_length(name);
len = min_def(len, sizeof(this->name) - 1);
memmove(&this->name, name, len);
this->name[len] = 0;
set_name_sub(this->name, name, -1);
}
void Task::set_priority(int32_t priority) {
this->priority = priority;
}
void Task::set_name_sub(char dst[0x20], const char* src, size_t size) {
if (dst == src)
return;
if (size) {
const char* end = (const char*)memchr(src, 0, size);
if (end)
size = end - src;
}
size = min_def(size, sizeof(dst) - 1);
if (size)
memcpy_s(dst, 0x20, src, size);
memset(&dst[size], 0, size < 0x20);
}
TaskWork::TaskWork() : current_task(), disp_task() {
}
+3
View File
@@ -80,6 +80,9 @@ namespace app {
void set_name(const char* name);
void set_priority(int32_t priority);
private:
static void set_name_sub(char dst[0x20], const char* src, size_t size);
};
struct TaskWork {
+10 -10
View File
@@ -74,8 +74,8 @@ texture* texture_alloc(texture_id id) {
}
void texture_apply_color_tone(const texture* chg_tex,
const texture* org_tex, const color_tone* col_tone) {
if (!chg_tex || !org_tex || !col_tone
const texture* org_tex, const ImgfColorToneParam* color) {
if (!chg_tex || !org_tex || !color
|| chg_tex->internal_format != org_tex->internal_format
|| chg_tex->width != org_tex->width
|| chg_tex->height != org_tex->height
@@ -95,9 +95,9 @@ void texture_apply_color_tone(const texture* chg_tex,
texture_bind(org_tex->target, org_tex->glid);
glGetCompressedTexImage(org_tex->target, i, data);
if (org_tex->internal_format == GL_COMPRESSED_RGB_S3TC_DXT1_EXT)
dxt1_image_apply_color_tone(width_align, height_align, size, (dxt1_block*)data, col_tone);
dxt1_image_apply_color_tone(width_align, height_align, size, (dxt1_block*)data, color);
else
dxt5_image_apply_color_tone(width_align, height_align, size, (dxt5_block*)data, col_tone);
dxt5_image_apply_color_tone(width_align, height_align, size, (dxt5_block*)data, color);
texture_bind(chg_tex->target, chg_tex->glid);
int32_t width = org_tex->get_width_mip_level(i);
@@ -111,7 +111,7 @@ void texture_apply_color_tone(const texture* chg_tex,
texture_bind(org_tex->target, org_tex->glid);
glGetTexImage(org_tex->target, i, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, data);
rgb565_image_apply_color_tone(width_align, height_align, size, (rgb565*)data, col_tone);
rgb565_image_apply_color_tone(width_align, height_align, size, (rgb565*)data, color);
texture_bind(chg_tex->target, chg_tex->glid);
int32_t width = org_tex->get_width_mip_level(i);
@@ -164,8 +164,8 @@ texture* texture_create_copy_texture(texture_id id, texture* org_tex) {
}
texture* texture_create_copy_texture_apply_color_tone(
texture_id id, texture* org_tex, const color_tone* col_tone) {
if (!org_tex || !col_tone || org_tex->target != GL_TEXTURE_2D)
texture_id id, texture* org_tex, const ImgfColorToneParam* color) {
if (!org_tex || !color || org_tex->target != GL_TEXTURE_2D)
return 0;
GLenum format = GL_ZERO;
@@ -190,16 +190,16 @@ texture* texture_create_copy_texture_apply_color_tone(
glGetCompressedTexImage(org_tex->target, i, data);
if (org_tex->internal_format == GL_COMPRESSED_RGB_S3TC_DXT1_EXT)
dxt1_image_apply_color_tone(width_align, height_align, size, (dxt1_block*)data, col_tone);
dxt1_image_apply_color_tone(width_align, height_align, size, (dxt1_block*)data, color);
else
dxt5_image_apply_color_tone(width_align, height_align, size, (dxt5_block*)data, col_tone);
dxt5_image_apply_color_tone(width_align, height_align, size, (dxt5_block*)data, color);
}
else if (org_tex->internal_format == GL_RGB5) {
int32_t width_align = org_tex->get_width_align_mip_level(i);
int32_t height_align = org_tex->get_height_align_mip_level(i);
glGetTexImage(org_tex->target, i, format, type, data);
rgb565_image_apply_color_tone(width_align, height_align, size, (rgb565*)data, col_tone);
rgb565_image_apply_color_tone(width_align, height_align, size, (rgb565*)data, color);
}
else
glGetTexImage(org_tex->target, i, format, type, data);
+2 -2
View File
@@ -101,10 +101,10 @@ struct texture_manager {
extern texture* texture_alloc(texture_id id);
extern void texture_apply_color_tone(const texture* chg_tex,
const texture* org_tex, const color_tone* col_tone);
const texture* org_tex, const ImgfColorToneParam* color);
extern texture* texture_create_copy_texture(texture_id id, texture* org_tex);
extern texture* texture_create_copy_texture_apply_color_tone(
texture_id id, texture* org_tex, const color_tone* col_tone);
texture_id id, texture* org_tex, const ImgfColorToneParam* color);
extern texture* texture_load_tex_2d(texture_id id, GLenum internal_format, int32_t width, int32_t height,
int32_t max_mipmap_level, const void** data_ptr, bool use_high_anisotropy);
extern texture* texture_load_tex_cube_map(texture_id id, GLenum internal_format, int32_t width, int32_t height,
+23 -24
View File
@@ -293,7 +293,7 @@ int32_t bone_database::get_block_index(const char* kind_name, const char* name)
return -1;
}
const std::vector<BODYTYPE>* bone_database::get_body_type(const char* kind_name) const {
const std::vector<BODYTYPE>* bone_database::get_body_type_table(const char* kind_name) const {
if (!kind_name)
return 0;
@@ -303,7 +303,7 @@ const std::vector<BODYTYPE>* bone_database::get_body_type(const char* kind_name)
return 0;
}
const std::vector<CHAINPOSRADIUS>* bone_database::get_chain_pos_rad(const char* kind_name) const {
const std::vector<CHAINPOSRADIUS>* bone_database::get_joint_table(const char* kind_name) const {
if (!kind_name)
return 0;
@@ -327,7 +327,7 @@ int32_t bone_database::get_bone_index(const char* kind_name, const char* name) c
return -1;
}
const std::vector<std::string>* bone_database::get_bone_name(const char* kind_name) const {
const std::vector<std::string>* bone_database::get_bone_name_table(const char* kind_name) const {
if (!kind_name)
return 0;
@@ -351,7 +351,7 @@ int32_t bone_database::get_bone_node_index(const char* kind_name, const char* na
return -1;
}
const std::vector<std::string>* bone_database::get_bone_node_name(const char* kind_name) const {
const std::vector<std::string>* bone_database::get_bone_node_name_table(const char* kind_name) const {
if (!kind_name)
return 0;
@@ -361,7 +361,7 @@ const std::vector<std::string>* bone_database::get_bone_node_name(const char* ki
return 0;
}
const std::vector<std::uint16_t>* bone_database::get_parent_node(const char* kind_name) const {
const std::vector<std::uint16_t>* bone_database::get_node_parent_table(const char* kind_name) const {
if (!kind_name)
return 0;
@@ -397,35 +397,34 @@ bool bone_database::load_file(void* data, const char* dir, const char* file, uin
return bone_data->ready;
}
void bone_database_bones_calculate_count(const std::vector<BODYTYPE>* bones,
size_t& bone_name_num, size_t& bone_node_num,
size_t& node_count, size_t& leaf_pos, size_t& chain_pos) {
bone_name_num = 0;
bone_node_num = 0;
node_count = 0;
leaf_pos = 0;
chain_pos = 0;
void bone_database_bones_calculate_count(const std::vector<BODYTYPE>* body_type_table,
size_t& mat_max, size_t& block_max, size_t& node_max, size_t& leaf_pos_max, size_t& chain_pos_max) {
mat_max = 0;
block_max = 0;
node_max = 0;
leaf_pos_max = 0;
chain_pos_max = 0;
for (const BODYTYPE& i : *bones) {
bone_name_num++;
node_count++;
for (const BODYTYPE& i : *body_type_table) {
mat_max++;
node_max++;
if (i.ik_type >= IKT_2)
bone_name_num += 2;
chain_pos++;
mat_max += 2;
chain_pos_max++;
if (i.ik_type >= IKT_1) {
chain_pos++;
node_count += 2;
chain_pos_max++;
node_max += 2;
if (i.ik_type >= IKT_2) {
chain_pos++;
node_count++;
chain_pos_max++;
node_max++;
}
}
if (i.ik_type >= IKT_ROOT)
leaf_pos++;
bone_node_num++;
leaf_pos_max++;
block_max++;
}
}
+30 -30
View File
@@ -34,13 +34,13 @@ enum IH_TYPE {
};
enum IK_TYPE {
IKT_0 = 0x00,
IKT_0N = 0x01,
IKT_0T = 0x02,
IKT_ROOT = 0x03,
IKT_1 = 0x04,
IKT_2 = 0x05,
IKT_2R = 0x06,
IKT_0 = 0x00, // Rotation
IKT_0N = 0x01, // Normal(?)
IKT_0T = 0x02, // Translation
IKT_ROOT = 0x03, // Rotation + Translation
IKT_1 = 0x04, // Rotation + IK with 1 Segment
IKT_2 = 0x05, // Rotation + IK with 2 Segment
IKT_2R = 0x06, // Rotation + IK with 2 Segment (Reverse)
};
struct CHAINPOSRADIUS {
@@ -100,32 +100,32 @@ struct bone_database {
const BoneData* get_bone_data(const char* kind_name) const;
int32_t get_block_index(const char* kind_name, const char* name) const;
const std::vector<BODYTYPE>* get_body_type(const char* kind_name) const;
const std::vector<CHAINPOSRADIUS>* get_chain_pos_rad(const char* kind_name) const;
const std::vector<BODYTYPE>* get_body_type_table(const char* kind_name) const;
const std::vector<CHAINPOSRADIUS>* get_joint_table(const char* kind_name) const;
int32_t get_bone_index(const char* kind_name, const char* name) const;
const std::vector<std::string>* get_bone_name(const char* kind_name) const;
const std::vector<std::string>* get_bone_name_table(const char* kind_name) const;
int32_t get_bone_node_index(const char* kind_name, const char* name) const;
const std::vector<std::string>* get_bone_node_name(const char* kind_name) const;
const std::vector<uint16_t>* get_parent_node(const char* kind_name) const;
const std::vector<std::string>* get_bone_node_name_table(const char* kind_name) const;
const std::vector<uint16_t>* get_node_parent_table(const char* kind_name) const;
const float_t* get_heel_height(const char* kind_name) const;
static bool load_file(void* data, const char* dir, const char* file, uint32_t hash);
const BoneData* get_bone_data(BONE_KIND kind) const;
int32_t get_block_index(BONE_KIND kind, const char* name) const;
const std::vector<BODYTYPE>* get_body_type(BONE_KIND kind) const;
const std::vector<CHAINPOSRADIUS>* get_chain_pos_rad(BONE_KIND kind) const;
const std::vector<BODYTYPE>* get_body_type_table(BONE_KIND kind) const;
const std::vector<CHAINPOSRADIUS>* get_joint_table(BONE_KIND kind) const;
int32_t get_bone_index(BONE_KIND kind, const char* name) const;
const std::vector<std::string>* get_bone_name(BONE_KIND kind) const;
const std::vector<std::string>* get_bone_name_table(BONE_KIND kind) const;
int32_t get_bone_node_index(BONE_KIND kind, const char* name) const;
const std::vector<std::string>* get_bone_node_name(BONE_KIND kind) const;
const std::vector<uint16_t>* get_parent_node(BONE_KIND kind) const;
const std::vector<std::string>* get_bone_node_name_table(BONE_KIND kind) const;
const std::vector<uint16_t>* get_node_parent_table(BONE_KIND kind) const;
const float_t* get_heel_height(BONE_KIND kind) const;
};
extern void bone_database_bones_calculate_count(const std::vector<BODYTYPE>* bones,
size_t& object_bone_count, size_t& motion_bone_count,
size_t& node_count, size_t& leaf_pos, size_t& chain_pos);
extern void bone_database_bones_calculate_count(const std::vector<BODYTYPE>* body_type_table,
size_t& mat_max, size_t& block_max,
size_t& node_max, size_t& leaf_pos_max, size_t& chain_pos_max);
extern const char* bone_database_skeleton_type_to_string(BONE_KIND kind);
@@ -137,32 +137,32 @@ inline int32_t bone_database::get_block_index(BONE_KIND kind, const char* name)
return get_block_index(bone_database_skeleton_type_to_string(kind), name);
}
inline const std::vector<BODYTYPE>* bone_database::get_body_type(BONE_KIND kind) const {
return get_body_type(bone_database_skeleton_type_to_string(kind));
inline const std::vector<BODYTYPE>* bone_database::get_body_type_table(BONE_KIND kind) const {
return get_body_type_table(bone_database_skeleton_type_to_string(kind));
}
inline const std::vector<CHAINPOSRADIUS>* bone_database::get_chain_pos_rad(BONE_KIND kind) const {
return get_chain_pos_rad(bone_database_skeleton_type_to_string(kind));
inline const std::vector<CHAINPOSRADIUS>* bone_database::get_joint_table(BONE_KIND kind) const {
return get_joint_table(bone_database_skeleton_type_to_string(kind));
}
inline int32_t bone_database::get_bone_index(BONE_KIND kind, const char* name) const {
return get_bone_index(bone_database_skeleton_type_to_string(kind), name);
}
inline const std::vector<std::string>* bone_database::get_bone_name(BONE_KIND kind) const {
return get_bone_name(bone_database_skeleton_type_to_string(kind));
inline const std::vector<std::string>* bone_database::get_bone_name_table(BONE_KIND kind) const {
return get_bone_name_table(bone_database_skeleton_type_to_string(kind));
}
inline int32_t bone_database::get_bone_node_index(BONE_KIND kind, const char* name) const {
return get_bone_node_index(bone_database_skeleton_type_to_string(kind), name);
}
inline const std::vector<std::string>* bone_database::get_bone_node_name(BONE_KIND kind) const {
return get_bone_node_name(bone_database_skeleton_type_to_string(kind));
inline const std::vector<std::string>* bone_database::get_bone_node_name_table(BONE_KIND kind) const {
return get_bone_node_name_table(bone_database_skeleton_type_to_string(kind));
}
inline const std::vector<uint16_t>* bone_database::get_parent_node(BONE_KIND kind) const {
return get_parent_node(bone_database_skeleton_type_to_string(kind));
inline const std::vector<uint16_t>* bone_database::get_node_parent_table(BONE_KIND kind) const {
return get_node_parent_table(bone_database_skeleton_type_to_string(kind));
}
inline const float_t* bone_database::get_heel_height(BONE_KIND kind) const {
+60 -56
View File
@@ -108,7 +108,7 @@ itm_table_item_data_obj::~itm_table_item_data_obj() {
}
itm_table_item_data_ofs::itm_table_item_data_ofs() : sub_id(), no() {
itm_table_item_data_ofs::itm_table_item_data_ofs() : sub_id(), item_no() {
}
@@ -120,7 +120,7 @@ itm_table_item_data_tex::~itm_table_item_data_tex() {
}
itm_table_item_data_col::itm_table_item_data_col() : flag(), col_tone() {
itm_table_item_data_col::itm_table_item_data_col() : flag(), color() {
}
@@ -136,8 +136,8 @@ itm_table_item_data::~itm_table_item_data() {
}
itm_table_item::itm_table_item() : no(), flag(), type(), attr(), des_id(),
sub_id(), exclusion(), point(), org_itm(), npr_flag(), face_depth() {
itm_table_item::itm_table_item() : no(), flag(), type(), attr(), equip_des_id(),
equip_sub_id(), exclusion(), point(), org_itm(), npr_flag(), face_depth() {
}
@@ -324,8 +324,8 @@ const char* item_id_get_name(ROB_PARTS_KIND rpk) {
return 0;
}
const char* item_sub_id_get_name(item_sub_id sub_id) {
if (sub_id >= 0 && sub_id < ITEM_SUB_MAX)
const char* item_sub_id_get_name(ROB_ITEM_EQUIP_SUB_ID sub_id) {
if (sub_id >= 0 && sub_id < ROB_ITEM_EQUIP_SUB_ID_MAX)
return rob_item_equip_sub_id_str[sub_id];
return 0;
}
@@ -434,7 +434,7 @@ static void itm_table_read_text(itm_table* itm_tbl, void* data, size_t size) {
continue;
}
if (!kv.read("flag", itm.flag)
if (!kv.read("flag", itm.flag.w)
|| !kv.read("name", itm.name)) {
kv.close_scope();
continue;
@@ -455,15 +455,19 @@ static void itm_table_read_text(itm_table* itm_tbl, void* data, size_t size) {
kv.close_scope();
}
int32_t type = 0;
int32_t des_id = 0;
int32_t sub_id = 0;
if (!kv.read("type", itm.type)
if (!kv.read("type", type)
|| !kv.read("attr", itm.attr)
|| !kv.read("des_id", itm.des_id)
|| !kv.read("des_id", des_id)
|| !kv.read("sub_id", sub_id)) {
kv.close_scope();
continue;
}
itm.sub_id = (item_sub_id)sub_id;
itm.type = (ROB_ITEM_TYPE)type;
itm.equip_des_id = (ROB_ITEM_EQUIP_DES_ID)des_id;
itm.equip_sub_id = (ROB_ITEM_EQUIP_SUB_ID)sub_id;
if (kv.open_scope("data")) {
int32_t count;
@@ -497,18 +501,18 @@ static void itm_table_read_text(itm_table* itm_tbl, void* data, size_t size) {
itm_table_item_data_ofs ofs;
int32_t sub_id = 0;
if (kv.read("no", ofs.no)
if (kv.read("no", ofs.item_no)
&& kv.read("sub_id", sub_id)
&& kv.read("tx", ofs.position.x)
&& kv.read("ty", ofs.position.y)
&& kv.read("tz", ofs.position.z)
&& kv.read("rx", ofs.rotation.x)
&& kv.read("ry", ofs.rotation.y)
&& kv.read("rz", ofs.rotation.z)
&& kv.read("tx", ofs.trans.x)
&& kv.read("ty", ofs.trans.y)
&& kv.read("tz", ofs.trans.z)
&& kv.read("rx", ofs.rot.x)
&& kv.read("ry", ofs.rot.y)
&& kv.read("rz", ofs.rot.z)
&& kv.read("sx", ofs.scale.x)
&& kv.read("sy", ofs.scale.y)
&& kv.read("sz", ofs.scale.z)) {
ofs.sub_id = (item_sub_id)sub_id;
ofs.sub_id = (ROB_ITEM_EQUIP_SUB_ID)sub_id;
vido.push_back(ofs);
}
@@ -545,25 +549,25 @@ static void itm_table_read_text(itm_table* itm_tbl, void* data, size_t size) {
itm_table_item_data_col col;
kv.read("tex", col.tex);
kv.read("flag", col.flag);
kv.read("flag", col.flag.w);
if (!(col.flag & 0x01)) {
if (!col.flag.m.is_available) {
vidc.push_back(col);
kv.close_scope();
continue;
}
kv.read("blend.0", col.col_tone.blend.x);
kv.read("blend.1", col.col_tone.blend.y);
kv.read("blend.2", col.col_tone.blend.z);
kv.read("offset.0", col.col_tone.offset.x);
kv.read("offset.1", col.col_tone.offset.y);
kv.read("offset.2", col.col_tone.offset.z);
kv.read("hue", col.col_tone.hue);
kv.read("saturation", col.col_tone.saturation);
kv.read("value", col.col_tone.value);
kv.read("contrast", col.col_tone.contrast);
kv.read("inverse", col.col_tone.inverse);
kv.read("blend.0", col.color.blend_color.x);
kv.read("blend.1", col.color.blend_color.y);
kv.read("blend.2", col.color.blend_color.z);
kv.read("offset.0", col.color.offset_color.x);
kv.read("offset.1", col.color.offset_color.y);
kv.read("offset.2", col.color.offset_color.z);
kv.read("hue", col.color.hue);
kv.read("saturation", col.color.saturation);
kv.read("value", col.color.value);
kv.read("contrast", col.color.contrast);
kv.read("inverse", col.color.inverse);
vidc.push_back(col);
kv.close_scope();
@@ -705,28 +709,28 @@ static void itm_table_write_text(itm_table* itm_tbl, void** data, size_t* size)
kv.open_scope_fmt(sort_index_data[j]);
itm_table_item_data_col* col = &vidc[sort_index_data[j]];
if (col->flag & 0x01) {
kv.write(s, "blend.0", col->col_tone.blend.x);
kv.write(s, "blend.1", col->col_tone.blend.y);
kv.write(s, "blend.2", col->col_tone.blend.z);
kv.write(s, "contrast", col->col_tone.contrast);
if (col->flag.m.is_available) {
kv.write(s, "blend.0", col->color.blend_color.x);
kv.write(s, "blend.1", col->color.blend_color.y);
kv.write(s, "blend.2", col->color.blend_color.z);
kv.write(s, "contrast", col->color.contrast);
}
kv.write(s, "flag", col->flag);
kv.write(s, "flag", col->flag.w);
if (col->flag & 0x01) {
kv.write(s, "hue", col->col_tone.hue);
kv.write(s, "inverse", col->col_tone.inverse ? 1 : 0);
kv.write(s, "offset.0", col->col_tone.offset.x);
kv.write(s, "offset.1", col->col_tone.offset.y);
kv.write(s, "offset.2", col->col_tone.offset.z);
kv.write(s, "saturation", col->col_tone.saturation);
if (col->flag.m.is_available) {
kv.write(s, "hue", col->color.hue);
kv.write(s, "inverse", col->color.inverse ? 1 : 0);
kv.write(s, "offset.0", col->color.offset_color.x);
kv.write(s, "offset.1", col->color.offset_color.y);
kv.write(s, "offset.2", col->color.offset_color.z);
kv.write(s, "saturation", col->color.saturation);
}
kv.write(s, "tex", col->tex);
if (col->flag & 0x01)
kv.write(s, "value", col->col_tone.value);
if (col->flag.m.is_available)
kv.write(s, "value", col->color.value);
kv.close_scope();
}
@@ -771,17 +775,17 @@ static void itm_table_write_text(itm_table* itm_tbl, void** data, size_t* size)
kv.open_scope_fmt(sort_index_data[j]);
itm_table_item_data_ofs* ofs = &vido[sort_index_data[j]];
kv.write(s, "no", ofs->no);
kv.write(s, "rx", ofs->rotation.x);
kv.write(s, "ry", ofs->rotation.y);
kv.write(s, "rz", ofs->rotation.z);
kv.write(s, "no", ofs->item_no);
kv.write(s, "rx", ofs->rot.x);
kv.write(s, "ry", ofs->rot.y);
kv.write(s, "rz", ofs->rot.z);
kv.write(s, "sub_id", ofs->sub_id);
kv.write(s, "sx", ofs->scale.x);
kv.write(s, "sy", ofs->scale.y);
kv.write(s, "sz", ofs->scale.z);
kv.write(s, "tx", ofs->position.x);
kv.write(s, "ty", ofs->position.y);
kv.write(s, "tz", ofs->position.z);
kv.write(s, "tx", ofs->trans.x);
kv.write(s, "ty", ofs->trans.y);
kv.write(s, "tz", ofs->trans.z);
kv.close_scope();
}
@@ -816,10 +820,10 @@ static void itm_table_write_text(itm_table* itm_tbl, void** data, size_t* size)
kv.close_scope();
}
kv.write(s, "des_id", itm->des_id);
kv.write(s, "des_id", itm->equip_des_id);
kv.write(s, "exclusion", itm->exclusion);
kv.write(s, "face_depth", itm->face_depth);
kv.write(s, "flag", itm->flag);
kv.write(s, "flag", itm->flag.w);
kv.write(s, "name", itm->name);
kv.write(s, "no", itm->no);
kv.write(s, "npr_flag", itm->npr_flag);
@@ -845,7 +849,7 @@ static void itm_table_write_text(itm_table* itm_tbl, void** data, size_t* size)
kv.write(s, "org_itm", itm->org_itm);
kv.write(s, "point", itm->point);
kv.write(s, "sub_id", itm->sub_id);
kv.write(s, "sub_id", itm->equip_sub_id);
kv.write(s, "type", itm->type);
kv.close_scope();
+172 -89
View File
@@ -15,53 +15,136 @@
enum CHARA_NUM {
CN_NONE = -1,
CN_MIKU = 0x00,
CN_RIN = 0x01,
CN_LEN = 0x02,
CN_LUKA = 0x03,
CN_NERU = 0x04,
CN_HAKU = 0x05,
CN_KAITO = 0x06,
CN_MEIKO = 0x07,
CN_SAKINE = 0x08,
CN_TETO = 0x09,
CN_MAX = 0x0A,
CN_MIKU = 0,
CN_RIN,
CN_LEN,
CN_LUKA,
CN_NERU,
CN_HAKU,
CN_KAITO,
CN_MEIKO,
CN_SAKINE,
CN_TETO,
CN_MAX,
};
enum ROB_ITEM_ATTR {
ROB_ITEM_ATTR_NONE = 0,
ROB_ITEM_ATTR_OBJ = 0x00000001,
ROB_ITEM_ATTR_OFS = 0x00000002,
ROB_ITEM_ATTR_TEX = 0x00000004,
ROB_ITEM_ATTR_COL = 0x00000008,
ROB_ITEM_ATTR_HYOUTAN = 0x00000010,
ROB_ITEM_ATTR_NUDE = 0x00000020,
ROB_ITEM_ATTR_HADA = 0x00000040,
ROB_ITEM_ATTR_NO_SDW = 0x00000080,
ROB_ITEM_ATTR_NO_REF = 0x00000100,
ROB_ITEM_ATTR_SYM = 0x00000200,
ROB_ITEM_ATTR_NO_MRG = 0x00000400,
ROB_ITEM_ATTR_HEAD = 0x00000800,
ROB_ITEM_ATTR_MAX = 0x80000000,
};
enum ROB_ITEM_EQUIP_DES_ID {
ROB_ITEM_EQUIP_DES_ID_NONE = -1,
ROB_ITEM_EQUIP_DES_ID_ATAM = 0,
ROB_ITEM_EQUIP_DES_ID_FACE,
ROB_ITEM_EQUIP_DES_ID_JOHA,
ROB_ITEM_EQUIP_DES_ID_KAHA,
ROB_ITEM_EQUIP_DES_ID_HADA,
ROB_ITEM_EQUIP_DES_ID_MAX,
};
enum ROB_ITEM_EQUIP_ID {
ROB_ITEM_EQUIP_ID_NONE = -1,
ROB_ITEM_EQUIP_ID_ATAM = 0,
ROB_ITEM_EQUIP_ID_KAO,
ROB_ITEM_EQUIP_ID_JOHA,
ROB_ITEM_EQUIP_ID_UDE,
ROB_ITEM_EQUIP_ID_KAHA,
ROB_ITEM_EQUIP_ID_MAX,
};
enum ROB_ITEM_EQUIP_SUB_ID {
ROB_ITEM_EQUIP_SUB_ID_NONE = -1,
ROB_ITEM_EQUIP_SUB_ID_ZUJO = 0,
ROB_ITEM_EQUIP_SUB_ID_KAMI,
ROB_ITEM_EQUIP_SUB_ID_HITAI,
ROB_ITEM_EQUIP_SUB_ID_ME,
ROB_ITEM_EQUIP_SUB_ID_MEGANE,
ROB_ITEM_EQUIP_SUB_ID_MIMI,
ROB_ITEM_EQUIP_SUB_ID_KUCHI,
ROB_ITEM_EQUIP_SUB_ID_MAKI,
ROB_ITEM_EQUIP_SUB_ID_KUBI,
ROB_ITEM_EQUIP_SUB_ID_INNER,
ROB_ITEM_EQUIP_SUB_ID_OUTER,
ROB_ITEM_EQUIP_SUB_ID_KATA,
ROB_ITEM_EQUIP_SUB_ID_U_UDE,
ROB_ITEM_EQUIP_SUB_ID_L_UDE,
ROB_ITEM_EQUIP_SUB_ID_TE,
ROB_ITEM_EQUIP_SUB_ID_JOHA_MAE,
ROB_ITEM_EQUIP_SUB_ID_JOHA_USHIRO,
ROB_ITEM_EQUIP_SUB_ID_BELT,
ROB_ITEM_EQUIP_SUB_ID_KOSI,
ROB_ITEM_EQUIP_SUB_ID_PANTS,
ROB_ITEM_EQUIP_SUB_ID_ASI,
ROB_ITEM_EQUIP_SUB_ID_SUNE,
ROB_ITEM_EQUIP_SUB_ID_KUTSU,
ROB_ITEM_EQUIP_SUB_ID_HADA,
ROB_ITEM_EQUIP_SUB_ID_HEAD,
ROB_ITEM_EQUIP_SUB_ID_MAX,
};
enum ROB_ITEM_TYPE {
ROB_ITEM_TYPE_NONE = -1,
ROB_ITEM_TYPE_EQUIP = 0,
ROB_ITEM_TYPE_REPLACE,
ROB_ITEM_TYPE_LOOKS,
ROB_ITEM_TYPE_REM,
ROB_ITEM_TYPE_MAX,
};
enum ROB_PARTS_KIND {
RPK_NONE = -1,
RPK_BODY = 0x00,
RPK_ATAMA = 0x01,
RPK_KATA_R = 0x02,
RPK_MUNE = 0x03,
RPK_KATA_L = 0x04,
RPK_UDE_R = 0x05,
RPK_SENAKA = 0x06,
RPK_UDE_L = 0x07,
RPK_HARA = 0x08,
RPK_KOSI = 0x09,
RPK_TE_R = 0x0A,
RPK_TE_L = 0x0B,
RPK_MOMO = 0x0C,
RPK_SUNE = 0x0D,
RPK_ASI = 0x0E,
RPK_ITEM01 = 0x0F,
RPK_ITEM02 = 0x10,
RPK_ITEM03 = 0x11,
RPK_ITEM04 = 0x12,
RPK_ITEM05 = 0x13,
RPK_ITEM06 = 0x14,
RPK_ITEM07 = 0x15,
RPK_ITEM08 = 0x16,
RPK_ITEM09 = 0x17,
RPK_ITEM10 = 0x18,
RPK_ITEM11 = 0x19,
RPK_ITEM12 = 0x1A,
RPK_ITEM13 = 0x1B,
RPK_ITEM14 = 0x1C,
RPK_ITEM15 = 0x1D,
RPK_ITEM16 = 0x1E,
RPK_MAX = 0x1F,
RPK_NONE = -1,
RPK_BODY = 0,
RPK_ATAMA,
RPK_KATA_R,
RPK_MUNE,
RPK_KATA_L,
RPK_UDE_R,
RPK_SENAKA,
RPK_UDE_L,
RPK_HARA,
RPK_KOSI,
RPK_TE_R,
RPK_TE_L,
RPK_MOMO,
RPK_SUNE,
RPK_ASI,
RPK_ITEM01,
RPK_ITEM02,
RPK_ITEM03,
RPK_ITEM04,
RPK_ITEM05,
RPK_ITEM06,
RPK_ITEM07,
RPK_ITEM08,
RPK_ITEM09,
RPK_ITEM10,
RPK_ITEM11,
RPK_ITEM12,
RPK_ITEM13,
RPK_ITEM14,
RPK_ITEM15,
RPK_ITEM16,
RPK_MAX,
RPK_TOP = RPK_BODY,
@@ -93,36 +176,13 @@ enum ROB_PARTS_KIND {
RPK_KUBI = RPK_ITEM06,
RPK_JOHA_USHIRO = RPK_ITEM07,
RPK_KUCHI = RPK_ITEM08,
};
enum item_sub_id {
ITEM_SUB_NONE = -1,
ITEM_SUB_ZUJO = 0x00,
ITEM_SUB_KAMI = 0x01,
ITEM_SUB_HITAI = 0x02,
ITEM_SUB_ME = 0x03,
ITEM_SUB_MEGANE = 0x04,
ITEM_SUB_MIMI = 0x05,
ITEM_SUB_KUCHI = 0x06,
ITEM_SUB_MAKI = 0x07,
ITEM_SUB_KUBI = 0x08,
ITEM_SUB_INNER = 0x09,
ITEM_SUB_OUTER = 0x0A,
ITEM_SUB_KATA = 0x0B,
ITEM_SUB_U_UDE = 0x0C,
ITEM_SUB_L_UDE = 0x0D,
ITEM_SUB_TE = 0x0E,
ITEM_SUB_JOHA_MAE = 0x0F,
ITEM_SUB_JOHA_USHIRO = 0x10,
ITEM_SUB_BELT = 0x11,
ITEM_SUB_KOSI = 0x12,
ITEM_SUB_PANTS = 0x13,
ITEM_SUB_ASI = 0x14,
ITEM_SUB_SUNE = 0x15,
ITEM_SUB_KUTSU = 0x16,
ITEM_SUB_HADA = 0x17,
ITEM_SUB_HEAD = 0x18,
ITEM_SUB_MAX = 0x19,
RPK_SP_UDE_L = 100,
RPK_SP_TE_L = 101,
RPK_SP_UDE_R = 102,
RPK_SP_TE_R = 103,
RPK_SP_SUNE = 104,
RPK_SP_ASI = 105,
};
struct itm_table_item_data_obj {
@@ -134,10 +194,10 @@ struct itm_table_item_data_obj {
};
struct itm_table_item_data_ofs {
item_sub_id sub_id;
int32_t no;
vec3 position;
vec3 rotation;
ROB_ITEM_EQUIP_SUB_ID sub_id;
uint32_t item_no;
vec3 trans;
vec3 rot;
vec3 scale;
itm_table_item_data_ofs();
@@ -151,10 +211,20 @@ struct itm_table_item_data_tex {
~itm_table_item_data_tex();
};
struct itm_table_item_data_col_flag_member {
uint32_t is_available : 1;
uint32_t reserve : 31;
};
union itm_table_item_data_col_flag {
uint32_t w;
itm_table_item_data_col_flag_member m;
};
struct itm_table_item_data_col {
std::string tex;
int32_t flag;
color_tone col_tone;
itm_table_item_data_col_flag flag;
ImgfColorToneParam color;
itm_table_item_data_col();
~itm_table_item_data_col();
@@ -170,19 +240,32 @@ struct itm_table_item_data {
~itm_table_item_data();
};
struct itm_table_item_flag_member {
uint32_t is_dummy : 1;
uint32_t is_present : 1;
uint32_t is_texorg : 1;
uint32_t is_objorg : 1;
uint32_t reserve : 28;
};
union itm_table_item_flag {
uint32_t w;
itm_table_item_flag_member m;
};
struct itm_table_item {
int32_t no;
int32_t flag;
uint32_t no;
itm_table_item_flag flag;
std::string name;
std::vector<std::string> objset;
int32_t type;
int32_t attr;
int32_t des_id;
item_sub_id sub_id;
ROB_ITEM_TYPE type;
uint32_t attr;
ROB_ITEM_EQUIP_DES_ID equip_des_id;
ROB_ITEM_EQUIP_SUB_ID equip_sub_id;
itm_table_item_data data;
int32_t exclusion;
int32_t point;
int32_t org_itm;
uint32_t exclusion;
uint32_t point;
uint32_t org_itm;
bool npr_flag;
float_t face_depth;
@@ -236,4 +319,4 @@ extern const char* get_chara_name_full(CHARA_NUM cname);
extern CHARA_NUM get_chara_num_from_char_id(const char* in_name);
extern const char* item_id_get_name(ROB_PARTS_KIND rpk);
extern const char* item_sub_id_get_name(item_sub_id sub_id);
extern const char* item_sub_id_get_name(ROB_ITEM_EQUIP_SUB_ID sub_id);
+21 -21
View File
@@ -5,14 +5,14 @@
#include "image.hpp"
static rgb565 rgb565_apply_color_tone(rgb565 col, const color_tone* col_tone);
static rgb565 rgb565_apply_color_tone(rgb565 col, const ImgfColorToneParam* color);
static void rgb_to_ycc(vec3& rgb, vec3& ycc);
static void ycc_apply_col_tone_hue(vec3& ycc, const color_tone* col_tone);
static void ycc_apply_col_tone_hue(vec3& ycc, const ImgfColorToneParam* color);
static void ycc_to_rgb(vec3& ycc, vec3& rgb);
color_tone::color_tone() : reserved() {
blend = 1.0f;
offset = 0.0f;
ImgfColorToneParam::ImgfColorToneParam() : reserved() {
blend_color = 1.0f;
offset_color = 0.0f;
hue = 0.0f;
saturation = 1.0f;
value = 0.0f;
@@ -21,13 +21,13 @@ color_tone::color_tone() : reserved() {
}
void dxt1_image_apply_color_tone(int32_t width, int32_t height,
int32_t size, dxt1_block* data, const color_tone* col_tone) {
int32_t size, dxt1_block* data, const ImgfColorToneParam* color) {
if (size <= 0)
return;
for (size_t i = (size - 1ULL) / sizeof(dxt1_block) + 1; i; i--, data++) {
data->color0 = rgb565_apply_color_tone(data->color0, col_tone);
data->color1 = rgb565_apply_color_tone(data->color1, col_tone);
data->color0 = rgb565_apply_color_tone(data->color0, color);
data->color1 = rgb565_apply_color_tone(data->color1, color);
if (*(uint16_t*)&data->color0 <= *(uint16_t*)&data->color1) {
data->indices[0] &= ~((data->indices[0] >> 1) & 0x5555);
data->indices[1] &= ~((data->indices[1] >> 1) & 0x5555);
@@ -36,13 +36,13 @@ void dxt1_image_apply_color_tone(int32_t width, int32_t height,
}
void dxt5_image_apply_color_tone(int32_t width, int32_t height,
int32_t size, dxt5_block* data, const color_tone* col_tone) {
int32_t size, dxt5_block* data, const ImgfColorToneParam* color) {
if (size <= 0)
return;
for (size_t i = (size - 1ULL) / sizeof(dxt5_block) + 1; i; i--, data++) {
data->color0 = rgb565_apply_color_tone(data->color0, col_tone);
data->color1 = rgb565_apply_color_tone(data->color1, col_tone);
data->color0 = rgb565_apply_color_tone(data->color0, color);
data->color1 = rgb565_apply_color_tone(data->color1, color);
if (*(uint16_t*)&data->color0 <= *(uint16_t*)&data->color1) {
data->color_indices[0] &= ~((data->color_indices[0] >> 1) & 0x5555);
data->color_indices[1] &= ~((data->color_indices[1] >> 1) & 0x5555);
@@ -51,12 +51,12 @@ void dxt5_image_apply_color_tone(int32_t width, int32_t height,
}
void rgb565_image_apply_color_tone(int32_t width, int32_t height,
int32_t size, rgb565* data, const color_tone* col_tone) {
int32_t size, rgb565* data, const ImgfColorToneParam* color) {
for (size_t i = (size - 1ULL) / sizeof(uint16_t) + 1; i; i--, data++)
*data = rgb565_apply_color_tone(*data, col_tone);
*data = rgb565_apply_color_tone(*data, color);
}
static rgb565 rgb565_apply_color_tone(rgb565 col, const color_tone* col_tone) {
static rgb565 rgb565_apply_color_tone(rgb565 col, const ImgfColorToneParam* color) {
const vec3 scale = {
(float_t)((1 << 5) - 1),
(float_t)((1 << 6) - 1),
@@ -70,7 +70,7 @@ static rgb565 rgb565_apply_color_tone(rgb565 col, const color_tone* col_tone) {
};
vec3 rgb;
if (col_tone->inverse) {
if (color->inverse) {
rgb.x = (float_t)((1 << 5) - 1 - col.r);
rgb.y = (float_t)((1 << 6) - 1 - col.g);
rgb.z = (float_t)((1 << 5) - 1 - col.b);
@@ -81,16 +81,16 @@ static rgb565 rgb565_apply_color_tone(rgb565 col, const color_tone* col_tone) {
rgb.z = (float_t)col.b;
}
rgb = vec3::clamp(rgb * inv_scale * col_tone->blend + col_tone->offset, 0.0f, 1.0f);
rgb = vec3::clamp(rgb * inv_scale * color->blend_color + color->offset_color, 0.0f, 1.0f);
vec3 ycc;
rgb_to_ycc(rgb, ycc);
*(vec2*)&ycc.y = *(vec2*)&ycc.y * col_tone->saturation;
*(vec2*)&ycc.y = *(vec2*)&ycc.y * color->saturation;
ycc_apply_col_tone_hue(ycc, col_tone);
ycc_apply_col_tone_hue(ycc, color);
ycc.x = (ycc.x + col_tone->value - 0.5f) * col_tone->contrast + 0.5f;
ycc.x = (ycc.x + color->value - 0.5f) * color->contrast + 0.5f;
ycc = vec3::clamp(ycc, vec3(0.0f, -0.5f, -0.5f), vec3(1.0f, 0.5f, 0.5f));
@@ -114,8 +114,8 @@ inline static void rgb_to_ycc(vec3& rgb, vec3& ycc) {
ycc.z = vec3::dot(rgb, _cr_coef_601);
}
inline static void ycc_apply_col_tone_hue(vec3& ycc, const color_tone* col_tone) {
float_t hue = col_tone->hue * DEG_TO_RAD_FLOAT;
inline static void ycc_apply_col_tone_hue(vec3& ycc, const ImgfColorToneParam* color) {
float_t hue = color->hue * DEG_TO_RAD_FLOAT;
float_t cos = cosf(hue);
float_t sin = sinf(hue);
float_t y = ycc.y;
+8 -8
View File
@@ -8,17 +8,17 @@
#include "default.hpp"
#include "vec.hpp"
struct color_tone {
vec3 blend;
vec3 offset;
struct ImgfColorToneParam {
vec3 blend_color;
vec3 offset_color;
float_t hue;
float_t saturation;
float_t value;
float_t contrast;
bool inverse;
int32_t reserved[8];
uint32_t reserved[8];
color_tone();
ImgfColorToneParam();
};
struct rgb565 {
@@ -43,8 +43,8 @@ struct dxt5_block {
};
extern void dxt1_image_apply_color_tone(int32_t width, int32_t height,
int32_t size, dxt1_block* data, const color_tone* col_tone);
int32_t size, dxt1_block* data, const ImgfColorToneParam* color);
extern void dxt5_image_apply_color_tone(int32_t width, int32_t height,
int32_t size, dxt5_block* data, const color_tone* col_tone);
int32_t size, dxt5_block* data, const ImgfColorToneParam* color);
extern void rgb565_image_apply_color_tone(int32_t width, int32_t height,
int32_t size, rgb565* data, const color_tone* col_tone);
int32_t size, rgb565* data, const ImgfColorToneParam* color);
+6 -6
View File
@@ -50,7 +50,7 @@ mot_key_set_data::mot_key_set_data() : type(), frames(), values(), keys_count(),
}
mot_data::mot_data() : info(), frame_count(), bone_info_count(), murmurhash(),
mot_data::mot_data() : info(), frame_max(), bone_info_count(), murmurhash(),
div_frames(), div_count(), name(), bone_info_array(), key_set_array() {
}
@@ -631,7 +631,7 @@ static void mot_classic_read_inner(mot_set* ms, prj::shared_ptr<prj::stack_alloc
s.set_position(mh[i].key_set_info_offset, SEEK_SET);
m->info = s.read_uint16_t();
m->frame_count = s.read_uint16_t();
m->frame_max = s.read_uint16_t();
uint32_t key_set_count = m->key_set_count;
mot_key_set_data* key_set_array = alloc->allocate<mot_key_set_data>(key_set_count);
@@ -698,7 +698,7 @@ static void mot_classic_write_inner(mot_set* ms, stream& s) {
mh[i].key_set_info_offset = (uint32_t)s.get_position();
s.write_uint16_t(m->info);
s.write_uint16_t(m->frame_count);
s.write_uint16_t(m->frame_max);
uint16_t key_set_count = m->key_set_count;
mot_key_set_data* key_set_array = m->key_set_array;
@@ -843,7 +843,7 @@ static void mot_modern_read_inner(mot_set* ms, prj::shared_ptr<prj::stack_alloca
s_motc.set_position(mh.key_set_info_offset, SEEK_SET);
m->info = s_motc.read_uint16_t_reverse_endianness();
m->frame_count = s_motc.read_uint16_t_reverse_endianness();
m->frame_max = s_motc.read_uint16_t_reverse_endianness();
uint32_t key_set_count = m->key_set_count;
mot_key_set_data* key_set_array = alloc->allocate<mot_key_set_data>(key_set_count);
@@ -1061,7 +1061,7 @@ static void mot_modern_write_inner(mot_set* ms, stream& s) {
mh.key_set_info_offset = s_motc.get_position();
s_motc.write_uint16_t_reverse_endianness(m->info);
s_motc.write_uint16_t_reverse_endianness(m->frame_count);
s_motc.write_uint16_t_reverse_endianness(m->frame_max);
mh.key_set_types_offset = s_motc.get_position();
uint16_t key_set_type_buf = 0;
@@ -1217,7 +1217,7 @@ inline static const char* mot_move_data_string(const char* str,
static void mot_data_move_data(mot_data* mot_dst, const mot_data* mot_src,
prj::shared_ptr<prj::stack_allocator> alloc) {
mot_dst->info = mot_src->info;
mot_dst->frame_count = mot_src->frame_count;
mot_dst->frame_max = mot_src->frame_max;
mot_dst->bone_info_count = mot_src->bone_info_count;
mot_dst->murmurhash = mot_src->murmurhash;
+3 -3
View File
@@ -45,12 +45,12 @@ struct mot_data {
union {
struct {
uint16_t key_set_count : 14;
uint16_t skeleton_select : 1;
uint16_t high_bit : 1;
uint16_t motion_body_type : 1;
uint16_t key_num_type : 1;
};
uint16_t info;
};
uint16_t frame_count;
uint16_t frame_max;
int32_t bone_info_count;
uint32_t murmurhash;
+34 -55
View File
@@ -40,7 +40,7 @@ struct obj_skin_ex_data_header {
int64_t osage_joint_offset;
int64_t root_name_offset;
int64_t ex_node_array_offset;
int32_t nb_node_name;
uint32_t nb_node_name;
int64_t ex_node_name_offset;
int64_t osage_constraint_tbl_offset;
int32_t nb_cloth;
@@ -959,11 +959,11 @@ static obj_skin_ex_data* obj_move_data_skin_ex_data(const obj_skin_ex_data* ex_s
ex_dst->ex_node_table = ex_node_array_dst;
ex_dst->num_ex_node = num_ex_node;
int32_t nb_node_name = ex_src->nb_node_name;
uint32_t nb_node_name = ex_src->nb_node_name;
const char** ex_node_name_src = ex_src->ex_node_name;
const char** ex_node_name_dst = alloc->allocate<const char*>(nb_node_name);
for (int32_t i = 0; i < nb_node_name; i++)
for (uint32_t i = 0; i < nb_node_name; i++)
ex_node_name_dst[i] = obj_move_data_string(ex_node_name_src[i], alloc);
ex_dst->nb_node_name = nb_node_name;
@@ -1268,12 +1268,9 @@ static void obj_set_classic_read_inner(obj_set* set, prj::shared_ptr<prj::stack_
if (osh.obj_skin_data && obj_skin_data[i])
obj->skin = obj_classic_read_skin(alloc, s, obj_skin_data[i]);
if (osh.obj_name_data && obj_name_data[i]) {
if (osh.obj_name_data)
obj->name = obj_read_utf8_string_null_terminated_offset(alloc, s, obj_name_data[i]);
obj->hash = hash_utf8_murmurhash(obj->name);
}
else
obj->hash = hash_murmurhash_empty;
obj->hash = obj->name ? hash_utf8_murmurhash(obj->name) : hash_murmurhash_empty;
}
s.set_position(osh.obj_id_data, SEEK_SET);
@@ -2109,7 +2106,7 @@ static void obj_classic_write_skin(obj_skin* sk, stream& s, int64_t base_offset)
}
}
exh.nb_node_name = (int32_t)bone_names.size();
exh.nb_node_name = (uint32_t)bone_names.size();
exh.ex_node_name_offset = s.get_position();
for (string_hash& i : bone_names)
s.write_int32_t(0);
@@ -2526,7 +2523,7 @@ static void obj_classic_write_skin(obj_skin* sk, stream& s, int64_t base_offset)
s.write_uint32_t((uint32_t)exh.osage_joint_offset);
s.write_uint32_t((uint32_t)exh.root_name_offset);
s.write_uint32_t((uint32_t)exh.ex_node_array_offset);
s.write_int32_t(exh.nb_node_name);
s.write_uint32_t(exh.nb_node_name);
s.write_uint32_t((uint32_t)exh.ex_node_name_offset);
s.write_uint32_t((uint32_t)exh.osage_constraint_tbl_offset);
s.write_int32_t(exh.nb_cloth);
@@ -2563,7 +2560,7 @@ static obj_skin_ex_data* obj_classic_read_skin_ex_data(prj::shared_ptr<prj::stac
exh.osage_joint_offset = s.read_uint32_t();
exh.root_name_offset = s.read_uint32_t();
exh.ex_node_array_offset = s.read_uint32_t();
exh.nb_node_name = s.read_int32_t();
exh.nb_node_name = s.read_uint32_t();
exh.ex_node_name_offset = s.read_uint32_t();
exh.osage_constraint_tbl_offset = s.read_uint32_t();
exh.nb_cloth = s.read_int32_t();
@@ -2580,7 +2577,7 @@ static obj_skin_ex_data* obj_classic_read_skin_ex_data(prj::shared_ptr<prj::stac
if (!exh.ex_node_name_offset)
return ex;
int32_t nb_node_name = exh.nb_node_name;
uint32_t nb_node_name = exh.nb_node_name;
const char** ex_node_name = alloc->allocate<const char*>(nb_node_name);
if (!ex_node_name)
return ex;
@@ -2589,18 +2586,12 @@ static obj_skin_ex_data* obj_classic_read_skin_ex_data(prj::shared_ptr<prj::stac
ex->nb_node_name = nb_node_name;
s.set_position(exh.ex_node_name_offset, SEEK_SET);
for (int32_t i = 0; i < nb_node_name; i++) {
int32_t string_offset = s.read_uint32_t();
if (string_offset)
ex_node_name[i] = obj_read_utf8_string_null_terminated_offset(alloc, s, string_offset);
else
ex_node_name[i] = 0;
for (uint32_t i = 0; i < nb_node_name; i++) {
uint32_t string_offset = s.read_uint32_t();
ex_node_name[i] = obj_read_utf8_string_null_terminated_offset(alloc, s, string_offset);
}
if (exh.osage_root_offset)
ex->osage_root = obj_read_utf8_string_null_terminated_offset(alloc, s, exh.osage_root_offset);
else
ex->osage_root = 0;
ex->osage_root = obj_read_utf8_string_null_terminated_offset(alloc, s, exh.osage_root_offset);
if (exh.osage_joint_offset) {
ex->osage_joint = alloc->allocate<obj_skin_osage_joint>(ex->nb_jointX);
@@ -3218,8 +3209,7 @@ static obj_skin_ex_node_expression* obj_classic_read_skin_ex_node_expression(
exp->nb_src = nb_src;
for (int32_t i = 0; i < nb_src; i++) {
uint32_t script_offset = s.read_uint32_t();
if (script_offset)
exp->script[i] = obj_read_utf8_string_null_terminated_offset(alloc, s, script_offset);
exp->script[i] = obj_read_utf8_string_null_terminated_offset(alloc, s, script_offset);
}
for (int32_t i = nb_src; i < 9; i++)
@@ -4005,12 +3995,9 @@ static void obj_set_modern_read_inner(obj_set* set, prj::shared_ptr<prj::stack_a
if (osh.obj_data)
for (int32_t i = 0; i < obj_num; i++) {
obj* obj = set->obj_data[i];
if (osh.obj_name_data && obj_name_data[i]) {
if (osh.obj_name_data)
obj->name = obj_read_utf8_string_null_terminated_offset(alloc, s_mosd, obj_name_data[i]);
obj->hash = hash_utf8_murmurhash(obj->name);
}
else
obj->hash = hash_murmurhash_empty;
obj->hash = obj->name ? hash_utf8_murmurhash(obj->name) : hash_murmurhash_empty;
}
if (osh.obj_id_data) {
@@ -5365,7 +5352,7 @@ static void obj_modern_write_skin(obj_skin* sk, stream& s,
exh.nb_root++;
}
exh.nb_node_name = (int32_t)bone_names.size();
exh.nb_node_name = (uint32_t)bone_names.size();
}
if (sk->ex_data) {
@@ -5421,13 +5408,13 @@ static void obj_modern_write_skin(obj_skin* sk, stream& s,
}
if (!is_x) {
ee = { off, 1, 4, (uint32_t)exh.nb_node_name };
ee = { off, 1, 4, exh.nb_node_name };
ee.append(0, 1, ENRS_DWORD);
e.vec.push_back(ee);
off = (uint32_t)(exh.nb_node_name * 4ULL);
}
else {
ee = { off, 1, 8, (uint32_t)exh.nb_node_name };
ee = { off, 1, 8, exh.nb_node_name };
ee.append(0, 1, ENRS_QWORD);
e.vec.push_back(ee);
off = (uint32_t)(exh.nb_node_name * 8ULL);
@@ -6506,7 +6493,7 @@ static void obj_modern_write_skin(obj_skin* sk, stream& s,
s.write_offset_f2(exh.osage_joint_offset, 0x20);
s.write_offset_f2(exh.root_name_offset, 0x20);
s.write_offset_f2(exh.ex_node_array_offset, 0x20);
s.write_int32_t_reverse_endianness(exh.nb_node_name);
s.write_uint32_t_reverse_endianness(exh.nb_node_name);
s.write_offset_f2(exh.ex_node_name_offset, 0x20);
s.write_offset_f2(exh.osage_constraint_tbl_offset, 0x20);
s.write_int32_t_reverse_endianness(exh.nb_cloth);
@@ -6525,7 +6512,7 @@ static void obj_modern_write_skin(obj_skin* sk, stream& s,
s.write_offset_x(exh.osage_joint_offset);
s.write_offset_x(exh.root_name_offset);
s.write_offset_x(exh.ex_node_array_offset);
s.write_int32_t_reverse_endianness(exh.nb_node_name);
s.write_uint32_t_reverse_endianness(exh.nb_node_name);
s.write_offset_x(exh.ex_node_name_offset);
s.write_offset_x(exh.osage_constraint_tbl_offset);
s.write_int32_t_reverse_endianness(exh.nb_cloth);
@@ -6578,7 +6565,7 @@ static obj_skin_ex_data* obj_modern_read_skin_ex_data(prj::shared_ptr<prj::stack
exh.osage_joint_offset = s.read_offset_f2(header_length);
exh.root_name_offset = s.read_offset_f2(header_length);
exh.ex_node_array_offset = s.read_offset_f2(header_length);
exh.nb_node_name = s.read_int32_t_reverse_endianness();
exh.nb_node_name = s.read_uint32_t_reverse_endianness();
exh.ex_node_name_offset = s.read_offset_f2(header_length);
exh.osage_constraint_tbl_offset = s.read_offset_f2(header_length);
exh.nb_cloth = s.read_int32_t_reverse_endianness();
@@ -6597,7 +6584,7 @@ static obj_skin_ex_data* obj_modern_read_skin_ex_data(prj::shared_ptr<prj::stack
exh.osage_joint_offset = s.read_offset_x();
exh.root_name_offset = s.read_offset_x();
exh.ex_node_array_offset = s.read_offset_x();
exh.nb_node_name = s.read_int32_t_reverse_endianness();
exh.nb_node_name = s.read_uint32_t_reverse_endianness();
exh.ex_node_name_offset = s.read_offset_x();
exh.osage_constraint_tbl_offset = s.read_offset_x();
exh.nb_cloth = s.read_int32_t_reverse_endianness();
@@ -6616,7 +6603,7 @@ static obj_skin_ex_data* obj_modern_read_skin_ex_data(prj::shared_ptr<prj::stack
return ex;
}
int32_t nb_node_name = exh.nb_node_name;
uint32_t nb_node_name = exh.nb_node_name;
const char** ex_node_name = alloc->allocate<const char*>(nb_node_name);
ex->ex_node_name = ex_node_name;
@@ -6624,26 +6611,17 @@ static obj_skin_ex_data* obj_modern_read_skin_ex_data(prj::shared_ptr<prj::stack
s.set_position(exh.ex_node_name_offset, SEEK_SET);
if (!is_x)
for (int32_t i = 0; i < nb_node_name; i++) {
for (uint32_t i = 0; i < nb_node_name; i++) {
int64_t string_offset = s.read_offset_f2(header_length);
if (string_offset)
ex_node_name[i] = obj_read_utf8_string_null_terminated_offset(alloc, s, string_offset);
else
ex_node_name[i] = 0;
ex_node_name[i] = obj_read_utf8_string_null_terminated_offset(alloc, s, string_offset);
}
else
for (int32_t i = 0; i < nb_node_name; i++) {
for (uint32_t i = 0; i < nb_node_name; i++) {
int64_t string_offset = s.read_offset_x();
if (string_offset)
ex_node_name[i] = obj_read_utf8_string_null_terminated_offset(alloc, s, string_offset);
else
ex_node_name[i] = 0;
ex_node_name[i] = obj_read_utf8_string_null_terminated_offset(alloc, s, string_offset);
}
if (exh.osage_root_offset)
ex->osage_root = obj_read_utf8_string_null_terminated_offset(alloc, s, exh.osage_root_offset);
else
ex->osage_root = 0;
ex->osage_root = obj_read_utf8_string_null_terminated_offset(alloc, s, exh.osage_root_offset);
if (exh.osage_joint_offset) {
ex->osage_joint = alloc->allocate<obj_skin_osage_joint>(ex->nb_jointX);
@@ -7296,14 +7274,12 @@ static obj_skin_ex_node_expression* obj_modern_read_skin_ex_node_expression(
if (!is_x)
for (int32_t i = 0; i < nb_src; i++) {
int64_t script_offset = s.read_offset_f2(header_length);
if (script_offset)
exp->script[i] = obj_read_utf8_string_null_terminated_offset(alloc, s, script_offset);
exp->script[i] = obj_read_utf8_string_null_terminated_offset(alloc, s, script_offset);
}
else
for (int32_t i = 0; i < nb_src; i++) {
int64_t script_offset = s.read_offset_x();
if (script_offset)
exp->script[i] = obj_read_utf8_string_null_terminated_offset(alloc, s, script_offset);
exp->script[i] = obj_read_utf8_string_null_terminated_offset(alloc, s, script_offset);
}
for (int32_t i = nb_src; i < 9; i++)
@@ -7855,6 +7831,9 @@ inline static const char* obj_move_data_string(const char* str,
inline static const char* obj_read_utf8_string_null_terminated_offset(
prj::shared_ptr<prj::stack_allocator>& alloc, stream& s, int64_t offset) {
if (!offset)
return 0;
size_t len = s.read_utf8_string_null_terminated_offset_length(offset);
char* str = alloc->allocate<char>(len + 1);
s.position_push(offset, SEEK_SET);
+1 -1
View File
@@ -651,7 +651,7 @@ struct obj_skin_ex_data {
obj_skin_osage_joint* osage_joint;
obj_skin_ex_node* ex_node_table;
int32_t num_ex_node;
int32_t nb_node_name;
uint32_t nb_node_name;
const char** ex_node_name;
obj_skin_osage_constraint_info* osage_constraint_tbl;
int32_t num_osage_constraint;
+3 -3
View File
@@ -156,7 +156,7 @@ static void dof_read_inner(dof* d, stream& s, uint32_t header_length) {
i.fuzzing_range = s.read_float_t_reverse_endianness(i.fuzzing_range);
i.ratio = s.read_float_t_reverse_endianness(i.ratio);
i.quality = s.read_float_t_reverse_endianness(i.quality);
i.chara_id = -1;
i.rob_id = -1;
}
s.position_pop();
}
@@ -173,7 +173,7 @@ static void dof_read_inner(dof* d, stream& s, uint32_t header_length) {
i.fuzzing_range = s.read_float_t_reverse_endianness(i.fuzzing_range);
i.ratio = s.read_float_t_reverse_endianness(i.ratio);
i.quality = s.read_float_t_reverse_endianness(i.quality);
i.chara_id = s.read_int32_t_reverse_endianness(i.chara_id);
i.rob_id = s.read_int32_t_reverse_endianness(i.rob_id);
}
s.position_pop();
}
@@ -250,7 +250,7 @@ static void dof_write_inner(dof* d, stream& s) {
s.write_float_t_reverse_endianness(i.fuzzing_range);
s.write_float_t_reverse_endianness(i.ratio);
s.write_float_t_reverse_endianness(i.quality);
s.write_int32_t_reverse_endianness(i.chara_id);
s.write_int32_t_reverse_endianness(i.rob_id);
}
}
+1 -1
View File
@@ -24,7 +24,7 @@ struct dof_data {
float_t fuzzing_range;
float_t ratio;
float_t quality;
int32_t chara_id;
int32_t rob_id;
};
struct dof {
+225
View File
@@ -0,0 +1,225 @@
/*
by korenkonder
GitHub/GitLab: korenkonder
*/
#pragma once
#include "../default.hpp"
namespace prj {
template <size_t n>
class BitArrayEmbCore {
public:
enum {
bits_per_block = sizeof(uint32_t) * 8,
};
static constexpr size_t size = n;
static constexpr size_t num_blocks = (n + bits_per_block - 1) / bits_per_block;
uint32_t M_pool[num_blocks];
};
template <size_t n>
class BitArrayExtCore {
public:
enum {
bits_per_block = sizeof(uint32_t) * 8,
};
static constexpr size_t size = n;
static constexpr size_t num_blocks = (n + bits_per_block - 1) / bits_per_block;
uint32_t* M_pool;
};
template <class T>
class BitArrayUtil {
public:
enum {
bits_per_block = sizeof(uint32_t) * 8,
};
};
template <class T>
class BitArrayBase {
private:
T M_core;
public:
BitArrayBase(size_t count, uint32_t* data) : M_core() {
init(count, data);
}
BitArrayBase(uint32_t* data) : M_core() {
init(data);
}
BitArrayBase() : M_core() {
}
void init(uint32_t* data) {
BitArrayUtil<T>::init(M_core, size(), num_blocks(), data);
}
void init(size_t size, uint32_t* data) {
BitArrayUtil<T>::init(M_core, size, num_blocks(), data);
M_reset_unused_bit();
}
private:
uint32_t* M_data() {
return M_core.M_pool;
}
const uint32_t* M_data() const {
return M_core.M_pool;
}
public:
constexpr size_t size() const {
return T::size;
}
constexpr size_t max_size() const {
return num_blocks() * T::bits_per_block;
}
constexpr size_t num_blocks() const {
return T::num_blocks;
}
size_t count() const {
size_t sum = 0;
for (size_t i = 0; i < num_blocks(); i++)
sum += S_mask_count(M_data()[i]);
return sum;
}
private:
size_t M_find0(size_t);
size_t M_find1(size_t);
public:
bool operator[](size_t pos) const {
return test(pos);
}
bool test(size_t pos) const {
return ((M_data()[pos / T::bits_per_block] >> (pos % T::bits_per_block)) & 0x01) != 0x00;
}
BitArrayBase& set(size_t pos) {
M_data()[pos / T::bits_per_block] |= 1u << (pos % T::bits_per_block);
return *this;
}
BitArrayBase& set() {
for (size_t i = 0, j = 0; i < num_blocks(); i++)
M_data()[i] = 0xFFFFFFFFu;
M_reset_unused_bit();
return *this;
}
BitArrayBase& reset(size_t pos) {
M_data()[pos / T::bits_per_block] &= ~(1u << (pos % T::bits_per_block));
return *this;
}
BitArrayBase& reset() {
for (size_t i = 0; i < num_blocks(); i++)
M_data()[i] = 0;
return *this;
}
BitArrayBase& flip(size_t pos) {
set(pos, !test(pos));
return *this;
}
BitArrayBase& flip() {
for (size_t i = 0; i < num_blocks(); i++)
M_data()[i] ^= 0xFFFFFFFFu;
M_reset_unused_bit();
return *this;
}
private:
void M_reset_unused_bit() {
M_data()[num_blocks() - 1] &= ~(0xFFFFFFFFu << (32 - (max_size() - size())));
}
void M_block_dump();
void M_dump();
void M_dump0();
void M_dump1();
size_t word(size_t);
size_t offset(size_t);
size_t S_mask2bit(uint32_t);
size_t S_mask_count(uint32_t x) const {
x = (x & 0x55555555) + ((x >> 1) & 0x55555555);
x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
x = (x & 0x0F0F0F0F) + ((x >> 4) & 0x0F0F0F0F);
x = (x & 0x00FF00FF) + ((x >> 8) & 0x00FF00FF);
x = (x & 0x0000FFFF) + ((x >> 16) & 0x0000FFFF);
return x;
}
public:
size_t calc_num_blocks(size_t n) const {
return (n + T::bits_per_block - 1) / T::bits_per_block;
}
bool operator==(const BitArrayBase<T>& right) const {
for (size_t i = 0; i < num_blocks(); i++)
if (M_data()[i] != right.M_data()[i])
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];
}
void operator|=(const BitArrayBase<T>& right) {
for (size_t i = 0; i < num_blocks(); i++)
M_data()[i] |= right.M_data()[i];
}
};
template <size_t n>
struct BitArrayUtil<BitArrayEmbCore<n> > {
static void init(BitArrayEmbCore<n>& core, size_t size, size_t num_blocks, uint32_t* data) {
for (size_t i = 0; i < num_blocks; ++i)
core.M_pool[i] = data[i];
}
};
template <size_t n>
struct BitArrayUtil<BitArrayExtCore<n> > {
static void init(BitArrayExtCore<n>& core, size_t size, size_t num_blocks, uint32_t* data) {
core.M_pool = data;
}
};
template <size_t n>
class BitArray : public BitArrayBase<BitArrayEmbCore<n>> {
public:
BitArray(size_t count, const uint32_t* data) : BitArrayBase<BitArrayEmbCore<n>>(count, (uint32_t*)data) {}
BitArray(const uint32_t* data) : BitArrayBase<BitArrayEmbCore<n>>((uint32_t*)data) {}
BitArray() : BitArrayBase<BitArrayEmbCore<n>>() {}
};
template <size_t n>
class BitArrayExt : public BitArrayBase<BitArrayExtCore<n>> {
public:
BitArrayExt(size_t count, uint32_t* data) : BitArrayBase<BitArrayExtCore<n>>(count, data) {}
BitArrayExt(uint32_t* data) : BitArrayBase<BitArrayExtCore<n>>(data) {}
BitArrayExt() : BitArrayBase<BitArrayExtCore<n>>() {};
};
}
+1 -1
View File
@@ -866,7 +866,7 @@ static render_context* render_context_load(const wchar_t* config_path) {
Glitter::glt_particle_manager_add_task();
for (int32_t i = 0; i < ROB_ID_MAX; i++)
rob_chara_array_reset_pv_data(i);
rob_chara_array_reset_pv_data((ROB_ID)i);
light_param_data_storage_data_load();
+5 -5
View File
@@ -282,7 +282,7 @@ void FaceAnim::Auth3D::reset() {
tex_db.clear();
}
FaceAnim::FaceAnim() : state(), play(), sound_play(), frame(), frame_count() {
FaceAnim::FaceAnim() : state(), play(), sound_play(), frame(), frame_max() {
}
@@ -345,7 +345,7 @@ bool FaceAnim::ctrl() {
auth_3d.patch();
frame = 5000;
frame_count = (int32_t)auth_3d.id.get_last_frame();
frame_max = (int32_t)auth_3d.id.get_last_frame();
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));
@@ -366,7 +366,7 @@ bool FaceAnim::ctrl() {
if (play)
frame++;
if (frame >= frame_count) {
if (frame >= frame_max) {
frame = 5000;
sound_work_release_stream(0);
@@ -414,7 +414,7 @@ void FaceAnim::window() {
if (ImGui::Button(play ? "Pause" : "Play"))
play ^= true;
ImGui::Text("% 5d/% 5d", frame, frame_count);
ImGui::Text("% 5d/% 5d", frame, frame_max);
ImGui::End();
}
@@ -427,6 +427,6 @@ void FaceAnim::reset() {
play = false;
sound_play = false;
frame = 0;
frame_count = 0;
frame_max = 0;
}
#endif
+1 -1
View File
@@ -37,7 +37,7 @@ public:
bool play;
bool sound_play;
int32_t frame;
int32_t frame_count;
int32_t frame_max;
FaceAnim();
virtual ~FaceAnim() override;
+6 -6
View File
@@ -3075,9 +3075,9 @@ static void glitter_editor_property_effect(GlitterEditor* glt_edt) {
Glitter::Effect::ExtAnimX* ext_anim = effect->data.ext_anim_x;
if (ext_anim->flags & Glitter::EFFECT_EXT_ANIM_CHARA) {
const int32_t max_chara = 4;
if (ImGui::ColumnComboBox("Chara Index", Glitter::effect_ext_anim_index_name,
max_chara, &ext_anim->chara_index, 0, false, &input_locked))
const int32_t max_rob_id = 4;
if (ImGui::ColumnComboBox("Rob ID", Glitter::effect_ext_anim_rob_id_name,
max_rob_id, &ext_anim->rob_id, 0, false, &input_locked))
changed = true;
int32_t node_index = ext_anim->node_index;
@@ -3166,9 +3166,9 @@ static void glitter_editor_property_effect(GlitterEditor* glt_edt) {
Glitter::Effect::ExtAnim* ext_anim = effect->data.ext_anim;
if (ext_anim->flags & Glitter::EFFECT_EXT_ANIM_CHARA) {
const int32_t max_chara = eg->type == Glitter::FT ? 6 : 3;
if (ImGui::ColumnComboBox("Chara Index", Glitter::effect_ext_anim_index_name,
max_chara, &ext_anim->chara_index, 0, false, &input_locked))
const int32_t max_rob_id = eg->type == Glitter::FT ? 6 : 4;
if (ImGui::ColumnComboBox("ROB ID", Glitter::effect_ext_anim_rob_id_name,
max_rob_id, &ext_anim->rob_id, 0, false, &input_locked))
changed = true;
int32_t node_index = ext_anim->node_index;
+26 -26
View File
@@ -74,8 +74,8 @@ bool RobCharaAdjust::init() {
}
bool RobCharaAdjust::ctrl() {
if (motion_id != dtm_mot_array[chara_id].motion_id) {
motion_id = dtm_mot_array[chara_id].motion_id;
if (motion_id != dtm_mot_array[chara_id].uid) {
motion_id = dtm_mot_array[chara_id].uid;
parts = ROB_OSAGE_PARTS_NONE;
data = 0;
}
@@ -88,7 +88,7 @@ bool RobCharaAdjust::ctrl() {
data_struct* aft_data = &data_list[DATA_AFT];
motion_database* aft_mot_db = &aft_data->data_ft.mot_db;
uint32_t set_id = dtm_mot_array[chara_id].motion_set_id;
uint32_t set_id = dtm_mot_array[chara_id].set;
MhdFile* mhd = mothead_storage_get_mhd_file(set_id);
const motion_set_info* set_info = aft_mot_db->get_motion_set_by_id(set_id);
@@ -223,19 +223,19 @@ void RobCharaAdjust::window() {
motion_database* aft_mot_db = &aft_data->data_ft.mot_db;
float_t frame = dtm_mot_array[chara_id].GetFrame();
const mothead_data* data = mothead_storage_get_mot_by_motion_id(motion_id, aft_mot_db)->data;
if (data) {
mothead_data_type type = data->type;
while (type >= MOTHEAD_DATA_TYPE_0) {
if ((type == MOTHEAD_DATA_ROB_PARTS_ADJUST
&& ((RobCharaAdjust::PartsData*)data->data)->parts == parts
|| type == MOTHEAD_DATA_ROB_ADJUST_GLOBAL)
&& frame >= (float_t)data->frame) {
this->data = (void*)data->data;
const MhpList* pp_list = mothead_storage_get_mot_by_motion_id(motion_id, aft_mot_db)->pp_list;
if (pp_list) {
int32_t type = pp_list->type;
while (type >= 0) {
if ((type == MHP_ROB_PARTS_ADJUST
&& ((RobCharaAdjust::PartsData*)pp_list->data)->parts == parts
|| type == MHP_ROB_ADJUST_GLOBAL)
&& frame >= (float_t)pp_list->frame) {
data = pp_list->data;
}
data++;
type = data->type;
pp_list++;
type = pp_list->type;
}
}
}
@@ -245,23 +245,23 @@ void RobCharaAdjust::window() {
data_struct* aft_data = &data_list[DATA_AFT];
motion_database* aft_mot_db = &aft_data->data_ft.mot_db;
const mothead_data* data = mothead_storage_get_mot_by_motion_id(motion_id, aft_mot_db)->data;
if (data) {
mothead_data_type type = data->type;
while (type >= MOTHEAD_DATA_TYPE_0) {
if (type == MOTHEAD_DATA_ROB_PARTS_ADJUST
&& ((RobCharaAdjust::PartsData*)data->data)->parts == parts
|| type == MOTHEAD_DATA_ROB_ADJUST_GLOBAL) {
MhpList* pp_list = mothead_storage_get_mot_by_motion_id(motion_id, aft_mot_db)->pp_list;
if (pp_list) {
int32_t type = pp_list->type;
while (type >= 0) {
if (type == MHP_ROB_PARTS_ADJUST
&& ((RobCharaAdjust::PartsData*)pp_list->data)->parts == parts
|| type == MHP_ROB_ADJUST_GLOBAL) {
char buf[0x40];
sprintf_s(buf, sizeof(buf), "%d", data->frame);
sprintf_s(buf, sizeof(buf), "%d", pp_list->frame);
ImGui::PushID(data);
if (ImGui::Selectable(buf, this->data == data->data) && !track_frame)
this->data = (void*)data->data;
if (ImGui::Selectable(buf, data == pp_list->data) && !track_frame)
data = pp_list->data;
ImGui::PopID();
}
data++;
type = data->type;
pp_list++;
type = pp_list->type;
}
}
ImGui::EndListBox();
@@ -100,7 +100,7 @@ struct mot_data_bake {
struct effchrpv_auth_3d_to_mot {
int32_t pv_id;
const int32_t* rob_chara_ids;
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;
@@ -131,6 +131,7 @@ struct effchrpv_auth_3d_to_mot {
void add_chara_effect_auth_3d(uint32_t hash, int32_t id);
void add_file_name(const std::string& file, const std::string& category);
void disp();
void get_body_anim(int32_t frame, bool add_keys);
void get_hand_anim(int32_t frame);
void load(int32_t frame);
@@ -143,12 +144,12 @@ effchrpv_auth_3d_to_mot* effchr_a2m;
extern render_context* rctx_ptr;
void effchrpv_auth_3d_to_mot_init(int32_t pv_id, const int32_t* rob_chara_ids) {
void effchrpv_auth_3d_to_mot_init(int32_t pv_id, const ROB_ID* rob_ids) {
if (!effchr_a2m)
effchr_a2m = new effchrpv_auth_3d_to_mot;
effchr_a2m->pv_id = pv_id;
effchr_a2m->rob_chara_ids = rob_chara_ids;
effchr_a2m->rob_ids = rob_ids;
effchr_a2m->bake.pv_id = pv_id;
}
@@ -161,6 +162,10 @@ void effchrpv_auth_3d_to_mot_add_file_name(const std::string& file, const std::s
effchr_a2m->add_file_name(file, category);
}
void effchrpv_auth_3d_to_mot_disp() {
effchr_a2m->disp();
}
void effchrpv_auth_3d_to_mot_get_body_anim(int32_t frame, bool add_keys) {
effchr_a2m->get_body_anim(frame, add_keys);
}
@@ -358,7 +363,7 @@ bool mot_data_bake::load_file(void* data, const char* path, const char* file, ui
return true;
}
effchrpv_auth_3d_to_mot::effchrpv_auth_3d_to_mot() : pv_id(), rob_chara_ids() {
effchrpv_auth_3d_to_mot::effchrpv_auth_3d_to_mot() : pv_id(), rob_ids() {
}
@@ -374,10 +379,28 @@ void effchrpv_auth_3d_to_mot::add_file_name(const std::string& file, const std::
auth_3d_mot_names.insert({ file, category });
}
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]);
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];
mat4 mat;
mat = oh->node[a2m.j_mune_wj].model_transform.mat;
mat4_scale_rot(&mat, 0.1f, &mat);
spr::put_rgb_cross(mat);
mat = oh->node[a2m.j_kao_wj].model_transform.mat;
mat4_scale_rot(&mat, 0.1f, &mat);
spr::put_rgb_cross(mat);
}*/
}
static void set_bone_key_set_global_data(
std::map<BONE_BLK, auth_3d_to_mot_keys>& bone_keys,
std::map<BONE_BLK, auth_3d_to_mot_keys>& second_bone_keys, bool add_keys,
motion_blend_mot* mot, mot_key_set* key_set, const vec3* data, const int32_t count = 1) {
motion_blend_mot* mot, FcurveKey* fck, const vec3* data, const int32_t count = 1) {
if (add_keys) {
auto elem = bone_keys.find(BLK_MAX);
if (elem == bone_keys.end())
@@ -400,15 +423,15 @@ static void set_bone_key_set_global_data(
}
}
key_set += mot->bone_data.bone_key_set_count;
fck += mot->bone_data.bone_key_set_count;
for (int32_t i = 0; i < count; i++) {
if (key_set[0].type == MOT_KEY_SET_STATIC && key_set[0].values)
*(float_t*)&key_set[0].values[0] = data[i].x;
if (key_set[1].type == MOT_KEY_SET_STATIC && key_set[1].values)
*(float_t*)&key_set[1].values[0] = data[i].y;
if (key_set[2].type == MOT_KEY_SET_STATIC && key_set[2].values)
*(float_t*)&key_set[2].values[0] = data[i].z;
key_set += 3;
if (fck[0].kind == FCURVE_KEY_KIND_STATIC_DATA && fck[0].val)
*(float_t*)&fck[0].val[0] = data[i].x;
if (fck[1].kind == FCURVE_KEY_KIND_STATIC_DATA && fck[1].val)
*(float_t*)&fck[1].val[0] = data[i].y;
if (fck[2].kind == FCURVE_KEY_KIND_STATIC_DATA && fck[2].val)
*(float_t*)&fck[2].val[0] = data[i].z;
fck += 3;
}
mot->bone_data.gblctr_pos = data[0];
@@ -417,15 +440,15 @@ static void set_bone_key_set_global_data(
mot->apply_global_transform();
}
static void set_bone_key_set_data(RobBlock* block,
static void set_bone_key_set_data(RobBlock* block_top,
std::map<BONE_BLK, auth_3d_to_mot_keys>& bone_keys,
std::map<BONE_BLK, auth_3d_to_mot_keys>& second_bone_keys, bool add_keys,
BONE_BLK block_id, int32_t& curr_block_id, int32_t skeleton_select,
mot_key_set* key_set, const vec3* data, const int32_t count = 1) {
BONE_BLK blk, int32_t& curr_block_id, int32_t motion_body_type,
FcurveKey* fck, const vec3* data, const int32_t count = 1) {
if (add_keys) {
auto elem = bone_keys.find(block_id);
auto elem = bone_keys.find(blk);
if (elem == bone_keys.end())
elem = bone_keys.insert({ block_id, {} }).first;
elem = bone_keys.insert({ blk, {} }).first;
auth_3d_to_mot_keys& keys = elem->second;
keys.x.push_back(data[0].x);
@@ -433,9 +456,9 @@ static void set_bone_key_set_data(RobBlock* block,
keys.z.push_back(data[0].z);
if (count == 2) {
auto elem = second_bone_keys.find(block_id);
auto elem = second_bone_keys.find(blk);
if (elem == second_bone_keys.end())
elem = second_bone_keys.insert({ block_id, {} }).first;
elem = second_bone_keys.insert({ blk, {} }).first;
auth_3d_to_mot_keys& keys = elem->second;
keys.x.push_back(data[1].x);
@@ -444,22 +467,22 @@ static void set_bone_key_set_data(RobBlock* block,
}
}
key_set += block[block_id].key_set_offset;
block[block_id].frame = -FLT_MAX;
fck += block_top[blk].key_set_offset;
block_top[blk].frame = -FLT_MAX;
for (int32_t i = 0; i < count; i++) {
if (key_set[0].type == MOT_KEY_SET_STATIC && key_set[0].values)
*(float_t*)&key_set[0].values[0] = data[i].x;
if (key_set[1].type == MOT_KEY_SET_STATIC && key_set[1].values)
*(float_t*)&key_set[1].values[0] = data[i].y;
if (key_set[2].type == MOT_KEY_SET_STATIC && key_set[2].values)
*(float_t*)&key_set[2].values[0] = data[i].z;
key_set += 3;
if (fck[0].kind == FCURVE_KEY_KIND_STATIC_DATA && fck[0].val)
*(float_t*)&fck[0].val[0] = data[i].x;
if (fck[1].kind == FCURVE_KEY_KIND_STATIC_DATA && fck[1].val)
*(float_t*)&fck[1].val[0] = data[i].y;
if (fck[2].kind == FCURVE_KEY_KIND_STATIC_DATA && fck[2].val)
*(float_t*)&fck[2].val[0] = data[i].z;
fck += 3;
}
block[block_id].set_global_leaf_sub(data, BONE_KIND_CMN, true, false);
block_top[blk].set_global_leaf_sub(data, BONE_KIND_CMN, true, false);
while (curr_block_id <= block_id)
block[curr_block_id++].get_mat(skeleton_select);
while (curr_block_id <= blk)
block_top[curr_block_id++].get_mat(motion_body_type);
}
static void rotate_euler(const mat4& src, const mat4& dst, const vec3& src_rotation, vec3& dst_rotation) {
@@ -480,23 +503,23 @@ static void rotate_euler(const mat4& src, const mat4& dst, const vec3& src_rotat
mat4_get_rotation_zxy(&rot, &dst_rotation);
}
static void set_bone_key_set_ik_target_data(auth_3d_to_mot_data& a2m,
const mat4& parent_mat, const vec3 rotation, RobBlock* block, mot_key_set* key_set, bool add_keys,
BONE_BLK block_id, int32_t& curr_block_id, int32_t skeleton_select,
static void set_bone_key_set_ik_target_data(auth_3d_to_mot_data& a2m, const mat4& mat,
const vec3 rotation, RobBlock* block_top, FcurveKey* fck, bool add_keys,
BONE_BLK blk, int32_t& curr_block_id, int32_t motion_body_type,
const vec3& position, const mat4& src, const mat4& dst, const bool disable_rot[3], bool offset = true) {
vec3 data[2];
if (offset) {
data[0] = position;
mat4_transform_point(&parent_mat, &data[0], &data[0]);
mat4_transform_point(&mat, &data[0], &data[0]);
data[1] = rotation;
rotate_euler(src, dst, data[1], data[1]);
int32_t _curr_block_id = curr_block_id;
set_bone_key_set_data(block, a2m.bone_keys, a2m.sec_bone_keys, false,
block_id, _curr_block_id, skeleton_select, key_set, data, 2);
set_bone_key_set_data(block_top, a2m.bone_keys, a2m.sec_bone_keys, false,
blk, _curr_block_id, motion_body_type, fck, data, 2);
data[0] = position;
mat4_transform_point(block[block_id].node[0].mat_ptr, &data[0], &data[0]);
mat4_transform_point(block_top[blk].node[0].mat_ptr, &data[0], &data[0]);
}
else
data[0] = position;
@@ -508,15 +531,15 @@ static void set_bone_key_set_ik_target_data(auth_3d_to_mot_data& a2m,
if (disable_rot[i])
(&data[1].x)[i] = 0.0f;
set_bone_key_set_data(block, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
block_id, curr_block_id, skeleton_select, key_set, data, 2);
set_bone_key_set_data(block_top, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
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,
const mat4& kata_mat, const mat4& ude_mat, const mat4& te_mat,
const vec3 c_kata_rotation, RobBlock* block, mot_key_set* key_set, bool add_keys,
const vec3 c_kata_rotation, RobBlock* block_top, FcurveKey* fck, bool add_keys,
BONE_BLK tl_up_kata_index, BONE_BLK c_kata_index,
int32_t& curr_block_id, int32_t skeleton_select) {
int32_t& curr_block_id, int32_t motion_body_type) {
vec3 pos_kata;
vec3 pos_ude;
vec3 pos_te;
@@ -524,7 +547,7 @@ static void set_bone_key_set_arm_ik_target_data(auth_3d_to_mot_data& a2m, auth_3
mat4_get_translation(&ude_mat, &pos_ude);
mat4_get_translation(&te_mat, &pos_te);
RobBlock* c_kata = &block[c_kata_index];
RobBlock* c_kata = &block_top[c_kata_index];
float_t arm_length = c_kata->len[0][0] + c_kata->len[1][0];
vec3 pos_ude_mid = vec3::lerp(pos_kata, pos_te, c_kata->len[0][0] / arm_length);
@@ -539,15 +562,15 @@ static void set_bone_key_set_arm_ik_target_data(auth_3d_to_mot_data& a2m, auth_3
vec3 data[2];
vec3 tl_up_kata_pos = tl_up_kata_dir + pos_ude;
mat4* mat = block[BLK_KL_MUNE_B_WJ].node[0].mat_ptr;
mat4* mat = block_top[BLK_KL_MUNE_B_WJ].node[0].mat_ptr;
mat4_inverse_transform_point(mat, &tl_up_kata_pos, &data[0]);
set_bone_key_set_data(block, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
tl_up_kata_index, curr_block_id, skeleton_select, key_set, data);
set_bone_key_set_data(block_top, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
tl_up_kata_index, curr_block_id, motion_body_type, fck, data);
data[0] = pos_te;
data[1] = c_kata_rotation;
set_bone_key_set_data(block, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
c_kata_index, curr_block_id, skeleton_select, key_set, data, 2);
set_bone_key_set_data(block_top, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
c_kata_index, curr_block_id, motion_body_type, fck, data, 2);
}
void effchrpv_auth_3d_to_mot::get_body_anim(int32_t frame, bool add_keys) {
@@ -556,7 +579,7 @@ 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 = rob_chara_array_get(rob_chara_ids[i.first]);
rob_chara* rob_chr = 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];
@@ -569,60 +592,60 @@ void effchrpv_auth_3d_to_mot::get_body_anim(int32_t frame, bool add_keys) {
auth->paused = true;
auth->ctrl(rctx_ptr);
rob_chr->set_visibility(oh->node[0].model_transform.visible);
rob_chr->set_disp_flag(oh->node[0].model_transform.visible);
motion_blend_mot* mot = rob_chr->bone_data->motion_loaded.front();
RobBlock* block = mot->bone_data.bones.data();
mot_key_set* key_set = mot->mot_key_data.mot.key_sets;
RobBlock* block_top = mot->bone_data.block_vec.data();
FcurveKey* fck = mot->mot_key_data.mot.fck_ptr;
int32_t curr_block_id = 0;
int32_t skeleton_select = mot->mot_key_data.skeleton_select;
int32_t motion_body_type = mot->mot_key_data.motion_body_type;
vec3 data[2];
data[0] = 0.0f;
data[1] = oh->node[a2m.gblctr].model_transform.rotation_value;
set_bone_key_set_global_data(a2m.bone_keys, a2m.sec_bone_keys, add_keys,
mot, key_set, data, 2);
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;
set_bone_key_set_data(block, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_N_HARA_CP, curr_block_id, skeleton_select, key_set, data, 2);
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;
set_bone_key_set_data(block, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_KG_HARA_Y, curr_block_id, skeleton_select, key_set, data);
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;
set_bone_key_set_data(block, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_KL_HARA_XZ, curr_block_id, skeleton_select, key_set, data);
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;
set_bone_key_set_data(block, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_N_HARA, curr_block_id, skeleton_select, key_set, data);
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]);
data[1] = 0.0f;
set_bone_key_set_data(block, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_CL_MUNE, curr_block_id, skeleton_select, key_set, data, 2);*/
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, key_set, add_keys,
BLK_CL_MUNE, curr_block_id, skeleton_select,
oh->node[a2m.j_mune_wj].model_transform.rotation_value, 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;
set_bone_key_set_data(block, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_KL_MUNE_B_WJ, curr_block_id, skeleton_select, key_set, data);
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;
set_bone_key_set_data(block, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_KL_KUBI, curr_block_id, skeleton_select, key_set, data);
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);
data[0] = { (float_t)(M_PI / 2.0), 0.0f, -(float_t)M_PI };
set_bone_key_set_data(block, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_N_KAO, curr_block_id, skeleton_select, key_set, data);
set_bone_key_set_data(block_top, a2m.bone_keys, a2m.sec_bone_keys, 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]);
@@ -630,12 +653,12 @@ void effchrpv_auth_3d_to_mot::get_body_anim(int32_t frame, bool add_keys) {
//data[1].x = -data[1].x;
//data[1].z = -data[1].z;
//data[1] = 0.0f;
set_bone_key_set_data(block, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_CL_KAO, curr_block_id, skeleton_select, key_set, data, 2);*/
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, key_set, add_keys,
BLK_CL_KAO, curr_block_id, skeleton_select,
oh->node[a2m.j_kao_wj].model_transform.rotation_value, 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) {
@@ -643,8 +666,8 @@ void effchrpv_auth_3d_to_mot::get_body_anim(int32_t frame, bool add_keys) {
data[0].x += (float_t)(M_PI / 2.0);
data[0].y = -data[0].z;
data[0].z = 0.0f;
set_bone_key_set_data(block, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_KL_EYE_R, curr_block_id, skeleton_select, key_set, data);
set_bone_key_set_data(block_top, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_KL_EYE_R, curr_block_id, motion_body_type, fck, data);
}
if (a2m.j_eye_l_wj != -1) {
@@ -652,53 +675,53 @@ void effchrpv_auth_3d_to_mot::get_body_anim(int32_t frame, bool add_keys) {
data[0].x += (float_t)(M_PI / 2.0);
data[0].y = -data[0].z;
data[0].z = 0.0f;
set_bone_key_set_data(block, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_KL_EYE_L, curr_block_id, skeleton_select, key_set, data);
set_bone_key_set_data(block_top, a2m.bone_keys, a2m.sec_bone_keys, 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;
set_bone_key_set_data(block, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_N_WAKI_L, curr_block_id, skeleton_select, key_set, data);
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;
set_bone_key_set_data(block, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_KL_WAKI_L_WJ, curr_block_id, skeleton_select, key_set, data);
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,
{ -(float_t)(M_PI / 2.0), -(float_t)(M_PI / 2.0), -(float_t)(M_PI / 2.0) },
block, key_set, add_keys, BLK_TL_UP_KATA_L, BLK_C_KATA_L,
curr_block_id, skeleton_select);
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;
set_bone_key_set_data(block, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_KL_TE_L_WJ, curr_block_id, skeleton_select, key_set, data);
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;
set_bone_key_set_data(block, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_N_WAKI_R, curr_block_id, skeleton_select, key_set, data);
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;
set_bone_key_set_data(block, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_KL_WAKI_R_WJ, curr_block_id, skeleton_select, key_set, data);
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,
{ -(float_t)(M_PI / 2.0), (float_t)(M_PI / 2.0), (float_t)(M_PI / 2.0) },
block, key_set, add_keys, BLK_TL_UP_KATA_R, BLK_C_KATA_R,
curr_block_id, skeleton_select);
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;
set_bone_key_set_data(block, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_KL_TE_R_WJ, curr_block_id, skeleton_select, key_set, data);
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;
set_bone_key_set_data(block, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_KL_KOSI_XZ, curr_block_id, skeleton_select, key_set, data);
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]);
data[0].y -= 0.033f;
@@ -706,16 +729,16 @@ void effchrpv_auth_3d_to_mot::get_body_anim(int32_t frame, bool add_keys) {
data[0].y = 0.103f;
data[1] = oh->node[a2m.j_momo_l_wj].model_transform.rotation_value;
data[1].z -= (float_t)(M_PI / 2.0);
set_bone_key_set_data(block, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_CL_MOMO_L, curr_block_id, skeleton_select, key_set, data, 2);*/
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]);
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, key_set, add_keys,
BLK_CL_MOMO_L, curr_block_id, skeleton_select,
oh->node[a2m.j_momo_l_wj].model_transform.rotation_value, 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]);
@@ -724,33 +747,33 @@ void effchrpv_auth_3d_to_mot::get_body_anim(int32_t frame, bool add_keys) {
data[0].y = 0.103f;
data[1] = oh->node[a2m.j_momo_r_wj].model_transform.rotation_value;
data[1].z -= (float_t)(M_PI / 2.0);
set_bone_key_set_data(block, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_CL_MOMO_R, curr_block_id, skeleton_select, key_set, data, 2);*/
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]);
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, key_set, add_keys,
BLK_CL_MOMO_R, curr_block_id, skeleton_select,
oh->node[a2m.j_momo_r_wj].model_transform.rotation_value, 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;
set_bone_key_set_data(block, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_KL_ASI_L_WJ_CO, curr_block_id, skeleton_select, key_set, data);
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;
set_bone_key_set_data(block, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_KL_ASI_R_WJ_CO, curr_block_id, skeleton_select, key_set, data);
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);
data[0] = { 0.0491406508f, 0.0f, 0.0f };
set_bone_key_set_data(block, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_KL_AGO_WJ, curr_block_id, skeleton_select, key_set, data);
set_bone_key_set_data(block_top, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_KL_AGO_WJ, curr_block_id, motion_body_type, fck, data);
data[0] = { 0.0f, 0.0331281610f, 0.0f };
set_bone_key_set_data(block, a2m.bone_keys, a2m.sec_bone_keys, add_keys,
BLK_N_KUBI_WJ_EX, curr_block_id, skeleton_select, key_set, data);
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;
@@ -760,30 +783,30 @@ void effchrpv_auth_3d_to_mot::get_body_anim(int32_t frame, bool add_keys) {
void effchrpv_auth_3d_to_mot::get_hand_anim(int32_t frame) {
for (auto& i : auth_3d_rob_mot_ids) {
rob_chara* rob_chr = rob_chara_array_get(rob_chara_ids[i.first]);
rob_chara* rob_chr = 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;
BONE_KIND skeleton_type = rob_bone_data->base_skeleton_type;
BONE_KIND kind = rob_bone_data->kind;
motion_blend_mot* mot = rob_bone_data->motion_loaded.front();
prj::sys_vector<RobBlock>* bones = &mot->bone_data.bones;
prj::sys_vector<RobBlock>* block_vec = &mot->bone_data.block_vec;
prj::sys_vector<uint16_t>* bone_indices = &mot->bone_data.bone_indices;
RobBlock* bones_data = bones->data();
RobBlock* block_top = block_vec->data();
for (uint16_t& i : *bone_indices) {
RobBlock* data = &bones_data[i];
BONE_BLK block_id = (BONE_BLK)data->block_id;
if (!(block_id >= BLK_N_HITO_L_EX && block_id <= BLK_NL_OYA_C_L_WJ
|| block_id >= BLK_N_HITO_R_EX && block_id <= BLK_NL_OYA_C_R_WJ))
RobBlock* block = &block_top[i];
BONE_BLK blk = (BONE_BLK)block->block_id;
if (!(blk >= BLK_N_HITO_L_EX && blk <= BLK_NL_OYA_C_L_WJ
|| blk >= BLK_N_HITO_R_EX && blk <= BLK_NL_OYA_C_R_WJ))
continue;
auto elem = a2m.bone_keys.find(block_id);
auto elem = a2m.bone_keys.find(blk);
if (elem == a2m.bone_keys.end())
elem = a2m.bone_keys.insert({ block_id, {} }).first;
elem = a2m.bone_keys.insert({ blk, {} }).first;
vec3 rotation;
mat4_get_rotation_zyx(&data->chain_rot[0], &rotation);
mat4_get_rotation_zyx(&block->chain_rot[0], &rotation);
if (elem->second.x.size() == frame)
elem->second.x.push_back(rotation.x);
if (elem->second.y.size() == frame)
@@ -806,8 +829,8 @@ 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 = rob_chara_array_get(rob_chara_ids[i]);
rob_chr->set_motion_id(motion_id, 0.0f,
rob_chara* rob_chr = get_rob_management()->get_rob(rob_ids[i]);
rob_chr->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);
@@ -1040,31 +1063,31 @@ static void mot_write_motion(mot_data_bake_data* bake_data) {
return;
std::string* bone_name = aft_mot_db->bone_name.data();
const std::vector<BODYTYPE>* bones = aft_bone_data->get_body_type(BONE_KIND_CMN);
if (!bones)
const std::vector<BODYTYPE>* body_type_table = aft_bone_data->get_body_type_table(BONE_KIND_CMN);
if (!body_type_table)
return;
prj::shared_ptr<prj::stack_allocator>& alloc = *bake->alloc;
auth_3d_to_mot_data& a2m = *bake_data->data;
const mot_bone_info* bone_info = mot_data->bone_info_array;
for (size_t key_set_offset = 0, i = 0; key_set_offset < key_set_count; i++) {
BONE_BLK bone_index = (BONE_BLK)aft_bone_data->get_block_index(
BONE_BLK blk = (BONE_BLK)aft_bone_data->get_block_index(
BONE_KIND_CMN, bone_name[bone_info[i].index].c_str());
if (bone_index == -1) {
if (blk == -1) {
i++;
bone_index = (BONE_BLK)aft_bone_data->get_block_index(
blk = (BONE_BLK)aft_bone_data->get_block_index(
BONE_KIND_CMN, bone_name[bone_info[i].index].c_str());
if (bone_index == -1)
if (blk == -1)
break;
}
const BODYTYPE* bone = &(*bones)[bone_index];
const BODYTYPE* bt = &(*body_type_table)[blk];
auto elem = a2m.bone_keys.find(bone_index);
auto elem = a2m.bone_keys.find(blk);
if (elem != a2m.bone_keys.end()) {
auth_3d_to_mot_keys& keys = elem->second;
if (bone->ik_type == IKT_0) {
if (bt->ik_type == IKT_0) {
fix_rotation(keys.x);
fix_rotation(keys.y);
fix_rotation(keys.z);
@@ -1098,7 +1121,7 @@ static void mot_write_motion(mot_data_bake_data* bake_data) {
key_set_data_z.data_type = MOT_KEY_SET_DATA_F32;
}
elem = a2m.sec_bone_keys.find(bone_index);
elem = a2m.sec_bone_keys.find(blk);
if (elem != a2m.sec_bone_keys.end()) {
auth_3d_to_mot_keys& keys = elem->second;
@@ -1134,7 +1157,7 @@ static void mot_write_motion(mot_data_bake_data* bake_data) {
key_set_data_z.data_type = MOT_KEY_SET_DATA_F32;
}
if (bone_index == BLK_KL_AGO_WJ) {
if (blk == BLK_KL_AGO_WJ) {
mot_key_set_data& key_set_data_x = mot_data->key_set_array[key_set_offset];
key_set_data_x.frames = 0;
{
@@ -1160,7 +1183,7 @@ static void mot_write_motion(mot_data_bake_data* bake_data) {
key_set_data_z.keys_count = 0;
key_set_data_z.data_type = MOT_KEY_SET_DATA_F32;
}
else if (bone_index == BLK_N_KUBI_WJ_EX) {
else if (blk == BLK_N_KUBI_WJ_EX) {
mot_key_set_data& key_set_data_x = mot_data->key_set_array[key_set_offset];
key_set_data_x.frames = 0;
key_set_data_x.values = 0;
@@ -1187,7 +1210,7 @@ static void mot_write_motion(mot_data_bake_data* bake_data) {
key_set_data_z.data_type = MOT_KEY_SET_DATA_F32;
}
key_set_offset += bone->ik_type >= IKT_ROOT ? 6 : 3;
key_set_offset += bt->ik_type >= IKT_ROOT ? 6 : 3;
}
bake_data->state = 0;
@@ -8,7 +8,7 @@
#include "../../KKdLib/default.hpp"
#include <string>
extern void effchrpv_auth_3d_to_mot_init(int32_t pv_id, const int32_t* rob_chara_ids);
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_file_name(const std::string& file, const std::string& category);
extern void effchrpv_auth_3d_to_mot_disp();
+64 -48
View File
@@ -44,7 +44,7 @@ public:
void Hide() override;
void GetCharaCos(CHARA_NUM chara_index, int32_t chara_id, dw::ListBox* list_box);
void GetCharaCos(CHARA_NUM chara_num, int32_t chara_id, dw::ListBox* list_box);
};
class Auth3dTestSubWindow : public dw::Shell {
@@ -243,7 +243,7 @@ public:
dw::Button* play;
dw::Button* end;
dw::Button* repeat;
dw::Button* left_right_reverse;
dw::Button* mirror;
dw::Button* pos;
dw::Button* log;
dw::Button* snap_shot;
@@ -269,7 +269,7 @@ public:
SelectionButtonEnd end_listener;
SelectionButtonBindBoolFunc pos_listener;
SelectionButtonBindBoolFunc repeat_listener;
SelectionButtonBindBoolFunc left_right_reverse_listener;
SelectionButtonBindBoolFunc mirror_listener;
SelectionButtonSnapShot snap_shot_listener;
SelectionButtonLog log_listener;
SelectionButtonShadowType shadow_type_listener;
@@ -304,7 +304,6 @@ public:
};
extern render_context* rctx_ptr;
extern bool auth_3d_chara_visible;
Auth3dTestTask* auth_3d_test_task;
Auth3dTestWindow* auth_3d_test_window;
@@ -316,8 +315,8 @@ static bool snap_shot;
static void auth_3d_test_window_init();
static const char* get_dev_ram_ss_dir();
Auth3dTestTask::DataEventListener::Data::Data() : state(), field_C(), field_D(),
load_chara_num(), chara_num(), prev_chara_num(), load_cos_id(), cos_id(), chara_visible() {
Auth3dTestTask::DataEventListener::Data::Data() : rob_man(), state(), field_C(), field_D(),
load_chara_num(), chara_num(), prev_chara_num(), load_cos_id(), cos_id(), colli_check_on() {
}
@@ -346,7 +345,21 @@ void Auth3dTestTask::DataEventListener::Data::ctrl() {
}
if (field_D) {
free_all_chara();
rob_man->dest_all();
if (prev_chara_num[0] < CN_MAX) {
const RobData* rob_data = get_rob_data(prev_chara_num[0]);
motion_set_unload_motion(rob_data->motfile_auth);
motion_set_unload_mothead(rob_data->motfile_auth);
prev_chara_num[0] = CN_MAX;
}
if (prev_chara_num[1] < CN_MAX) {
const RobData* rob_data = get_rob_data(prev_chara_num[1]);
motion_set_unload_motion(rob_data->motfile_auth);
motion_set_unload_mothead(rob_data->motfile_auth);
prev_chara_num[1] = CN_MAX;
}
field_D = false;
}
@@ -382,11 +395,10 @@ void Auth3dTestTask::DataEventListener::Data::ctrl() {
dtm_eq_vs[0].SetCharaNumCosId(load_chara_num[0], load_cos_id[0]);
dtm_eq_vs[1].SetCharaNumCosId(load_chara_num[1], load_cos_id[1]);
if (state == 4)
{
rob_chara_array_set_visibility(0, false);
if (state == 4) {
rob_man->set_disp_on(ROB_ID_1P, false);
if (state == 4)
rob_chara_array_set_visibility(1, false);
rob_man->set_disp_on(ROB_ID_2P, false);
}
}
}
@@ -395,13 +407,10 @@ void Auth3dTestTask::DataEventListener::Data::dest() {
dtm_eq_vs[0].del_task();
dtm_eq_vs[1].del_task();
auth_3d_chara_visible = chara_visible;
rob_man->set_colli_check_on(colli_check_on);
free_all_chara();
}
inline void Auth3dTestTask::DataEventListener::Data::free_all_chara() {
task_rob_manager_free_all_chara();
rob_man->dest_all();
rob_man = 0;
if (prev_chara_num[0] < CN_MAX) {
const RobData* rob_data = get_rob_data(prev_chara_num[0]);
@@ -419,8 +428,9 @@ inline void Auth3dTestTask::DataEventListener::Data::free_all_chara() {
}
void Auth3dTestTask::DataEventListener::Data::init() {
chara_visible = auth_3d_chara_visible;
auth_3d_chara_visible = false;
rob_man = get_rob_management();
colli_check_on = rob_man->get_colli_check_on();
rob_man->set_colli_check_on(false);
field_C = false;
field_D = false;
@@ -451,10 +461,10 @@ void Auth3dTestTask::DataEventListener::Data::sub_140244E20() {
data_struct* aft_data = &data_list[DATA_AFT];
motion_database* aft_mot_db = &aft_data->data_ft.mot_db;
rob_chara_pv_data pv_data;
pv_data.field_4 = false;
rob_chara_array_init_chara_num(load_chara_num[0], pv_data, load_cos_id[0], true);
rob_chara_array_init_chara_num(load_chara_num[1], pv_data, load_cos_id[1], true);
RobInit rob_init;
rob_init.disp = false;
rob_man->create_rob(load_chara_num[0], rob_init, load_cos_id[0], true);
rob_man->create_rob(load_chara_num[1], rob_init, load_cos_id[1], true);
if (load_chara_num[0] < CN_MAX) {
const RobData* rob_data = get_rob_data(load_chara_num[0]);
@@ -473,13 +483,17 @@ void Auth3dTestTask::DataEventListener::Data::sub_140244E20() {
state = 1;
}
void Auth3dTestTask::DataEventListener::Data::sub_140249A40(bool other_chara) {
void Auth3dTestTask::DataEventListener::Data::sub_140249A40(int32_t rob_id) {
if (state != 4)
return;
rob_chara_pv_data pv_data;
pv_data.field_4 = false;
auth_3d_check_chara_visible(other_chara, &pv_data);
data_struct* aft_data = &data_list[DATA_AFT];
bone_database* aft_bone_data = &aft_data->data_ft.bone_data;
motion_database* aft_mot_db = &aft_data->data_ft.mot_db;
RobInit rob_init;
rob_init.disp = false;
rob_man->reset_rob(rob_id ? ROB_ID_2P : ROB_ID_1P, rob_init, aft_bone_data, aft_mot_db);
}
Auth3dTestTask::DataEventListener::DataEventListener() {
@@ -540,7 +554,7 @@ Auth3dTestTask::Auth3dTestTask() {
auth_3d_id = {};
auth_3d_uid = -1;
repeat = true;
left_right_reverse = false;
mirror = false;
pos = false;
snap_shot = false;
snap_shot_state = 0;
@@ -578,7 +592,7 @@ bool Auth3dTestTask::init() {
auth_3d_id = {};
auth_3d_uid = -1;
repeat = true;
left_right_reverse = false;
mirror = false;
pos = false;
snap_shot = false;
snap_shot_state = 0;
@@ -641,7 +655,7 @@ bool Auth3dTestTask::ctrl() {
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_left_right_reverse(auth_3d_test_task->left_right_reverse);
auth_3d_id.set_mirror(auth_3d_test_task->mirror);
auth_3d_id.set_pos(auth_3d_test_task->pos);
state = 4;
}
@@ -727,13 +741,14 @@ void Auth3dTestTask::disp() {
}
void Auth3dTestTask::DispAuth3dChara(::auth_3d_id& id) {
RobManagement* rob_man = get_rob_management();
id.get_uid(); // ???
rob_chara_item_equip* rob_disp = rob_chara_array_get_rob_disp(0);
RobDisp* rob_disp = rob_man->get_rob_robdisp_work(ROB_ID_1P);
if (!rob_disp)
return;
for (int32_t i = RPK_ITEM_BEGIN; i <= RPK_ITEM_END; i++)
rob_disp->set_disp((ROB_PARTS_KIND)i, true);
rob_disp->set_disp_flag((ROB_PARTS_KIND)i, true);
}
void Auth3dTestTask::DispChara() {
@@ -1009,17 +1024,18 @@ void Auth3dTestRobWindow::Hide() {
SetDisp();
}
void Auth3dTestRobWindow::GetCharaCos(CHARA_NUM chara_index, int32_t chara_id, dw::ListBox* list_box) {
void Auth3dTestRobWindow::GetCharaCos(CHARA_NUM chara_num, int32_t chara_id, dw::ListBox* list_box) {
list_box->ClearItems();
for (const auto& i : item_table_handler_array_get_table(chara_index)->cos) {
if (!i.second.data.outer)
for (const auto& i : get_rob_item_header(chara_num)->defset) {
if (!i.second.item_no[ROB_ITEM_EQUIP_SUB_ID_OUTER])
continue;
const item_table_item* item = item_table_handler_array_get_item(chara_index, i.second.data.outer);
if (item) {
const RobItemTable* tbl = get_rob_item_table(chara_num,
i.second.item_no[ROB_ITEM_EQUIP_SUB_ID_OUTER]);
if (tbl) {
char buf[0x100];
sprintf_s(buf, sizeof(buf), "%03d %s", i.first + 1, item->name.c_str());
sprintf_s(buf, sizeof(buf), "%03d %s", i.first + 1, tbl->name.c_str());
list_box->AddItem(buf);
}
}
@@ -1453,7 +1469,7 @@ Auth3dTestWindow::Auth3dTestWindow() {
const char* nage_text;
const char* obj_link_text;
const char* left_right_reverse_text;
const char* mirror_text;
const char* snap_shot_text;
const char* self_shadow_off_text;
const char* black_mask_text;
@@ -1461,7 +1477,7 @@ Auth3dTestWindow::Auth3dTestWindow() {
if (dw::translate) {
nage_text = u8"NAGE▽";
obj_link_text = u8"OBJ Link";
left_right_reverse_text = u8"Left Right Reverse";
mirror_text = u8"Mirror";
snap_shot_text = u8"ss capture";
self_shadow_off_text = u8"Self Shadow Off";
black_mask_text = u8"Black Mask";
@@ -1470,7 +1486,7 @@ Auth3dTestWindow::Auth3dTestWindow() {
else {
nage_text = u8"投▽";
obj_link_text = u8"OBJ連動";
left_right_reverse_text = u8"左右逆";
mirror_text = u8"左右逆";
snap_shot_text = u8"ss画撮";
self_shadow_off_text = u8"セルフ影OFF";
black_mask_text = u8"黒mask";
@@ -1584,11 +1600,11 @@ Auth3dTestWindow::Auth3dTestWindow() {
repeat_listener.callback = Auth3dTestWindow::RepeatCallback;
repeat->AddSelectionListener(&repeat_listener);
left_right_reverse = new dw::Button(this, dw::CHECKBOX);
left_right_reverse->SetText(left_right_reverse_text);
left_right_reverse->SetValue(auth_3d_test_task->left_right_reverse);
left_right_reverse_listener.callback = Auth3dTestWindow::LeftRightReverseCallback;
left_right_reverse->AddSelectionListener(&left_right_reverse_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->AddSelectionListener(&mirror_listener);
dw::Composite* v79 = new dw::Composite(this);
v79->SetLayout(new dw::RowLayout(dw::HORIZONTAL));
@@ -1770,10 +1786,10 @@ void Auth3dTestWindow::CategoryCharaMenuInit(dw::Button* button, dw::Menu*& menu
}
void Auth3dTestWindow::LeftRightReverseCallback(bool value) {
auth_3d_test_task->left_right_reverse = 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_left_right_reverse(value);
auth_3d_test_task->auth_3d_id.set_mirror(value);
}
}
+5 -4
View File
@@ -8,6 +8,7 @@
#include <string>
#include "../../KKdLib/default.hpp"
#include "../../KKdLib/database/item_table.hpp"
#include "../../CRE/rob/rob.hpp"
#include "../../CRE/auth_3d.hpp"
#include "../../CRE/task.hpp"
#include "equip_test.hpp"
@@ -17,6 +18,7 @@ public:
class DataEventListener : public a3d::EventAdapter {
public:
struct Data {
RobManagement* rob_man;
int32_t state;
bool field_C;
bool field_D;
@@ -26,18 +28,17 @@ public:
int32_t load_cos_id[2];
int32_t cos_id[2];
DtmEqVs dtm_eq_vs[2];
bool chara_visible;
bool colli_check_on;
Data();
~Data();
void ctrl();
void dest();
void free_all_chara();
void init();
void sub_140244E20();
void sub_140249A40(bool other_chara);
void sub_140249A40(int32_t rob_id);
};
Data data;
@@ -58,7 +59,7 @@ public:
::auth_3d_id auth_3d_id;
int32_t auth_3d_uid;
bool repeat;
bool left_right_reverse;
bool mirror;
bool pos;
bool snap_shot;
int32_t snap_shot_state;
File diff suppressed because it is too large Load Diff
+11 -11
View File
@@ -6,19 +6,19 @@
#pragma once
#include "../../KKdLib/default.hpp"
#include "../../CRE/rob/rob.hpp"
#include "../../CRE/task.hpp"
class DtmEqVs : public app::Task {
public:
int32_t state;
int32_t chara_id;
CHARA_NUM chara_num;
CHARA_NUM curr_chara_num;
int32_t cos_id;
int32_t curr_cos_id;
int32_t disp_parts;
private:
int32_t m_mode;
int32_t m_rc;
int32_t m_cn_cur;
int32_t m_cn_pre;
int32_t m_cs_cur;
int32_t m_cs_pre;
int32_t m_dp;
public:
DtmEqVs();
virtual ~DtmEqVs() override;
@@ -26,10 +26,10 @@ public:
virtual bool ctrl() override;
virtual bool dest() override;
virtual bool add_task(int32_t chara_id, CHARA_NUM chara_index);
virtual bool add_task(int32_t rob_id, int32_t cn);
virtual bool del_task();
void SetCharaNumCosId(CHARA_NUM chara_index, int32_t cos_id);
void SetCharaNumCosId(int32_t cn, int32_t cs);
void CtrlChara();
void CtrlDispParts();
File diff suppressed because it is too large Load Diff
+36 -38
View File
@@ -14,16 +14,16 @@
class DataTestMot : public app::Task {
public:
struct Data {
struct Offset {
struct Off {
float_t array[2];
Offset();
Off();
};
struct Divide {
struct Div {
float_t array[3];
Divide();
Div();
};
struct Step {
@@ -32,18 +32,18 @@ public:
Step();
};
CHARA_NUM chara_num[2];
CHARA_NUM curr_chara_num[2];
uint32_t cos_id[2];
uint32_t curr_cos_id[2];
uint32_t motion_set_index[2];
uint32_t curr_motion_set_index[2];
uint32_t motion_index[2];
uint32_t curr_motion_index[2];
CHARA_NUM chr[2];
CHARA_NUM curr_chr[2];
uint32_t ptr[2];
uint32_t curr_ptr[2];
uint32_t set[2];
uint32_t curr_set[2];
uint32_t uid[2];
uint32_t curr_uid[2];
float_t rot_y[2];
float_t trans_x[2];
Offset offset[2];
Divide divide[2];
Off off[2];
Div div[2];
Step step[2];
float_t start_frame[2];
int32_t type;
@@ -102,31 +102,30 @@ public:
class DtmMot : public app::Task {
public:
rob_chara_bone_data* rob_bone_data;
int32_t chara_id;
int32_t type;
CHARA_NUM chara_num;
int32_t cos_id;
union {
uint32_t motion_set_id;
int32_t motion_set_index;
enum ASSIGN {
IDX = 0,
UID,
};
union {
uint32_t motion_id;
int32_t motion_index;
};
vec3 trans;
vec3 rotation;
float_t rot_y;
RobManagement* rob_man;
rob_chara_bone_data* motion;
ROB_ID rctrl;
ASSIGN assign;
CHARA_NUM chr;
int32_t ptr;
uint32_t set;
uint32_t uid;
vec3 pos;
float_t rot[4];
float_t pre_offset;
float_t post_offset;
float_t step[4];
float_t divide[3];
float_t div[3];
bool loop;
bool play;
bool field_D2;
bool change_motion;
bool disp;
bool move;
bool item;
bool reset_osage_flag;
bool display;
bool use_opd;
bool loaded;
bool reset_mot;
@@ -152,12 +151,11 @@ public:
virtual bool init() override;
virtual bool ctrl() override;
virtual bool dest() override;
virtual void disp() override;
virtual void basic() override;
virtual bool add_task(CHARA_NUM chara_num,
int32_t cos_id, uint32_t motion_set_index, uint32_t motion_index);
virtual bool add_task(CHARA_NUM chara_num,
int32_t cos_id, uint32_t motion_id);
virtual bool add_task(CHARA_NUM chr, int32_t ptr, uint32_t set, uint32_t uid);
virtual bool add_task(CHARA_NUM chr, int32_t ptr, uint32_t uid);
virtual bool del_task();
bool CheckFirstFrame();
+7 -7
View File
@@ -189,9 +189,9 @@ void TaskDataTestOpd::disp() {
print_work.printf_align_left("item:\n");
for (uint32_t& j : i.items) {
const item_table_item* item = item_table_handler_array_get_item(i.chara, j);
if (item)
print_work.printf_align_left("%03u %s\n", j, item->name.c_str());
const RobItemTable* tbl = get_rob_item_table(i.chara, j);
if (tbl)
print_work.printf_align_left("%03u %s\n", j, tbl->name.c_str());
}
worker++;
}
@@ -261,11 +261,11 @@ void TaskDataTestOpd::GetCustomizeItemObjectNames(
data_struct* aft_data = &data_list[DATA_AFT];
object_database* aft_obj_db = &aft_data->data_ft.obj_db;
const item_table_item* item = item_table_handler_array_get_item(
const RobItemTable* tbl = get_rob_item_table(
cstm.chara != 10 ? (CHARA_NUM)cstm.chara : CN_MIKU, cstm.obj_id);
if (item)
for (const item_table_item_data_obj& i : item->data.obj)
objects.push_back(aft_obj_db->get_object_name(i.obj_info));
if (tbl)
for (const RobItemDataObj& i : tbl->data.obj)
objects.push_back(aft_obj_db->get_object_name(i.uid));
}
bool TaskDataTestOpd::add_task() {
+45 -45
View File
@@ -425,8 +425,8 @@ extern render_context* rctx_ptr;
RobOsageTest::RobOsageTest() : load(), save(), coli(), line(),
osage_index(), collision_index(), collision_update() {
chara_id = -1;
load_chara_id = 0;
rob_id = ROB_ID_NULL;
rob_id_load = ROB_ID_1P;
chara_num = CN_NONE;
cos_id = -1;
rpk = RPK_NONE;
@@ -449,8 +449,8 @@ bool RobOsageTest::init() {
}
bool RobOsageTest::ctrl() {
if (chara_id != -1) {
rob_chara* rob_chr = rob_chara_array_get(chara_id);
if (rob_id != ROB_ID_NULL) {
rob_chara* rob_chr = get_rob_management()->get_rob(rob_id);
if (!rob_chr)
return false;
@@ -461,7 +461,7 @@ bool RobOsageTest::ctrl() {
if (load) {
load = false;
chara_id = load_chara_id;
rob_id = rob_id_load;
chara_num = CN_NONE;
cos_id = -1;
@@ -473,14 +473,14 @@ bool RobOsageTest::ctrl() {
rob_osage_test_dw->rob.object_list_box->ClearItems();
rob_osage_test_dw->rob.object_list_box->SetItemIndex(-1);
rob_chara* rob_chr = rob_chara_array_get(chara_id);
rob_chara* rob_chr = get_rob_management()->get_rob(rob_id);
if (!rob_chr)
return false;
chara_num = rob_chr->chara_num;
cos_id = rob_chr->cos_id;
rob_chara_item_equip* rob_disp = rob_chr->rob_disp;
RobDisp* rob_disp = rob_chr->disp;
if (!rob_disp)
return false;
@@ -489,7 +489,7 @@ bool RobOsageTest::ctrl() {
object_database* aft_obj_db = &aft_data->data_ft.obj_db;
for (int32_t i = 0; i < RPK_MAX; i++) {
rob_chara_item_equip_object* skin_disp = rob_disp->get_skin_disp((ROB_PARTS_KIND)i);
RobSkinDisp* skin_disp = rob_disp->get_skin_work((ROB_PARTS_KIND)i);
::obj* obj = objset_info_storage_get_obj(skin_disp->obj_uid);
if (!obj || !skin_disp->osage_blk.size() && !skin_disp->cloth.size())
continue;
@@ -513,12 +513,12 @@ bool RobOsageTest::ctrl() {
std::vector<std::pair<std::string, ExNodeBlock*>> ex_nodes;
ex_nodes.reserve(skin_disp->osage_blk.size() + skin_disp->cloth.size());
for (ExOsageBlock*& j : skin_disp->osage_blk) {
for (ExOsageBlock* j : skin_disp->osage_blk) {
ExOsageBlock* osg = j;
ex_nodes.push_back({ osg->name, osg });
}
for (ExClothBlock*& j : skin_disp->cloth) {
for (ExClothBlock* j : skin_disp->cloth) {
ExClothBlock* cls = j;
ex_nodes.push_back({ cls->name, cls });
}
@@ -632,7 +632,7 @@ bool RobOsageTest::ctrl() {
const char* flt_fmt = "%0.6f";
rob_chara_item_equip* rob_disp = rob_chara_array_get_rob_disp(chara_id);
RobDisp* rob_disp = get_rob_management()->get_rob_robdisp_work((ROB_ID)rob_id);
if (!rob_disp)
return false;
@@ -640,10 +640,10 @@ bool RobOsageTest::ctrl() {
bone_database* aft_bone_data = &aft_data->data_ft.bone_data;
object_database* aft_obj_db = &aft_data->data_ft.obj_db;
const std::vector<std::string>* object_bones = aft_bone_data->get_bone_name(BONE_KIND_CMN);
const std::vector<std::string>* bone_name_table = aft_bone_data->get_bone_name_table(BONE_KIND_CMN);
for (int32_t i = 0; i < RPK_MAX; i++) {
rob_chara_item_equip_object* skin_disp = rob_disp->get_skin_disp((ROB_PARTS_KIND)i);
RobSkinDisp* skin_disp = rob_disp->get_skin_work((ROB_PARTS_KIND)i);
::obj* obj = objset_info_storage_get_obj(skin_disp->obj_uid);
if (!obj || !skin_disp->osage_blk.size() && !skin_disp->cloth.size())
continue;
@@ -771,7 +771,7 @@ bool RobOsageTest::ctrl() {
kv.open_scope_fmt(sort_index_data[k]);
SkinParam::CollisionParam* cls_param = &vc[sort_index_data[k]];
kv.write(s, "bone.0.name", object_bones->data()[cls_param->node_idx[0]].c_str());
kv.write(s, "bone.0.name", bone_name_table->data()[cls_param->node_idx[0]].c_str());
kv.write(s, "bone.0.posx", cls_param->pos[0].x, flt_fmt);
kv.write(s, "bone.0.posy", cls_param->pos[0].y, flt_fmt);
kv.write(s, "bone.0.posz", cls_param->pos[0].z, flt_fmt);
@@ -780,7 +780,7 @@ bool RobOsageTest::ctrl() {
case SkinParam::CollisionTypeCapsule:
case SkinParam::CollisionTypePlane:
case SkinParam::CollisionTypeEllipse:
kv.write(s, "bone.1.name", object_bones->data()[cls_param->node_idx[1]].c_str());
kv.write(s, "bone.1.name", bone_name_table->data()[cls_param->node_idx[1]].c_str());
kv.write(s, "bone.1.posx", cls_param->pos[1].x, flt_fmt);
kv.write(s, "bone.1.posy", cls_param->pos[1].y, flt_fmt);
kv.write(s, "bone.1.posz", cls_param->pos[1].z, flt_fmt);
@@ -883,12 +883,12 @@ bool RobOsageTest::dest() {
}
void RobOsageTest::disp() {
if (chara_id < 0 || chara_id >= ROB_ID_MAX)
if (rob_id < 0 || rob_id >= ROB_ID_MAX)
return;
rob_chara* rob_chr = rob_chara_array_get(chara_id);
if (rob_chr && !pv_osage_manager_array_get_disp(chara_id)
&& rob_chr->is_visible() && !rob_chr->data.flag.bit.rf_31) {
rob_chara* rob_chr = get_rob_management()->get_rob(rob_id);
if (rob_chr && !pv_osage_manager_array_get_disp(rob_id)
&& rob_chr->get_disp_flag() && !rob_chr->rob_base.flag.bit.no_ctrl) {
disp_coli();
disp_line();
}
@@ -903,7 +903,7 @@ void RobOsageTest::basic() {
rob_osage_test_dw->UpdateLayout();
}
rob_chara_item_equip_object* skin_disp = get_skin_disp();
RobSkinDisp* skin_disp = get_skin_work();
if (!skin_disp)
return;
@@ -938,7 +938,7 @@ void RobOsageTest::disp_coli() {
if (!coli)
return;
rob_chara_item_equip_object* skin_disp = get_skin_disp();
RobSkinDisp* skin_disp = get_skin_work();
if (!skin_disp || skin_disp->obj_uid != obj_info)
return;
@@ -1143,7 +1143,7 @@ void RobOsageTest::disp_line() {
if (!line)
return;
rob_chara_item_equip_object* skin_disp = get_skin_disp();
RobSkinDisp* skin_disp = get_skin_work();
if (!skin_disp || skin_disp->obj_uid != obj_info)
return;
@@ -1257,7 +1257,7 @@ void RobOsageTest::disp_line_cls_param(const mat4& motion_matrix, const vec3& po
SCREEN_MODE_MAX, spr::SPR_PRIO_DW, color_yellow);
}
inline ExClothBlock* RobOsageTest::get_cloth_block(rob_chara_item_equip_object* skin_disp) const {
inline ExClothBlock* RobOsageTest::get_cloth_block(RobSkinDisp* skin_disp) const {
if (skin_disp && skin_disp->obj_uid == obj_info && osage_index >= skin_disp->osage_blk.size()
&& osage_index - skin_disp->osage_blk.size() < skin_disp->cloth.size())
return skin_disp->cloth[osage_index - skin_disp->osage_blk.size()];
@@ -1282,17 +1282,17 @@ inline SkinParam::CollisionParam* RobOsageTest::get_cls_param(
return 0;
}
inline rob_chara_item_equip_object* RobOsageTest::get_skin_disp() const {
if (chara_id < 0 || chara_id >= ROB_ID_MAX)
inline RobSkinDisp* RobOsageTest::get_skin_work() const {
if (rob_id < 0 || rob_id >= ROB_ID_MAX)
return 0;
rob_chara_item_equip* rob_disp = rob_chara_array_get_rob_disp(chara_id);
RobDisp* rob_disp = get_rob_management()->get_rob_robdisp_work((ROB_ID)rob_id);
if (rob_disp && rpk >= 0 && rpk < RPK_MAX)
return rob_disp->get_skin_disp(rpk);
return rob_disp->get_skin_work(rpk);
return 0;
}
inline ExNodeBlock* RobOsageTest::get_node_block(rob_chara_item_equip_object* skin_disp) const {
inline ExNodeBlock* RobOsageTest::get_node_block(RobSkinDisp* skin_disp) const {
if (skin_disp && skin_disp->obj_uid == obj_info)
if (osage_index < skin_disp->osage_blk.size())
return skin_disp->osage_blk[osage_index];
@@ -1302,7 +1302,7 @@ inline ExNodeBlock* RobOsageTest::get_node_block(rob_chara_item_equip_object* sk
return 0;
}
inline ExOsageBlock* RobOsageTest::get_osage_block(rob_chara_item_equip_object* skin_disp) const {
inline ExOsageBlock* RobOsageTest::get_osage_block(RobSkinDisp* skin_disp) const {
if (skin_disp && skin_disp->obj_uid == obj_info && osage_index < skin_disp->osage_blk.size())
return skin_disp->osage_blk[osage_index];
return 0;
@@ -1385,14 +1385,14 @@ void RobOsageTestDw::Rob::Init(dw::Composite* parent) {
void RobOsageTestDw::Rob::CharaCallback(dw::Widget* data) {
dw::ListBox* list_box = dynamic_cast<dw::ListBox*>(data);
if (list_box)
rob_osage_test->load_chara_id = (int32_t)list_box->list->selected_item;
rob_osage_test->rob_id_load = (ROB_ID)(int32_t)list_box->list->selected_item;
}
void RobOsageTestDw::Rob::DefaultCallback(dw::Widget* data) {
dw::Button* button = dynamic_cast<dw::Button*>(data);
if (button) {
rob_osage_test->chara_id = -1;
rob_osage_test->load_chara_id = 0;
rob_osage_test->rob_id = ROB_ID_NULL;
rob_osage_test->rob_id_load = ROB_ID_1P;
rob_osage_test->rpk = RPK_NONE;
rob_osage_test->obj_info = object_info();
rob_osage_test->osage_index = -1;
@@ -1427,7 +1427,7 @@ void RobOsageTestDw::Rob::ObjectCallback(dw::Widget* data) {
rob_osage_test_dw->root.list_box->ClearItems();
rob_chara_item_equip_object* skin_disp = rob_osage_test->get_skin_disp();
RobSkinDisp* skin_disp = rob_osage_test->get_skin_work();
if (skin_disp) {
for (ExOsageBlock*& i : skin_disp->osage_blk)
rob_osage_test_dw->root.list_box->AddItem(i->name);
@@ -2222,7 +2222,7 @@ void RobOsageTestDw::Node::CollisionRadius::Update(bool value) {
void RobOsageTestDw::Node::CollisionRadius::Callback(dw::Widget* data) {
dw::Slider* slider = dynamic_cast<dw::Slider*>(data);
if (slider) {
rob_chara_item_equip_object* skin_disp = rob_osage_test->get_skin_disp();
RobSkinDisp* skin_disp = rob_osage_test->get_skin_work();
ExOsageBlock* osg = rob_osage_test->get_osage_block(skin_disp);
if (osg) {
float_t value = slider->GetValue();
@@ -2321,7 +2321,7 @@ void RobOsageTestDw::Node::Hinge::Update(bool value) {
void RobOsageTestDw::Node::Hinge::YMinCallback(dw::Widget* data) {
dw::Slider* slider = dynamic_cast<dw::Slider*>(data);
if (slider) {
rob_chara_item_equip_object* skin_disp = rob_osage_test->get_skin_disp();
RobSkinDisp* skin_disp = rob_osage_test->get_skin_work();
ExOsageBlock* osg = rob_osage_test->get_osage_block(skin_disp);
if (osg) {
float_t value = slider->GetValue() * DEG_TO_RAD_FLOAT;
@@ -2336,7 +2336,7 @@ void RobOsageTestDw::Node::Hinge::YMinCallback(dw::Widget* data) {
void RobOsageTestDw::Node::Hinge::YMaxCallback(dw::Widget* data) {
dw::Slider* slider = dynamic_cast<dw::Slider*>(data);
if (slider) {
rob_chara_item_equip_object* skin_disp = rob_osage_test->get_skin_disp();
RobSkinDisp* skin_disp = rob_osage_test->get_skin_work();
ExOsageBlock* osg = rob_osage_test->get_osage_block(skin_disp);
if (osg) {
float_t value = slider->GetValue() * DEG_TO_RAD_FLOAT;
@@ -2351,7 +2351,7 @@ void RobOsageTestDw::Node::Hinge::YMaxCallback(dw::Widget* data) {
void RobOsageTestDw::Node::Hinge::ZMinCallback(dw::Widget* data) {
dw::Slider* slider = dynamic_cast<dw::Slider*>(data);
if (slider) {
rob_chara_item_equip_object* skin_disp = rob_osage_test->get_skin_disp();
RobSkinDisp* skin_disp = rob_osage_test->get_skin_work();
ExOsageBlock* osg = rob_osage_test->get_osage_block(skin_disp);
if (osg) {
float_t value = slider->GetValue() * DEG_TO_RAD_FLOAT;
@@ -2366,7 +2366,7 @@ void RobOsageTestDw::Node::Hinge::ZMinCallback(dw::Widget* data) {
void RobOsageTestDw::Node::Hinge::ZMaxCallback(dw::Widget* data) {
dw::Slider* slider = dynamic_cast<dw::Slider*>(data);
if (slider) {
rob_chara_item_equip_object* skin_disp = rob_osage_test->get_skin_disp();
RobSkinDisp* skin_disp = rob_osage_test->get_skin_work();
ExOsageBlock* osg = rob_osage_test->get_osage_block(skin_disp);
if (osg) {
float_t value = slider->GetValue() * DEG_TO_RAD_FLOAT;
@@ -2425,7 +2425,7 @@ void RobOsageTestDw::Node::InertialCancel::Update(bool value) {
void RobOsageTestDw::Node::InertialCancel::Callback(dw::Widget* data) {
dw::Slider* slider = dynamic_cast<dw::Slider*>(data);
if (slider) {
rob_chara_item_equip_object* skin_disp = rob_osage_test->get_skin_disp();
RobSkinDisp* skin_disp = rob_osage_test->get_skin_work();
ExOsageBlock* osg = rob_osage_test->get_osage_block(skin_disp);
if (osg) {
float_t value = slider->GetValue();
@@ -2484,7 +2484,7 @@ void RobOsageTestDw::Node::Weight::Update(bool value) {
void RobOsageTestDw::Node::Weight::Callback(dw::Widget* data) {
dw::Slider* slider = dynamic_cast<dw::Slider*>(data);
if (slider) {
rob_chara_item_equip_object* skin_disp = rob_osage_test->get_skin_disp();
RobSkinDisp* skin_disp = rob_osage_test->get_skin_work();
ExOsageBlock* osg = rob_osage_test->get_osage_block(skin_disp);
if (osg) {
float_t value = slider->GetValue();
@@ -2569,7 +2569,7 @@ void RobOsageTestDw::Collision::Update() {
data_struct* aft_data = &data_list[DATA_AFT];
bone_database* aft_bone_data = &aft_data->data_ft.bone_data;
const std::vector<std::string>* object_bones = aft_bone_data->get_bone_name(BONE_KIND_CMN);
const std::vector<std::string>* bone_name_table = aft_bone_data->get_bone_name_table(BONE_KIND_CMN);
char buf[0x200];
int32_t index = 0;
@@ -2585,7 +2585,7 @@ void RobOsageTestDw::Collision::Update() {
case SkinParam::CollisionTypeEllipse:
case SkinParam::CollisionTypeAABB:
sprintf_s(buf, sizeof(buf), "%d %s/%s", index,
collision_type_name_list[i.type], object_bones->data()[i.node_idx[0]].c_str());
collision_type_name_list[i.type], bone_name_table->data()[i.node_idx[0]].c_str());
break;
default:
sprintf_s(buf, sizeof(buf), "%d", index);
@@ -2690,11 +2690,11 @@ void RobOsageTestDw::ColliElement::Init(dw::Composite* parent) {
data_struct* aft_data = &data_list[DATA_AFT];
bone_database* aft_bone_data = &aft_data->data_ft.bone_data;
const std::vector<std::string>* object_bones = aft_bone_data->get_bone_name(BONE_KIND_CMN);
const std::vector<std::string>* bone_name_table = aft_bone_data->get_bone_name_table(BONE_KIND_CMN);
bone0_list_box = new dw::ListBox(group);
bone0_list_box->SetMaxItems(20);
for (const std::string& i : *object_bones)
for (const std::string& i : *bone_name_table)
bone0_list_box->AddItem(i);
bone0_list_box->callback_data.i32 = 0;
bone0_list_box->AddSelectionListener(new dw::SelectionListenerOnHook(
@@ -2726,7 +2726,7 @@ void RobOsageTestDw::ColliElement::Init(dw::Composite* parent) {
bone1_list_box = new dw::ListBox(group);
bone1_list_box->SetMaxItems(20);
for (const std::string& i : *object_bones)
for (const std::string& i : *bone_name_table)
bone1_list_box->AddItem(i);
bone1_list_box->callback_data.i32 = 1;
bone1_list_box->AddSelectionListener(new dw::SelectionListenerOnHook(
+9 -9
View File
@@ -70,8 +70,8 @@ public:
bool coli;
bool line;
int32_t chara_id;
int32_t load_chara_id;
ROB_ID rob_id;
ROB_ID rob_id_load;
CHARA_NUM chara_num;
int32_t cos_id;
ROB_PARTS_KIND rpk;
@@ -107,17 +107,17 @@ public:
void disp_line();
void disp_line_cls_param(const mat4& transform, const vec3& pos);
ExClothBlock* get_cloth_block(rob_chara_item_equip_object* skin_disp) const;
ExClothBlock* get_cloth_block(RobSkinDisp* skin_disp) const;
std::vector<SkinParam::CollisionParam>* get_cls_list(ExNodeBlock* cls) const;
SkinParam::CollisionParam* get_cls_param(std::vector<SkinParam::CollisionParam>* cls_list) const;
rob_chara_item_equip_object* get_skin_disp() const;
ExNodeBlock* get_node_block(rob_chara_item_equip_object* skin_disp) const;
ExOsageBlock* get_osage_block(rob_chara_item_equip_object* skin_disp) const;
RobSkinDisp* get_skin_work() const;
ExNodeBlock* get_node_block(RobSkinDisp* skin_disp) const;
ExOsageBlock* get_osage_block(RobSkinDisp* skin_disp) const;
void set_node(skin_param_osage_node* skp_osg_node);
void set_root(skin_param* skp);
inline std::vector<SkinParam::CollisionParam>* get_cls_list() const {
rob_chara_item_equip_object* skin_disp = get_skin_disp();
RobSkinDisp* skin_disp = get_skin_work();
if (!skin_disp)
return 0;
@@ -129,7 +129,7 @@ public:
}
inline skin_param* get_skin_param() const {
rob_chara_item_equip_object* skin_disp = get_skin_disp();
RobSkinDisp* skin_disp = get_skin_work();
ExNodeBlock* ex_node = get_node_block(skin_disp);
if (!ex_node)
return 0;
@@ -142,7 +142,7 @@ public:
}
inline skin_param_osage_node* get_skin_param_osage_node() const {
rob_chara_item_equip_object* skin_disp = get_skin_disp();
RobSkinDisp* skin_disp = get_skin_work();
ExOsageBlock* osg = get_osage_block(skin_disp);
if (osg && osg->osage_work.joint_node_vec.size() > 1)
return &osg->osage_work.joint_node_vec.data()[1].data_ptr->skp_osg_node;
+3 -2
View File
@@ -5,6 +5,7 @@
#include "auth_3d.hpp"
#include "../../KKdLib/database/item_table.hpp"
#include "../../CRE/rob/rob.hpp"
#include "../../CRE/auth_3d.hpp"
#include "../imgui_helper.hpp"
#include "../task_window.hpp"
@@ -155,8 +156,8 @@ void DataViewAuth3D::window() {
tree_node_flags = tree_node_base_flags;
tree_node_flags |= ImGuiTreeNodeFlags_DefaultOpen;
if (auth->chara_id != -1)
ImGui::Text("Chara: %d", auth->chara_id);
if (auth->rob_id != ROB_ID_NULL)
ImGui::Text("Chara: %d", auth->rob_id + 1);
else
ImGui::Text("Chara: None");
+69 -69
View File
@@ -49,8 +49,8 @@ public:
bool set;
int32_t color_change_index;
std::vector<texture*> textures;
std::vector<color_tone> color_tones;
color_tone color_tone_temp;
std::vector<ImgfColorToneParam> color_tones;
ImgfColorToneParam color_tone_temp;
bool show;
bool auto_resize;
CHARA_NUM chara_num;
@@ -65,11 +65,11 @@ public:
virtual void Hide() override;
texture* GetChgTex();
color_tone* GetColorTone();
void GetColorToneDefault(color_tone& value);
const item_table_item* GetItem(int32_t item_index);
ImgfColorToneParam* GetColorTone();
void GetColorToneDefault(ImgfColorToneParam& value);
const RobItemTable* GetItem(int32_t item_index);
void GetItemColTone();
const item_table_item_data* GetItemData(int32_t item_index);
const RobItemData* GetItemData(int32_t item_index);
int32_t GetItemNo(int32_t item_index);
const char* GetItemTexChangeName();
texture* GetOrgTex();
@@ -136,7 +136,7 @@ ColorChangeDw::ColorChangeDw() {
obj_set_id = aft_obj_db->get_object_set_id(0u);
color_change_index = 0;
color_tone col_tone;
ImgfColorToneParam col_tone;
GetColorToneDefault(col_tone);
color_tone_temp = col_tone;
@@ -259,7 +259,7 @@ ColorChangeDw::ColorChangeDw() {
blend_r = dw::Slider::Create(color_group, (dw::Flags)(dw::FLAG_800 | dw::HORIZONTAL),
0.0f, 0.0f, 100.0f, glyph_height, "BLEND R");
blend_r->SetParams(col_tone.blend.x, 0.0f, 5.0f, 0.4f, 0.01f, 0.1f);
blend_r->SetParams(col_tone.blend_color.x, 0.0f, 5.0f, 0.4f, 0.01f, 0.1f);
blend_r->format = "%4.2f";
blend_r->AddSelectionListener(new dw::SelectionListenerOnHook(
(dw::SelectionListenerOnHook::CallbackFunc)ColorChangeDw::BlendRCallback));
@@ -267,7 +267,7 @@ ColorChangeDw::ColorChangeDw() {
blend_g = dw::Slider::Create(color_group, (dw::Flags)(dw::FLAG_800 | dw::HORIZONTAL),
0.0f, 0.0f, 100.0f, glyph_height, "BLEND G");
blend_g->SetParams(col_tone.blend.y, 0.0f, 5.0f, 0.4f, 0.01f, 0.1f);
blend_g->SetParams(col_tone.blend_color.y, 0.0f, 5.0f, 0.4f, 0.01f, 0.1f);
blend_g->format = "%4.2f";
blend_g->AddSelectionListener(new dw::SelectionListenerOnHook(
(dw::SelectionListenerOnHook::CallbackFunc)ColorChangeDw::BlendGCallback));
@@ -275,7 +275,7 @@ ColorChangeDw::ColorChangeDw() {
blend_b = dw::Slider::Create(color_group, (dw::Flags)(dw::FLAG_800 | dw::HORIZONTAL),
0.0f, 0.0f, 100.0f, glyph_height, "BLEND B");
blend_b->SetParams(col_tone.blend.z, 0.0f, 5.0f, 0.4f, 0.01f, 0.1f);
blend_b->SetParams(col_tone.blend_color.z, 0.0f, 5.0f, 0.4f, 0.01f, 0.1f);
blend_b->format = "%4.2f";
blend_b->AddSelectionListener(new dw::SelectionListenerOnHook(
(dw::SelectionListenerOnHook::CallbackFunc)ColorChangeDw::BlendBCallback));
@@ -283,7 +283,7 @@ ColorChangeDw::ColorChangeDw() {
offset_r = dw::Slider::Create(color_group, (dw::Flags)(dw::FLAG_800 | dw::HORIZONTAL),
0.0f, 0.0f, 100.0f, glyph_height, "OFFSET R");
offset_r->SetParams(col_tone.offset.x, -1.0f, 1.0f, 0.4f, 0.01f, 0.1f);
offset_r->SetParams(col_tone.offset_color.x, -1.0f, 1.0f, 0.4f, 0.01f, 0.1f);
offset_r->format = "%4.2f";
offset_r->AddSelectionListener(new dw::SelectionListenerOnHook(
(dw::SelectionListenerOnHook::CallbackFunc)ColorChangeDw::OffsetRCallback));
@@ -291,7 +291,7 @@ ColorChangeDw::ColorChangeDw() {
offset_g = dw::Slider::Create(color_group, (dw::Flags)(dw::FLAG_800 | dw::HORIZONTAL),
0.0f, 0.0f, 100.0f, glyph_height, "OFFSET G");
offset_g->SetParams(col_tone.offset.y, -1.0f, 1.0f, 0.4f, 0.01f, 0.1f);
offset_g->SetParams(col_tone.offset_color.y, -1.0f, 1.0f, 0.4f, 0.01f, 0.1f);
offset_g->format = "%4.2f";
offset_g->AddSelectionListener(new dw::SelectionListenerOnHook(
(dw::SelectionListenerOnHook::CallbackFunc)ColorChangeDw::OffsetGCallback));
@@ -299,7 +299,7 @@ ColorChangeDw::ColorChangeDw() {
offset_b = dw::Slider::Create(color_group, (dw::Flags)(dw::FLAG_800 | dw::HORIZONTAL),
0.0f, 0.0f, 100.0f, glyph_height, "OFFSET B");
offset_b->SetParams(col_tone.offset.z, -1.0f, 1.0f, 0.4f, 0.01f, 0.1f);
offset_b->SetParams(col_tone.offset_color.z, -1.0f, 1.0f, 0.4f, 0.01f, 0.1f);
offset_b->format = "%4.2f";
offset_b->AddSelectionListener(new dw::SelectionListenerOnHook(
(dw::SelectionListenerOnHook::CallbackFunc)ColorChangeDw::OffsetBCallback));
@@ -371,7 +371,7 @@ void ColorChangeDw::Draw() {
const texture* org_tex = GetOrgTex();
const texture* chg_tex = GetChgTex();
const color_tone* col_tone = GetColorTone();
const ImgfColorToneParam* col_tone = GetColorTone();
if (org_tex && chg_tex && col_tone)
texture_apply_color_tone(org_tex, chg_tex, col_tone);
@@ -419,34 +419,34 @@ texture* ColorChangeDw::GetChgTex() {
return 0;
}
color_tone* ColorChangeDw::GetColorTone() {
ImgfColorToneParam* ColorChangeDw::GetColorTone() {
if (color_change_index < color_tones.size())
return &color_tones.data()[color_change_index];
return 0;
}
void ColorChangeDw::GetColorToneDefault(color_tone& value) {
value = color_tone();
void ColorChangeDw::GetColorToneDefault(ImgfColorToneParam& value) {
value = ImgfColorToneParam();
}
const item_table_item* ColorChangeDw::GetItem(int32_t item_index) {
int32_t item_no = GetItemNo(item_index);
const RobItemTable* ColorChangeDw::GetItem(int32_t item_index) {
uint32_t item_no = GetItemNo(item_index);
if (item_no != -1)
return item_table_handler_array_get_item(chara_num, item_no);
return get_rob_item_table(chara_num, item_no);
return 0;
}
void ColorChangeDw::GetItemColTone() {
color_tone* col_tone = GetColorTone();
ImgfColorToneParam* col_tone = GetColorTone();
if (col_tone) {
const item_table_item* item = GetItem(item_index);
const RobItemTable* item = GetItem(item_index);
if (item && item_texture_index < item->data.col.size())
*col_tone = item->data.col.data()[item_texture_index].col_tone;
*col_tone = item->data.col.data()[item_texture_index].color;
}
}
const item_table_item_data* ColorChangeDw::GetItemData(int32_t item_index) {
const item_table_item* item = GetItem(item_index);
const RobItemData* ColorChangeDw::GetItemData(int32_t item_index) {
const RobItemTable* item = GetItem(item_index);
if (item)
return &item->data;
return 0;
@@ -454,10 +454,10 @@ const item_table_item_data* ColorChangeDw::GetItemData(int32_t item_index) {
int32_t ColorChangeDw::GetItemNo(int32_t item_index) {
int32_t index = 0;
const item_table* item = item_table_handler_array_get_table(chara_num);
if (item)
for (auto& i : item->item)
if (i.second.attr & 0x68) {
const RobItemHeader* tbl = get_rob_item_header(chara_num);
if (tbl)
for (auto& i : tbl->table)
if (i.second.attr & (ROB_ITEM_ATTR_HADA | ROB_ITEM_ATTR_NUDE | ROB_ITEM_ATTR_COL)) {
if (item_index == index)
return 0;
index++;
@@ -470,11 +470,11 @@ const char* ColorChangeDw::GetItemTexChangeName() {
texture_database* aft_tex_db = &aft_data->data_ft.tex_db;
std::string item = item_texture_names->GetItemStr(item_texture_index);
const item_table_item_data* itm_data = GetItemData(item_index);
const RobItemData* itm_data = GetItemData(item_index);
if (itm_data)
for (const item_table_item_data_tex& i : itm_data->tex)
if (!item.compare(aft_tex_db->get_texture_name(i.org)))
return aft_tex_db->get_texture_name(i.chg);
for (const RobItemDataTex& i : itm_data->tex)
if (!item.compare(aft_tex_db->get_texture_name(i.org_uid)))
return aft_tex_db->get_texture_name(i.chg_uid);
return 0;
}
@@ -486,15 +486,15 @@ texture* ColorChangeDw::GetOrgTex() {
}
void ColorChangeDw::GetSetColorTone() {
color_tone* col_tone = GetColorTone();
ImgfColorToneParam* col_tone = GetColorTone();
if (col_tone) {
inverse->SetValue(col_tone->inverse);
blend_r->SetValue(col_tone->blend.x);
blend_g->SetValue(col_tone->blend.y);
blend_b->SetValue(col_tone->blend.z);
offset_r->SetValue(col_tone->offset.x);
offset_g->SetValue(col_tone->offset.y);
offset_b->SetValue(col_tone->offset.z);
blend_r->SetValue(col_tone->blend_color.x);
blend_g->SetValue(col_tone->blend_color.y);
blend_b->SetValue(col_tone->blend_color.z);
offset_r->SetValue(col_tone->offset_color.x);
offset_g->SetValue(col_tone->offset_color.y);
offset_b->SetValue(col_tone->offset_color.z);
hue->SetValue(col_tone->hue);
saturation->SetValue(col_tone->saturation);
value->SetValue(col_tone->value);
@@ -528,7 +528,7 @@ bool ColorChangeDw::LoadColorTone() {
if (!textures.size())
return false;
color_tone col_tone;
ImgfColorToneParam col_tone;
ColorChangeDw::GetColorToneDefault(col_tone);
for (texture*& i : textures)
color_tones.push_back(col_tone);
@@ -634,12 +634,12 @@ void ColorChangeDw::UpdateItemTextureNames() {
return;
item_texture_names->ClearItems();
const item_table_item_data* itm_data = GetItemData(item_index);
const RobItemData* itm_data = GetItemData(item_index);
if (!itm_data)
return;
for (const item_table_item_data_col& i : itm_data->col) {
const char* name = aft_tex_db->get_texture_name(i.tex_id);
for (const RobItemDataCol& i : itm_data->col) {
const char* name = aft_tex_db->get_texture_name(i.tex_uid);
if (name)
item_texture_names->AddItem(name);
}
@@ -681,49 +681,49 @@ void ColorChangeDw::AutoResizeCallback(dw::Button* data) {
void ColorChangeDw::BlendBCallback(dw::Slider* data) {
ColorChangeDw* color_change_dw = (ColorChangeDw*)data->callback_data.v64;
color_tone* col_tone = color_change_dw->GetColorTone();
ImgfColorToneParam* col_tone = color_change_dw->GetColorTone();
if (col_tone)
col_tone->blend.z = data->GetValue();
col_tone->blend_color.z = data->GetValue();
}
void ColorChangeDw::BlendGCallback(dw::Slider* data) {
ColorChangeDw* color_change_dw = (ColorChangeDw*)data->callback_data.v64;
color_tone* col_tone = color_change_dw->GetColorTone();
ImgfColorToneParam* col_tone = color_change_dw->GetColorTone();
if (col_tone)
col_tone->blend.y = data->GetValue();
col_tone->blend_color.y = data->GetValue();
}
void ColorChangeDw::BlendRCallback(dw::Slider* data) {
ColorChangeDw* color_change_dw = (ColorChangeDw*)data->callback_data.v64;
color_tone* col_tone = color_change_dw->GetColorTone();
ImgfColorToneParam* col_tone = color_change_dw->GetColorTone();
if (col_tone)
col_tone->blend.x = data->GetValue();
col_tone->blend_color.x = data->GetValue();
}
void ColorChangeDw::ContrastCallback(dw::Slider* data) {
ColorChangeDw* color_change_dw = (ColorChangeDw*)data->callback_data.v64;
color_tone* col_tone = color_change_dw->GetColorTone();
ImgfColorToneParam* col_tone = color_change_dw->GetColorTone();
if (col_tone)
col_tone->contrast = data->GetValue();
}
void ColorChangeDw::CopyCallback(dw::Button* data) {
ColorChangeDw* color_change_dw = (ColorChangeDw*)data->callback_data.v64;
color_tone* col_tone = color_change_dw->GetColorTone();
ImgfColorToneParam* col_tone = color_change_dw->GetColorTone();
if (col_tone)
color_change_dw->color_tone_temp = *col_tone;
}
void ColorChangeDw::HueCallback(dw::Slider* data) {
ColorChangeDw* color_change_dw = (ColorChangeDw*)data->callback_data.v64;
color_tone* col_tone = color_change_dw->GetColorTone();
ImgfColorToneParam* col_tone = color_change_dw->GetColorTone();
if (col_tone)
col_tone->hue = data->GetValue();
}
void ColorChangeDw::InverseCallback(dw::Button* data) {
ColorChangeDw* color_change_dw = (ColorChangeDw*)data->callback_data.v64;
color_tone* col_tone = color_change_dw->GetColorTone();
ImgfColorToneParam* col_tone = color_change_dw->GetColorTone();
if (col_tone)
col_tone->inverse = data->value;
}
@@ -736,7 +736,7 @@ void ColorChangeDw::ItemCallback(dw::ListBox* data) {
ColorChangeDw* color_change_dw = (ColorChangeDw*)data->callback_data.v64;
color_change_dw->item_index = index;
const item_table_item* item = color_change_dw->GetItem(index);
const RobItemTable* item = color_change_dw->GetItem(index);
if (!item) {
color_change_dw->UpdateItemTextureNames();
return;
@@ -746,8 +746,8 @@ void ColorChangeDw::ItemCallback(dw::ListBox* data) {
for (const uint32_t& i : item->objset)
name = aft_obj_db->get_object_set_name(i);
if (item->attr & 0x40)
name = aft_obj_db->get_object_set_name(get_rob_data(color_change_dw->chara_num)->object_set);
if (item->attr & ROB_ITEM_ATTR_HADA)
name = aft_obj_db->get_object_set_name(get_rob_data(color_change_dw->chara_num)->objset);
if (name) {
color_change_dw->SetObjectSet(name);
@@ -765,7 +765,7 @@ void ColorChangeDw::ItemTextureCallback(dw::ListBox* data) {
ColorChangeDw* color_change_dw = (ColorChangeDw*)data->callback_data.v64;
color_change_dw->item_texture_index = data->list->selected_item;
const item_table_item* item = color_change_dw->GetItem(color_change_dw->item_index);
const RobItemTable* item = color_change_dw->GetItem(color_change_dw->item_index);
if (!item)
return;
@@ -773,7 +773,7 @@ void ColorChangeDw::ItemTextureCallback(dw::ListBox* data) {
if (!size || color_change_dw->item_texture_index >= size)
return;
if (item->attr & 0x04) {
if (item->attr & ROB_ITEM_ATTR_TEX) {
const char* name = color_change_dw->GetItemTexChangeName();
if (name)
color_change_dw->SetTextureName(name);
@@ -803,23 +803,23 @@ void ColorChangeDw::ObjectSetCallback(dw::ListBox* data) {
void ColorChangeDw::OffsetBCallback(dw::Slider* data) {
ColorChangeDw* color_change_dw = (ColorChangeDw*)data->callback_data.v64;
color_tone* col_tone = color_change_dw->GetColorTone();
ImgfColorToneParam* col_tone = color_change_dw->GetColorTone();
if (col_tone)
col_tone->offset.z = data->GetValue();
col_tone->offset_color.z = data->GetValue();
}
void ColorChangeDw::OffsetGCallback(dw::Slider* data) {
ColorChangeDw* color_change_dw = (ColorChangeDw*)data->callback_data.v64;
color_tone* col_tone = color_change_dw->GetColorTone();
ImgfColorToneParam* col_tone = color_change_dw->GetColorTone();
if (col_tone)
col_tone->offset.y = data->GetValue();
col_tone->offset_color.y = data->GetValue();
}
void ColorChangeDw::OffsetRCallback(dw::Slider* data) {
ColorChangeDw* color_change_dw = (ColorChangeDw*)data->callback_data.v64;
color_tone* col_tone = color_change_dw->GetColorTone();
ImgfColorToneParam* col_tone = color_change_dw->GetColorTone();
if (col_tone)
col_tone->offset.x = data->GetValue();
col_tone->offset_color.x = data->GetValue();
}
void ColorChangeDw::OverwriteCallback(dw::Button* data) {
@@ -828,21 +828,21 @@ void ColorChangeDw::OverwriteCallback(dw::Button* data) {
void ColorChangeDw::PasteCallback(dw::Button* data) {
ColorChangeDw* color_change_dw = (ColorChangeDw*)data->callback_data.v64;
color_tone* col_tone = color_change_dw->GetColorTone();
ImgfColorToneParam* col_tone = color_change_dw->GetColorTone();
if (col_tone)
*col_tone = color_change_dw->color_tone_temp;
}
void ColorChangeDw::ResetCallback(dw::Button* data) {
ColorChangeDw* color_change_dw = (ColorChangeDw*)data->callback_data.v64;
color_tone* col_tone = color_change_dw->GetColorTone();
ImgfColorToneParam* col_tone = color_change_dw->GetColorTone();
if (col_tone)
color_change_dw->GetColorToneDefault(*col_tone);
}
void ColorChangeDw::SaturationCallback(dw::Slider* data) {
ColorChangeDw* color_change_dw = (ColorChangeDw*)data->callback_data.v64;
color_tone* col_tone = color_change_dw->GetColorTone();
ImgfColorToneParam* col_tone = color_change_dw->GetColorTone();
if (col_tone)
col_tone->saturation = data->GetValue();
}
@@ -866,7 +866,7 @@ void ColorChangeDw::TextureCallback(dw::ListBox* data) {
void ColorChangeDw::ValueCallback(dw::Slider* data) {
ColorChangeDw* color_change_dw = (ColorChangeDw*)data->callback_data.v64;
color_tone* col_tone = color_change_dw->GetColorTone();
ImgfColorToneParam* col_tone = color_change_dw->GetColorTone();
if (col_tone)
col_tone->value = data->GetValue();
}
+182 -206
View File
@@ -118,7 +118,7 @@ struct pv_game_se_data {
struct struc_674 {
size_t performer;
int32_t module;
rob_chara_pv_data_item item;
RobItemEquipInit item;
bool field_1C;
const pv_db_pv* pv;
@@ -172,14 +172,14 @@ static void pv_game_time_pause();
static void pv_game_time_start();
static FrameRateControl* get_diva_pv_frame_rate();
static SysFrameRate* sys_frame_rate_get(int32_t chara_id);
static SysFrameRate* sys_frame_rate_get(int32_t id);
static int32_t sub_1400FCFD0(pv_game_chara* arr, const pv_db_pv* pv);
static void sub_140105010(pv_game_chara* arr, size_t max_count, pv_game_item_mask* a3, struc_674& a4);
static bool sub_1401279D0();
static bool sub_140128480();
pv_game_chara::pv_game_chara() : chara_num(), cos(), chara_id(), pv_data(), rob_chr() {
pv_game_chara::pv_game_chara() : chara_num(), cos(), rob_id(), rob_chr() {
}
@@ -188,16 +188,16 @@ pv_game_chara::~pv_game_chara() {
}
bool pv_game_chara::check_chara() {
if (chara_id != -1)
if (rob_id != ROB_ID_NULL)
return !!rob_chr;
return false;
}
void pv_game_chara::reset() {
void pv_game_chara::init() {
chara_num = CN_MAX;
cos = -1;
chara_id = -1;
pv_data.reset();
rob_id = ROB_ID_NULL;
rob_init.init();
rob_chr = 0;
motion_ids.clear();
motion_face_ids.clear();
@@ -385,12 +385,12 @@ void pv_game_data::reset() {
for (pv_play_data& i : pv_data.playdata) {
rob_chara* rob_chr = i.rob_chr;
if (rob_chr) {
rob_chr->reset_data(&rob_chr->pv_data, aft_bone_data, aft_mot_db);
rob_chr->set_hand_l_mottbl_motion(0, 194, 1.0f, ROB_PARTIAL_MOTION_PLAYBACK_STOP,
rob_chr->reset_rob(rob_chr->rob_init, aft_bone_data, aft_mot_db);
rob_chr->set_hand_l_mottbl_motion(0, MTP_HAND_NORMAL, 1.0f, ROB_PARTIAL_MOTION_PLAYBACK_STOP,
0.0f, 0.0f, 1.0f, ROB_PARTIAL_MOTION_LOOP_NONE, 0.0f, aft_mot_db);
rob_chr->set_hand_r_mottbl_motion(0, 194, 1.0f, ROB_PARTIAL_MOTION_PLAYBACK_STOP,
rob_chr->set_hand_r_mottbl_motion(0, MTP_HAND_NORMAL, 1.0f, ROB_PARTIAL_MOTION_PLAYBACK_STOP,
0.0f, 0.0f, 1.0f, ROB_PARTIAL_MOTION_LOOP_NONE, 0.0f, aft_mot_db);
rob_chr->set_visibility(true);
rob_chr->set_disp_flag(true);
}
i.motion_data.start_pos = 0.0f;
@@ -1946,11 +1946,10 @@ void pv_game::edit_instrument_reset() {
j.set_enable(false);
}
void pv_game::edit_instrument_set_disp(int32_t chara_id, bool value) {
pv_game_edit_instrument& v4 = data.edit_instrument[chara_id];
int32_t v5 = v4.index;
if (v5 >= 0 && v4.auth_3d_ids.size()) {
auth_3d_id& id = v4.auth_3d_ids[v5];
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);
}
@@ -2172,9 +2171,9 @@ uint32_t pv_game::get_chreff_auth_3d_object_set(int32_t& uid) {
return obj_set;
}
int64_t pv_game::get_data_itmpv_time(int32_t chara_id, int32_t index) {
auto elem = data.itmpv[chara_id].find(index);
if (elem != data.itmpv[chara_id].end())
int64_t pv_game::get_data_itmpv_time(int32_t rob_id, int32_t index) {
auto elem = data.itmpv[rob_id].find(index);
if (elem != data.itmpv[rob_id].end())
return elem->second.second;
return -1;
}
@@ -2604,9 +2603,9 @@ bool pv_game::load() {
for (int32_t i = 0; i < ROB_ID_MAX; i++) {
pv_game_chara& j = data.chara[i];
j.reset();
j.pv_data.field_4 = false;
j.pv_data.field_70 = player_data->field_66C;
j.init();
j.rob_init.disp = false;
j.rob_init.field_70 = player_data->field_66C;
struc_674 v750;
v750.performer = i;
@@ -2618,25 +2617,25 @@ bool pv_game::load() {
sub_140105010(data.chara, ROB_ID_MAX, items_mask, v750);
if (data.height_adjust)
j.pv_data.height_adjust = true;
j.rob_init.height_adjust = true;
pv_performer_size size = data.pv ? data.pv->get_performer_size(i) : PV_PERFORMER_NORMAL;
switch (size) {
case PV_PERFORMER_NORMAL:
default:
j.pv_data.chara_size_index = 1;
j.rob_init.chara_size_index = 1;
break;
case PV_PERFORMER_PLAY_CHARA:
j.pv_data.chara_size_index = rob_data_get_chara_size_index(j.chara_num);
j.rob_init.chara_size_index = rob_data_get_chara_size_index(j.chara_num);
break;
case PV_PERFORMER_PV_CHARA:
j.pv_data.chara_size_index = rob_data_get_chara_size_index(data.pv->get_performer_chara(i));
j.rob_init.chara_size_index = rob_data_get_chara_size_index(data.pv->get_performer_chara(i));
break;
case PV_PERFORMER_SHORT:
j.pv_data.chara_size_index = 2;
j.rob_init.chara_size_index = 2;
break;
case PV_PERFORMER_TALL:
j.pv_data.chara_size_index = 0;
j.rob_init.chara_size_index = 0;
break;
}
@@ -2673,90 +2672,80 @@ bool pv_game::load() {
if (sub_14013C8C0()->sub_1400E7910() >= 4) {
state = 12;
for (pv_game_chara& i : data.chara) {
if (!i.motion_ids.size())
continue;
i.chara_id = rob_chara_array_init_chara_num(i.chara_num, i.pv_data, i.cos, true);
if (i.chara_id != -1)
i.rob_chr = rob_chara_array_get(i.chara_id);
}
if (data.pv->get_performer_count() < 2)
rctx_ptr->render.update_res(false, 1);
else
rctx_ptr->render.update_res(false, 2);
rctx_ptr->render_manager->set_effect_texture(0);
state = 12;
return false;
}
else {
data.motion_set_ids.clear();
data.motion_set_face_ids.clear();
data.motion_set_ids.clear();
data.motion_set_face_ids.clear();
if (diff) {
for (int32_t i = 0; i < ROB_ID_MAX; i++) {
pv_game_chara& chr = data.chara[i];
data.motion_set_ids.reserve(diff->motion[i].size());
data.motion_set_face_ids.reserve(diff->motion[i].size());
if (diff) {
for (int32_t i = 0; i < ROB_ID_MAX; i++) {
pv_game_chara& chr = data.chara[i];
data.motion_set_ids.reserve(diff->motion[i].size());
data.motion_set_face_ids.reserve(diff->motion[i].size());
int32_t face_mot_index = 0;
for (const pv_db_pv_motion& j : diff->motion[i]) {
if (j.index < 0)
continue;
int32_t motion_face_id_index = 0;
for (const pv_db_pv_motion& j : diff->motion[i]) {
if (j.index < 0)
continue;
uint32_t motnum = j.id;
if (data.pv)
motnum = data.pv->get_chrmot_motion_id(i, chr.chara_num, j);
uint32_t motion_id = j.id;
if (data.pv)
motion_id = data.pv->get_chrmot_motion_id(i, chr.chara_num, j);
uint32_t motion_set_id = aft_mot_db->get_motion_set_id_by_motion_id(motnum);
if (motion_set_id != -1) {
if (!prj::find(chr.motion_ids, motnum))
chr.motion_ids.push_back(motnum);
if (!prj::find(data.motion_set_ids, motion_set_id))
data.motion_set_ids.push_back(motion_set_id);
}
uint32_t motion_set_id = aft_mot_db->get_motion_set_id_by_motion_id(motion_id);
if (motion_set_id != -1) {
if (!prj::find(chr.motion_ids, motion_id))
chr.motion_ids.push_back(motion_id);
if (!prj::find(data.motion_set_ids, motion_set_id))
data.motion_set_ids.push_back(motion_set_id);
}
if (j.index <= 0)
continue;
if (j.index <= 0)
continue;
std::string motion_face_name;
motion_face_name.assign(get_chara_name_face_mot(chr.chara_num));
motion_face_name.append("_FACE_");
motion_face_name.append(j.name);
std::string motion_face_name;
motion_face_name.assign(get_chara_name_face_mot(chr.chara_num));
motion_face_name.append("_FACE_");
motion_face_name.append(j.name);
uint32_t motion_face_id = aft_mot_db->get_motion_id(motion_face_name.c_str());
if (face_mot_index < 10)
chr.rob_init.face_mot_slot[face_mot_index++] = motion_face_id;
uint32_t motion_face_id = aft_mot_db->get_motion_id(motion_face_name.c_str());
if (motion_face_id_index < 10)
chr.pv_data.motion_face_ids[motion_face_id_index++] = motion_face_id;
uint32_t motion_face_set_id = aft_mot_db->get_motion_set_id_by_motion_id(motion_face_id);
if (motion_face_set_id != -1 && motion_face_set_id != 2) {
if (!prj::find(chr.motion_face_ids, motion_face_id))
chr.motion_face_ids.push_back(motion_face_id);
if (!prj::find(data.motion_set_face_ids, motion_face_set_id))
data.motion_set_face_ids.push_back(motion_face_set_id);
uint32_t motion_face_set_id = aft_mot_db->get_motion_set_id_by_motion_id(motion_face_id);
if (motion_face_set_id != -1 && motion_face_set_id != 2) {
if (!prj::find(chr.motion_face_ids, motion_face_id))
chr.motion_face_ids.push_back(motion_face_id);
if (!prj::find(data.motion_set_face_ids, motion_face_set_id))
data.motion_set_face_ids.push_back(motion_face_set_id);
}
}
}
}
for (uint32_t& i : data.motion_set_ids) {
motion_set_load_motion(i, std::string(data.pv->mdata.dir), aft_mot_db);
motion_set_load_mothead(i, std::string(data.pv->mdata.dir), aft_mot_db);
}
for (uint32_t& i : data.motion_set_face_ids)
motion_set_load_motion(i, std::string(data.pv->mdata.dir), aft_mot_db);
if (data.pv->pv_expression_file_name.size())
pv_expression_file_load(aft_data, data.pv->pv_expression_file_name.c_str());
state = 3;
}
for (uint32_t& i : data.motion_set_ids) {
motion_set_load_motion(i, std::string(data.pv->mdata.dir), aft_mot_db);
motion_set_load_mothead(i, std::string(data.pv->mdata.dir), aft_mot_db);
}
for (uint32_t& i : data.motion_set_face_ids)
motion_set_load_motion(i, std::string(data.pv->mdata.dir), aft_mot_db);
pv_expression_file_load(aft_data, data.pv->pv_expression_file_name.c_str());
for (pv_game_chara& i : data.chara) {
if (!i.motion_ids.size())
continue;
i.chara_id = rob_chara_array_init_chara_num(i.chara_num, i.pv_data, i.cos, true);
if (i.chara_id != -1)
i.rob_chr = rob_chara_array_get(i.chara_id);
RobManagement* rob_man = get_rob_management();
if (rob_man) {
i.rob_id = rob_man->create_rob(i.chara_num, i.rob_init, i.cos, true);
if (i.rob_id != ROB_ID_NULL)
i.rob_chr = rob_man->get_rob(i.rob_id);
}
}
if (data.pv->get_performer_count() < 2)
@@ -2764,7 +2753,6 @@ bool pv_game::load() {
else
rctx_ptr->render.update_res(false, 2);
rctx_ptr->render_manager->set_effect_texture(0);
state = 3;
} return false;
case 3: {
const pv_db_pv_difficulty* diff = get_pv_db_pv()->get_difficulty(
@@ -2886,9 +2874,9 @@ bool pv_game::load() {
bool has_chara = false;
for (pv_game_chara& i : data.chara)
if (i.chara_id != -1 && i.rob_chr) {
if (i.rob_id != ROB_ID_NULL && i.rob_chr) {
has_chara = true;
if (!task_rob_manager_check_chara_loaded(i.rob_chr->chara_id))
if (!task_rob_manager_check_chara_loaded(i.rob_id))
return false;
}
@@ -2897,13 +2885,13 @@ bool pv_game::load() {
for (int32_t i = 0; i < ROB_ID_MAX; i++) {
pv_game_chara& chr = data.chara[i];
if (chr.chara_id == -1 || !chr.rob_chr)
if (chr.rob_id == ROB_ID_NULL || !chr.rob_chr)
continue;
for (int32_t j = 0; j < PV_PERFORMER_ITEM_MAX; j++) {
int32_t item_no = data.pv->get_performer_item(i, (pv_performer_item)j);
uint32_t item_no = data.pv->get_performer_item(i, (pv_performer_item)j);
if (!item_no || item_no < 0 && !items_mask[i].arr[j])
chr.rob_chr->load_body_parts_object_info(
chr.rob_chr->set_item(
pv_performer_item_to_rob_parts_kind((pv_performer_item)j),
{}, aft_bone_data, aft_data, aft_obj_db);
}
@@ -2918,14 +2906,14 @@ bool pv_game::load() {
if (!data.use_osage_play_data)
for (pv_game_chara& i : data.chara) {
if (i.chara_id == -1 || !i.rob_chr)
if (i.rob_id == ROB_ID_NULL || !i.rob_chr)
continue;
pv_osage_manager_array_reset(i.chara_id);
const std::vector<pv_data_set_motion>* set_motion = data.pv_data.get_set_motion(i.chara_id);
pv_osage_manager_array_reset(i.rob_id);
const std::vector<pv_data_set_motion>* set_motion = data.pv_data.get_set_motion(i.rob_id);
if (set_motion)
pv_osage_manager_array_set_pv_set_motion(i.chara_id, *set_motion);
pv_osage_manager_array_set_pv_id(i.chara_id, data.pv->id, true);
pv_osage_manager_array_set_pv_set_motion(i.rob_id, *set_motion);
pv_osage_manager_array_set_pv_id(i.rob_id, data.pv->id, true);
}
state = 8;
} return false;
@@ -3603,7 +3591,7 @@ bool pv_game::load() {
data.play_data.ogg = true;
for (pv_game_chara& i : data.chara)
if (i.check_chara() && !task_rob_manager_check_chara_loaded(i.chara_id))
if (i.check_chara() && !task_rob_manager_check_chara_loaded(i.rob_id))
return false;
pv_game_music_get()->ogg_reset();
@@ -3680,9 +3668,9 @@ bool pv_game::load() {
for (pv_game_chara& i : data.chara)
if (i.check_chara()) {
i.rob_chr->set_hand_l_mottbl_motion(0, 194, 1.0f, ROB_PARTIAL_MOTION_PLAYBACK_STOP,
i.rob_chr->set_hand_l_mottbl_motion(0, MTP_HAND_NORMAL, 1.0f, ROB_PARTIAL_MOTION_PLAYBACK_STOP,
0.0f, 0.0f, 1.0f, ROB_PARTIAL_MOTION_LOOP_NONE, 0.0f, aft_mot_db);
i.rob_chr->set_hand_r_mottbl_motion(0, 194, 1.0f, ROB_PARTIAL_MOTION_PLAYBACK_STOP,
i.rob_chr->set_hand_r_mottbl_motion(0, MTP_HAND_NORMAL, 1.0f, ROB_PARTIAL_MOTION_PLAYBACK_STOP,
0.0f, 0.0f, 1.0f, ROB_PARTIAL_MOTION_LOOP_NONE, 0.0f, aft_mot_db);
}
@@ -3774,7 +3762,7 @@ bool pv_game::load() {
for (pv_game_chara& i : data.chara)
if (i.check_chara())
i.rob_chr->set_visibility(true);
i.rob_chr->set_disp_flag(true);
field_4 = false;
if (sub_14013C8C0()->sub_1400E7910() == 3)
@@ -3884,14 +3872,14 @@ bool pv_game::load() {
continue;
rob_chara* rob_chr = i.rob_chr;
rob_chr->set_visibility(true);
rob_chr->set_disp_flag(true);
if (rob_chr->check_for_ageageagain_module()) {
rob_chara_age_age_array_set_skip(rob_chr->chara_id, 1);
rob_chara_age_age_array_set_skip(rob_chr->chara_id, 2);
rob_chara_age_age_array_set_skip(rob_chr->idnm, 1);
rob_chara_age_age_array_set_skip(rob_chr->idnm, 2);
}
rob_chr->set_hand_l_mottbl_motion(0, 194, 1.0f, ROB_PARTIAL_MOTION_PLAYBACK_STOP,
rob_chr->set_hand_l_mottbl_motion(0, MTP_HAND_NORMAL, 1.0f, ROB_PARTIAL_MOTION_PLAYBACK_STOP,
0.0f, 0.0f, 1.0f, ROB_PARTIAL_MOTION_LOOP_NONE, 0.0f, aft_mot_db);
rob_chr->set_hand_r_mottbl_motion(0, 194, 1.0f, ROB_PARTIAL_MOTION_PLAYBACK_STOP,
rob_chr->set_hand_r_mottbl_motion(0, MTP_HAND_NORMAL, 1.0f, ROB_PARTIAL_MOTION_PLAYBACK_STOP,
0.0f, 0.0f, 1.0f, ROB_PARTIAL_MOTION_LOOP_NONE, 0.0f, aft_mot_db);
}
@@ -4050,15 +4038,8 @@ void pv_game::reset() {
data.field_2CFB0 = 0;
data.chance_point = 0;
for (pv_game_chara& i : data.chara) {
i.chara_num = CN_MAX;
i.cos = -1;
i.chara_id = -1;
i.pv_data = {};
i.rob_chr = 0;
i.motion_ids.clear();
i.motion_face_ids.clear();
}
for (pv_game_chara& i : data.chara)
i.init();
data.motion_set_ids.clear();
data.motion_set_face_ids.clear();
@@ -4388,7 +4369,7 @@ void pv_game::set_chara_use_opd(bool value) {
return;
for (pv_game_chara& i : data.chara)
if (i.chara_id != -1 && i.rob_chr)
if (i.rob_id != ROB_ID_NULL && i.rob_chr)
i.rob_chr->set_use_opd(value);
}
@@ -4414,9 +4395,9 @@ void pv_game::set_data_campv(int32_t type, int32_t index, float_t frame) {
}
}
void pv_game::set_data_itmpv(int32_t chara_id, int32_t index, bool enable, int64_t time) {
auto elem = data.itmpv[chara_id].find(index);
if (elem == data.itmpv[chara_id].end())
void pv_game::set_data_itmpv(int32_t rob_id, int32_t index, bool enable, int64_t time) {
auto elem = data.itmpv[rob_id].find(index);
if (elem == data.itmpv[rob_id].end())
return;
auth_3d_id& id = elem->second.first;
@@ -4432,45 +4413,45 @@ void pv_game::set_data_itmpv(int32_t chara_id, int32_t index, bool enable, int64
}
}
void pv_game::set_data_itmpv_chara_id(int32_t chara_id, int32_t index, bool attach) {
auto elem = data.itmpv[chara_id].find(index);
if (elem != data.itmpv[chara_id].end())
elem->second.first.set_chara_id(attach ? chara_id : -1);
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);
}
void pv_game::set_data_itmpv_req_frame(int32_t chara_id, int32_t index, float_t value) {
auto elem = data.itmpv[chara_id].find(index);
if (elem != data.itmpv[chara_id].end())
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);
}
void pv_game::set_data_itmpv_max_frame(int32_t chara_id, float_t value) {
for (auto& i : data.itmpv[chara_id])
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);
}
void pv_game::set_data_itmpv_max_frame(int32_t chara_id, int32_t index, float_t value) {
auto elem = data.itmpv[chara_id].find(index);
if (elem != data.itmpv[chara_id].end())
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);
}
void pv_game::set_data_itmpv_visibility(int32_t chara_id, bool value) {
for (auto& i : data.itmpv[chara_id])
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);
}
void pv_game::set_data_itmpv_visibility(int32_t chara_id, int32_t index, bool value) {
auto elem = data.itmpv[chara_id].find(index);
if (elem != data.itmpv[chara_id].end())
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);
}
void pv_game::set_edit_instrument(int32_t chara_id, bool disp, int32_t index, float_t frame, float_t frame_speed) {
if (chara_id < 0 || chara_id >= 3)
void pv_game::set_edit_instrument(int32_t rob_id, bool disp, int32_t index, float_t frame, float_t frame_speed) {
if (rob_id < ROB_ID_1P || rob_id > ROB_ID_3P)
return;
pv_game_edit_instrument& edit_instrument = data.edit_instrument[chara_id];
pv_game_edit_instrument& edit_instrument = data.edit_instrument[rob_id];
if (edit_instrument.index >= 0) {
if (edit_instrument.index >= edit_instrument.auth_3d_ids.size())
return;
@@ -4489,10 +4470,10 @@ void pv_game::set_edit_instrument(int32_t chara_id, bool disp, int32_t index, fl
id.set_visibility(disp);
id.set_paused(false);
id.set_req_frame(frame);
id.set_chara_id(chara_id);
id.set_chara_id(rob_id);
id.set_last_frame(id.get_play_control_size() - 1.0f);
FrameRateControl* sys_frame_rate = sys_frame_rate_get(chara_id);
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);
}
@@ -4501,18 +4482,18 @@ void pv_game::set_edit_instrument(int32_t chara_id, bool disp, int32_t index, fl
}
void pv_game::set_eyes_adjust(pv_game_chara* chr) {
chr->pv_data.eyes_adjust.xrot_adjust = data.pv->eyes_xrot_adjust;
chr->rob_init.eyes_adjust.xrot_adjust = data.pv->eyes_xrot_adjust;
if (data.pv->eyes_base_adjust_type != EYES_BASE_ADJUST_NONE)
chr->pv_data.eyes_adjust.base_adjust = data.pv->eyes_base_adjust_type;
chr->rob_init.eyes_adjust.base_adjust = data.pv->eyes_base_adjust_type;
auto elem = data.pv->eyes_rot_rate.find(chr->chara_num);
if (elem != data.pv->eyes_rot_rate.end()) {
chr->pv_data.eyes_adjust.neg = elem->second.xn_rate;
chr->pv_data.eyes_adjust.pos = elem->second.xp_rate;
chr->rob_init.eyes_adjust.neg = elem->second.xn_rate;
chr->rob_init.eyes_adjust.pos = elem->second.xp_rate;
}
}
void pv_game::set_item(size_t performer, rob_chara_pv_data_item& value) {
void pv_game::set_item(size_t performer, RobItemEquipInit& value) {
items[performer] = value;
}
@@ -4558,37 +4539,37 @@ void pv_game::set_osage_init(const pv_game_chara& chr) {
osage_init_data osage_init;
osage_init.rob_chr = chr.rob_chr;
osage_init.pv_id = pv->id;
osage_init.motion_id = i;
osage_init.motnum = i;
osage_init.frame = -1;
vec.push_back(osage_init);
}
const std::vector<pv_data_set_motion>* set_motion = data.pv_data.get_set_motion(chr.chara_id);
const std::vector<pv_data_set_motion>* set_motion = data.pv_data.get_set_motion(chr.rob_id);
if (set_motion)
for (const pv_data_set_motion& i : *set_motion) {
osage_init_data osage_init;
osage_init.rob_chr = chr.rob_chr;
osage_init.pv_id = pv->id;
osage_init.motion_id = i.motion_id;
osage_init.motnum = i.motnum;
osage_init.frame = (int32_t)prj::roundf(i.frame_stage_index.first);
vec.push_back(osage_init);
}
for (const pv_db_pv_osage_init& i : pv->osage_init) {
uint32_t motion_id = aft_mot_db->get_motion_id(i.motion.c_str());
if (motion_id == -1)
uint32_t motnum = aft_mot_db->get_motion_id(i.motion.c_str());
if (motnum == -1)
continue;
osage_init_data osage_init;
osage_init.rob_chr = chr.rob_chr;
osage_init.pv_id = pv->id;
osage_init.motion_id = motion_id;
osage_init.motnum = motnum;
osage_init.dir.assign(pv->mdata.dir);
osage_init.frame = i.frame;
vec.push_back(osage_init);
}
skin_param_manager_add_task(chr.chara_id, vec);
skin_param_manager_add_task(chr.rob_id, vec);
}
bool pv_game::set_pv_param_post_process_bloom_data(bool set, int32_t id, float_t duration) {
@@ -4598,19 +4579,18 @@ bool pv_game::set_pv_param_post_process_bloom_data(bool set, int32_t id, float_t
return true;
}
void pv_game::set_pv_param_post_process_chara_alpha_data(int32_t chara_id,
void pv_game::set_pv_param_post_process_chara_alpha_data(ROB_ID rob_id,
float_t alpha, int32_t type, float_t duration) {
if (chara_id >= 0 && chara_id < ROB_ID_MAX)
if (rob_id >= 0 && rob_id < ROB_ID_MAX)
pv_param_task::post_process_task_set_chara_alpha(
chara_id, type, alpha, duration);
rob_id, type, alpha, duration);
}
void pv_game::set_pv_param_post_process_chara_item_alpha_data(int32_t chara_id,
void pv_game::set_pv_param_post_process_chara_item_alpha_data(ROB_ID rob_id,
float_t alpha, int32_t type, float_t duration) {
if (chara_id >= 0 && chara_id < ROB_ID_MAX)
if (rob_id >= 0 && rob_id < ROB_ID_MAX)
pv_param_task::post_process_task_set_chara_item_alpha(
chara_id, type, alpha, duration,
pv_game::chara_item_alpha_callback, this);
rob_id, type, alpha, duration, pv_game::chara_item_alpha_callback, this);
}
bool pv_game::set_pv_param_post_process_color_correction_data(bool set, int32_t id, float_t duration) {
@@ -4743,18 +4723,14 @@ bool pv_game::unload() {
}
for (pv_game_chara& i : data.chara) {
if (i.chara_id != -1 && i.rob_chr) {
skin_param_manager_reset(i.chara_id);
rob_chara_array_free_chara_id(i.chara_id);
if (i.rob_id != ROB_ID_NULL && i.rob_chr) {
skin_param_manager_reset(i.rob_id);
RobManagement* rob_mon = get_rob_management();
if (rob_mon)
rob_mon->dest_rob(i.rob_id);
}
i.chara_num = CN_MAX;
i.cos = -1;
i.chara_id = -1;
i.pv_data = {};
i.rob_chr = 0;
i.motion_ids.clear();
i.motion_face_ids.clear();
i.init();
}
osage_play_data_manager_reset();
@@ -5050,8 +5026,8 @@ void pv_game::sub_1401230A0() {
sub_14013C8C0()->field_26 = true;
}
void pv_game::chara_item_alpha_callback(void* data, int32_t chara_id, int32_t type, float_t alpha) {
if (!data || chara_id < 0 || chara_id >= ROB_ID_MAX)
void pv_game::chara_item_alpha_callback(void* data, ROB_ID rob_id, int32_t type, float_t alpha) {
if (!data || rob_id < 0 || rob_id >= ROB_ID_MAX)
return;
mdl::ObjFlags flags;
@@ -5068,13 +5044,13 @@ void pv_game::chara_item_alpha_callback(void* data, int32_t chara_id, int32_t ty
break;
}
for (auto& i : ((pv_game*)data)->data.itmpv[chara_id])
for (auto& i : ((pv_game*)data)->data.itmpv[rob_id])
i.second.first.set_alpha_obj_flags(alpha, flags);
}
void pv_game::get_item_mask(pv_performer_type type,
rob_chara_pv_data_item* src_item, pv_game_item_mask* src_mask,
rob_chara_pv_data_item* dst_item, pv_game_item_mask* dst_mask) {
RobItemEquipInit* src_item, pv_game_item_mask* src_mask,
RobItemEquipInit* dst_item, pv_game_item_mask* dst_mask) {
if (!src_item || !src_mask || !dst_item || !dst_mask)
return;
@@ -5105,7 +5081,7 @@ void pv_game_init_data::reset() {
for (int32_t& i : modules)
i = 0;
for (rob_chara_pv_data_item& i : items)
for (RobItemEquipInit& i : items)
i = {};
for (pv_game_item_mask& i : items_mask)
@@ -5868,11 +5844,11 @@ void task_pv_game_init_pv() {
for (int32_t i = 0; i < ROB_ID_MAX; i++) {
args.init_data.modules[i] = v2->field_2C.field_4C[i];
for (int32_t j = 0; j < 4; j++) {
int32_t item_no = 0;
uint32_t item_no = 0;
if (v2->field_2C.field_7C[i].arr[j] >= 0)
item_no = customize_item_data_handler_data_get_customize_item_obj_id(
v2->field_2C.field_7C[i].arr[j]);
args.init_data.items[i].arr[j] = item_no;
args.init_data.items[i].item_no[j] = item_no;
args.init_data.items_mask[i].arr[j] = v2->field_2C.field_DC[i].arr[j];
}
}
@@ -5954,7 +5930,7 @@ bool task_pv_game_init_demo_pv(int32_t pv_id, pv_difficulty difficulty, bool mus
else
task_pv_game->data.init_data.modules[i] = 0;
for (int32_t& j : task_pv_game->data.init_data.items[i].arr)
for (uint32_t& j : task_pv_game->data.init_data.items[i].item_no)
j = 0;
for (bool& j : task_pv_game->data.init_data.items_mask[i].arr)
@@ -6285,10 +6261,10 @@ static FrameRateControl* get_diva_pv_frame_rate() {
return &diva_pv_frame_rate;
}
static SysFrameRate* sys_frame_rate_get(int32_t chara_id) {
if (chara_id < 0 || chara_id >= 3)
chara_id = 0;
return &sys_frame_rate_array[chara_id];
static SysFrameRate* sys_frame_rate_get(int32_t id) {
if (id < ROB_ID_1P || id > ROB_ID_3P)
id = ROB_ID_1P;
return &sys_frame_rate_array[id];
}
static int32_t sub_1400FCFD0(pv_game_chara* arr, const pv_db_pv* pv) {
@@ -6321,8 +6297,8 @@ static void sub_140105010(pv_game_chara* arr, size_t max_count, pv_game_item_mas
if (module_data_handler_data_get_module(a4.module, mdl)) {
chr->chara_num = mdl.chara_num;
chr->cos = mdl.cos;
chr->pv_data.sleeve_l = mdl.sleeve_l;
chr->pv_data.sleeve_r = mdl.sleeve_r;
chr->rob_init.sleeve_l = mdl.sleeve_l;
chr->rob_init.sleeve_r = mdl.sleeve_r;
}
else {
chr->chara_num = CN_MIKU;
@@ -6330,11 +6306,11 @@ static void sub_140105010(pv_game_chara* arr, size_t max_count, pv_game_item_mas
}
}
chr->pv_data.item = a4.item;
chr->rob_init.item = a4.item;
/*for (int32_t i = 0; i < PV_PERFORMER_ITEM_MAX; i++)
if (sub_140234860()->sub_140234460(chr->pv_data.item.arr[i]) < 0)
chr->pv_data.item.arr[i] = 0;*/
chr->rob_init.item.arr[i] = 0;*/
const pv_db_pv* pv = a4.pv;
PlayerData* player_data = player_data_array_get(0);
@@ -6355,8 +6331,8 @@ static void sub_140105010(pv_game_chara* arr, size_t max_count, pv_game_item_mas
pv_performer_type type = pv->get_performer_type(performer);
costume = pv_db_pv::get_pseudo_costume(type, pseudo_chr->chara_num, pseudo_chr->cos);
pv_game::get_item_mask(type, &pseudo_chr->pv_data.item,
&a3[pseudo_performer], &chr->pv_data.item, &a3[performer]);
pv_game::get_item_mask(type, &pseudo_chr->rob_init.item,
&a3[pseudo_performer], &chr->rob_init.item, &a3[performer]);
}
}
}
@@ -6379,23 +6355,23 @@ static void sub_140105010(pv_game_chara* arr, size_t max_count, pv_game_item_mas
pv_performer_item item = PV_PERFORMER_ITEM_ZUJO;
for (int32_t i = 0; i < PV_PERFORMER_ITEM_MAX; i++) {
int32_t item_no = pv->get_performer_item(performer, item);
uint32_t item_no = pv->get_performer_item(performer, item);
if (item_no == -2) {
const item_cos_data* cos = item_table_handler_array_get_item_cos_data(chr->chara_num, chr->cos);
if (!cos)
const RobItemEquip* item_set = get_default_costume_data(chr->chara_num, chr->cos);
if (!item_set)
continue;
item_sub_id sub_id = pv_performer_item_to_item_sub_id(item);
if (sub_id < 0 || sub_id >= ITEM_SUB_MAX)
ROB_ITEM_EQUIP_SUB_ID sub_id = pv_performer_item_to_item_sub_id(item);
if (sub_id < 0 || sub_id >= ROB_ITEM_EQUIP_SUB_ID_MAX)
continue;
chr->pv_data.item.arr[i] = cos->arr[sub_id];
chr->rob_init.item.item_no[i] = item_set->item_no[sub_id];
a3[performer].arr[i] = true;
}
else if (item_no > 0) {
const item_table_item* itm = item_table_handler_array_get_item(chr->chara_num, item_no);
if (itm && itm->sub_id == pv_performer_item_to_item_sub_id(item))
chr->pv_data.item.arr[i] = item_no;
const RobItemTable* tbl = get_rob_item_table(chr->chara_num, item_no);
if (tbl && tbl->equip_sub_id == pv_performer_item_to_item_sub_id(item))
chr->rob_init.item.item_no[i] = item_no;
}
}
}
+21 -21
View File
@@ -42,8 +42,8 @@ enum hit_state {
struct pv_game_chara {
CHARA_NUM chara_num;
int32_t cos;
int32_t chara_id;
rob_chara_pv_data pv_data;
ROB_ID rob_id;
RobInit rob_init;
rob_chara* rob_chr;
std::vector<uint32_t> motion_ids;
std::vector<uint32_t> motion_face_ids;
@@ -52,7 +52,7 @@ struct pv_game_chara {
~pv_game_chara();
bool check_chara();
void reset();
void init();
};
struct pv_game_edit_effect_data {
@@ -346,7 +346,7 @@ struct pv_game {
int32_t pv_id;
bool field_14;
int32_t modules[ROB_ID_MAX];
rob_chara_pv_data_item items[ROB_ID_MAX];
RobItemEquipInit items[ROB_ID_MAX];
pv_game_item_mask items_mask[ROB_ID_MAX];
pv_game_data data;
@@ -377,7 +377,7 @@ struct pv_game {
void edit_effect_ctrl(float_t delta_time);
void edit_effect_set(int32_t index, float_t frame_speed, float_t delta_time);
void edit_instrument_reset();
void edit_instrument_set_disp(int32_t chara_id, bool value);
void edit_instrument_set_disp(int32_t rob_id, bool value);
void end(bool complete, bool set_fade);
float_t 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);
@@ -392,7 +392,7 @@ struct pv_game {
auth_3d_id get_auth_3d_id(int32_t uid);
int64_t get_auth_3d_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 chara_id, int32_t index);
int64_t get_data_itmpv_time(int32_t rob_id, int32_t index);
float_t get_data_rival_percentage();
std::string get_effect_se_file_name();
int32_t get_field_aet_frame_by_name_id(pv_game_field& field,
@@ -433,24 +433,24 @@ struct pv_game {
void restart();
void set_chara_use_opd(bool value);
void set_data_campv(int32_t type, int32_t index, float_t frame);
void set_data_itmpv(int32_t chara_id, int32_t index, bool enable, int64_t time);
void set_data_itmpv_chara_id(int32_t chara_id, int32_t index, bool attach);
void set_data_itmpv_req_frame(int32_t chara_id, int32_t index, float_t value);
void set_data_itmpv_max_frame(int32_t chara_id, float_t value);
void set_data_itmpv_max_frame(int32_t chara_id, int32_t index, float_t value);
void set_data_itmpv_visibility(int32_t chara_id, bool value);
void set_data_itmpv_visibility(int32_t chara_id, int32_t index, bool value);
void set_edit_instrument(int32_t chara_id, bool disp, int32_t index, float_t frame, float_t frame_speed);
void set_data_itmpv(int32_t rob_id, int32_t index, bool enable, int64_t time);
void set_data_itmpv_chara_id(int32_t rob_id, int32_t index, bool attach);
void set_data_itmpv_req_frame(int32_t rob_id, int32_t index, float_t value);
void set_data_itmpv_max_frame(int32_t rob_id, float_t value);
void set_data_itmpv_max_frame(int32_t rob_id, int32_t index, float_t value);
void set_data_itmpv_visibility(int32_t rob_id, bool value);
void set_data_itmpv_visibility(int32_t rob_id, int32_t index, bool value);
void set_edit_instrument(int32_t rob_id, bool disp, int32_t index, float_t frame, float_t frame_speed);
void set_eyes_adjust(pv_game_chara* chr);
void set_item(size_t performer, rob_chara_pv_data_item& value);
void set_item(size_t performer, RobItemEquipInit& value);
void set_item_mask(size_t performer, size_t item, bool value);
void set_lyric(int32_t lyric_index, color4u8 lyric_color);
void set_module(size_t performer, int32_t module);
void set_osage_init(const pv_game_chara& chr);
bool set_pv_param_post_process_bloom_data(bool set, int32_t id, float_t duration);
void set_pv_param_post_process_chara_alpha_data(int32_t chara_id,
void set_pv_param_post_process_chara_alpha_data(ROB_ID rob_id,
float_t alpha, int32_t type, float_t duration);
void set_pv_param_post_process_chara_item_alpha_data(int32_t chara_id,
void set_pv_param_post_process_chara_item_alpha_data(ROB_ID rob_id,
float_t alpha, int32_t type, float_t duration);
bool set_pv_param_post_process_color_correction_data(bool set, int32_t id, float_t duration);
bool set_pv_param_post_process_dof_data(bool set, int32_t id, float_t duration);
@@ -468,10 +468,10 @@ struct pv_game {
int32_t sub_140112C00(int32_t index);
void sub_1401230A0();
static void chara_item_alpha_callback(void* data, int32_t chara_id, int32_t type, float_t alpha);
static void chara_item_alpha_callback(void* data, ROB_ID rob_id, int32_t type, float_t alpha);
static void get_item_mask(pv_performer_type type,
rob_chara_pv_data_item* src_item, pv_game_item_mask* src_mask,
rob_chara_pv_data_item* dst_item, pv_game_item_mask* dst_mask);
RobItemEquipInit* src_item, pv_game_item_mask* src_mask,
RobItemEquipInit* dst_item, pv_game_item_mask* dst_mask);
};
struct pv_game_init_data {
@@ -483,7 +483,7 @@ struct pv_game_init_data {
int32_t life_gauge_border;
int32_t stage_index;
int32_t modules[ROB_ID_MAX];
rob_chara_pv_data_item items[ROB_ID_MAX];
RobItemEquipInit items[ROB_ID_MAX];
pv_game_item_mask items_mask[ROB_ID_MAX];
pv_game_init_data();
+7 -7
View File
@@ -25,7 +25,7 @@ struct pv_game_camera {
vec3 up_vec;
float_t fov;
float_t min_dist;
int32_t chara_id;
ROB_ID rob_id;
int32_t chara_follow_point;
float_t acceleration_1;
float_t acceleration_2;
@@ -47,7 +47,7 @@ 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);
pv_game_camera::pv_game_camera() : enable(), follow_chara(), edit_camera(), duration(), curr_time(),
start_distance(), end_distance(), fov(), min_dist(), chara_id(), chara_follow_point(),
start_distance(), end_distance(), fov(), min_dist(), rob_id(), chara_follow_point(),
acceleration_1(), acceleration_2(), field_F4(), acceleration(), acceleration_curr_time() {
}
@@ -68,7 +68,7 @@ void pv_game_camera::reset() {
up_vec = { 0.0f, 1.0f, 0.0f };
fov = 32.2673416137695f;
min_dist = 0.05f;
chara_id = 0;
rob_id = ROB_ID_1P;
chara_follow_point = 0;
acceleration_1 = 0.0f;
acceleration_2 = 1.0f;
@@ -106,7 +106,7 @@ void pv_game_camera_reset() {
void pv_game_camera_set_dsc_data(float_t duration, pv_game_camera_dsc_data& start,
pv_game_camera_dsc_data& end, float_t acceleration_1, float_t acceleration_2,
int32_t follow_chara, int32_t chara_id, int32_t chara_follow_point, bool edit_camera) {
int32_t follow_chara, int32_t rob_id, int32_t chara_follow_point, bool edit_camera) {
pv_game_camera_data.reset();
pv_game_camera_data.edit_camera = edit_camera;
@@ -141,7 +141,7 @@ void pv_game_camera_set_dsc_data(float_t duration, pv_game_camera_dsc_data& star
if (follow_chara) {
pv_game_camera_data.follow_chara = true;
pv_game_camera_data.chara_id = chara_id;
pv_game_camera_data.rob_id = (ROB_ID)rob_id;
switch (chara_follow_point) {
case 0:
@@ -235,7 +235,7 @@ static bool pv_game_camera_get_edit_camera(cam_struct* cam, float_t delta_time)
}
if (pv_game_camera_data.follow_chara) {
rob_chara* rob_chr = rob_chara_array_get(pv_game_camera_data.chara_id);
rob_chara* rob_chr = get_rob_management()->get_rob(pv_game_camera_data.rob_id);
if (rob_chr) {
mat4 mat = mat4_identity;
rob_chr->sub_1405163C0(pv_game_camera_data.chara_follow_point, mat);
@@ -282,7 +282,7 @@ static bool pv_game_camera_get_move_camera(cam_struct* cam, float_t delta_time)
}
if (pv_game_camera_data.follow_chara) {
rob_chara* rob_chr = rob_chara_array_get(pv_game_camera_data.chara_id);
rob_chara* rob_chr = get_rob_management()->get_rob(pv_game_camera_data.rob_id);
if (rob_chr) {
mat4 mat = mat4_identity;
rob_chr->sub_1405163C0(pv_game_camera_data.chara_follow_point, mat);
+1 -1
View File
@@ -20,5 +20,5 @@ extern void pv_game_camera_ctrl(float_t delta_time);
extern void pv_game_camera_reset();
extern void pv_game_camera_set_dsc_data(float_t duration, pv_game_camera_dsc_data& start,
pv_game_camera_dsc_data& end, float_t acceleration_1, float_t acceleration_2,
int32_t follow_chara, int32_t chara_id, int32_t chara_follow_point, bool edit_camera);
int32_t follow_chara, int32_t rob_id, int32_t chara_follow_point, bool edit_camera);
extern void pv_game_camera_set_fov_min_dist(float_t fov, float_t min_dist);
File diff suppressed because it is too large Load Diff
+6 -6
View File
@@ -274,7 +274,7 @@ struct pv_game_pv_data {
bool field_2BF60;
int32_t field_2BF64;
int64_t field_2BF68;
int32_t chara_id;
ROB_ID rob_id;
struct pv_game* pv_game;
//struc_162* field_2BF80;
struct pv_game_music* music;
@@ -333,10 +333,10 @@ struct pv_game_pv_data {
int32_t* pv_branch_mode, dsc_data* start, dsc_data* end);
void find_change_fields();
void find_data_camera();
void find_playdata_item_anim(int32_t chara_id);
void find_playdata_set_motion(int32_t chara_id);
void find_playdata_item_anim(int32_t rob_id);
void find_playdata_set_motion(int32_t rob_id);
void find_set_motion(const struct pv_db_pv_difficulty* diff);
const std::vector<pv_data_set_motion>* get_set_motion(size_t chara_id);
const std::vector<pv_data_set_motion>* get_set_motion(size_t rob_id);
pv_dsc_target_group* get_target();
int32_t get_target_target_count(size_t index, float_t time_offset, bool a4);
void init(::pv_game* pv_game, bool music_play);
@@ -345,6 +345,6 @@ struct pv_game_pv_data {
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 chara_id, int32_t index, int64_t time);
void set_motion_max_frame(int32_t chara_id, int32_t motion_index, 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);
};
+232 -222
View File
File diff suppressed because it is too large Load Diff
+12 -12
View File
@@ -107,7 +107,7 @@ public:
struct x_pv_play_data_set_motion {
float_t frame_speed;
uint32_t motion_id;
uint32_t motnum;
float_t frame;
float_t blend_duration;
bool blend;
@@ -185,7 +185,7 @@ struct x_pv_game_song_effect_glitter {
struct x_pv_game_song_effect {
bool enable;
int32_t chara_id;
ROB_ID rob_id;
int64_t time;
std::vector<x_pv_game_song_effect_auth_3d> auth_3d;
std::vector<x_pv_game_song_effect_glitter> glitter;
@@ -233,7 +233,7 @@ struct x_pv_game_effect {
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, int32_t chara_id, bool chara_scale);
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);
@@ -274,15 +274,15 @@ struct x_pv_game_chara_effect {
~x_pv_game_chara_effect();
void ctrl(int32_t pv_id, object_database* obj_db, texture_database* tex_db);
vec3 get_node_translation(int32_t chara_id, int32_t chara_effect, int32_t objhrc_index, const char* node_name);
vec3 get_node_translation(ROB_ID rob_id, int32_t chara_effect, int32_t objhrc_index, const char* node_name);
void load(int32_t pv_id, pvpp* play_param, FrameRateControl* frame_rate_control, CHARA_NUM charas[6]);
void load_data();
void reset();
void set_chara_effect(int32_t chara_id, int32_t index, int64_t time);
void set_chara_effect_time(int32_t chara_id, int32_t index, int64_t time);
void set_chara_effect(ROB_ID rob_id, int32_t index, int64_t time);
void set_chara_effect_time(ROB_ID rob_id, int32_t index, int64_t time);
void set_time(int64_t time);
void stop();
void stop_chara_effect(int32_t chara_id, int32_t index);
void stop_chara_effect(ROB_ID rob_id, int32_t index);
void unload();
void unload_data();
};
@@ -479,7 +479,7 @@ struct x_pv_game_pv_data {
dsc_data* dsc_data_ptr;
dsc_data* dsc_data_ptr_end;
std::vector<pv_data_set_motion> set_motion[ROB_ID_MAX];
int32_t chara_id;
ROB_ID rob_id;
class x_pv_game* pv_game;
float_t measured_fps;
float_t anim_frame_speed;
@@ -500,8 +500,8 @@ struct x_pv_game_pv_data {
int32_t* pv_branch_mode, dsc_data* start, dsc_data* end);
void find_bar_beat(x_pv_bar_beat& bar_beat);
void find_change_fields(std::vector<int64_t>& change_fields);
void find_playdata_item_anim(int32_t chara_id);
void find_playdata_set_motion(int32_t chara_id);
void find_playdata_item_anim(ROB_ID rob_id);
void find_playdata_set_motion(ROB_ID rob_id);
int64_t find_pv_end();
void find_set_motion();
void find_stage_effects(prj::vector_pair<int64_t, int32_t>& stage_effects);
@@ -510,7 +510,7 @@ struct x_pv_game_pv_data {
bool set_pv_param_post_process_bloom_data(bool set, int32_t id, float_t duration);
bool set_pv_param_post_process_color_correction_data(bool set, int32_t id, float_t duration);
bool set_pv_param_post_process_dof_data(bool set, int32_t id, float_t duration);
void set_motion_max_frame(int32_t chara_id, int32_t motion_index, int64_t time);
void set_motion_max_frame(ROB_ID rob_id, int32_t motion_index, int64_t time);
void stop();
void unload();
void unload_data();
@@ -756,7 +756,7 @@ public:
int32_t frame;
double_t frame_float;
int64_t time;
int32_t rob_chara_ids[ROB_ID_MAX];
ROB_ID rob_ids[ROB_ID_MAX];
std::string light_category;