summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPheenoh <pheenoh@gmail.com>2021-05-12 22:44:37 -0400
committerPheenoh <pheenoh@gmail.com>2021-05-12 22:44:37 -0400
commit5c7589aa1615183fe390b23101de97858aa760a5 (patch)
tree1489bfac14980fc05b16ffabf066935e6905fece
parentd9f24828567057824a6a14cfd68ad4bf29d8a5f3 (diff)
clang-format
-rw-r--r--include/utils/card.h1
-rw-r--r--src/commands.cpp32
-rw-r--r--src/fs.cpp1
-rw-r--r--src/lib.cpp4
-rw-r--r--src/save_manager.cpp23
-rw-r--r--src/utils/loading.cpp5
6 files changed, 39 insertions, 27 deletions
diff --git a/include/utils/card.h b/include/utils/card.h
index 1a0fb89..e0a1985 100644
--- a/include/utils/card.h
+++ b/include/utils/card.h
@@ -2,7 +2,6 @@
#include "gcn_c/include/card.h"
#include "menu.h"
-
namespace Utilities {
int32_t card_write(CardInfo* card_info, void* data, int32_t size, int32_t offset,
int32_t sector_size);
diff --git a/src/commands.cpp b/src/commands.cpp
index dce0bae..f85c6ac 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -83,13 +83,17 @@ void hit_reset() {
void reload_area() {
inject_save_flag = true;
if (g_area_reload_behavior == LOAD_AREA) {
- tp_memcpy(tp_gameInfo.temp_flags.flags, gSaveManager.mAreaReloadOpts.temp_flags,
- sizeof(gSaveManager.mAreaReloadOpts.temp_flags)); // restore last set of saved temp flags
- tp_gameInfo.inventory.tears = gSaveManager.mAreaReloadOpts.tears; // restore last tear count
- gSaveManager.mPracticeFileOpts.inject_options_before_load = SaveManager::inject_default_before;
+ tp_memcpy(
+ tp_gameInfo.temp_flags.flags, gSaveManager.mAreaReloadOpts.temp_flags,
+ sizeof(
+ gSaveManager.mAreaReloadOpts.temp_flags)); // restore last set of saved temp flags
+ tp_gameInfo.inventory.tears =
+ gSaveManager.mAreaReloadOpts.tears; // restore last tear count
+ gSaveManager.mPracticeFileOpts.inject_options_before_load =
+ SaveManager::inject_default_before;
gSaveManager.mPracticeFileOpts.inject_options_during_load = nullptr;
gSaveManager.mPracticeFileOpts.inject_options_after_load = nullptr;
- } else {
+ } else {
SaveManager::load_save(last_save_index, last_category, last_special_ptr, 0xFF);
}
} // namespace Commands
@@ -97,9 +101,12 @@ void reload_area() {
void gorge_void() {
if (button_this_frame == GORGE_VOID_BUTTONS && button_last_frame != GORGE_VOID_BUTTONS) {
SaveManager::load_save_file("tpgz/save_files/any/gorge_void.bin");
- gSaveManager.mPracticeFileOpts.inject_options_before_load = SaveManager::inject_default_before;
- gSaveManager.mPracticeFileOpts.inject_options_during_load = GorgeVoidIndicator::warp_to_gorge;
- gSaveManager.mPracticeFileOpts.inject_options_after_load = GorgeVoidIndicator::prep_rupee_roll;
+ gSaveManager.mPracticeFileOpts.inject_options_before_load =
+ SaveManager::inject_default_before;
+ gSaveManager.mPracticeFileOpts.inject_options_during_load =
+ GorgeVoidIndicator::warp_to_gorge;
+ gSaveManager.mPracticeFileOpts.inject_options_after_load =
+ GorgeVoidIndicator::prep_rupee_roll;
inject_save_flag = true;
}
}
@@ -108,9 +115,12 @@ void gorge_void() {
void back_in_time() {
if (button_this_frame == BACK_IN_TIME_BUTTONS && button_last_frame != BACK_IN_TIME_BUTTONS) {
SaveManager::load_save_file("tpgz/save_files/any/ordon_gate_clip.bin");
- gSaveManager.mPracticeFileOpts.inject_options_before_load = gSaveManager.inject_default_before;
- gSaveManager.mPracticeFileOpts.inject_options_during_load = gSaveManager.inject_default_during;
- gSaveManager.mPracticeFileOpts.inject_options_after_load = BiTIndicator::set_camera_angle_position;
+ gSaveManager.mPracticeFileOpts.inject_options_before_load =
+ gSaveManager.inject_default_before;
+ gSaveManager.mPracticeFileOpts.inject_options_during_load =
+ gSaveManager.inject_default_during;
+ gSaveManager.mPracticeFileOpts.inject_options_after_load =
+ BiTIndicator::set_camera_angle_position;
gSaveManager.mPracticeFileOpts.inject_options_after_counter = 10;
inject_save_flag = true;
}
diff --git a/src/fs.cpp b/src/fs.cpp
index 4b019b7..06de68f 100644
--- a/src/fs.cpp
+++ b/src/fs.cpp
@@ -3,7 +3,6 @@
#include "gcn_c/include/dvd.h"
#include "libtp_c/include/system.h"
-
void loadFile(const char* filePath, void* buffer, signed long length, signed long offset) {
DVDFileInfo fileInfo;
if (DVDOpen(filePath, &fileInfo)) {
diff --git a/src/lib.cpp b/src/lib.cpp
index 47e6df6..bb1f40a 100644
--- a/src/lib.cpp
+++ b/src/lib.cpp
@@ -125,8 +125,8 @@ void draw() {
setupRendering();
// Consolas.setupRendering();
if (MenuRendering::is_menu_open()) {
- Font::gz_renderChars("tpgz v" INTERNAL_GZ_VERSION, sprite_offsets[MENU_INDEX].x + 35.0f, 25.0f, cursor_rgba,
- g_drop_shadows);
+ Font::gz_renderChars("tpgz v" INTERNAL_GZ_VERSION, sprite_offsets[MENU_INDEX].x + 35.0f,
+ 25.0f, cursor_rgba, g_drop_shadows);
if (gzIconTex.loadCode == TexCode::TEX_OK) {
Draw::draw_rect(0xFFFFFFFF, {sprite_offsets[MENU_INDEX].x, 5.0f}, {30, 30},
&gzIconTex._texObj);
diff --git a/src/save_manager.cpp b/src/save_manager.cpp
index d525bf2..87fb0c1 100644
--- a/src/save_manager.cpp
+++ b/src/save_manager.cpp
@@ -81,9 +81,10 @@ void SaveManager::load_save(uint32_t id, char* category, special i_specials[], i
// Load the corresponding file path and properties
tp_sprintf(currentFileName, "tpgz/save_files/%s.bin", category);
- loadFile(currentFileName, &gSaveManager.mPracticeSaveInfo, sizeof(gSaveManager.mPracticeSaveInfo),
- id * sizeof(gSaveManager.mPracticeSaveInfo));
- tp_sprintf(currentFileName, "tpgz/save_files/%s/%s.bin", category, gSaveManager.mPracticeSaveInfo.filename);
+ loadFile(currentFileName, &gSaveManager.mPracticeSaveInfo,
+ sizeof(gSaveManager.mPracticeSaveInfo), id * sizeof(gSaveManager.mPracticeSaveInfo));
+ tp_sprintf(currentFileName, "tpgz/save_files/%s/%s.bin", category,
+ gSaveManager.mPracticeSaveInfo.filename);
// 0xFF is used to identify a call from file reload, which doesn't need to run the default load
if (size != 0xFF) {
@@ -93,10 +94,12 @@ void SaveManager::load_save(uint32_t id, char* category, special i_specials[], i
}
if (gSaveManager.mPracticeSaveInfo.requirements) {
- gSaveManager.mPracticeFileOpts.inject_options_after_load = gSaveManager.mPracticeSaveInfo.requirements & REQ_CAM ?
- Utilities::set_camera_angle_position :
- Utilities::set_angle_position;
- gSaveManager.mPracticeFileOpts.inject_options_after_counter = gSaveManager.mPracticeSaveInfo.counter;
+ gSaveManager.mPracticeFileOpts.inject_options_after_load =
+ gSaveManager.mPracticeSaveInfo.requirements & REQ_CAM ?
+ Utilities::set_camera_angle_position :
+ Utilities::set_angle_position;
+ gSaveManager.mPracticeFileOpts.inject_options_after_counter =
+ gSaveManager.mPracticeSaveInfo.counter;
}
tp_bossFlags = 0;
@@ -106,10 +109,12 @@ void SaveManager::load_save(uint32_t id, char* category, special i_specials[], i
for (int i = 0; i < size; ++i) {
if (id == i_specials[i].idx) {
if (i_specials[i].CallbackDuring) {
- gSaveManager.mPracticeFileOpts.inject_options_during_load = i_specials[i].CallbackDuring;
+ gSaveManager.mPracticeFileOpts.inject_options_during_load =
+ i_specials[i].CallbackDuring;
}
if (i_specials[i].CallbackAfter) {
- gSaveManager.mPracticeFileOpts.inject_options_after_load = i_specials[i].CallbackAfter;
+ gSaveManager.mPracticeFileOpts.inject_options_after_load =
+ i_specials[i].CallbackAfter;
}
}
}
diff --git a/src/utils/loading.cpp b/src/utils/loading.cpp
index 9afa48c..6da3fb8 100644
--- a/src/utils/loading.cpp
+++ b/src/utils/loading.cpp
@@ -15,8 +15,8 @@ void set_camera_angle_position() {
tp_matrixInfo.matrix_info->pos = gSaveManager.mPracticeSaveInfo.cam_pos;
tp_zelAudio.link_debug_ptr->facing = gSaveManager.mPracticeSaveInfo.angle;
tp_zelAudio.link_debug_ptr->position = gSaveManager.mPracticeSaveInfo.position;
- tp_osReport("%d",gSaveManager.mPracticeSaveInfo.angle);
- tp_osReport("0x%08X",&gSaveManager.mPracticeSaveInfo.angle);
+ tp_osReport("%d", gSaveManager.mPracticeSaveInfo.angle);
+ tp_osReport("0x%08X", &gSaveManager.mPracticeSaveInfo.angle);
}
void set_angle_position() {
@@ -24,5 +24,4 @@ void set_angle_position() {
tp_zelAudio.link_debug_ptr->position = gSaveManager.mPracticeSaveInfo.position;
}
-
} // namespace Utilities \ No newline at end of file