diff --git a/src/ReDIVA/data_test/auth_2d_test.cpp b/src/ReDIVA/data_test/auth_2d_test.cpp index 412df835..ce1c51a2 100644 --- a/src/ReDIVA/data_test/auth_2d_test.cpp +++ b/src/ReDIVA/data_test/auth_2d_test.cpp @@ -394,7 +394,7 @@ void dtm_aet_load() { if (!dtw_aet) { dtw_aet = new DtwAet; - dtw_aet->sub_1402F38B0(); + dtw_aet->LimitPosDisp(); } else dtw_aet->Disp(); diff --git a/src/ReDIVA/data_test/auth_3d_test.cpp b/src/ReDIVA/data_test/auth_3d_test.cpp index baa9bcea..f0a12685 100644 --- a/src/ReDIVA/data_test/auth_3d_test.cpp +++ b/src/ReDIVA/data_test/auth_3d_test.cpp @@ -1809,14 +1809,14 @@ void SelectionButtonBool::Callback(CallbackData* data) { static void auth_3d_test_window_init() { if (!auth_3d_test_window) { Auth3dTestWindow* test_window = new Auth3dTestWindow; - test_window->sub_1402F38B0(); + test_window->LimitPosDisp(); Auth3dTestSubWindow* sub_window = new Auth3dTestSubWindow; - sub_window->sub_1402F38B0(); + sub_window->LimitPosDisp(); test_window->sub_window = sub_window; Auth3dTestRobWindow* rob_window = new Auth3dTestRobWindow; - rob_window->sub_1402F38B0(); + rob_window->LimitPosDisp(); test_window->rob_window = rob_window; auth_3d_test_window = test_window; diff --git a/src/ReDIVA/data_test/equip_test.cpp b/src/ReDIVA/data_test/equip_test.cpp index 3d525a01..d51047a3 100644 --- a/src/ReDIVA/data_test/equip_test.cpp +++ b/src/ReDIVA/data_test/equip_test.cpp @@ -841,7 +841,7 @@ void DataTestEquipDw::sub_140261C40(int32_t chara_id) { void data_test_equip_dw_init() { if (!data_test_equip_dw) { data_test_equip_dw = new DataTestEquipDw; - data_test_equip_dw->sub_1402F38B0(); + data_test_equip_dw->LimitPosDisp(); } else { data_test_item_equip_array_load(); diff --git a/src/ReDIVA/data_test/glitter_test.cpp b/src/ReDIVA/data_test/glitter_test.cpp index 7707ba63..c26f53e1 100644 --- a/src/ReDIVA/data_test/glitter_test.cpp +++ b/src/ReDIVA/data_test/glitter_test.cpp @@ -76,7 +76,7 @@ bool TaskDataTestGlitterParticle::init() { hash = hash_fnv1a64m_empty; scene_counter = 0; dw = new DataTestGlitterParticleDw(this); - dw->sub_1402F38B0(); + dw->LimitPosDisp(); frame = 0; auto_and_repeat = false; reload = false; diff --git a/src/ReDIVA/data_test/motion_test.cpp b/src/ReDIVA/data_test/motion_test.cpp index 3b6a3d7e..380c9ef0 100644 --- a/src/ReDIVA/data_test/motion_test.cpp +++ b/src/ReDIVA/data_test/motion_test.cpp @@ -2944,7 +2944,7 @@ static void data_test_mot_dw_array_init(int32_t chara_id, DtmMot* dtm_mot) { DataTestMotDw* test_mot_dw = new DataTestMotDw(chara_id, dtm_mot); data_test_mot_dw_array[chara_id] = test_mot_dw; - test_mot_dw->sub_1402F38B0(); + test_mot_dw->LimitPosDisp(); switch (chara_id) { case 0: { @@ -2966,7 +2966,7 @@ static void data_test_mot_a3d_dw_init() { data_test_mot_a3d_add_task(); if (!data_test_mot_a3d_dw) { data_test_mot_a3d_dw = new DataTestMotA3dDw; - data_test_mot_a3d_dw->sub_1402F38B0(); + data_test_mot_a3d_dw->LimitPosDisp(); } else data_test_mot_a3d_dw->Disp(); @@ -2979,7 +2979,7 @@ static DataTestMotA3dDw* data_test_mot_a3d_dw_get() { static void data_test_mot_ctrl_dw_init() { if (!data_test_mot_ctrl_dw) { data_test_mot_ctrl_dw = new DataTestMotCtrlDw; - data_test_mot_ctrl_dw->sub_1402F38B0(); + data_test_mot_ctrl_dw->LimitPosDisp(); } else data_test_mot_ctrl_dw->Disp(); @@ -2995,7 +2995,7 @@ static void data_test_face_mot_dw_array_init(int32_t chara_id) { if (!data_test_face_mot_dw_array[chara_id]) { data_test_face_mot_dw_array[chara_id] = new DataTestFaceMotDw(chara_id); - data_test_face_mot_dw_array[chara_id]->sub_1402F38B0(); + data_test_face_mot_dw_array[chara_id]->LimitPosDisp(); } else data_test_face_mot_dw_array[chara_id]->Disp(); diff --git a/src/ReDIVA/data_test/object_test.cpp b/src/ReDIVA/data_test/object_test.cpp index 2ea6932b..8d8c829e 100644 --- a/src/ReDIVA/data_test/object_test.cpp +++ b/src/ReDIVA/data_test/object_test.cpp @@ -517,7 +517,7 @@ void DataTestObjDw::StageDisplayCallback(dw::Widget* data) { static void data_test_obj_dw_init() { if (!data_test_obj_dw) { data_test_obj_dw = new DataTestObjDw; - data_test_obj_dw->sub_1402F38B0(); + data_test_obj_dw->LimitPosDisp(); } else data_test_obj_dw->Disp(); diff --git a/src/ReDIVA/data_test/rob_osage_test.cpp b/src/ReDIVA/data_test/rob_osage_test.cpp index 2c020c55..a773e782 100644 --- a/src/ReDIVA/data_test/rob_osage_test.cpp +++ b/src/ReDIVA/data_test/rob_osage_test.cpp @@ -441,7 +441,7 @@ RobOsageTest::~RobOsageTest() { bool RobOsageTest::init() { if (!rob_osage_test_dw) { rob_osage_test_dw = new RobOsageTestDw; - rob_osage_test_dw->sub_1402F38B0(); + rob_osage_test_dw->LimitPosDisp(); } else rob_osage_test_dw->Disp(); diff --git a/src/ReDIVA/dw.cpp b/src/ReDIVA/dw.cpp index 72aa6d45..0387270c 100644 --- a/src/ReDIVA/dw.cpp +++ b/src/ReDIVA/dw.cpp @@ -136,7 +136,7 @@ namespace dw_gui_detail { dw::Widget::KeyCallbackData key_callback_data; std::vector free_widgets; dw_gui_detail::Input input; - dw::init_data field_F8; + dw::DisplayData data; int64_t field_118; vec2 field_120; float_t field_128; @@ -144,7 +144,7 @@ namespace dw_gui_detail { std::wstring name; RootKeySelection root_key_selection; - Display(dw::init_data& init_data); + Display(dw::DisplayData& data); virtual ~Display(); void CheckShells(); @@ -441,12 +441,12 @@ namespace dw { Draw(); } - void Widget::sub_1402F3770(Widget* widget) { + void Widget::LimitPos(Widget* widget) { if (!widget) return; rectangle v10 = widget->GetRectangle(); - rectangle v11 = dw_gui_detail_display->field_F8.field_0; + rectangle v11 = dw_gui_detail_display->data.field_0; if (v11.pos.x > v10.pos.x || v10.pos.x + v10.size.x > v11.pos.x + v11.size.x || v11.pos.y > v10.pos.y || v10.pos.y + v10.size.y > v11.pos.y + v11.size.y) { vec2 v7 = v10.pos; @@ -1095,6 +1095,11 @@ namespace dw { return disp; } + void Shell::LimitPosDisp() { + LimitPos(this); + Disp(); + } + void Shell::SetDisp(bool value) { if (disp == value) return; @@ -1124,11 +1129,6 @@ namespace dw { field_178 = 0; } - void Shell::sub_1402F38B0() { - sub_1402F3770(this); - Disp(); - } - KeyListener::KeyListener() { } @@ -2285,8 +2285,8 @@ namespace dw { vec2 size = list->GetSize(); vec2 pos; - if (dw_gui_detail_display->field_F8.field_0.pos.y - + dw_gui_detail_display->field_F8.field_0.size.y > rect.pos.y + rect.size.y + size.y) + if (dw_gui_detail_display->data.field_0.pos.y + + dw_gui_detail_display->data.field_0.size.y > rect.pos.y + rect.size.y + size.y) pos.y = rect.size.y; else pos.y = -size.y; @@ -2976,7 +2976,7 @@ namespace dw { return slider; } - init_data::init_data() { + DisplayData::DisplayData() { } @@ -3070,28 +3070,28 @@ namespace dw { } void dw_init() { - dw::init_data init_data; + dw::DisplayData data; resolution_struct* res_wind = res_window_get(); - init_data.field_10.size.x = (float_t)res_wind->width; - init_data.field_10.size.y = (float_t)res_wind->height; - init_data.field_0.size = init_data.field_10.size; - dw_init(init_data); + data.field_10.size.x = (float_t)res_wind->width; + data.field_10.size.y = (float_t)res_wind->height; + data.field_0.size = data.field_10.size; + dw_init(data); } -void dw_init(dw::init_data& init_data) { +void dw_init(dw::DisplayData& data) { dw::colors_current = dw::colors_default; //dw::set_color_list(&dw::colors_current); dw::font_init(); if (!dw::print) - dw::print = new dw::Print(init_data.field_0.size.x, init_data.field_0.size.y); + dw::print = new dw::Print(data.field_0.size.x, data.field_0.size.y); dw::print->SetColor(dw::colors_current.foreground); dw::print->SetFillColor(dw::colors_current.background); if (!dw_gui_detail_display) - dw_gui_detail_display = new dw_gui_detail::Display(init_data); + dw_gui_detail_display = new dw_gui_detail::Display(data); if (!dw::clipboard) dw::clipboard = new std::wstring; @@ -3486,18 +3486,18 @@ void dw_gui_detail::Display::RootKeySelection::Field_8(const dw::Widget::KeyCall } -dw_gui_detail::Display::Display(dw::init_data& init_data) : active_shell(), +dw_gui_detail::Display::Display(dw::DisplayData& data) : active_shell(), active_menu(), on(), move(), widget(), cap(), focused_shell(), find_focus(), field_118() { set_focus = true; - field_F8 = init_data; + this->data = data; field_128 = 1.0f; - field_120 = (1.0f / field_128) * init_data.field_10.size; + field_120 = (1.0f / field_128) * this->data.field_10.size; name.assign(L"Display"); /*drag_bounds_control = new dw::DragBoundsControl; - drag_bounds_control->rect.pos = field_F8.field_0.pos; - drag_bounds_control->SetSize(field_F8.field_0.size); + drag_bounds_control->rect.pos = this->data.field_0.pos; + drag_bounds_control->SetSize(this->data.field_0.size); drag_bounds_control->AddKeyListener(&root_key_selection); v10 = new dw::Menu(drag_bounds_control); diff --git a/src/ReDIVA/dw.hpp b/src/ReDIVA/dw.hpp index 03997d55..e77d93a0 100644 --- a/src/ReDIVA/dw.hpp +++ b/src/ReDIVA/dw.hpp @@ -250,7 +250,7 @@ namespace dw { SetText(str); } - static void sub_1402F3770(Widget* widget); + static void LimitPos(Widget* widget); }; class KeyListener; @@ -395,11 +395,11 @@ namespace dw { void Disp(); bool GetDisp(); + void LimitPosDisp(); void SetDisp(bool value = false); void sub_1402E43C0(Widget* widget); void sub_1402E61F0(Widget* widget); - void sub_1402F38B0(); }; class KeyListener { @@ -855,11 +855,11 @@ namespace dw { } }; - struct init_data { + struct DisplayData { rectangle field_0; rectangle field_10; - init_data(); + DisplayData(); }; class DropDownListScrollBarSelectionListener : public SelectionAdapter { @@ -896,7 +896,7 @@ namespace dw { } extern void dw_init(); -extern void dw_init(dw::init_data& init_data); +extern void dw_init(dw::DisplayData& data); extern void dw_free(); extern void dw_gui_ctrl_disp(); diff --git a/src/ReDIVA/graphics/color_change.cpp b/src/ReDIVA/graphics/color_change.cpp index a0d186f1..f57e346c 100644 --- a/src/ReDIVA/graphics/color_change.cpp +++ b/src/ReDIVA/graphics/color_change.cpp @@ -121,7 +121,7 @@ void color_change_dw_init() { if (!color_change_dw) { color_change_dw = new ColorChangeDw; color_change_dw->UpdateLayout(); - color_change_dw->sub_1402F38B0(); + color_change_dw->LimitPosDisp(); } else color_change_dw->Disp(); diff --git a/src/ReDIVA/graphics/face_light.cpp b/src/ReDIVA/graphics/face_light.cpp index 70081883..cf7d8a24 100644 --- a/src/ReDIVA/graphics/face_light.cpp +++ b/src/ReDIVA/graphics/face_light.cpp @@ -46,7 +46,7 @@ DwFaceLight::SliderSelectionListener dw_face_light_slider_selection_listener; void dw_face_light_init() { if (!dw_face_light) { dw_face_light = new DwFaceLight; - dw_face_light->sub_1402F38B0(); + dw_face_light->LimitPosDisp(); } else dw_face_light->Disp(); diff --git a/src/ReDIVA/graphics/fog.cpp b/src/ReDIVA/graphics/fog.cpp index 36de7841..9b65b101 100644 --- a/src/ReDIVA/graphics/fog.cpp +++ b/src/ReDIVA/graphics/fog.cpp @@ -125,7 +125,7 @@ static fog* fog_dw_get_fog(); void fog_dw_init() { if (!fog_dw) { fog_dw = new FogDw; - fog_dw->sub_1402F38B0(); + fog_dw->LimitPosDisp(); } else fog_dw->Disp(); diff --git a/src/ReDIVA/graphics/glitter.cpp b/src/ReDIVA/graphics/glitter.cpp index 6e13e926..2874ad07 100644 --- a/src/ReDIVA/graphics/glitter.cpp +++ b/src/ReDIVA/graphics/glitter.cpp @@ -26,7 +26,7 @@ GlitterDw* glitter_dw; void glitter_dw_init() { if (!glitter_dw) { glitter_dw = new GlitterDw; - glitter_dw->sub_1402F38B0(); + glitter_dw->LimitPosDisp(); } else glitter_dw->Disp(); diff --git a/src/ReDIVA/graphics/global_material.cpp b/src/ReDIVA/graphics/global_material.cpp index 085aad9b..fab7e0dc 100644 --- a/src/ReDIVA/graphics/global_material.cpp +++ b/src/ReDIVA/graphics/global_material.cpp @@ -32,7 +32,7 @@ GlobalMaterialDw* global_material_dw; void global_material_dw_init() { if (!global_material_dw) { global_material_dw = new GlobalMaterialDw; - global_material_dw->sub_1402F38B0(); + global_material_dw->LimitPosDisp(); global_material_dw->UpdateLayout(); } else diff --git a/src/ReDIVA/graphics/light.cpp b/src/ReDIVA/graphics/light.cpp index 5791d39d..ea2f8d16 100644 --- a/src/ReDIVA/graphics/light.cpp +++ b/src/ReDIVA/graphics/light.cpp @@ -275,7 +275,7 @@ static light_data* light_dw_get_light(); void light_dw_init() { if (!light_dw) { light_dw = new LightDw; - light_dw->sub_1402F38B0(); + light_dw->LimitPosDisp(); } else light_dw->Disp(); diff --git a/src/ReDIVA/graphics/material.cpp b/src/ReDIVA/graphics/material.cpp index d9631460..433313b1 100644 --- a/src/ReDIVA/graphics/material.cpp +++ b/src/ReDIVA/graphics/material.cpp @@ -107,7 +107,7 @@ MaterialDw* material_dw; void material_dw_init() { if (!material_dw) { material_dw = new MaterialDw; - material_dw->sub_1402F38B0(); + material_dw->LimitPosDisp(); material_dw->UpdateLayout(); } else diff --git a/src/ReDIVA/graphics/post_process.cpp b/src/ReDIVA/graphics/post_process.cpp index 0c3cc159..307f5eea 100644 --- a/src/ReDIVA/graphics/post_process.cpp +++ b/src/ReDIVA/graphics/post_process.cpp @@ -139,7 +139,7 @@ void dw_post_process_init() { if (!dw_post_process) { dw_post_process = new dwPostProcess; dw_post_process->UpdateLayout(); - dw_post_process->sub_1402F38B0(); + dw_post_process->LimitPosDisp(); } else dw_post_process->Disp(); @@ -889,7 +889,7 @@ static void dw_scene_fade_init() { if (!dw_scene_fade) { dw_scene_fade = new dwSceneFade; dw_scene_fade->UpdateLayout(); - dw_scene_fade->sub_1402F38B0(); + dw_scene_fade->LimitPosDisp(); } else dw_scene_fade->Disp(); @@ -899,7 +899,7 @@ static void dw_tone_trans_init() { if (!dw_tone_trans) { dw_tone_trans = new dwToneTrans; dw_tone_trans->UpdateLayout(); - dw_tone_trans->sub_1402F38B0(); + dw_tone_trans->LimitPosDisp(); } else dw_tone_trans->Disp(); diff --git a/src/ReDIVA/graphics/reflect_refract.cpp b/src/ReDIVA/graphics/reflect_refract.cpp index f204dfee..7e65715f 100644 --- a/src/ReDIVA/graphics/reflect_refract.cpp +++ b/src/ReDIVA/graphics/reflect_refract.cpp @@ -34,7 +34,7 @@ void reflect_refract_dw_init() { if (!reflect_refract_dw) { reflect_refract_dw = new ReflectRefractDw; reflect_refract_dw->UpdateLayout(); - reflect_refract_dw->sub_1402F38B0(); + reflect_refract_dw->LimitPosDisp(); } else reflect_refract_dw->Disp(); diff --git a/src/ReDIVA/graphics/render_settings.cpp b/src/ReDIVA/graphics/render_settings.cpp index 2f955515..0ac2f039 100644 --- a/src/ReDIVA/graphics/render_settings.cpp +++ b/src/ReDIVA/graphics/render_settings.cpp @@ -35,7 +35,7 @@ static void render_settings_scale_to_string(char* str, size_t str_len); void render_settings_dw_init() { if (!render_settings_dw) { render_settings_dw = new RenderSettingsDw; - render_settings_dw->sub_1402F38B0(); + render_settings_dw->LimitPosDisp(); } else render_settings_dw->Disp(); diff --git a/src/ReDIVA/graphics/shadow.cpp b/src/ReDIVA/graphics/shadow.cpp index 7d7d044a..eb254768 100644 --- a/src/ReDIVA/graphics/shadow.cpp +++ b/src/ReDIVA/graphics/shadow.cpp @@ -47,7 +47,7 @@ void shadow_dw_init() { if (!shadow_dw) { shadow_dw = new ShadowDw; shadow_dw->UpdateLayout(); - shadow_dw->sub_1402F38B0(); + shadow_dw->LimitPosDisp(); } else shadow_dw->Disp(); diff --git a/src/ReDIVA/information/dw_console.cpp b/src/ReDIVA/information/dw_console.cpp index 97bcf50f..05f21b32 100644 --- a/src/ReDIVA/information/dw_console.cpp +++ b/src/ReDIVA/information/dw_console.cpp @@ -77,7 +77,7 @@ static const char* dw_console_c_buff_array_get_buf(int32_t index); void dw_console_init() { if (!dw_console) { dw_console = new DwConsole; - dw_console->sub_1402F38B0(); + dw_console->LimitPosDisp(); } else dw_console->Disp(); diff --git a/src/ReDIVA/information/frame_speed.cpp b/src/ReDIVA/information/frame_speed.cpp index 606e1c7d..089a7002 100644 --- a/src/ReDIVA/information/frame_speed.cpp +++ b/src/ReDIVA/information/frame_speed.cpp @@ -31,7 +31,7 @@ FrameSpeedWindow* frame_speed_window; void frame_speed_window_init() { if (!frame_speed_window) { frame_speed_window = new FrameSpeedWindow; - frame_speed_window->sub_1402F38B0(); + frame_speed_window->LimitPosDisp(); frame_speed_window->slider->SetValue(get_delta_frame()); } else { diff --git a/src/ReDIVA/information/task.cpp b/src/ReDIVA/information/task.cpp index e0d321f7..4918ca13 100644 --- a/src/ReDIVA/information/task.cpp +++ b/src/ReDIVA/information/task.cpp @@ -40,7 +40,7 @@ static int32_t task_sort_by_name(void const* src1, void const* src2); void dw_task_init() { if (!dw_task) { dw_task = new DwTask(); - dw_task->sub_1402F38B0(); + dw_task->LimitPosDisp(); } else dw_task->Disp();