From 01534790b1f7e260a2e5cd8a7ac6d23c788e355b Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Sat, 11 Feb 2023 17:10:06 -0400 Subject: TMainTask: Add, and match `func_80228c44()` oof, my system crashed in the middle of builing `TMainTask.cpp`, causing it to corrupt the source file, meaning I had to redo this function again. Thank god I'm using version control. --- context.h | 1 + include/pso/TMainTask.h | 1 + src/pso/TMainTask.cpp | 66 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+) diff --git a/context.h b/context.h index 8a6bdcd..36c7384 100644 --- a/context.h +++ b/context.h @@ -317,6 +317,7 @@ public: void unused_render_func(); void render_objects(); void render_ui(); + void func_80228c44(s32 arg0); void func_80228dbc(); void render_clipout_and_fade(); void init_main_task(); diff --git a/include/pso/TMainTask.h b/include/pso/TMainTask.h index 31e8e79..e889a30 100644 --- a/include/pso/TMainTask.h +++ b/include/pso/TMainTask.h @@ -47,6 +47,7 @@ public: void unused_render_func(); void render_objects(); void render_ui(); + void func_80228c44(s32 arg0); void func_80228dbc(); void render_clipout_and_fade(); void init_main_task(); diff --git a/src/pso/TMainTask.cpp b/src/pso/TMainTask.cpp index 71a1393..8ae626c 100644 --- a/src/pso/TMainTask.cpp +++ b/src/pso/TMainTask.cpp @@ -164,6 +164,72 @@ void TMainTask::render() { set_task_flags(0x100); } + +void TMainTask::func_80228c44(s32 arg0) { + set_task_flags(0x20); + some_main_task_flag = 0; + set_depth_buffer_settings_3(); + set_depth_buffer_settings_id(1); + save_depth_buffer_settings(); + + switch (arg0) { + case 0: + tl_03->render_nodes(); + tl_04->render_nodes(); + + set_depth_buffer_settings_id(3); + + tl_item_equip->allow_rendering(); + tl_item_equip->render_nodes(); + tl_item_equip->disallow_rendering(); + + func_80141618(); + break; + case 1: + tl_03->render_nodes(); + tl_04->render_nodes(); + break; + case 2: + tl_03->render_nodes(); + break; + case 3: + tl_04->render_nodes(); + break; + case 4: + set_depth_buffer_settings_id(1); + func_803e11e8(1); + + tl_item_equip->allow_rendering(); + tl_item_equip->render_nodes(); + tl_item_equip->disallow_rendering(); + + func_803e11f0(); + func_80141618(); + break; + case 5: + set_depth_buffer_settings_id(2); + func_803e11e8(2); + + tl_item_equip->allow_rendering(); + tl_item_equip->render_nodes(); + tl_item_equip->disallow_rendering(); + + func_803e11f0(); + func_80141618(); + break; + } + + restore_depth_buffer_settings(); + some_main_task_flag = 1; + + set_depth_buffer_settings_1(); + set_depth_buffer_settings_id(2); + save_depth_buffer_settings(); + + restore_depth_buffer_settings(); + clear_task_flags(0x20); +} + void TMainTask::func_80228dbc() { set_task_flags(0x10); some_main_task_flag = 0; -- cgit v1.2.3-13-gbd6f