From d1484bd0fd28bf6abd65caf82cfe14d554dc1fb6 Mon Sep 17 00:00:00 2001 From: korenkonder Date: Sun, 27 Aug 2023 14:03:51 +0300 Subject: [PATCH] Various fixes --- src/CRE/auth_3d.cpp | 3 +++ src/KKdLib/prj/stack_allocator.cpp | 4 ++++ src/ReDIVA/classes/data_view/auth_3d.cpp | 7 +++++++ src/ReDIVA/x_pv_game.cpp | 6 ++++-- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/CRE/auth_3d.cpp b/src/CRE/auth_3d.cpp index 5e61eedc..6d9c4b6e 100644 --- a/src/CRE/auth_3d.cpp +++ b/src/CRE/auth_3d.cpp @@ -5787,6 +5787,9 @@ static void auth_3d_object_load(auth_3d* auth, auth_3d_object* o, static void auth_3d_object_curve_load(auth_3d* auth, auth_3d_object_curve* oc, std::string& name, float_t frame_offset) { + if (!name.size()) + return; + oc->curve = 0; oc->name.assign(name); oc->frame_offset = 0.0f; diff --git a/src/KKdLib/prj/stack_allocator.cpp b/src/KKdLib/prj/stack_allocator.cpp index 75150e02..764f29ce 100644 --- a/src/KKdLib/prj/stack_allocator.cpp +++ b/src/KKdLib/prj/stack_allocator.cpp @@ -37,7 +37,11 @@ namespace prj { #endif if (allocate) { +#if PRJ_STACK_ALLOCATOR_ORIGINAL_CODE size_t data_size = this->size; +#else + size_t data_size = node ? (node->capacity + sizeof(stack_allocator_node)) * 2 : this->size; +#endif size_t _size = size + sizeof(stack_allocator_node); size_t mults = 0; while (data_size < _size) { diff --git a/src/ReDIVA/classes/data_view/auth_3d.cpp b/src/ReDIVA/classes/data_view/auth_3d.cpp index 7055ce4b..258eba83 100644 --- a/src/ReDIVA/classes/data_view/auth_3d.cpp +++ b/src/ReDIVA/classes/data_view/auth_3d.cpp @@ -165,6 +165,13 @@ void data_view_auth_3d_imgui(class_data* data) { ImGui::TreePop(); } + if (auth->curve.size() > 0 + && ImGui::TreeNodeEx("Curve", tree_node_flags)) { + for (auth_3d_curve& l : auth->curve) + data_view_auth_3d_imgui_auth_3d_curve(&l); + ImGui::TreePop(); + } + data_view_auth_3d_imgui_auth_3d_dof(&auth->dof); if (auth->fog.size() > 0 diff --git a/src/ReDIVA/x_pv_game.cpp b/src/ReDIVA/x_pv_game.cpp index 9e1d960f..eba1c869 100644 --- a/src/ReDIVA/x_pv_game.cpp +++ b/src/ReDIVA/x_pv_game.cpp @@ -3886,12 +3886,14 @@ void x_pv_game_stage::unload() { auth_3d_ids.clear(); - for (x_pv_game_stage_effect& i : effect) - for (x_pv_game_stage_effect_glitter& j : i.glitter) + for (int32_t i = 0; i < X_PV_GAME_STAGE_EFFECT_COUNT; i++) { + x_pv_game_stage_effect& eff = effect[i]; + for (x_pv_game_stage_effect_glitter& j : eff.glitter) if (j.scene_counter) { Glitter::glt_particle_manager->FreeSceneEffect(j.scene_counter, false); j.scene_counter = 0; } + } if (stage_effect_transition_state == 1) stop_stage_change_effect();