From df28ecb621bb0a2492666be20b84d37fcb52c1d9 Mon Sep 17 00:00:00 2001 From: korenkonder Date: Fri, 12 Jan 2024 07:34:01 +0300 Subject: [PATCH] Bake DoF fixes --- src/CRE/effect.cpp | 2 +- src/KKdLib/a3da.cpp | 2 +- src/ReDIVA/config.hpp | 3 ++- src/ReDIVA/game_state.cpp | 1 + src/ReDIVA/render.cpp | 2 +- src/ReDIVA/x_pv_game.cpp | 20 +++++++++----------- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/CRE/effect.cpp b/src/CRE/effect.cpp index b38d6813..ea1ad9b6 100644 --- a/src/CRE/effect.cpp +++ b/src/CRE/effect.cpp @@ -2803,7 +2803,7 @@ void TaskEffectLitproj::set_stage_indices(const std::vector& stage_indi } stage_param_data_litproj_current = 0; - if (this->stage_indices.size()) + if (!this->stage_indices.size()) return; int32_t stage_index = this->stage_indices.front(); diff --git a/src/KKdLib/a3da.cpp b/src/KKdLib/a3da.cpp index bcb9bc8c..88aeff81 100644 --- a/src/KKdLib/a3da.cpp +++ b/src/KKdLib/a3da.cpp @@ -3163,7 +3163,7 @@ inline static void a3da_key_make_raw_data_binary(a3da_key* value) { inline static void a3da_model_transform_make_raw_data_binary(a3da_model_transform* value) { a3da_vec3_make_raw_data_binary(&value->rotation); a3da_vec3_make_raw_data_binary(&value->scale); - a3da_vec3_make_raw_data_binary(&value->scale); + a3da_vec3_make_raw_data_binary(&value->translation); a3da_key_make_raw_data_binary(&value->visibility); } diff --git a/src/ReDIVA/config.hpp b/src/ReDIVA/config.hpp index b36a202c..85c748e3 100644 --- a/src/ReDIVA/config.hpp +++ b/src/ReDIVA/config.hpp @@ -4,10 +4,11 @@ */ #if defined(ReDIVA_DEV) +#define BAKE_DOF (0) #define BAKE_PNG (0) #define BAKE_VIDEO (0) #define BAKE_PV826 (0) -#define BAKE_X_PACK (1) +#define BAKE_X_PACK (0) #define DW_TRANSLATE (0) #define PV_DEBUG (1) diff --git a/src/ReDIVA/game_state.cpp b/src/ReDIVA/game_state.cpp index 9f39fb06..3949396c 100644 --- a/src/ReDIVA/game_state.cpp +++ b/src/ReDIVA/game_state.cpp @@ -17,6 +17,7 @@ #include "data_test/motion_test.hpp" #include "data_test/selector.hpp" #include "data_test/stage_test.hpp" +#include "information/dw_console.hpp" #include "pv_game/player_data.hpp" #include "pv_game/pv_game.hpp" #include "data_edit.hpp" diff --git a/src/ReDIVA/render.cpp b/src/ReDIVA/render.cpp index 7bf02d3c..535e89a4 100644 --- a/src/ReDIVA/render.cpp +++ b/src/ReDIVA/render.cpp @@ -231,7 +231,7 @@ int32_t render_main(render_init_struct* ris) { if (!render_lock) return 0; -#if BAKE_X_PACK || DOF_BAKE +#if BAKE_X_PACK || BAKE_DOF render_timer = new timer(600.0); #else render_timer = new timer(60.0); diff --git a/src/ReDIVA/x_pv_game.cpp b/src/ReDIVA/x_pv_game.cpp index adc52c4c..76dc79dc 100644 --- a/src/ReDIVA/x_pv_game.cpp +++ b/src/ReDIVA/x_pv_game.cpp @@ -39,7 +39,7 @@ #if BAKE_PV826 #include "../KKdLib/waitable_timer.hpp" #endif -#include "dw_console.hpp" +#include "information/dw_console.hpp" #include "imgui_helper.hpp" #include "input.hpp" @@ -210,9 +210,7 @@ enum dsc_x_func { DSC_X_MAX, }; -#define DOF_BAKE 0 - -#if DOF_BAKE +#if BAKE_DOF struct dof_cam { std::vector position_x; std::vector position_y; @@ -234,7 +232,7 @@ struct dof_cam { static int32_t aet_index_table[] = { 0, 1, 2, 6, 5 }; -#if DOF_BAKE +#if BAKE_DOF dof_cam dof_cam_data; #endif x_pv_game* x_pv_game_ptr; @@ -267,7 +265,7 @@ static void x_pv_game_write_object_set(ObjsetInfo* info, object_database* obj_db static void print_dsc_command(dsc& dsc, dsc_data* dsc_data_ptr, int64_t time); static void print_dsc_command(dsc& dsc, dsc_data* dsc_data_ptr, int64_t* time); -#if BAKE_X_PACK || DOF_BAKE +#if BAKE_X_PACK || BAKE_DOF static void replace_pv832(char* str); static void replace_pv832(std::string& str); #endif @@ -5534,7 +5532,7 @@ nvenc_encoder* nvenc_enc; file_stream* nvenc_stream; #endif -#if DOF_BAKE +#if BAKE_DOF static void a3da_key_rev(a3da_key& k, std::vector& values_src) { std::vector values; int32_t type = interpolate_chs_reverse_sequence(values_src, values); @@ -6705,7 +6703,7 @@ bool x_pv_game::ctrl() { for (int32_t i = 0; i < ROB_CHARA_COUNT; i++) pv_expression_array_reset_motion(i); -#if DOF_BAKE +#if BAKE_DOF { x_pv_game_data& pv_data = this->get_data(); @@ -6859,7 +6857,7 @@ void x_pv_game::basic() { if (state_old != 20 && state_old != 21) return; -#if DOF_BAKE +#if BAKE_DOF if (dof_cam_data.frame != frame) { camera* cam = rctx_ptr->camera; @@ -8006,7 +8004,7 @@ bool x_pv_game_selector_free() { } #endif -#if DOF_BAKE +#if BAKE_DOF dof_cam::dof_cam() { frame = -999999; enable = false; @@ -8764,7 +8762,7 @@ static void print_dsc_command(dsc& dsc, dsc_data* dsc_data_ptr, int64_t* time) { dw_console_printf(DW_CONSOLE_PV_SCRIPT, ")\n"); } -#if BAKE_X_PACK || DOF_BAKE +#if BAKE_X_PACK || BAKE_DOF static void replace_pv832(char* str) { char* pv; pv = str;