Style fixes

This commit is contained in:
korenkonder
2024-05-12 23:44:21 +03:00
parent 88698ab52b
commit f6ca32c0cd
7 changed files with 92 additions and 48 deletions
+1
View File
@@ -8,6 +8,7 @@
#include "../../KKdLib/default.hpp"
#include "../../KKdLib/database/bone.hpp"
#include "../../KKdLib/database/motion.hpp"
#include "../../KKdLib/prj/vector_pair.hpp"
#include "../../KKdLib/mat.hpp"
#include "../../KKdLib/mot.hpp"
#include "../../KKdLib/vec.hpp"
+1 -1
View File
@@ -223,7 +223,7 @@ void bone_database::update() {
i.bone_names.clear();
i.object_bone_names.clear();
i.motion_bone_names.clear();
i.bone_names.reserve(i.bone.size());
i.object_bone_names.reserve(i.object_bone.size());
i.motion_bone_names.reserve(i.motion_bone.size());
+31 -34
View File
@@ -1019,43 +1019,41 @@ bool DtmMot::ctrl() {
const pv_db_pv_difficulty* diff = task_pv_db_get_pv_difficulty(pv_id, PV_DIFFICULTY_HARD, 0);
if (pv_id > 0 && diff && dsc_file_handler.get_data()) {
if (diff) {
pv_data.reset();
pv_data.dsc.parse(dsc_file_handler.get_data(), dsc_file_handler.get_size(), DSC_FT);
pv_data.reset();
pv_data.dsc.parse(dsc_file_handler.get_data(), dsc_file_handler.get_size(), DSC_FT);
dsc_file_handler.reset();
dsc_file_handler.reset();
int32_t chara_id = 0;
for (auto& i : diff->motion)
for (const pv_db_pv_motion& j : i)
if (j.id == motion_id) {
chara_id = (int32_t)(&i - diff->motion);
break;
}
int32_t chara_id = 0;
for (auto& i : diff->motion)
for (const pv_db_pv_motion& j : i)
if (j.id == motion_id) {
chara_id = (int32_t)(&i - diff->motion);
break;
}
pv_data.find_playdata_set_motion(chara_id);
pv_data.find_set_motion(diff);
const std::vector<pv_data_set_motion>* set_motion = pv_data.get_set_motion(chara_id);
if (set_motion) {
this->set_motion.assign(set_motion->begin(), set_motion->end());
const mothead_mot* mhdm = mothead_storage_get_mot_by_motion_id(motion_id, aft_mot_db);
if (mhdm)
for (const mothead_data& i : mhdm->data) {
if (i.type != MOTHEAD_DATA_WIND_RESET)
continue;
pv_data.find_playdata_set_motion(chara_id);
pv_data.find_set_motion(diff);
const std::vector<pv_data_set_motion>* set_motion = pv_data.get_set_motion(chara_id);
if (set_motion) {
this->set_motion.assign(set_motion->begin(), set_motion->end());
const mothead_mot* mhdm = mothead_storage_get_mot_by_motion_id(motion_id, aft_mot_db);
if (mhdm)
for (const mothead_data& i : mhdm->data) {
if (i.type != MOTHEAD_DATA_WIND_RESET)
continue;
auto j_begin = this->set_motion.begin();
auto j_end = this->set_motion.end();
for (auto j = j_begin; j != j_end; )
if ((float_t)i.frame == j->frame_stage_index.first) {
std::move(j + 1, j_end, j);
this->set_motion.pop_back();
j_end = this->set_motion.end();
}
else
j++;
}
}
auto j_begin = this->set_motion.begin();
auto j_end = this->set_motion.end();
for (auto j = j_begin; j != j_end; )
if ((float_t)i.frame == j->frame_stage_index.first) {
std::move(j + 1, j_end, j);
this->set_motion.pop_back();
j_end = this->set_motion.end();
}
else
j++;
}
}
}
@@ -1090,7 +1088,6 @@ bool DtmMot::ctrl() {
state = 9;
bool has_opd = false;
const uint32_t* opd_motion_set_ids = get_opd_motion_set_ids();
while (*opd_motion_set_ids != -1) {
if (*opd_motion_set_ids != motion_set_id) {
+1 -1
View File
@@ -433,7 +433,7 @@ DataTestObjDw::DataTestObjDw() {
shadow->AddItem("ON");
shadow->SetItemIndex(obj_data->shadow);
shadow->AddSelectionListener(new dw::SelectionListenerOnHook(DataTestObjDw::ShadowCallback));
(new dw::Label(this))->SetText("STAGE HDRI");
dw::ListBox* stage_hdri = new dw::ListBox(this);
+54 -9
View File
@@ -8,6 +8,10 @@
#include "../../CRE/data.hpp"
#include "../../CRE/render_context.hpp"
#include "../../CRE/resolution_mode.hpp"
#include "../../KKdLib/io/file_stream.hpp"
#include "../../KKdLib/io/path.hpp"
#include "../../KKdLib/prj/algorithm.hpp"
#include "../../KKdLib/key_val.hpp"
#include "../dw.hpp"
class RobOsageTestDw : public dw::Shell {
@@ -63,7 +67,7 @@ public:
void SetValue(float_t value);
void Update(bool value);
};
class Gain : public dw::SelectionAdapter {
public:
dw::Composite* comp;
@@ -78,7 +82,7 @@ public:
void SetValue(float_t value);
void Update(bool value);
};
class AirRes : public dw::SelectionAdapter {
public:
dw::Composite* comp;
@@ -93,7 +97,7 @@ public:
void SetValue(float_t value);
void Update(bool value);
};
class RootYRot : public dw::SelectionAdapter {
public:
dw::Composite* comp;
@@ -108,7 +112,7 @@ public:
void SetValue(float_t value);
void Update(bool value);
};
class RootZRot : public dw::SelectionAdapter {
public:
dw::Composite* comp;
@@ -123,7 +127,7 @@ public:
void SetValue(float_t value);
void Update(bool value);
};
class Fric : public dw::SelectionAdapter {
public:
dw::Composite* comp;
@@ -138,7 +142,7 @@ public:
void SetValue(float_t value);
void Update(bool value);
};
class WindAfc : public dw::SelectionAdapter {
public:
dw::Composite* comp;
@@ -153,7 +157,7 @@ public:
void SetValue(float_t value);
void Update(bool value);
};
class ColiType : public dw::SelectionAdapter {
public:
dw::Composite* comp;
@@ -259,6 +263,11 @@ public:
void SetValue(const RobOsageTest::Node::Hinge& value);
void Update(bool value);
static void YMinCallback(dw::Widget* data);
static void YMaxCallback(dw::Widget* data);
static void ZMinCallback(dw::Widget* data);
static void ZMaxCallback(dw::Widget* data);
};
class InertialCancel : public dw::SelectionAdapter {
@@ -1582,21 +1591,29 @@ void RobOsageTestDw::Node::Hinge::Update(bool value) {
y_min_slider->SetText(" Ymin ");
y_min_slider->format = "% 6.0f";
y_min_slider->SetParams(rob_osage_test->node.hinge.ymin, -179.0f, 0.0f, 89.5f, 0.5f, 5.0f);
y_min_slider->AddSelectionListener(new dw::SelectionListenerOnHook(
RobOsageTestDw::Node::Hinge::YMinCallback));
y_max_slider = dw::Slider::Create(comp);
y_max_slider->SetText(" Ymax ");
y_max_slider->format = "% 6.0f";
y_max_slider->SetParams(rob_osage_test->node.hinge.ymax, 0.0f, 179.0f, 89.5f, 0.5f, 5.0f);
y_max_slider->AddSelectionListener(new dw::SelectionListenerOnHook(
RobOsageTestDw::Node::Hinge::YMaxCallback));
z_min_slider = dw::Slider::Create(comp);
z_min_slider->SetText(" Zmin ");
z_min_slider->format = "% 6.0f";
z_min_slider->SetParams(rob_osage_test->node.hinge.zmin, -179.0f, 0.0f, 89.5f, 0.5f, 5.0f);
z_min_slider->AddSelectionListener(new dw::SelectionListenerOnHook(
RobOsageTestDw::Node::Hinge::ZMinCallback));
z_max_slider = dw::Slider::Create(comp);
z_max_slider->SetText(" Zmax ");
z_max_slider->format = "% 6.0f";
z_max_slider->SetParams(rob_osage_test->node.hinge.zmax, 0.0f, 179.0f, 89.5f, 0.5f, 5.0f);
z_max_slider->AddSelectionListener(new dw::SelectionListenerOnHook(
RobOsageTestDw::Node::Hinge::ZMaxCallback));
}
else if (y_min_slider) {
comp->controls.erase(comp->controls.begin() + comp->GetControlIndex(y_min_slider));
@@ -1615,6 +1632,34 @@ 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) {
}
}
void RobOsageTestDw::Node::Hinge::YMaxCallback(dw::Widget* data) {
dw::Slider* slider = dynamic_cast<dw::Slider*>(data);
if (slider) {
}
}
void RobOsageTestDw::Node::Hinge::ZMinCallback(dw::Widget* data) {
dw::Slider* slider = dynamic_cast<dw::Slider*>(data);
if (slider) {
}
}
void RobOsageTestDw::Node::Hinge::ZMaxCallback(dw::Widget* data) {
dw::Slider* slider = dynamic_cast<dw::Slider*>(data);
if (slider) {
}
}
RobOsageTestDw::Node::InertialCancel::InertialCancel(dw::Composite* parent) : slider() {
comp = new dw::Composite(parent);
comp->SetLayout(new dw::RowLayout(dw::HORIZONTAL));
@@ -1912,7 +1957,7 @@ void RobOsageTestDw::ColliElement::Init(dw::Composite* parent) {
bone0_x_slider->callback_data.i32 = 0;
bone0_x_slider->AddSelectionListener(new dw::SelectionListenerOnHook(
RobOsageTestDw::ColliElement::BonePosXCallback));
bone0_y_slider = dw::Slider::Create(group);
bone0_y_slider->SetText("y");
bone0_y_slider->format = "% 2.3f ";
@@ -1920,7 +1965,7 @@ void RobOsageTestDw::ColliElement::Init(dw::Composite* parent) {
bone0_y_slider->callback_data.i32 = 0;
bone0_y_slider->AddSelectionListener(new dw::SelectionListenerOnHook(
RobOsageTestDw::ColliElement::BonePosYCallback));
bone0_z_slider = dw::Slider::Create(group);
bone0_z_slider->SetText("z");
bone0_z_slider->format = "% 2.3f ";
+1
View File
@@ -6,6 +6,7 @@
#pragma once
#include "../../KKdLib/default.hpp"
#include "../../KKdLib/prj/vector_pair.hpp"
#include "../../CRE/rob/rob.hpp"
#include "../../CRE/task.hpp"
+3 -3
View File
@@ -213,7 +213,7 @@ void FogDw::TypeListBox::Callback(dw::SelectionListener::CallbackData* data) {
FogDw::DensitySlider::DensitySlider(FogDw* fog_dw, dw::Widget* parent) {
this->fog_dw = fog_dw;
density = 0;
dw::Composite* comp = dynamic_cast<dw::Composite*>(parent);
if (comp) {
fog* fog = fog_dw_get_fog();
@@ -314,7 +314,7 @@ FogDw::ColorSlider::ColorSlider(FogDw* fog_dw, dw::Widget* parent) {
r->SetParams(value.y, 0.0f, 8.0f, 0.8f, 0.01f, 0.1f);
r->callback_data.i64 = 1;
r->AddSelectionListener(this);
g = dw::Slider::Create(comp);
g->SetText("G");
g->format = "%3.2f";
@@ -358,7 +358,7 @@ FogDw::IoButton::IoButton(FogDw* fog_dw, dw::Widget* parent) {
save->SetText("SAVE");
save->callback_data.v64 = fog_dw;
save->callback = FogDw::IoButton::SaveCallback;
load = new dw::Button(_comp, dw::FLAG_8);
load->SetText("LOAD");
load->callback_data.v64 = fog_dw;