summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKiritoDv <36680385+KiritoDv@users.noreply.github.com>2025-05-16 02:44:40 +0000
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2025-05-16 02:44:40 +0000
commitb53a5dbcfa24ef2aa4860b6d9512709976686de8 (patch)
tree441f2bb9c0bc8f955eb9289d19b13beab5c239c5 /include
parentbdf5ca8d603ae56ac275bebf9fde58ae72484d76 (diff)
clang formatclang-format
Diffstat (limited to 'include')
-rw-r--r--include/actor_types.h35
-rw-r--r--include/common_structs.h3
-rw-r--r--include/course_offsets.h8
-rw-r--r--include/defines.h16
-rw-r--r--include/mk64.h2
-rw-r--r--include/portable-file-dialogs.h69
-rw-r--r--include/vehicles.h2
7 files changed, 64 insertions, 71 deletions
diff --git a/include/actor_types.h b/include/actor_types.h
index e9f8844de..033f38631 100644
--- a/include/actor_types.h
+++ b/include/actor_types.h
@@ -133,7 +133,7 @@ struct Actor {
/* 0x18 */ Vec3f pos;
/* 0x24 */ Vec3f velocity;
/* 0x30 */ Collision unk30;
- const char* model;
+ const char* model;
}; // size = 0x70
// Duplicate declare for simplicity when externing actors & packed files.
@@ -158,25 +158,26 @@ struct TrainCar {
/* 0x18 */ Vec3f pos;
/* 0x24 */ Vec3f velocity;
/* 0x30 */ Collision unk30;
- const char* model;
+ const char* model;
}; // size = 0x70
struct RailroadCrossing {
/* 0x00 */ s16 type;
/* 0x02 */ s16 flags;
/* 0x04 */ s16 someTimer;
- /* 0x06 */ s16 crossingId; // unused now
+ /* 0x06 */ s16 crossingId; // unused now
/* 0x08 */ void* crossingTrigger; // Crossing Trigger Class
/* 0x10 */ Vec3s rot;
/* 0x16 */ s16 unk_16;
/* 0x18 */ Vec3f pos;
/* 0x24 */ Vec3f velocity;
/* 0x30 */ Collision unk30;
- const char* model;
+ const char* model;
}; // size = 0x70
// crossingTrigger might ruin struct size when compiled on 32 bit
-static_assert(sizeof(struct RailroadCrossing) == sizeof(struct Actor), "RailroadCrossing struct size does not match base struct size");
+static_assert(sizeof(struct RailroadCrossing) == sizeof(struct Actor),
+ "RailroadCrossing struct size does not match base struct size");
struct FallingRock {
/* 0x00 */ s16 type;
@@ -190,7 +191,7 @@ struct FallingRock {
/* 0x18 */ Vec3f pos;
/* 0x24 */ Vec3f velocity;
/* 0x30 */ Collision unk30;
- const char* model;
+ const char* model;
}; // size = 0x70
struct ActorSpawnData {
@@ -235,7 +236,7 @@ struct YoshiValleyEgg {
// pathCenter[0] and pathCenter[2] are the X,Z coordinates of the center of the path
/* 0x24 */ Vec3f pathCenter;
/* 0x30 */ Collision unk30;
- const char* model;
+ const char* model;
}; // size = 0x70
struct KiwanoFruit {
@@ -254,7 +255,7 @@ struct KiwanoFruit {
/* 0x18 */ Vec3f pos;
/* 0x24 */ Vec3f velocity;
/* 0x30 */ Collision unk30;
- const char* model;
+ const char* model;
}; // size = 0x70
struct PaddleWheelBoat {
@@ -269,7 +270,7 @@ struct PaddleWheelBoat {
/* 0x18 */ Vec3f pos;
/* 0x24 */ Vec3f velocity;
/* 0x30 */ Collision unk30;
- const char* model;
+ const char* model;
}; // size = 0x70
struct PiranhaPlant {
@@ -282,7 +283,7 @@ struct PiranhaPlant {
/* 0x24 */ Vec4s timers; // A per-camera timer. Might be more appropriate to call this state
/* 0x2C */ f32 unk_02C;
/* 0x30 */ Collision unk30;
- const char* model;
+ const char* model;
}; // size = 0x70
struct PalmTree {
@@ -297,7 +298,7 @@ struct PalmTree {
/* 0x18 */ Vec3f pos;
/* 0x24 */ Vec3f velocity;
/* 0x30 */ Collision unk30;
- const char* model;
+ const char* model;
}; // size = 0x70
typedef struct {
@@ -314,7 +315,7 @@ typedef struct {
/* 0x18 */ Vec3f unk_18;
/* 0x24 */ Vec3f shellIndices; // Indices in gActorList for the shells "owned" by this parent
/* 0x30 */ Collision unk30;
- const char* model;
+ const char* model;
} TripleShellParent; // size = 0x70
struct ShellActor {
@@ -342,7 +343,7 @@ struct ShellActor {
/* 0x18 */ Vec3f pos;
/* 0x24 */ Vec3f velocity; // All 0 until the shell is fired
/* 0x30 */ Collision unk30;
- const char* model;
+ const char* model;
}; // size = 0x70
struct ItemBox {
@@ -361,7 +362,7 @@ struct ItemBox {
/* 0x28 */ f32 unk_028;
/* 0x2C */ f32 unk_02C;
/* 0x30 */ Collision unk30;
- const char* model;
+ const char* model;
}; // size = 0x70
struct FakeItemBox {
@@ -378,7 +379,7 @@ struct FakeItemBox {
/* 0x28 */ f32 targetY;
/* 0x2C */ f32 unk_02C;
/* 0x30 */ Collision unk30;
- const char* model;
+ const char* model;
}; // size = 0x70
struct BananaBunchParent {
@@ -394,7 +395,7 @@ struct BananaBunchParent {
/* 0x1E */ s16 unk_1E;
/* 0x20 */ f32 unk_20[4];
/* 0x30 */ Collision unk30;
- const char* model;
+ const char* model;
}; // size = 0x70
struct BananaActor {
@@ -417,7 +418,7 @@ struct BananaActor {
/* 0x18 */ Vec3f pos;
/* 0x24 */ Vec3f velocity;
/* 0x30 */ Collision unk30;
- const char* model;
+ const char* model;
}; // size = 0x70
// #pragma GCC diagnostic pop
diff --git a/include/common_structs.h b/include/common_structs.h
index b5efa387a..8b5b83d03 100644
--- a/include/common_structs.h
+++ b/include/common_structs.h
@@ -395,7 +395,7 @@ typedef struct {
s32 nCharacter; // Networked character choice
s32 nStartingRank;
u32 nHasAuthority;
-} Player; // size = 0xDD8
+} Player; // size = 0xDD8
typedef struct {
// Something related to time trial ghost data?
@@ -412,7 +412,6 @@ typedef struct {
uint8_t r, g, b;
} RGB8;
-
typedef struct {
/* 0x00 */ u16 red;
/* 0x02 */ u16 green;
diff --git a/include/course_offsets.h b/include/course_offsets.h
index 947ebbebf..011b7c040 100644
--- a/include/course_offsets.h
+++ b/include/course_offsets.h
@@ -8,10 +8,10 @@
#include "animation.h"
typedef struct {
- const char* addr; // segmented address texture file
- u32 file_size; // compressed file size
- u32 data_size; // uncompressed texture size
- u32 padding; // always zero
+ const char* addr; // segmented address texture file
+ u32 file_size; // compressed file size
+ u32 data_size; // uncompressed texture size
+ u32 padding; // always zero
} course_texture;
extern uintptr_t d_course_sherbet_land_unk_data1[];
diff --git a/include/defines.h b/include/defines.h
index bca0f9b5f..f0f51a166 100644
--- a/include/defines.h
+++ b/include/defines.h
@@ -48,7 +48,6 @@
#define HOLD_ALL_DPAD_AND_C_BUTTONS \
(U_JPAD | L_JPAD | R_JPAD | D_JPAD | U_CBUTTONS | L_CBUTTONS | R_CBUTTONS | D_CBUTTONS)
-
/**
* @brief Jump to demo mode from the debug menu using L and A
*/
@@ -208,7 +207,6 @@ enum { COURSE_ONE, COURSE_TWO, COURSE_THREE, COURSE_FOUR };
#define RACE_UNK 6
#define RACE_EXIT 7
-
/**
* @brief Options for gScreenModeSelection and gActiveScreenMode
*/
@@ -306,12 +304,7 @@ enum KART_AI_BEHAVIOURS {
BEHAVIOUR_MAX_SPEED
};
-enum DIRECTION {
- NORTH,
- EAST,
- SOUTH,
- WEST
-};
+enum DIRECTION { NORTH, EAST, SOUTH, WEST };
/**
* @brief Balloon status
@@ -371,7 +364,6 @@ enum DIRECTION {
#define COLOR_LAVA GPACK_RGB888(0x34, 0x00, 0x00)
#define COLOR_BLACK GPACK_RGB888(0, 0, 0)
-
/**
*
* Collision mesh flags
@@ -387,9 +379,9 @@ enum DIRECTION {
#endif // DEFINES_H
/**
- *
+ *
* Laps
- *
+ *
*/
#define MIN_LAPS 0
-#define MAX_LAPS 3 \ No newline at end of file
+#define MAX_LAPS 3
diff --git a/include/mk64.h b/include/mk64.h
index fabd57254..f1d69efa4 100644
--- a/include/mk64.h
+++ b/include/mk64.h
@@ -103,7 +103,7 @@ enum SURFACE_TYPE {
/* 0x0F */ CAVE, // DK Jungle cave
/* 0x10 */ ROPE_BRIDGE, // Bowser's Castle bridge 2, DK Jungle bridge
/* 0x11 */ WOOD_BRIDGE, // Frappe Snowland bridge, Bowser's Castle bridge 1,3, Yoshi Valley bridge 2
- /* 0xFB */ WATER_SURFACE = 0xFB, // Water effect and Lakitu picks up the player
+ /* 0xFB */ WATER_SURFACE = 0xFB, // Water effect and Lakitu picks up the player
/* 0xFC */ BOOST_RAMP_WOOD = 0xFC, // DK Jungle
/* 0xFD */ OUT_OF_BOUNDS, // DK Jungle river island oob / out of bounds
/* 0xFE */ BOOST_RAMP_ASPHALT, // Royal Raceway
diff --git a/include/portable-file-dialogs.h b/include/portable-file-dialogs.h
index 8b46c9b70..fee490350 100644
--- a/include/portable-file-dialogs.h
+++ b/include/portable-file-dialogs.h
@@ -214,7 +214,7 @@ class platform {
template <typename T> class proc {
public:
proc(dll const& lib, std::string const& sym)
- : m_proc(reinterpret_cast<T*>((void*)::GetProcAddress(lib.handle, sym.c_str()))) {
+ : m_proc(reinterpret_cast<T*>((void*) ::GetProcAddress(lib.handle, sym.c_str()))) {
}
operator bool() const {
@@ -400,16 +400,17 @@ namespace internal {
#if _WIN32
static inline std::wstring str2wstr(std::string const& str) {
- int len = MultiByteToWideChar(CP_UTF8, 0, str.c_str(), (int)str.size(), nullptr, 0);
+ int len = MultiByteToWideChar(CP_UTF8, 0, str.c_str(), (int) str.size(), nullptr, 0);
std::wstring ret(len, '\0');
- MultiByteToWideChar(CP_UTF8, 0, str.c_str(), (int)str.size(), (LPWSTR)ret.data(), (int)ret.size());
+ MultiByteToWideChar(CP_UTF8, 0, str.c_str(), (int) str.size(), (LPWSTR) ret.data(), (int) ret.size());
return ret;
}
static inline std::string wstr2str(std::wstring const& str) {
- int len = WideCharToMultiByte(CP_UTF8, 0, str.c_str(), (int)str.size(), nullptr, 0, nullptr, nullptr);
+ int len = WideCharToMultiByte(CP_UTF8, 0, str.c_str(), (int) str.size(), nullptr, 0, nullptr, nullptr);
std::string ret(len, '\0');
- WideCharToMultiByte(CP_UTF8, 0, str.c_str(), (int)str.size(), (LPSTR)ret.data(), (int)ret.size(), nullptr, nullptr);
+ WideCharToMultiByte(CP_UTF8, 0, str.c_str(), (int) str.size(), (LPSTR) ret.data(), (int) ret.size(), nullptr,
+ nullptr);
return ret;
}
@@ -534,10 +535,10 @@ inline void settings::rescan() {
// Check whether a program is present using “which”.
inline bool settings::check_program(std::string const& program) {
#if _WIN32
- (void)program;
+ (void) program;
return false;
#elif __EMSCRIPTEN__
- (void)program;
+ (void) program;
return false;
#else
int exit_code = -1;
@@ -636,7 +637,7 @@ inline bool internal::executor::kill() {
if (m_future.valid()) {
// Close all windows that weren’t open when we started the future
auto previous_windows = m_windows;
- EnumWindows(&enum_windows_callback, (LPARAM)this);
+ EnumWindows(&enum_windows_callback, (LPARAM) this);
for (auto hwnd : m_windows)
if (previous_windows.find(hwnd) == previous_windows.end()) {
SendMessage(hwnd, WM_CLOSE, 0, 0);
@@ -656,7 +657,7 @@ inline bool internal::executor::kill() {
#if _WIN32
inline BOOL CALLBACK internal::executor::enum_windows_callback(HWND hwnd, LPARAM lParam) {
- auto that = (executor*)lParam;
+ auto that = (executor*) lParam;
DWORD pid;
auto tid = GetWindowThreadProcessId(hwnd, &pid);
@@ -673,7 +674,7 @@ inline void internal::executor::start_func(std::function<std::string(int*)> cons
auto trampoline = [fun, this]() {
// Save our thread id so that the caller can cancel us
m_tid = GetCurrentThreadId();
- EnumWindows(&enum_windows_callback, (LPARAM)this);
+ EnumWindows(&enum_windows_callback, (LPARAM) this);
m_cond.notify_all();
return fun(&m_exit_code);
};
@@ -760,7 +761,7 @@ inline bool internal::executor::ready(int timeout /* = default_wait_timeout */)
}
#elif __EMSCRIPTEN__ || __NX__
// FIXME: do something
- (void)timeout;
+ (void) timeout;
#else
char buf[BUFSIZ];
ssize_t received = read(m_fd, buf, BUFSIZ); // Flawfinder: ignore
@@ -866,7 +867,7 @@ inline HANDLE internal::platform::new_style_context::create() {
0,
0,
sys_dir.c_str(),
- (LPCSTR)124,
+ (LPCSTR) 124,
nullptr,
0,
};
@@ -892,11 +893,11 @@ inline std::vector<std::string> internal::dialog::desktop_helper() const {
#if __APPLE__
return { "osascript" };
#else
- return { flags(flag::has_zenity) ? "zenity"
+ return { flags(flag::has_zenity) ? "zenity"
: flags(flag::has_matedialog) ? "matedialog"
- : flags(flag::has_qarma) ? "qarma"
- : flags(flag::has_kdialog) ? "kdialog"
- : "echo" };
+ : flags(flag::has_qarma) ? "qarma"
+ : flags(flag::has_kdialog) ? "kdialog"
+ : "echo" };
#endif
}
@@ -980,7 +981,7 @@ inline internal::file_dialog::file_dialog(type in_type, std::string const& title
filter_list += '\0';
m_async->start_func([this, in_type, title, default_path, filter_list, options](int* exit_code) -> std::string {
- (void)exit_code;
+ (void) exit_code;
m_wtitle = internal::str2wstr(title);
m_wdefault_path = internal::str2wstr(default_path);
auto wfilter_list = internal::str2wstr(filter_list);
@@ -1010,7 +1011,7 @@ inline internal::file_dialog::file_dialog(type in_type, std::string const& title
memset(&bi, 0, sizeof(bi));
bi.lpfn = &bffcallback;
- bi.lParam = (LPARAM)this;
+ bi.lParam = (LPARAM) this;
if (flags(flag::is_vista)) {
if (ole32.is_initialized())
@@ -1039,8 +1040,8 @@ inline internal::file_dialog::file_dialog(type in_type, std::string const& title
ofn.lpstrFilter = wfilter_list.c_str();
auto woutput = std::wstring(MAX_PATH * 256, L'\0');
- ofn.lpstrFile = (LPWSTR)woutput.data();
- ofn.nMaxFile = (DWORD)woutput.size();
+ ofn.lpstrFile = (LPWSTR) woutput.data();
+ ofn.nMaxFile = (DWORD) woutput.size();
if (!m_wdefault_path.empty()) {
// If a directory was provided, use it as the initial directory. If
// a valid path was provided, use it as the initial file. Otherwise,
@@ -1052,8 +1053,8 @@ inline internal::file_dialog::file_dialog(type in_type, std::string const& title
// second argument is size of buffer, not length of string
StringCchCopyW(ofn.lpstrFile, MAX_PATH * 256 + 1, m_wdefault_path.c_str());
else {
- ofn.lpstrFileTitle = (LPWSTR)m_wdefault_path.data();
- ofn.nMaxFileTitle = (DWORD)m_wdefault_path.size();
+ ofn.lpstrFileTitle = (LPWSTR) m_wdefault_path.data();
+ ofn.nMaxFileTitle = (DWORD) m_wdefault_path.size();
}
}
ofn.lpstrTitle = m_wtitle.c_str();
@@ -1101,11 +1102,11 @@ inline internal::file_dialog::file_dialog(type in_type, std::string const& title
});
#elif __EMSCRIPTEN__
// FIXME: do something
- (void)in_type;
- (void)title;
- (void)default_path;
- (void)filters;
- (void)options;
+ (void) in_type;
+ (void) title;
+ (void) default_path;
+ (void) filters;
+ (void) options;
#else
auto command = desktop_helper();
@@ -1277,10 +1278,10 @@ inline std::vector<std::string> internal::file_dialog::vector_result() {
#if _WIN32
// Use a static function to pass as BFFCALLBACK for legacy folder select
inline int CALLBACK internal::file_dialog::bffcallback(HWND hwnd, UINT uMsg, LPARAM, LPARAM pData) {
- auto inst = (file_dialog*)pData;
+ auto inst = (file_dialog*) pData;
switch (uMsg) {
case BFFM_INITIALIZED:
- SendMessage(hwnd, BFFM_SETSELECTIONW, TRUE, (LPARAM)inst->m_wdefault_path.c_str());
+ SendMessage(hwnd, BFFM_SETSELECTIONW, TRUE, (LPARAM) inst->m_wdefault_path.c_str());
break;
}
return 0;
@@ -1409,12 +1410,12 @@ inline notify::notify(std::string const& title, std::string const& message, icon
}
ENUMRESNAMEPROC icon_enum_callback = [](HMODULE, LPCTSTR, LPTSTR lpName, LONG_PTR lParam) -> BOOL {
- ((NOTIFYICONDATAW*)lParam)->hIcon = ::LoadIcon(GetModuleHandle(nullptr), lpName);
+ ((NOTIFYICONDATAW*) lParam)->hIcon = ::LoadIcon(GetModuleHandle(nullptr), lpName);
return false;
};
nid->hIcon = ::LoadIcon(nullptr, IDI_APPLICATION);
- ::EnumResourceNames(nullptr, RT_GROUP_ICON, icon_enum_callback, (LONG_PTR)nid.get());
+ ::EnumResourceNames(nullptr, RT_GROUP_ICON, icon_enum_callback, (LONG_PTR) nid.get());
nid->uTimeout = 5000;
@@ -1425,8 +1426,8 @@ inline notify::notify(std::string const& title, std::string const& message, icon
Shell_NotifyIconW(NIM_ADD, nid.get());
#elif __EMSCRIPTEN__
// FIXME: do something
- (void)title;
- (void)message;
+ (void) title;
+ (void) message;
#else
auto command = desktop_helper();
@@ -1767,4 +1768,4 @@ inline std::string select_folder::result() {
#endif // PFD_SKIP_IMPLEMENTATION
-} // namespace pfd \ No newline at end of file
+} // namespace pfd
diff --git a/include/vehicles.h b/include/vehicles.h
index 39f4dd65b..d1c679455 100644
--- a/include/vehicles.h
+++ b/include/vehicles.h
@@ -56,7 +56,7 @@ typedef struct {
/* 0x048 */ TrainCarStuff passengerCars[NUM_PASSENGER_CAR_ENTRIES];
/* 0x0FC */ f32 speed;
/* 0x100 */ s32 someFlags;
- s32 numCarriages;
+ s32 numCarriages;
/* 0x104 */ s32 numCars; // Non-locomotive car count?
/* 0x108 */ s32 unused; // Not read or written. Could be padding?
} TrainStuff; // size = 0x10C