diff --git a/.clang-format b/.clang-format index a724b7fddf..87f9bf8e9e 100644 --- a/.clang-format +++ b/.clang-format @@ -1,4 +1,18 @@ --- BasedOnStyle: Chromium ColumnLimit: 100 -SortIncludes: false +SortIncludes: true +IncludeBlocks: Regroup +IncludeCategories: + - Regex: '^<[a-zA-Z_\-\.]+>' + Priority: 1 + - Regex: '^"[a-zA-Z_\-\.]+"' + Priority: 2 + - Regex: '^(<|")common.*' + Priority: 3 + - Regex: '^"third-party.*' + Priority: 4 + SortPriority: 5 + - Regex: '.*' + Priority: 5 + SortPriority: 4 diff --git a/common/audio/audio_formats.cpp b/common/audio/audio_formats.cpp index 33abd67a28..b6f3216eb1 100644 --- a/common/audio/audio_formats.cpp +++ b/common/audio/audio_formats.cpp @@ -1,5 +1,7 @@ #include "audio_formats.h" + #include "common/util/BinaryWriter.h" + #include "third-party/fmt/core.h" /*! diff --git a/common/audio/audio_formats.h b/common/audio/audio_formats.h index ea72c50f5e..0b5d2b2487 100644 --- a/common/audio/audio_formats.h +++ b/common/audio/audio_formats.h @@ -3,8 +3,8 @@ #include #include -#include "common/util/BinaryReader.h" #include "common/common_types.h" +#include "common/util/BinaryReader.h" // The header data for a simple wave file struct WaveFileHeader { diff --git a/common/cross_os_debug/xdbg.cpp b/common/cross_os_debug/xdbg.cpp index ba591240ed..3768baab34 100644 --- a/common/cross_os_debug/xdbg.cpp +++ b/common/cross_os_debug/xdbg.cpp @@ -4,28 +4,32 @@ * Nothing in here should hold state, that should all be managed in Debugger. */ -#include -#include "common/goal_constants.h" -#include "common/util/Timer.h" -#include "third-party/fmt/core.h" #include "xdbg.h" +#include + +#include "common/goal_constants.h" +#include "common/util/Timer.h" + +#include "third-party/fmt/core.h" + #ifdef __linux +#include #include + +#include +#include #include #include -#include -#include #include #include #include -#include #elif _WIN32 #define NOMINMAX #define WIN32_LEAN_AND_MEAN #include -#include #include +#include #endif namespace xdbg { diff --git a/common/cross_os_debug/xdbg.h b/common/cross_os_debug/xdbg.h index 4629fd54f4..d928c37c94 100644 --- a/common/cross_os_debug/xdbg.h +++ b/common/cross_os_debug/xdbg.h @@ -6,8 +6,9 @@ #pragma once -#include #include +#include + #include "common/common_types.h" #ifdef __linux diff --git a/common/cross_sockets/XSocket.cpp b/common/cross_sockets/XSocket.cpp index c6f4fe05e1..5ff7bd1e66 100644 --- a/common/cross_sockets/XSocket.cpp +++ b/common/cross_sockets/XSocket.cpp @@ -3,9 +3,10 @@ * Cross platform socket library used for the listener. */ +// clang-format off #ifdef __linux -#include #include +#include #include #elif _WIN32 #define WIN32_LEAN_AND_MEAN @@ -17,6 +18,7 @@ #include #include "third-party/fmt/core.h" +// clang-format on int open_socket(int af, int type, int protocol) { #ifdef __linux diff --git a/common/cross_sockets/XSocket.h b/common/cross_sockets/XSocket.h index 0e80f35138..ce9143cc94 100644 --- a/common/cross_sockets/XSocket.h +++ b/common/cross_sockets/XSocket.h @@ -5,18 +5,20 @@ * Cross platform socket library used for the listener. */ +// clang-format off #ifdef __linux -#include -#include -#include -#include #include +#include +#include +#include +#include #elif _WIN32 #define NOMINMAX #define WIN32_LEAN_AND_MEAN #include #include #endif +// clang-format on #ifdef __linux const int TCP_SOCKET_LEVEL = SOL_TCP; diff --git a/common/cross_sockets/XSocketClient.cpp b/common/cross_sockets/XSocketClient.cpp index e698e8e29e..025b445a7e 100644 --- a/common/cross_sockets/XSocketClient.cpp +++ b/common/cross_sockets/XSocketClient.cpp @@ -1,8 +1,10 @@ #include "XSocketClient.h" -#include "common/cross_sockets/XSocket.h" #include +#include "common/cross_sockets/XSocket.h" + +// clang-format off #ifdef _WIN32 #define NOMINMAX #define WIN32_LEAN_AND_MEAN @@ -11,7 +13,9 @@ #include #endif #include "common/nrepl/ReplServer.h" + #include "third-party/fmt/core.h" +// clang-format on XSocketClient::XSocketClient(int _tcp_port) { tcp_port = _tcp_port; diff --git a/common/cross_sockets/XSocketClient.h b/common/cross_sockets/XSocketClient.h index 10c7b48949..6ca49d2ed4 100644 --- a/common/cross_sockets/XSocketClient.h +++ b/common/cross_sockets/XSocketClient.h @@ -1,11 +1,11 @@ #pragma once -#include "common/cross_sockets/XSocket.h" - -#include -#include "common/common_types.h" #include #include +#include + +#include "common/common_types.h" +#include "common/cross_sockets/XSocket.h" /// @brief A cross platform generic socket client implementation class XSocketClient { diff --git a/common/cross_sockets/XSocketServer.cpp b/common/cross_sockets/XSocketServer.cpp index 37e7e67f28..40a1ba246c 100644 --- a/common/cross_sockets/XSocketServer.cpp +++ b/common/cross_sockets/XSocketServer.cpp @@ -1,9 +1,10 @@ +// clang-format off #include "XSocketServer.h" -#include "third-party/fmt/core.h" - #include "common/cross_sockets/XSocket.h" +#include "third-party/fmt/core.h" + #ifdef _WIN32 #define NOMINMAX #define WIN32_LEAN_AND_MEAN @@ -11,6 +12,7 @@ #include #include #endif +// clang-format on XSocketServer::XSocketServer(std::function shutdown_callback, int _tcp_port, diff --git a/common/cross_sockets/XSocketServer.h b/common/cross_sockets/XSocketServer.h index c7db82206f..5d9e0899ba 100644 --- a/common/cross_sockets/XSocketServer.h +++ b/common/cross_sockets/XSocketServer.h @@ -1,11 +1,11 @@ #pragma once -#include "common/cross_sockets/XSocket.h" - -#include -#include "common/common_types.h" #include #include +#include + +#include "common/common_types.h" +#include "common/cross_sockets/XSocket.h" /// @brief A cross platform generic socket server implementation class XSocketServer { diff --git a/common/custom_data/TFrag3Data.cpp b/common/custom_data/TFrag3Data.cpp index 879ee585da..85acad65b6 100644 --- a/common/custom_data/TFrag3Data.cpp +++ b/common/custom_data/TFrag3Data.cpp @@ -1,6 +1,8 @@ -#include -#include #include "Tfrag3Data.h" + +#include +#include + #include "common/util/Assert.h" namespace tfrag3 { diff --git a/common/custom_data/Tfrag3Data.h b/common/custom_data/Tfrag3Data.h index 826806b1b5..a573f8fb73 100644 --- a/common/custom_data/Tfrag3Data.h +++ b/common/custom_data/Tfrag3Data.h @@ -5,9 +5,9 @@ #include "common/common_types.h" #include "common/dma/gs.h" -#include "common/util/Serializer.h" #include "common/math/Vector.h" #include "common/util/Assert.h" +#include "common/util/Serializer.h" namespace tfrag3 { diff --git a/common/custom_data/pack_helpers.cpp b/common/custom_data/pack_helpers.cpp index 0dd17d700b..0025c596b5 100644 --- a/common/custom_data/pack_helpers.cpp +++ b/common/custom_data/pack_helpers.cpp @@ -1,4 +1,5 @@ #include "pack_helpers.h" + #include constexpr float kClusterSize = 4096 * 40; // 100 in-game meters diff --git a/common/deserialization/subtitles/subtitles.cpp b/common/deserialization/subtitles/subtitles.cpp index 5751e12e3d..cf704eb67e 100644 --- a/common/deserialization/subtitles/subtitles.cpp +++ b/common/deserialization/subtitles/subtitles.cpp @@ -1,10 +1,12 @@ #include "subtitles.h" #include +#include + +#include "common/util/FileUtil.h" + #include "third-party/fmt/core.h" #include "third-party/fmt/ranges.h" -#include -#include "common/util/FileUtil.h" #include "third-party/json.hpp" bool write_subtitle_db_to_files(const GameSubtitleDB& db) { diff --git a/common/dma/dma.cpp b/common/dma/dma.cpp index 7ff1b6799a..77b0240580 100644 --- a/common/dma/dma.cpp +++ b/common/dma/dma.cpp @@ -1,8 +1,9 @@ #include "dma.h" -#include "third-party/fmt/core.h" #include "common/util/Assert.h" +#include "third-party/fmt/core.h" + std::string DmaTag::print() { std::string result; const char* mode_names[8] = {"refe", "cnt", "next", "ref", "refs", "call", "ret", "end"}; diff --git a/common/dma/dma.h b/common/dma/dma.h index fd79fa94e3..6b50e66000 100644 --- a/common/dma/dma.h +++ b/common/dma/dma.h @@ -5,10 +5,12 @@ * PS2 DMA and VIF types. */ -#include #include +#include + #include "common/common_types.h" #include "common/util/Assert.h" + #include "third-party/fmt/core.h" struct DmaStats { diff --git a/common/dma/dma_chain_read.h b/common/dma/dma_chain_read.h index 34e4585458..5e6f5f582f 100644 --- a/common/dma/dma_chain_read.h +++ b/common/dma/dma_chain_read.h @@ -1,6 +1,7 @@ #pragma once #include + #include "common/dma/dma.h" #include "common/util/Assert.h" diff --git a/common/dma/dma_copy.cpp b/common/dma/dma_copy.cpp index 898d98c5fa..b02f10df55 100644 --- a/common/dma/dma_copy.cpp +++ b/common/dma/dma_copy.cpp @@ -1,10 +1,12 @@ -#include "common/goal_constants.h" -#include "common/dma/dma_chain_read.h" #include "dma_copy.h" -#include "third-party/fmt/core.h" + +#include "common/dma/dma_chain_read.h" +#include "common/goal_constants.h" #include "common/util/Timer.h" +#include "third-party/fmt/core.h" + /*! * Convert a DMA chain to an array of bytes that can be directly fed to VIF. */ diff --git a/common/dma/gs.cpp b/common/dma/gs.cpp index 55beacfc99..932f00e9ee 100644 --- a/common/dma/gs.cpp +++ b/common/dma/gs.cpp @@ -1,8 +1,9 @@ #include "gs.h" -#include "third-party/fmt/core.h" #include "common/util/Assert.h" +#include "third-party/fmt/core.h" + std::string reg_descriptor_name(GifTag::RegisterDescriptor reg) { switch (reg) { case GifTag::RegisterDescriptor::PRIM: diff --git a/common/global_profiler/GlobalProfiler.cpp b/common/global_profiler/GlobalProfiler.cpp index 3e713a7f5e..54b563da26 100644 --- a/common/global_profiler/GlobalProfiler.cpp +++ b/common/global_profiler/GlobalProfiler.cpp @@ -1,13 +1,16 @@ +// clang-format off #include "GlobalProfiler.h" -#include -#include #include -#include "third-party/fmt/core.h" -#include "third-party/json.hpp" +#include +#include + #include "common/util/Assert.h" #include "common/util/FileUtil.h" +#include "third-party/fmt/core.h" +#include "third-party/json.hpp" + #ifdef __linux__ u32 get_current_tid() { return (u32)pthread_self(); @@ -21,6 +24,7 @@ u32 get_current_tid() { return (u32)GetCurrentThreadId(); } #endif +// clang-format on u64 get_current_ts() { return std::chrono::steady_clock::now().time_since_epoch().count(); diff --git a/common/global_profiler/GlobalProfiler.h b/common/global_profiler/GlobalProfiler.h index b96d9611e2..b155a646c0 100644 --- a/common/global_profiler/GlobalProfiler.h +++ b/common/global_profiler/GlobalProfiler.h @@ -1,9 +1,10 @@ #pragma once -#include "common/common_types.h" -#include -#include #include +#include +#include + +#include "common/common_types.h" struct ProfNode { u64 ts; diff --git a/common/goos/Interpreter.cpp b/common/goos/Interpreter.cpp index 9800af2996..092c1b1b4f 100644 --- a/common/goos/Interpreter.cpp +++ b/common/goos/Interpreter.cpp @@ -3,10 +3,14 @@ * The GOOS Interpreter and implementation of special and "built-in forms" */ -#include #include "Interpreter.h" + +#include + #include "ParseHelpers.h" + #include "common/util/FileUtil.h" + #include "third-party/fmt/core.h" namespace goos { diff --git a/common/goos/Interpreter.h b/common/goos/Interpreter.h index b855658837..cb78fc30d5 100644 --- a/common/goos/Interpreter.h +++ b/common/goos/Interpreter.h @@ -7,6 +7,7 @@ #include #include + #include "Object.h" #include "Reader.h" diff --git a/common/goos/Object.cpp b/common/goos/Object.cpp index 3012163332..cfe01f09dd 100644 --- a/common/goos/Object.cpp +++ b/common/goos/Object.cpp @@ -38,12 +38,15 @@ * */ -#include #include "Object.h" + +#include + #include "common/util/FileUtil.h" -#include "third-party/fmt/core.h" #include "common/util/print_float.h" +#include "third-party/fmt/core.h" + namespace goos { /*! diff --git a/common/goos/Object.h b/common/goos/Object.h index 8e711bb6b7..09cea46918 100644 --- a/common/goos/Object.h +++ b/common/goos/Object.h @@ -43,14 +43,15 @@ * */ -#include +#include #include +#include +#include #include #include #include #include -#include -#include + #include "common/common_types.h" #include "common/util/Assert.h" diff --git a/common/goos/ParseHelpers.cpp b/common/goos/ParseHelpers.cpp index cf69b4385d..0963bd4ebd 100644 --- a/common/goos/ParseHelpers.cpp +++ b/common/goos/ParseHelpers.cpp @@ -1,4 +1,5 @@ #include "ParseHelpers.h" + #include "third-party/fmt/core.h" namespace goos { diff --git a/common/goos/ParseHelpers.h b/common/goos/ParseHelpers.h index 47df3575d2..53fe4e1d31 100644 --- a/common/goos/ParseHelpers.h +++ b/common/goos/ParseHelpers.h @@ -2,8 +2,9 @@ #include #include -#include #include +#include + #include "Object.h" namespace goos { diff --git a/common/goos/PrettyPrinter.cpp b/common/goos/PrettyPrinter.cpp index 947e1b5255..ee3c994c1c 100644 --- a/common/goos/PrettyPrinter.cpp +++ b/common/goos/PrettyPrinter.cpp @@ -4,17 +4,20 @@ * It is not very good, but significantly better than putting everything on one line */ +#include "PrettyPrinter.h" + +#include #include #include -#include -#include "PrettyPrinter.h" + #include "Reader.h" -#include "third-party/fmt/core.h" -#include "common/log/log.h" #include "common/goos/PrettyPrinter2.h" +#include "common/log/log.h" #include "common/util/Assert.h" +#include "third-party/fmt/core.h" + namespace pretty_print { /*! diff --git a/common/goos/PrettyPrinter.h b/common/goos/PrettyPrinter.h index 71eeeb84bf..a5924555b7 100644 --- a/common/goos/PrettyPrinter.h +++ b/common/goos/PrettyPrinter.h @@ -8,10 +8,11 @@ #include #include + #include "common/goos/Object.h" -#include "common/goos/Reader.h" -#include "common/goos/Printer.h" #include "common/goos/PrettyPrinter2.h" +#include "common/goos/Printer.h" +#include "common/goos/Reader.h" namespace pretty_print { // main pretty print function diff --git a/common/goos/PrettyPrinter2.cpp b/common/goos/PrettyPrinter2.cpp index a31ab6b844..bdabb9ea6f 100644 --- a/common/goos/PrettyPrinter2.cpp +++ b/common/goos/PrettyPrinter2.cpp @@ -1,8 +1,10 @@ #include "PrettyPrinter2.h" + #include "common/common_types.h" -#include "third-party/fmt/core.h" #include "common/util/Assert.h" +#include "third-party/fmt/core.h" + namespace pretty_print { namespace v2 { diff --git a/common/goos/PrettyPrinter2.h b/common/goos/PrettyPrinter2.h index bcc0516c47..2b42fdd1bc 100644 --- a/common/goos/PrettyPrinter2.h +++ b/common/goos/PrettyPrinter2.h @@ -2,9 +2,10 @@ #include #include + #include "common/goos/Object.h" -#include "common/goos/Reader.h" #include "common/goos/Printer.h" +#include "common/goos/Reader.h" namespace pretty_print { // main pretty print function diff --git a/common/goos/Printer.cpp b/common/goos/Printer.cpp index 51466d6c10..a34bb55a9a 100644 --- a/common/goos/Printer.cpp +++ b/common/goos/Printer.cpp @@ -1,4 +1,5 @@ #include "Printer.h" + #include "third-party/fmt/core.h" namespace pretty_print { diff --git a/common/goos/Printer.h b/common/goos/Printer.h index 20d285027f..1052b9426e 100644 --- a/common/goos/Printer.h +++ b/common/goos/Printer.h @@ -2,6 +2,7 @@ #include #include + #include "common/goos/Object.h" #include "common/goos/Reader.h" diff --git a/common/goos/Reader.cpp b/common/goos/Reader.cpp index 54a3567375..a601443ac6 100644 --- a/common/goos/Reader.cpp +++ b/common/goos/Reader.cpp @@ -10,11 +10,15 @@ */ #include "Reader.h" + +#include + +#include "ReplUtils.h" + #include "common/util/FileUtil.h" #include "common/util/FontUtils.h" + #include "third-party/fmt/core.h" -#include -#include "ReplUtils.h" namespace goos { diff --git a/common/goos/Reader.h b/common/goos/Reader.h index 357ff52d38..9dd725ab97 100644 --- a/common/goos/Reader.h +++ b/common/goos/Reader.h @@ -12,15 +12,14 @@ */ #include -#include -#include #include - -#include "common/goos/Object.h" -#include "common/goos/TextDB.h" +#include +#include #include "ReplUtils.h" +#include "common/goos/Object.h" +#include "common/goos/TextDB.h" #include "common/util/Assert.h" namespace goos { diff --git a/common/goos/ReplUtils.cpp b/common/goos/ReplUtils.cpp index 90ec42e00e..77a02d7d25 100644 --- a/common/goos/ReplUtils.cpp +++ b/common/goos/ReplUtils.cpp @@ -1,10 +1,11 @@ #include "ReplUtils.h" #include "common/util/FileUtil.h" -#include "third-party/replxx/include/replxx.hxx" #include "common/versions.h" + #include "third-party/fmt/color.h" #include "third-party/fmt/core.h" +#include "third-party/replxx/include/replxx.hxx" // TODO - expand a list of hints (ie. a hint for defun to show at a glance how to write a function, // or perhaps, show the docstring for the current function being used?) diff --git a/common/goos/TextDB.cpp b/common/goos/TextDB.cpp index 38dda75ffc..03ca3a2e0c 100644 --- a/common/goos/TextDB.cpp +++ b/common/goos/TextDB.cpp @@ -11,11 +11,12 @@ * (+ 1 (+ a b)) ; compute the sum */ -#include "common/util/FileUtil.h" -#include "third-party/fmt/core.h" - #include "TextDB.h" +#include "common/util/FileUtil.h" + +#include "third-party/fmt/core.h" + namespace goos { /*! diff --git a/common/goos/TextDB.h b/common/goos/TextDB.h index b6b62a1140..735b80ac61 100644 --- a/common/goos/TextDB.h +++ b/common/goos/TextDB.h @@ -13,12 +13,12 @@ * (+ 1 (+ a b)) ; compute the sum */ -#include -#include -#include -#include #include #include +#include +#include +#include +#include #include "common/goos/Object.h" diff --git a/common/log/log.cpp b/common/log/log.cpp index e2ee06d468..a0eebfd493 100644 --- a/common/log/log.cpp +++ b/common/log/log.cpp @@ -1,8 +1,10 @@ +#include "log.h" + #include #include #include + #include "third-party/fmt/color.h" -#include "log.h" #ifdef _WIN32 // see lg::initialize #define NOMINMAX #define WIN32_LEAN_AND_MEAN diff --git a/common/log/log.h b/common/log/log.h index 5de1cca8e4..225ddcbd59 100644 --- a/common/log/log.h +++ b/common/log/log.h @@ -6,6 +6,7 @@ #include #endif #include + #include "third-party/fmt/core.h" namespace lg { diff --git a/common/nrepl/ReplClient.cpp b/common/nrepl/ReplClient.cpp index bbadd67ce8..eb19cd28b7 100644 --- a/common/nrepl/ReplClient.cpp +++ b/common/nrepl/ReplClient.cpp @@ -1,9 +1,10 @@ +// clang-format off #include "ReplClient.h" #include "common/cross_sockets/XSocket.h" +#include "common/versions.h" #include "third-party/fmt/core.h" -#include "common/versions.h" #ifdef _WIN32 #define NOMINMAX @@ -12,6 +13,7 @@ #include #include #endif +// clang-format on void ReplClient::eval(std::string form) { if (!is_connected()) { diff --git a/common/nrepl/ReplClient.h b/common/nrepl/ReplClient.h index 2c08154872..28eafa14a6 100644 --- a/common/nrepl/ReplClient.h +++ b/common/nrepl/ReplClient.h @@ -1,8 +1,9 @@ #pragma once -#include "common/cross_sockets/XSocketClient.h" #include "ReplServer.h" +#include "common/cross_sockets/XSocketClient.h" + class ReplClient : public XSocketClient { public: using XSocketClient::XSocketClient; diff --git a/common/nrepl/ReplServer.cpp b/common/nrepl/ReplServer.cpp index 828ef5284f..1d709802ba 100644 --- a/common/nrepl/ReplServer.cpp +++ b/common/nrepl/ReplServer.cpp @@ -1,9 +1,10 @@ +// clang-format off #include "ReplServer.h" #include "common/cross_sockets/XSocket.h" +#include #include "third-party/fmt/core.h" -#include #ifdef _WIN32 #define NOMINMAX @@ -12,6 +13,7 @@ #include #include #endif +// clang-format on // TODO - basically REPL to listen and inject commands into a running REPL // - we will need a C++ side client as well which will let us communicate with the repl via for diff --git a/common/nrepl/ReplServer.h b/common/nrepl/ReplServer.h index 58759d3b68..4cd5e09ba0 100644 --- a/common/nrepl/ReplServer.h +++ b/common/nrepl/ReplServer.h @@ -1,8 +1,9 @@ #pragma once -#include "common/cross_sockets/XSocketServer.h" -#include #include +#include + +#include "common/cross_sockets/XSocketServer.h" enum ReplServerMessageType { PING = 0, EVAL = 10, SHUTDOWN = 20 }; diff --git a/common/serialization/subtitles/subtitles.cpp b/common/serialization/subtitles/subtitles.cpp index 26a9699a01..865ffbacef 100644 --- a/common/serialization/subtitles/subtitles.cpp +++ b/common/serialization/subtitles/subtitles.cpp @@ -1,10 +1,12 @@ #include "subtitles.h" + #include "common/goos/ParseHelpers.h" #include "common/goos/Reader.h" #include "common/util/FileUtil.h" -#include "third-party/fmt/core.h" #include "common/util/json_util.h" +#include "third-party/fmt/core.h" + static const std::unordered_map s_text_ver_enum_map = { {"jak1-v1", GameTextVersion::JAK1_V1}, {"jak1-v2", GameTextVersion::JAK1_V2}}; diff --git a/common/serialization/subtitles/subtitles.h b/common/serialization/subtitles/subtitles.h index 7fc0a94437..8628a0d6c9 100644 --- a/common/serialization/subtitles/subtitles.h +++ b/common/serialization/subtitles/subtitles.h @@ -1,13 +1,14 @@ #pragma once -#include "common/util/FontUtils.h" -#include "common/util/Assert.h" -#include "common/goos/Object.h" -#include -#include -#include -#include #include +#include +#include +#include +#include + +#include "common/goos/Object.h" +#include "common/util/Assert.h" +#include "common/util/FontUtils.h" /*! * The text bank contains all lines (accessed with an ID) for a language. diff --git a/common/texture/texture_conversion.h b/common/texture/texture_conversion.h index 520769cdad..a5394f296f 100644 --- a/common/texture/texture_conversion.h +++ b/common/texture/texture_conversion.h @@ -1,6 +1,7 @@ #pragma once #include "common/common_types.h" +#include "common/util/Assert.h" /*! * Convert from a pixel location in a texture (x, y, texture buffer width) to VRAM address (byte). diff --git a/common/type_system/Type.cpp b/common/type_system/Type.cpp index 29282a5daa..e816b86343 100644 --- a/common/type_system/Type.cpp +++ b/common/type_system/Type.cpp @@ -3,11 +3,14 @@ * Representation of a GOAL type in the type system. */ -#include -#include "third-party/fmt/core.h" #include "Type.h" + +#include + #include "common/util/Assert.h" +#include "third-party/fmt/core.h" + namespace { std::string reg_kind_to_string(RegClass kind) { switch (kind) { diff --git a/common/type_system/Type.h b/common/type_system/Type.h index c5d8fdafdc..7ced6b8620 100644 --- a/common/type_system/Type.h +++ b/common/type_system/Type.h @@ -5,11 +5,13 @@ * Representation of a GOAL type in the type system. */ -#include #include +#include #include -#include "common/goal_constants.h" + #include "TypeSpec.h" + +#include "common/goal_constants.h" #include "common/util/Assert.h" class TypeSystem; diff --git a/common/type_system/TypeFieldLookup.cpp b/common/type_system/TypeFieldLookup.cpp index 4733c7266e..cc013e71ec 100644 --- a/common/type_system/TypeFieldLookup.cpp +++ b/common/type_system/TypeFieldLookup.cpp @@ -4,9 +4,11 @@ */ #include -#include "third-party/fmt/core.h" + #include "TypeSystem.h" +#include "third-party/fmt/core.h" + namespace { // debug prints for the reverse lookup bool debug_reverse_lookup = false; diff --git a/common/type_system/TypeSpec.cpp b/common/type_system/TypeSpec.cpp index 2765bd0225..6932c86f86 100644 --- a/common/type_system/TypeSpec.cpp +++ b/common/type_system/TypeSpec.cpp @@ -3,8 +3,10 @@ * A GOAL TypeSpec is a reference to a type or compound type. */ -#include #include "TypeSpec.h" + +#include + #include "third-party/fmt/core.h" bool TypeTag::operator==(const TypeTag& other) const { diff --git a/common/type_system/TypeSpec.h b/common/type_system/TypeSpec.h index defbc1be1d..8978f134ca 100644 --- a/common/type_system/TypeSpec.h +++ b/common/type_system/TypeSpec.h @@ -5,11 +5,12 @@ * A GOAL TypeSpec is a reference to a type or compound type. */ -#include -#include #include -#include "common/util/SmallVector.h" +#include +#include + #include "common/util/Assert.h" +#include "common/util/SmallVector.h" /*! * A :name value modifier to apply to a type. diff --git a/common/type_system/TypeSystem.cpp b/common/type_system/TypeSystem.cpp index a3788edd51..4b1ecd60bb 100644 --- a/common/type_system/TypeSystem.cpp +++ b/common/type_system/TypeSystem.cpp @@ -5,12 +5,15 @@ * access types, and reverse type lookups. */ -#include "third-party/fmt/core.h" -#include "third-party/fmt/color.h" -#include #include "TypeSystem.h" -#include "common/util/math_util.h" + +#include + #include "common/util/Assert.h" +#include "common/util/math_util.h" + +#include "third-party/fmt/color.h" +#include "third-party/fmt/core.h" namespace { template diff --git a/common/type_system/TypeSystem.h b/common/type_system/TypeSystem.h index c21467558b..c7a52165c7 100644 --- a/common/type_system/TypeSystem.h +++ b/common/type_system/TypeSystem.h @@ -7,16 +7,16 @@ * access types, and reverse type lookups. */ +#include +#include +#include +#include #include #include #include -#include -#include -#include -#include -#include "TypeSpec.h" #include "Type.h" +#include "TypeSpec.h" struct TypeFlags { union { diff --git a/common/type_system/defenum.cpp b/common/type_system/defenum.cpp index c0a83c3e14..b6faf17c02 100644 --- a/common/type_system/defenum.cpp +++ b/common/type_system/defenum.cpp @@ -4,12 +4,15 @@ * This is used both in the compiler and in the decompiler for the type definition file. */ -#include "common/goos/ParseHelpers.h" #include "defenum.h" + #include "deftype.h" -#include "third-party/fmt/core.h" + +#include "common/goos/ParseHelpers.h" #include "common/util/BitUtils.h" +#include "third-party/fmt/core.h" + namespace { const goos::Object& car(const goos::Object* x) { if (!x->is_pair()) { diff --git a/common/type_system/defenum.h b/common/type_system/defenum.h index 3650ee6d92..5ca25c6dec 100644 --- a/common/type_system/defenum.h +++ b/common/type_system/defenum.h @@ -7,6 +7,7 @@ */ #include "TypeSystem.h" + #include "common/goos/Object.h" EnumType* parse_defenum(const goos::Object& defenum, TypeSystem* ts); diff --git a/common/type_system/deftype.cpp b/common/type_system/deftype.cpp index 053b189db5..3880214822 100644 --- a/common/type_system/deftype.cpp +++ b/common/type_system/deftype.cpp @@ -4,8 +4,10 @@ * This is used both in the compiler and in the decompiler for the type definition file. */ -#include "common/goos/ParseHelpers.h" #include "deftype.h" + +#include "common/goos/ParseHelpers.h" + #include "third-party/fmt/core.h" /*! diff --git a/common/type_system/deftype.h b/common/type_system/deftype.h index dc0559aab0..d6aa240afa 100644 --- a/common/type_system/deftype.h +++ b/common/type_system/deftype.h @@ -7,6 +7,7 @@ */ #include "TypeSystem.h" + #include "common/goos/Object.h" struct DeftypeResult { diff --git a/common/type_system/state.cpp b/common/type_system/state.cpp index 64d32ad7c9..aa2cc38b73 100644 --- a/common/type_system/state.cpp +++ b/common/type_system/state.cpp @@ -1,4 +1,5 @@ #include "state.h" + #include "common/type_system/TypeSystem.h" /*! diff --git a/common/type_system/state.h b/common/type_system/state.h index b1ecb9801e..cf992455a1 100644 --- a/common/type_system/state.h +++ b/common/type_system/state.h @@ -1,6 +1,7 @@ #pragma once #include + #include "common/type_system/TypeSpec.h" /*! diff --git a/common/util/BinaryReader.h b/common/util/BinaryReader.h index 066ba37df5..5eee37d8fb 100644 --- a/common/util/BinaryReader.h +++ b/common/util/BinaryReader.h @@ -8,6 +8,7 @@ #include #include #include + #include "common/common_types.h" #include "common/util/Assert.h" diff --git a/common/util/BinaryWriter.h b/common/util/BinaryWriter.h index 5232f62cc9..a4a7b22c61 100644 --- a/common/util/BinaryWriter.h +++ b/common/util/BinaryWriter.h @@ -5,10 +5,11 @@ * Write raw data like a stream. */ -#include -#include #include #include +#include +#include + #include "common/util/Assert.h" struct BinaryWriterRef { diff --git a/common/util/BitUtils.h b/common/util/BitUtils.h index e57a94ee23..f6fec27902 100644 --- a/common/util/BitUtils.h +++ b/common/util/BitUtils.h @@ -1,9 +1,10 @@ #pragma once #include -#include "common/util/Range.h" + #include "common/common_types.h" #include "common/util/Assert.h" +#include "common/util/Range.h" constexpr int BITS_PER_BYTE = 8; template diff --git a/common/util/CopyOnWrite.h b/common/util/CopyOnWrite.h index 3916e47a5a..2a8ba2c28f 100644 --- a/common/util/CopyOnWrite.h +++ b/common/util/CopyOnWrite.h @@ -1,4 +1,5 @@ #include + #include "common/util/Assert.h" /* diff --git a/common/util/DgoReader.cpp b/common/util/DgoReader.cpp index 0d360b0f9d..2203ba4600 100644 --- a/common/util/DgoReader.cpp +++ b/common/util/DgoReader.cpp @@ -1,13 +1,17 @@ -#include -#include -#include #include "DgoReader.h" + +#include +#include +#include + #include "BinaryReader.h" -#include "common/link_types.h" -#include "third-party/json.hpp" #include "BitUtils.h" #include "dgo_util.h" +#include "common/link_types.h" + +#include "third-party/json.hpp" + DgoReader::DgoReader(std::string file_name, const std::vector& data) : m_file_name(std::move(file_name)) { BinaryReader reader(data); diff --git a/common/util/DgoReader.h b/common/util/DgoReader.h index ff7693fdba..456db7cb62 100644 --- a/common/util/DgoReader.h +++ b/common/util/DgoReader.h @@ -1,7 +1,8 @@ #pragma once -#include #include +#include + #include "common/common_types.h" struct DgoDataEntry { diff --git a/common/util/DgoWriter.cpp b/common/util/DgoWriter.cpp index d75680fbdb..3cd1842413 100644 --- a/common/util/DgoWriter.cpp +++ b/common/util/DgoWriter.cpp @@ -3,9 +3,10 @@ * Create a DGO from existing files. */ +#include "DgoWriter.h" + #include "BinaryWriter.h" #include "FileUtil.h" -#include "DgoWriter.h" void build_dgo(const DgoDescription& description) { BinaryWriter writer; diff --git a/common/util/DgoWriter.h b/common/util/DgoWriter.h index 87117a9e0e..d192abe1c6 100644 --- a/common/util/DgoWriter.h +++ b/common/util/DgoWriter.h @@ -5,8 +5,8 @@ * Create a DGO from existing files. */ -#include #include +#include struct DgoDescription { std::string dgo_name; diff --git a/common/util/FileUtil.cpp b/common/util/FileUtil.cpp index 2beb0f67b1..d553575408 100644 --- a/common/util/FileUtil.cpp +++ b/common/util/FileUtil.cpp @@ -4,23 +4,25 @@ */ #include "FileUtil.h" -#include -#include + #include /* defines FILENAME_MAX */ -#include -#include #include -#include "common/util/BinaryReader.h" +#include +#include +#include +#include + #include "BinaryWriter.h" + #include "common/common_types.h" +#include "common/util/BinaryReader.h" // This disables the use of PCLMULQDQ which is probably ok, but let's just be safe and disable it // because nobody will care if png compression is 10% slower. #define FPNG_NO_SSE 1 -#include "third-party/fpng/fpng.cpp" - -#include "third-party/fpng/fpng.h" #include "third-party/fmt/core.h" +#include "third-party/fpng/fpng.cpp" +#include "third-party/fpng/fpng.h" #include "third-party/lzokay/lzokay.hpp" #ifdef _WIN32 @@ -28,8 +30,8 @@ #define WIN32_LEAN_AND_MEAN #include #else -#include #include +#include #endif #include "common/util/Assert.h" #include diff --git a/common/util/FileUtil.h b/common/util/FileUtil.h index 8abeee9715..2f5eada17b 100644 --- a/common/util/FileUtil.h +++ b/common/util/FileUtil.h @@ -5,10 +5,11 @@ * Utility functions for reading and writing files. */ -#include -#include #include #include +#include +#include + #include "common/common_types.h" namespace fs = std::filesystem; diff --git a/common/util/FontUtils.cpp b/common/util/FontUtils.cpp index 83faf654ab..b48f4e14e3 100644 --- a/common/util/FontUtils.cpp +++ b/common/util/FontUtils.cpp @@ -7,8 +7,10 @@ * Always verify the encoding if string detection suddenly goes awry. */ -#include #include "FontUtils.h" + +#include + #include "third-party/fmt/core.h" GameTextFontBank::GameTextFontBank(GameTextVersion version, diff --git a/common/util/FontUtils.h b/common/util/FontUtils.h index 5792bca4bc..4bfa31d2b8 100644 --- a/common/util/FontUtils.h +++ b/common/util/FontUtils.h @@ -9,12 +9,12 @@ * Always verify the encoding if string detection suddenly goes awry. */ -#include "common/common_types.h" - -#include -#include -#include #include +#include +#include +#include + +#include "common/common_types.h" // version of the game text file's text encoding. Not real, but we need to differentiate them // somehow, since the encoding changes. diff --git a/common/util/FrameLimiter.cpp b/common/util/FrameLimiter.cpp index a4f6ed5732..8c8f1e6067 100644 --- a/common/util/FrameLimiter.cpp +++ b/common/util/FrameLimiter.cpp @@ -1,4 +1,5 @@ #include "FrameLimiter.h" + #include double FrameLimiter::round_to_nearest_60fps(double current) { diff --git a/common/util/Serializer.h b/common/util/Serializer.h index a960c7a609..b8c1fff2d9 100644 --- a/common/util/Serializer.h +++ b/common/util/Serializer.h @@ -3,6 +3,7 @@ #include #include #include + #include "common/common_types.h" #include "common/util/Assert.h" diff --git a/common/util/SimpleThreadGroup.cpp b/common/util/SimpleThreadGroup.cpp index a647799546..aea1917a4d 100644 --- a/common/util/SimpleThreadGroup.cpp +++ b/common/util/SimpleThreadGroup.cpp @@ -1,4 +1,5 @@ #include "SimpleThreadGroup.h" + #include "common/util/Assert.h" void SimpleThreadGroup::run(const std::function& func, int num_runs) { diff --git a/common/util/SimpleThreadGroup.h b/common/util/SimpleThreadGroup.h index b800648e3a..a28acfc85e 100644 --- a/common/util/SimpleThreadGroup.h +++ b/common/util/SimpleThreadGroup.h @@ -1,6 +1,6 @@ +#include #include #include -#include /*! * Very simple group of threads. diff --git a/common/util/SmallVector.h b/common/util/SmallVector.h index 9dfe4c4828..e328ea3dec 100644 --- a/common/util/SmallVector.h +++ b/common/util/SmallVector.h @@ -5,6 +5,7 @@ #include #include #include + #include "common/util/Assert.h" namespace cu { diff --git a/common/util/Timer.h b/common/util/Timer.h index 762ed923a3..9be8503419 100644 --- a/common/util/Timer.h +++ b/common/util/Timer.h @@ -2,6 +2,7 @@ #include #include + #include "common/util/Assert.h" /*! diff --git a/common/util/Trie.h b/common/util/Trie.h index 34f03c5725..0767f164f9 100644 --- a/common/util/Trie.h +++ b/common/util/Trie.h @@ -1,7 +1,8 @@ #pragma once -#include #include +#include + #include "common/util/Assert.h" /*! diff --git a/common/util/compress.cpp b/common/util/compress.cpp index fb931db3c4..39f8fd6f81 100644 --- a/common/util/compress.cpp +++ b/common/util/compress.cpp @@ -1,10 +1,12 @@ -#include -#include - #include "compress.h" -#include "third-party/zstd/lib/zstd.h" + +#include +#include + #include "common/util/Assert.h" + #include "third-party/fmt/core.h" +#include "third-party/zstd/lib/zstd.h" namespace compression { diff --git a/common/util/compress.h b/common/util/compress.h index aff7e59023..b0ef58b8d7 100644 --- a/common/util/compress.h +++ b/common/util/compress.h @@ -1,6 +1,7 @@ #pragma once #include + #include "common/common_types.h" namespace compression { // compress and decompress data with zstd diff --git a/common/util/crc32.h b/common/util/crc32.h index d0f3f845c0..2cd5fad94d 100644 --- a/common/util/crc32.h +++ b/common/util/crc32.h @@ -1,4 +1,5 @@ #include + #include "common/common_types.h" u32 crc32(const u8* data, size_t size); \ No newline at end of file diff --git a/common/util/dgo_util.cpp b/common/util/dgo_util.cpp index 3d940b29e1..b328d27402 100644 --- a/common/util/dgo_util.cpp +++ b/common/util/dgo_util.cpp @@ -1,8 +1,11 @@ -#include #include "dgo_util.h" -#include "common/versions.h" -#include "third-party/fmt/core.h" + +#include + #include "common/util/Assert.h" +#include "common/versions.h" + +#include "third-party/fmt/core.h" /*! * Assert false if the char[] has non-null data after the null terminated string. diff --git a/common/util/dgo_util.h b/common/util/dgo_util.h index 5915bfea90..06d22b6e0b 100644 --- a/common/util/dgo_util.h +++ b/common/util/dgo_util.h @@ -1,6 +1,7 @@ #pragma once #include + #include "common/common_types.h" #include "common/versions.h" diff --git a/common/util/diff.cpp b/common/util/diff.cpp index 62f8733448..7b6890e80c 100644 --- a/common/util/diff.cpp +++ b/common/util/diff.cpp @@ -32,12 +32,12 @@ #include "diff.h" -#include #include -#include #include +#include #include #include +#include namespace { enum EditType { kMatch, kAdd, kRemove, kReplace }; diff --git a/common/util/json_util.cpp b/common/util/json_util.cpp index 428a0c4b7c..0dfbcac67a 100644 --- a/common/util/json_util.cpp +++ b/common/util/json_util.cpp @@ -1,5 +1,6 @@ -#include "common/log/log.h" #include "json_util.h" + +#include "common/log/log.h" #include "common/util/Assert.h" /*! diff --git a/common/util/json_util.h b/common/util/json_util.h index 9e3a21f6dd..1e210a097c 100644 --- a/common/util/json_util.h +++ b/common/util/json_util.h @@ -1,7 +1,9 @@ #pragma once #include + #include "common/util/Range.h" + #include "third-party/json.hpp" std::string strip_cpp_style_comments(const std::string& input); diff --git a/common/util/print_float.cpp b/common/util/print_float.cpp index f25f4b5549..1f4c605c0d 100644 --- a/common/util/print_float.cpp +++ b/common/util/print_float.cpp @@ -1,10 +1,12 @@ +#include "print_float.h" + #include +#include "common/goal_constants.h" +#include "common/util/Assert.h" + #include "third-party/dragonbox.h" #include "third-party/fmt/core.h" -#include "print_float.h" -#include "common/goal_constants.h" -#include "common/util/Assert.h" /*! * Convert a float to a string. The string is _always_ in this format: diff --git a/common/util/print_float.h b/common/util/print_float.h index b88dc9b0bb..e502d90fb1 100644 --- a/common/util/print_float.h +++ b/common/util/print_float.h @@ -1,6 +1,7 @@ #pragma once #include + #include "common/common_types.h" float fixed_point_to_float(s64 value, s64 scale); diff --git a/common/util/read_iso_file.cpp b/common/util/read_iso_file.cpp index 6e65ddf43f..74b836c37a 100644 --- a/common/util/read_iso_file.cpp +++ b/common/util/read_iso_file.cpp @@ -1,6 +1,7 @@ #include "read_iso_file.h" -#include "common/log/log.h" + #include "common/common_types.h" +#include "common/log/log.h" #include "common/util/Assert.h" #include "common/util/FileUtil.h" diff --git a/common/util/read_iso_file.h b/common/util/read_iso_file.h index 6109d90cce..ef9fae8b7f 100644 --- a/common/util/read_iso_file.h +++ b/common/util/read_iso_file.h @@ -1,8 +1,9 @@ #pragma once +#include #include #include -#include + #include "third-party/xxhash.hpp" struct IsoFile { diff --git a/decompiler/Disasm/Instruction.cpp b/decompiler/Disasm/Instruction.cpp index a433838634..3cb018d75b 100644 --- a/decompiler/Disasm/Instruction.cpp +++ b/decompiler/Disasm/Instruction.cpp @@ -5,10 +5,13 @@ */ #include "Instruction.h" -#include "decompiler/ObjectFile/LinkedObjectFile.h" -#include "third-party/fmt/core.h" + #include "common/util/Assert.h" +#include "decompiler/ObjectFile/LinkedObjectFile.h" + +#include "third-party/fmt/core.h" + namespace decompiler { /*! * Convert atom to a string for disassembly. diff --git a/decompiler/Disasm/Instruction.h b/decompiler/Disasm/Instruction.h index 6034c5de23..7a6bc85d2b 100644 --- a/decompiler/Disasm/Instruction.h +++ b/decompiler/Disasm/Instruction.h @@ -7,6 +7,7 @@ */ #include + #include "OpcodeInfo.h" #include "Register.h" diff --git a/decompiler/Disasm/InstructionDecode.cpp b/decompiler/Disasm/InstructionDecode.cpp index daff8a7849..ecf3eaccca 100644 --- a/decompiler/Disasm/InstructionDecode.cpp +++ b/decompiler/Disasm/InstructionDecode.cpp @@ -4,11 +4,14 @@ * This is the part of the disassembler that decodes MIPS instructions. */ -#include "third-party/fmt/core.h" #include "InstructionDecode.h" -#include "decompiler/ObjectFile/LinkedObjectFile.h" + #include "common/util/Assert.h" +#include "decompiler/ObjectFile/LinkedObjectFile.h" + +#include "third-party/fmt/core.h" + namespace decompiler { // utility class to extract fields of an opcode. struct OpcodeFields { diff --git a/decompiler/Disasm/InstructionMatching.cpp b/decompiler/Disasm/InstructionMatching.cpp index b8df563cf7..25580b66ec 100644 --- a/decompiler/Disasm/InstructionMatching.cpp +++ b/decompiler/Disasm/InstructionMatching.cpp @@ -4,6 +4,7 @@ */ #include "InstructionMatching.h" + #include "common/util/Assert.h" namespace decompiler { diff --git a/decompiler/Disasm/InstructionMatching.h b/decompiler/Disasm/InstructionMatching.h index b9efc44746..51bfd8b823 100644 --- a/decompiler/Disasm/InstructionMatching.h +++ b/decompiler/Disasm/InstructionMatching.h @@ -6,6 +6,7 @@ */ #include "Instruction.h" + #include "decompiler/util/MatchParam.h" namespace decompiler { diff --git a/decompiler/Disasm/InstructionParser.cpp b/decompiler/Disasm/InstructionParser.cpp index 1c62bbd707..dd7221130e 100644 --- a/decompiler/Disasm/InstructionParser.cpp +++ b/decompiler/Disasm/InstructionParser.cpp @@ -1,9 +1,12 @@ -#include -#include -#include -#include "common/common_types.h" #include "InstructionParser.h" + +#include +#include +#include + +#include "common/common_types.h" #include "common/util/Assert.h" + #include "third-party/fmt/core.h" namespace decompiler { diff --git a/decompiler/Disasm/InstructionParser.h b/decompiler/Disasm/InstructionParser.h index 6bbcaa4802..47cda29f03 100644 --- a/decompiler/Disasm/InstructionParser.h +++ b/decompiler/Disasm/InstructionParser.h @@ -7,8 +7,9 @@ #include #include -#include "Instruction.h" + #include "DecompilerLabel.h" +#include "Instruction.h" namespace decompiler { struct ParsedProgram { diff --git a/decompiler/Disasm/OpcodeInfo.cpp b/decompiler/Disasm/OpcodeInfo.cpp index 7e7c1cbcc9..91084eb556 100644 --- a/decompiler/Disasm/OpcodeInfo.cpp +++ b/decompiler/Disasm/OpcodeInfo.cpp @@ -4,6 +4,7 @@ */ #include "OpcodeInfo.h" + #include "common/util/Assert.h" namespace decompiler { diff --git a/decompiler/Disasm/Register.cpp b/decompiler/Disasm/Register.cpp index 674fd64105..12c3529b56 100644 --- a/decompiler/Disasm/Register.cpp +++ b/decompiler/Disasm/Register.cpp @@ -4,10 +4,13 @@ */ #include "Register.h" + #include -#include "third-party/fmt/core.h" + #include "common/util/Assert.h" +#include "third-party/fmt/core.h" + namespace decompiler { namespace Reg { // register which may hold GOAL local variables diff --git a/decompiler/Disasm/Register.h b/decompiler/Disasm/Register.h index 696aff35e1..14c1cbd41f 100644 --- a/decompiler/Disasm/Register.h +++ b/decompiler/Disasm/Register.h @@ -7,6 +7,7 @@ #include #include + #include "common/util/Assert.h" namespace decompiler { diff --git a/decompiler/Function/BasicBlocks.cpp b/decompiler/Function/BasicBlocks.cpp index 5b50d8927b..113258515c 100644 --- a/decompiler/Function/BasicBlocks.cpp +++ b/decompiler/Function/BasicBlocks.cpp @@ -1,9 +1,12 @@ -#include #include "BasicBlocks.h" -#include "decompiler/ObjectFile/LinkedObjectFile.h" -#include "decompiler/Disasm/InstructionMatching.h" + +#include + #include "common/util/Assert.h" +#include "decompiler/Disasm/InstructionMatching.h" +#include "decompiler/ObjectFile/LinkedObjectFile.h" + namespace decompiler { /*! * Find all basic blocks in a function. diff --git a/decompiler/Function/BasicBlocks.h b/decompiler/Function/BasicBlocks.h index a9be9ecb5a..d265238a30 100644 --- a/decompiler/Function/BasicBlocks.h +++ b/decompiler/Function/BasicBlocks.h @@ -1,7 +1,7 @@ #pragma once -#include #include +#include // for RegSet: #include "decompiler/analysis/reg_usage.h" diff --git a/decompiler/Function/CfgVtx.cpp b/decompiler/Function/CfgVtx.cpp index 7abe855cc6..ac2426f1db 100644 --- a/decompiler/Function/CfgVtx.cpp +++ b/decompiler/Function/CfgVtx.cpp @@ -1,9 +1,12 @@ +#include "CfgVtx.h" + +#include "Function.h" + #include "common/goos/PrettyPrinter.h" +#include "common/util/Assert.h" + #include "decompiler/Disasm/InstructionMatching.h" #include "decompiler/ObjectFile/LinkedObjectFile.h" -#include "CfgVtx.h" -#include "Function.h" -#include "common/util/Assert.h" namespace decompiler { ///////////////////////////////////////// diff --git a/decompiler/Function/CfgVtx.h b/decompiler/Function/CfgVtx.h index aaf2fd9584..9bd9205346 100644 --- a/decompiler/Function/CfgVtx.h +++ b/decompiler/Function/CfgVtx.h @@ -1,9 +1,13 @@ #pragma once +#include #include #include + #include "common/util/Assert.h" +#include "decompiler/config.h" + namespace goos { class Object; } diff --git a/decompiler/Function/Function.cpp b/decompiler/Function/Function.cpp index b04a59688d..e7d700f9ad 100644 --- a/decompiler/Function/Function.cpp +++ b/decompiler/Function/Function.cpp @@ -1,12 +1,15 @@ -#include #include "Function.h" + +#include + #include "common/log/log.h" +#include "common/util/Assert.h" +#include "common/util/BitUtils.h" + #include "decompiler/Disasm/InstructionMatching.h" +#include "decompiler/IR2/Form.h" #include "decompiler/ObjectFile/LinkedObjectFile.h" #include "decompiler/util/DecompilerTypeSystem.h" -#include "decompiler/IR2/Form.h" -#include "common/util/BitUtils.h" -#include "common/util/Assert.h" namespace decompiler { namespace { diff --git a/decompiler/Function/Function.h b/decompiler/Function/Function.h index 6d8f37f084..80f4348875 100644 --- a/decompiler/Function/Function.h +++ b/decompiler/Function/Function.h @@ -1,20 +1,23 @@ #pragma once -#include -#include -#include #include +#include +#include #include -#include "decompiler/analysis/atomic_op_builder.h" -#include "decompiler/Disasm/Instruction.h" -#include "decompiler/Disasm/Register.h" +#include + #include "BasicBlocks.h" #include "CfgVtx.h" -#include "common/type_system/TypeSpec.h" -#include "decompiler/config.h" #include "Warnings.h" + +#include "common/type_system/TypeSpec.h" #include "common/type_system/state.h" +#include "decompiler/Disasm/Instruction.h" +#include "decompiler/Disasm/Register.h" +#include "decompiler/analysis/atomic_op_builder.h" +#include "decompiler/config.h" + namespace decompiler { class DecompilerTypeSystem; diff --git a/decompiler/Function/Warnings.h b/decompiler/Function/Warnings.h index 0180c6368c..adb9c6a3b1 100644 --- a/decompiler/Function/Warnings.h +++ b/decompiler/Function/Warnings.h @@ -1,10 +1,12 @@ #pragma once +#include #include #include -#include -#include "third-party/fmt/core.h" + #include "common/util/Assert.h" +#include "third-party/fmt/core.h" + namespace decompiler { class DecompWarnings { public: diff --git a/decompiler/IR2/AtomicOp.cpp b/decompiler/IR2/AtomicOp.cpp index ea68a0e026..a8bd27ebe3 100644 --- a/decompiler/IR2/AtomicOp.cpp +++ b/decompiler/IR2/AtomicOp.cpp @@ -1,14 +1,19 @@ -#include -#include -#include "common/goal_constants.h" -#include "third-party/fmt/core.h" -#include "common/goos/PrettyPrinter.h" -#include "decompiler/ObjectFile/LinkedObjectFile.h" #include "AtomicOp.h" -#include "OpenGoalMapping.h" + +#include +#include + #include "Form.h" +#include "OpenGoalMapping.h" + +#include "common/goal_constants.h" +#include "common/goos/PrettyPrinter.h" #include "common/util/Assert.h" +#include "decompiler/ObjectFile/LinkedObjectFile.h" + +#include "third-party/fmt/core.h" + namespace decompiler { ///////////////////////////// // VARIABLE diff --git a/decompiler/IR2/AtomicOp.h b/decompiler/IR2/AtomicOp.h index b2fd838368..d2d9353a5b 100644 --- a/decompiler/IR2/AtomicOp.h +++ b/decompiler/IR2/AtomicOp.h @@ -1,15 +1,18 @@ #pragma once -#include #include +#include #include -#include "common/goos/Object.h" -#include "decompiler/Disasm/Register.h" -#include "decompiler/Disasm/Instruction.h" -#include "decompiler/IR2/IR2_common.h" + #include "Env.h" + +#include "common/goos/Object.h" #include "common/util/Assert.h" +#include "decompiler/Disasm/Instruction.h" +#include "decompiler/Disasm/Register.h" +#include "decompiler/IR2/IR2_common.h" + namespace decompiler { class FormElement; class ConditionElement; diff --git a/decompiler/IR2/AtomicOpForm.cpp b/decompiler/IR2/AtomicOpForm.cpp index ac961f4565..d3c3509f0a 100644 --- a/decompiler/IR2/AtomicOpForm.cpp +++ b/decompiler/IR2/AtomicOpForm.cpp @@ -1,10 +1,12 @@ #include "AtomicOp.h" #include "Form.h" + #include "common/type_system/TypeSystem.h" -#include "decompiler/util/DecompilerTypeSystem.h" -#include "decompiler/ObjectFile/LinkedObjectFile.h" -#include "decompiler/util/data_decompile.h" + #include "decompiler/IR2/bitfields.h" +#include "decompiler/ObjectFile/LinkedObjectFile.h" +#include "decompiler/util/DecompilerTypeSystem.h" +#include "decompiler/util/data_decompile.h" namespace decompiler { diff --git a/decompiler/IR2/AtomicOpTypeAnalysis.cpp b/decompiler/IR2/AtomicOpTypeAnalysis.cpp index 6c294b10cc..4e39e10c01 100644 --- a/decompiler/IR2/AtomicOpTypeAnalysis.cpp +++ b/decompiler/IR2/AtomicOpTypeAnalysis.cpp @@ -1,14 +1,17 @@ -#include "third-party/fmt/core.h" -#include "decompiler/ObjectFile/LinkedObjectFile.h" -#include "common/log/log.h" #include "AtomicOp.h" -#include "decompiler/util/TP_Type.h" -#include "decompiler/util/DecompilerTypeSystem.h" -#include "decompiler/IR2/bitfields.h" + +#include "common/log/log.h" #include "common/type_system/state.h" #include "common/util/BitUtils.h" + +#include "decompiler/IR2/bitfields.h" +#include "decompiler/ObjectFile/LinkedObjectFile.h" +#include "decompiler/util/DecompilerTypeSystem.h" +#include "decompiler/util/TP_Type.h" #include "decompiler/util/goal_constants.h" +#include "third-party/fmt/core.h" + namespace decompiler { namespace { diff --git a/decompiler/IR2/Env.cpp b/decompiler/IR2/Env.cpp index 46d5b23004..b520dbc952 100644 --- a/decompiler/IR2/Env.cpp +++ b/decompiler/IR2/Env.cpp @@ -1,13 +1,17 @@ +#include "Env.h" + +#include #include #include -#include -#include "decompiler/util/DecompilerTypeSystem.h" -#include "Env.h" + #include "Form.h" -#include "decompiler/analysis/atomic_op_builder.h" + #include "common/goos/PrettyPrinter.h" #include "common/util/math_util.h" +#include "decompiler/analysis/atomic_op_builder.h" +#include "decompiler/util/DecompilerTypeSystem.h" + namespace decompiler { constexpr const char* reg_names[] = {"a0-0", "a1-0", "a2-0", "a3-0", diff --git a/decompiler/IR2/Env.h b/decompiler/IR2/Env.h index 8edab5ea68..cc23852053 100644 --- a/decompiler/IR2/Env.h +++ b/decompiler/IR2/Env.h @@ -2,14 +2,16 @@ #include #include + #include "common/goos/Object.h" -#include "decompiler/util/TP_Type.h" -#include "decompiler/util/StackSpillMap.h" +#include "common/util/Assert.h" + #include "decompiler/Disasm/Register.h" #include "decompiler/IR2/IR2_common.h" #include "decompiler/analysis/reg_usage.h" #include "decompiler/config.h" -#include "common/util/Assert.h" +#include "decompiler/util/StackSpillMap.h" +#include "decompiler/util/TP_Type.h" namespace decompiler { class LinkedObjectFile; diff --git a/decompiler/IR2/ExpressionHelpers.cpp b/decompiler/IR2/ExpressionHelpers.cpp index 4db004b0e5..abbee45fca 100644 --- a/decompiler/IR2/ExpressionHelpers.cpp +++ b/decompiler/IR2/ExpressionHelpers.cpp @@ -1,9 +1,11 @@ #include "ExpressionHelpers.h" -#include "decompiler/IR2/Form.h" -#include "decompiler/IR2/Env.h" + #include "common/goal_constants.h" -#include "decompiler/IR2/GenericElementMatcher.h" + +#include "decompiler/IR2/Env.h" +#include "decompiler/IR2/Form.h" #include "decompiler/IR2/FormStack.h" +#include "decompiler/IR2/GenericElementMatcher.h" namespace decompiler { diff --git a/decompiler/IR2/Form.cpp b/decompiler/IR2/Form.cpp index 750e0f0735..81f0d6320a 100644 --- a/decompiler/IR2/Form.cpp +++ b/decompiler/IR2/Form.cpp @@ -2,13 +2,15 @@ #include #include -#include "decompiler/ObjectFile/LinkedObjectFile.h" + #include "common/goos/PrettyPrinter.h" #include "common/type_system/TypeSystem.h" +#include "common/util/print_float.h" + +#include "decompiler/ObjectFile/LinkedObjectFile.h" #include "decompiler/util/DecompilerTypeSystem.h" #include "decompiler/util/data_decompile.h" #include "decompiler/util/sparticle_decompile.h" -#include "common/util/print_float.h" namespace decompiler { diff --git a/decompiler/IR2/Form.h b/decompiler/IR2/Form.h index 2687fe4283..af812262cd 100644 --- a/decompiler/IR2/Form.h +++ b/decompiler/IR2/Form.h @@ -1,17 +1,19 @@ #pragma once -#include -#include -#include #include +#include +#include +#include + +#include "common/goos/Object.h" +#include "common/math/Vector.h" +#include "common/type_system/TypeSystem.h" +#include "common/type_system/state.h" + +#include "decompiler/Disasm/DecompilerLabel.h" #include "decompiler/Disasm/Register.h" #include "decompiler/IR2/AtomicOp.h" -#include "common/goos/Object.h" -#include "common/type_system/TypeSystem.h" -#include "decompiler/Disasm/DecompilerLabel.h" -#include "common/type_system/state.h" #include "decompiler/IR2/LabelDB.h" -#include "common/math/Vector.h" #include "decompiler/ObjectFile/LinkedWord.h" namespace decompiler { diff --git a/decompiler/IR2/FormExpressionAnalysis.cpp b/decompiler/IR2/FormExpressionAnalysis.cpp index 1873591cb3..80b49185cb 100644 --- a/decompiler/IR2/FormExpressionAnalysis.cpp +++ b/decompiler/IR2/FormExpressionAnalysis.cpp @@ -1,17 +1,19 @@ #include "Form.h" #include "FormStack.h" #include "GenericElementMatcher.h" + #include "common/goos/PrettyPrinter.h" -#include "decompiler/util/DecompilerTypeSystem.h" -#include "decompiler/ObjectFile/LinkedObjectFile.h" -#include "decompiler/util/data_decompile.h" -#include "decompiler/IR2/bitfields.h" -#include "common/util/BitUtils.h" #include "common/type_system/state.h" -#include "common/util/print_float.h" -#include "decompiler/IR2/ExpressionHelpers.h" -#include "decompiler/util/goal_constants.h" #include "common/util/Assert.h" +#include "common/util/BitUtils.h" +#include "common/util/print_float.h" + +#include "decompiler/IR2/ExpressionHelpers.h" +#include "decompiler/IR2/bitfields.h" +#include "decompiler/ObjectFile/LinkedObjectFile.h" +#include "decompiler/util/DecompilerTypeSystem.h" +#include "decompiler/util/data_decompile.h" +#include "decompiler/util/goal_constants.h" /* * TODO diff --git a/decompiler/IR2/FormStack.cpp b/decompiler/IR2/FormStack.cpp index 154b7b2f5a..0507d98a5b 100644 --- a/decompiler/IR2/FormStack.cpp +++ b/decompiler/IR2/FormStack.cpp @@ -1,7 +1,10 @@ -#include #include "FormStack.h" + +#include + #include "Form.h" #include "GenericElementMatcher.h" + #include "decompiler/Function/Function.h" #include "decompiler/util/DecompilerTypeSystem.h" diff --git a/decompiler/IR2/FormStack.h b/decompiler/IR2/FormStack.h index bb5e74200c..680d560c03 100644 --- a/decompiler/IR2/FormStack.h +++ b/decompiler/IR2/FormStack.h @@ -1,6 +1,7 @@ #pragma once #include + #include "decompiler/Disasm/Register.h" #include "decompiler/IR2/AtomicOp.h" diff --git a/decompiler/IR2/IR2_common.h b/decompiler/IR2/IR2_common.h index 9f1f8ea05a..9248de12ed 100644 --- a/decompiler/IR2/IR2_common.h +++ b/decompiler/IR2/IR2_common.h @@ -1,11 +1,14 @@ #pragma once #include + #include "common/common_types.h" #include "common/goos/Object.h" + #include "decompiler/Disasm/Register.h" -#include "decompiler/util/TP_Type.h" -#include "third-party/fmt/core.h" #include "decompiler/Function/Warnings.h" +#include "decompiler/util/TP_Type.h" + +#include "third-party/fmt/core.h" namespace decompiler { enum class AccessMode : u8 { diff --git a/decompiler/IR2/LabelDB.cpp b/decompiler/IR2/LabelDB.cpp index 9980f0e880..4d9dc8a4b2 100644 --- a/decompiler/IR2/LabelDB.cpp +++ b/decompiler/IR2/LabelDB.cpp @@ -1,7 +1,7 @@ -#include "third-party/fmt/core.h" - #include "LabelDB.h" +#include "third-party/fmt/core.h" + namespace decompiler { std::string LabelInfo::print() const { diff --git a/decompiler/IR2/LabelDB.h b/decompiler/IR2/LabelDB.h index 208f098655..d9247ee939 100644 --- a/decompiler/IR2/LabelDB.h +++ b/decompiler/IR2/LabelDB.h @@ -1,13 +1,15 @@ #pragma once #include -#include -#include #include +#include +#include + #include "common/link_types.h" #include "common/type_system/TypeSpec.h" -#include "decompiler/config.h" + #include "decompiler/Disasm/DecompilerLabel.h" +#include "decompiler/config.h" #include "decompiler/util/DecompilerTypeSystem.h" namespace decompiler { diff --git a/decompiler/IR2/OpenGoalMapping.cpp b/decompiler/IR2/OpenGoalMapping.cpp index 27b01bee45..13f3ba143b 100644 --- a/decompiler/IR2/OpenGoalMapping.cpp +++ b/decompiler/IR2/OpenGoalMapping.cpp @@ -1,7 +1,9 @@ #include "OpenGoalMapping.h" -#include "common/goos/PrettyPrinter.h" + #include +#include "common/goos/PrettyPrinter.h" + namespace decompiler { typedef OpenGOALAsm::InstructionModifiers MOD; diff --git a/decompiler/IR2/OpenGoalMapping.h b/decompiler/IR2/OpenGoalMapping.h index 41ec97d227..cd575af10a 100644 --- a/decompiler/IR2/OpenGoalMapping.h +++ b/decompiler/IR2/OpenGoalMapping.h @@ -1,17 +1,20 @@ #pragma once -#include -#include -#include #include -#include "common/goos/Object.h" -#include "decompiler/Disasm/Register.h" -#include "decompiler/Disasm/Instruction.h" -#include "decompiler/IR2/IR2_common.h" -#include "Env.h" +#include +#include +#include + #include "AtomicOp.h" +#include "Env.h" + +#include "common/goos/Object.h" #include "common/util/Assert.h" +#include "decompiler/Disasm/Instruction.h" +#include "decompiler/Disasm/Register.h" +#include "decompiler/IR2/IR2_common.h" + namespace decompiler { struct OpenGOALAsm { diff --git a/decompiler/IR2/bitfields.cpp b/decompiler/IR2/bitfields.cpp index 0cd7b97522..124fc4821e 100644 --- a/decompiler/IR2/bitfields.cpp +++ b/decompiler/IR2/bitfields.cpp @@ -1,12 +1,13 @@ #include "bitfields.h" -#include "decompiler/IR2/Form.h" #include "common/goos/PrettyPrinter.h" -#include "common/util/Range.h" #include "common/util/BitUtils.h" -#include "decompiler/util/DecompilerTypeSystem.h" -#include "decompiler/IR2/GenericElementMatcher.h" +#include "common/util/Range.h" + #include "decompiler/Function/Function.h" +#include "decompiler/IR2/Form.h" +#include "decompiler/IR2/GenericElementMatcher.h" +#include "decompiler/util/DecompilerTypeSystem.h" namespace decompiler { diff --git a/decompiler/IR2/bitfields.h b/decompiler/IR2/bitfields.h index 0f43bf5447..ca492b904e 100644 --- a/decompiler/IR2/bitfields.h +++ b/decompiler/IR2/bitfields.h @@ -1,9 +1,10 @@ #pragma once #include "common/common_types.h" +#include "common/util/Assert.h" + #include "decompiler/IR2/Form.h" #include "decompiler/util/data_decompile.h" -#include "common/util/Assert.h" namespace decompiler { struct BitfieldManip { diff --git a/decompiler/ObjectFile/LinkedObjectFile.cpp b/decompiler/ObjectFile/LinkedObjectFile.cpp index c0de248957..d76a1da966 100644 --- a/decompiler/ObjectFile/LinkedObjectFile.cpp +++ b/decompiler/ObjectFile/LinkedObjectFile.cpp @@ -3,17 +3,21 @@ * An object file's data with linking information included. */ +#include "LinkedObjectFile.h" + #include #include #include -#include "third-party/fmt/core.h" -#include "LinkedObjectFile.h" + +#include "common/goos/PrettyPrinter.h" +#include "common/log/log.h" +#include "common/util/Assert.h" + #include "decompiler/Disasm/InstructionDecode.h" #include "decompiler/config.h" + +#include "third-party/fmt/core.h" #include "third-party/json.hpp" -#include "common/log/log.h" -#include "common/goos/PrettyPrinter.h" -#include "common/util/Assert.h" namespace decompiler { /*! diff --git a/decompiler/ObjectFile/LinkedObjectFile.h b/decompiler/ObjectFile/LinkedObjectFile.h index f1870a26c9..d94c2839a6 100644 --- a/decompiler/ObjectFile/LinkedObjectFile.h +++ b/decompiler/ObjectFile/LinkedObjectFile.h @@ -6,14 +6,17 @@ */ #include -#include #include #include #include +#include + #include "LinkedWord.h" + +#include "common/common_types.h" + #include "decompiler/Disasm/DecompilerLabel.h" #include "decompiler/Function/Function.h" -#include "common/common_types.h" #include "decompiler/IR2/LabelDB.h" namespace decompiler { diff --git a/decompiler/ObjectFile/LinkedObjectFileCreation.cpp b/decompiler/ObjectFile/LinkedObjectFileCreation.cpp index 4234bebe0f..97c25b726e 100644 --- a/decompiler/ObjectFile/LinkedObjectFileCreation.cpp +++ b/decompiler/ObjectFile/LinkedObjectFileCreation.cpp @@ -4,13 +4,16 @@ * This implements a decoder for the GOAL linking format. */ -#include #include "LinkedObjectFileCreation.h" + +#include + +#include "common/link_types.h" +#include "common/util/Assert.h" +#include "common/util/BitUtils.h" + #include "decompiler/config.h" #include "decompiler/util/DecompilerTypeSystem.h" -#include "common/link_types.h" -#include "common/util/BitUtils.h" -#include "common/util/Assert.h" namespace decompiler { // There are three link versions: diff --git a/decompiler/ObjectFile/LinkedWord.h b/decompiler/ObjectFile/LinkedWord.h index dc278d7bfc..7559362ff4 100644 --- a/decompiler/ObjectFile/LinkedWord.h +++ b/decompiler/ObjectFile/LinkedWord.h @@ -6,8 +6,9 @@ */ #include -#include #include +#include + #include "common/common_types.h" #include "common/util/Assert.h" diff --git a/decompiler/ObjectFile/ObjectFileDB.cpp b/decompiler/ObjectFile/ObjectFileDB.cpp index 1748df3eb4..0172e313a2 100644 --- a/decompiler/ObjectFile/ObjectFileDB.cpp +++ b/decompiler/ObjectFile/ObjectFileDB.cpp @@ -6,27 +6,32 @@ */ #include "ObjectFileDB.h" + #include -#include #include #include +#include + +#include "LinkedObjectFileCreation.h" + #include "common/link_types.h" -#include "common/util/dgo_util.h" +#include "common/log/log.h" +#include "common/util/BinaryReader.h" #include "common/util/BitUtils.h" -#include "decompiler/data/tpage.h" -#include "decompiler/data/game_text.h" +#include "common/util/FileUtil.h" +#include "common/util/Timer.h" +#include "common/util/crc32.h" +#include "common/util/dgo_util.h" +#include "common/util/json_util.h" + +#include "decompiler/Function/BasicBlocks.h" +#include "decompiler/config.h" #include "decompiler/data/StrFileReader.h" #include "decompiler/data/dir_tpages.h" #include "decompiler/data/game_count.h" -#include "LinkedObjectFileCreation.h" -#include "decompiler/config.h" -#include "common/util/BinaryReader.h" -#include "common/util/Timer.h" -#include "common/util/FileUtil.h" -#include "decompiler/Function/BasicBlocks.h" -#include "common/log/log.h" -#include "common/util/json_util.h" -#include "common/util/crc32.h" +#include "decompiler/data/game_text.h" +#include "decompiler/data/tpage.h" + #include "third-party/xdelta3/xdelta3.h" namespace decompiler { diff --git a/decompiler/ObjectFile/ObjectFileDB.h b/decompiler/ObjectFile/ObjectFileDB.h index f0daf965eb..2e640f18c8 100644 --- a/decompiler/ObjectFile/ObjectFileDB.h +++ b/decompiler/ObjectFile/ObjectFileDB.h @@ -10,14 +10,18 @@ #include #include #include -#include "common/common_types.h" + #include "LinkedObjectFile.h" -#include "third-party/fmt/core.h" -#include "decompiler/util/DecompilerTypeSystem.h" -#include "decompiler/data/TextureDB.h" -#include "decompiler/analysis/symbol_def_map.h" + +#include "common/common_types.h" #include "common/util/Assert.h" +#include "decompiler/analysis/symbol_def_map.h" +#include "decompiler/data/TextureDB.h" +#include "decompiler/util/DecompilerTypeSystem.h" + +#include "third-party/fmt/core.h" + namespace decompiler { /*! * A "record" which can be used to identify an object file. diff --git a/decompiler/ObjectFile/ObjectFileDB_IR2.cpp b/decompiler/ObjectFile/ObjectFileDB_IR2.cpp index f9ffd7e7c7..2331f6c016 100644 --- a/decompiler/ObjectFile/ObjectFileDB_IR2.cpp +++ b/decompiler/ObjectFile/ObjectFileDB_IR2.cpp @@ -3,29 +3,31 @@ * This runs the IR2 analysis passes. */ -#include "common/link_types.h" #include "ObjectFileDB.h" + +#include "common/goos/PrettyPrinter.h" +#include "common/link_types.h" #include "common/log/log.h" -#include "common/util/Timer.h" #include "common/util/FileUtil.h" -#include "decompiler/analysis/type_analysis.h" -#include "decompiler/analysis/reg_usage.h" +#include "common/util/Timer.h" + +#include "decompiler/IR2/Form.h" +#include "decompiler/analysis/cfg_builder.h" +#include "decompiler/analysis/expression_build.h" +#include "decompiler/analysis/final_output.h" +#include "decompiler/analysis/find_defpartgroup.h" +#include "decompiler/analysis/find_defstates.h" +#include "decompiler/analysis/find_skelgroups.h" +#include "decompiler/analysis/inline_asm_rewrite.h" #include "decompiler/analysis/insert_lets.h" #include "decompiler/analysis/label_types.h" -#include "decompiler/analysis/find_defstates.h" -#include "decompiler/analysis/variable_naming.h" -#include "decompiler/analysis/cfg_builder.h" -#include "decompiler/analysis/final_output.h" -#include "decompiler/analysis/expression_build.h" -#include "decompiler/analysis/inline_asm_rewrite.h" +#include "decompiler/analysis/mips2c.h" +#include "decompiler/analysis/reg_usage.h" #include "decompiler/analysis/stack_spill.h" #include "decompiler/analysis/static_refs.h" #include "decompiler/analysis/symbol_def_map.h" -#include "decompiler/analysis/find_skelgroups.h" -#include "decompiler/analysis/find_defpartgroup.h" -#include "common/goos/PrettyPrinter.h" -#include "decompiler/IR2/Form.h" -#include "decompiler/analysis/mips2c.h" +#include "decompiler/analysis/type_analysis.h" +#include "decompiler/analysis/variable_naming.h" namespace decompiler { diff --git a/decompiler/VuDisasm/VuDisassembler.cpp b/decompiler/VuDisasm/VuDisassembler.cpp index 84f099fee6..0d72667e36 100644 --- a/decompiler/VuDisasm/VuDisassembler.cpp +++ b/decompiler/VuDisasm/VuDisassembler.cpp @@ -1,10 +1,12 @@ -#include -#include - #include "VuDisassembler.h" -#include "third-party/fmt/core.h" -#include "common/util/print_float.h" + +#include +#include + #include "common/util/Assert.h" +#include "common/util/print_float.h" + +#include "third-party/fmt/core.h" namespace decompiler { diff --git a/decompiler/VuDisasm/VuDisassembler.h b/decompiler/VuDisasm/VuDisassembler.h index 073f0204bf..0ba268c59d 100644 --- a/decompiler/VuDisasm/VuDisassembler.h +++ b/decompiler/VuDisasm/VuDisassembler.h @@ -2,9 +2,10 @@ #include -#include "decompiler/VuDisasm/VuProgram.h" #include "common/util/Assert.h" +#include "decompiler/VuDisasm/VuProgram.h" + namespace decompiler { struct VuDecodeStep { diff --git a/decompiler/VuDisasm/VuInstruction.cpp b/decompiler/VuDisasm/VuInstruction.cpp index 5da13d4ce2..7bfaf0073d 100644 --- a/decompiler/VuDisasm/VuInstruction.cpp +++ b/decompiler/VuDisasm/VuInstruction.cpp @@ -1,7 +1,9 @@ -#include "third-party/fmt/core.h" #include "VuInstruction.h" + #include "common/util/Assert.h" +#include "third-party/fmt/core.h" + namespace decompiler { VuInstructionAtom VuInstructionAtom::make_vf(int idx) { ASSERT(idx >= 0 && idx <= 31); diff --git a/decompiler/VuDisasm/VuInstruction.h b/decompiler/VuDisasm/VuInstruction.h index 7169928260..db470777ea 100644 --- a/decompiler/VuDisasm/VuInstruction.h +++ b/decompiler/VuDisasm/VuInstruction.h @@ -1,7 +1,8 @@ #pragma once -#include #include +#include +#include #include "common/common_types.h" @@ -209,4 +210,4 @@ struct VuInstructionPair { VuInstruction upper, lower; }; -} // namespace decompiler \ No newline at end of file +} // namespace decompiler diff --git a/decompiler/config.cpp b/decompiler/config.cpp index b161bbe001..a855103321 100644 --- a/decompiler/config.cpp +++ b/decompiler/config.cpp @@ -1,10 +1,13 @@ #include "config.h" -#include "third-party/json.hpp" -#include "third-party/fmt/core.h" + #include "common/util/FileUtil.h" #include "common/util/json_util.h" + #include "decompiler/util/config_parsers.h" +#include "third-party/fmt/core.h" +#include "third-party/json.hpp" + namespace decompiler { namespace { diff --git a/decompiler/config.h b/decompiler/config.h index b9bab1243d..2c5da26435 100644 --- a/decompiler/config.h +++ b/decompiler/config.h @@ -1,14 +1,16 @@ #pragma once -#include -#include -#include -#include #include +#include +#include +#include +#include + +#include "common/common_types.h" +#include "common/versions.h" + #include "decompiler/Disasm/Register.h" #include "decompiler/data/game_text.h" -#include "common/versions.h" -#include "common/common_types.h" namespace decompiler { struct RegisterTypeCast { diff --git a/decompiler/data/LinkedWordReader.h b/decompiler/data/LinkedWordReader.h index 7371b53069..5902547594 100644 --- a/decompiler/data/LinkedWordReader.h +++ b/decompiler/data/LinkedWordReader.h @@ -1,12 +1,14 @@ #pragma once #include -#include -#include #include +#include +#include + #include "common/common_types.h" -#include "decompiler/ObjectFile/LinkedWord.h" #include "common/util/Assert.h" +#include "decompiler/ObjectFile/LinkedWord.h" + namespace decompiler { class LinkedWordReader { public: diff --git a/decompiler/data/StrFileReader.cpp b/decompiler/data/StrFileReader.cpp index 8dc68b25d5..83c94ddc91 100644 --- a/decompiler/data/StrFileReader.cpp +++ b/decompiler/data/StrFileReader.cpp @@ -3,12 +3,15 @@ * Utility class to read a .STR file and extract the full file name. */ +#include "StrFileReader.h" + #include + +#include "common/util/Assert.h" #include "common/util/FileUtil.h" + #include "game/common/overlord_common.h" #include "game/common/str_rpc_types.h" -#include "StrFileReader.h" -#include "common/util/Assert.h" namespace decompiler { StrFileReader::StrFileReader(const std::string& file_path) { diff --git a/decompiler/data/StrFileReader.h b/decompiler/data/StrFileReader.h index 5a492f69c5..c97685cbb2 100644 --- a/decompiler/data/StrFileReader.h +++ b/decompiler/data/StrFileReader.h @@ -7,6 +7,7 @@ #include #include + #include "common/common_types.h" namespace decompiler { diff --git a/decompiler/data/TextureDB.cpp b/decompiler/data/TextureDB.cpp index 45d46d114c..34a53985c1 100644 --- a/decompiler/data/TextureDB.cpp +++ b/decompiler/data/TextureDB.cpp @@ -1,10 +1,12 @@ #include "TextureDB.h" -#include "third-party/fmt/core.h" -#include "common/util/Assert.h" -#include "third-party/stb_image/stb_image.h" #include +#include "common/util/Assert.h" + +#include "third-party/fmt/core.h" +#include "third-party/stb_image/stb_image.h" + namespace decompiler { void TextureDB::add_texture(u32 tpage, diff --git a/decompiler/data/TextureDB.h b/decompiler/data/TextureDB.h index 79ac412c81..23e8c0ae4c 100644 --- a/decompiler/data/TextureDB.h +++ b/decompiler/data/TextureDB.h @@ -1,9 +1,10 @@ #pragma once -#include -#include #include #include +#include +#include + #include "common/common_types.h" namespace decompiler { diff --git a/decompiler/data/dir_tpages.cpp b/decompiler/data/dir_tpages.cpp index 8b5e0cde31..b7f823f5d4 100644 --- a/decompiler/data/dir_tpages.cpp +++ b/decompiler/data/dir_tpages.cpp @@ -1,7 +1,9 @@ -#include "third-party/fmt/core.h" -#include "decompiler/ObjectFile/ObjectFileDB.h" #include "dir_tpages.h" +#include "decompiler/ObjectFile/ObjectFileDB.h" + +#include "third-party/fmt/core.h" + namespace decompiler { std::string DirTpageResult::to_source() const { std::string result; diff --git a/decompiler/data/dir_tpages.h b/decompiler/data/dir_tpages.h index ddf6034f8e..f2dc95d73c 100644 --- a/decompiler/data/dir_tpages.h +++ b/decompiler/data/dir_tpages.h @@ -1,7 +1,7 @@ #pragma once -#include #include +#include namespace decompiler { diff --git a/decompiler/data/game_count.cpp b/decompiler/data/game_count.cpp index ded897cc7b..d30a0267f8 100644 --- a/decompiler/data/game_count.cpp +++ b/decompiler/data/game_count.cpp @@ -1,8 +1,11 @@ -#include "third-party/fmt/core.h" -#include "decompiler/ObjectFile/ObjectFileDB.h" #include "game_count.h" + #include "LinkedWordReader.h" +#include "decompiler/ObjectFile/ObjectFileDB.h" + +#include "third-party/fmt/core.h" + namespace decompiler { GameCountResult process_game_count(ObjectFileData& data) { GameCountResult result; diff --git a/decompiler/data/game_count.h b/decompiler/data/game_count.h index 530c21440a..a124588486 100644 --- a/decompiler/data/game_count.h +++ b/decompiler/data/game_count.h @@ -1,7 +1,8 @@ #pragma once -#include #include +#include + #include "common/common_types.h" namespace decompiler { diff --git a/decompiler/data/game_text.cpp b/decompiler/data/game_text.cpp index 74f5c6dfb2..f7f67af96d 100644 --- a/decompiler/data/game_text.cpp +++ b/decompiler/data/game_text.cpp @@ -1,13 +1,17 @@ +#include "game_text.h" + +#include #include #include #include -#include -#include "third-party/fmt/core.h" -#include "game_text.h" -#include "decompiler/ObjectFile/ObjectFileDB.h" + #include "common/goos/Reader.h" #include "common/util/BitUtils.h" +#include "decompiler/ObjectFile/ObjectFileDB.h" + +#include "third-party/fmt/core.h" + namespace decompiler { namespace { template diff --git a/decompiler/data/game_text.h b/decompiler/data/game_text.h index 1d3a1f54b7..a1b73458f2 100644 --- a/decompiler/data/game_text.h +++ b/decompiler/data/game_text.h @@ -1,6 +1,7 @@ #pragma once #include #include + #include "common/util/FontUtils.h" namespace decompiler { diff --git a/decompiler/data/streamed_audio.cpp b/decompiler/data/streamed_audio.cpp index 7d1855b4c0..e26aa410e1 100644 --- a/decompiler/data/streamed_audio.cpp +++ b/decompiler/data/streamed_audio.cpp @@ -1,13 +1,14 @@ -#include "common/log/log.h" -#include "common/util/FileUtil.h" -#include "common/util/BinaryReader.h" -#include "common/audio/audio_formats.h" -#include "third-party/fmt/core.h" -#include "third-party/json.hpp" - #include "streamed_audio.h" +#include "common/audio/audio_formats.h" +#include "common/log/log.h" +#include "common/util/BinaryReader.h" +#include "common/util/FileUtil.h" + +#include "third-party/fmt/core.h" +#include "third-party/json.hpp" + namespace decompiler { // number of bytes per "audio page" in the VAG directory file. diff --git a/decompiler/data/tpage.cpp b/decompiler/data/tpage.cpp index acdd932f98..4d020c0973 100644 --- a/decompiler/data/tpage.cpp +++ b/decompiler/data/tpage.cpp @@ -14,12 +14,15 @@ * check duplicate names */ -#include "common/util/FileUtil.h" #include "tpage.h" -#include "common/versions.h" -#include "decompiler/ObjectFile/ObjectFileDB.h" -#include "third-party/fmt/core.h" + #include "common/texture/texture_conversion.h" +#include "common/util/FileUtil.h" +#include "common/versions.h" + +#include "decompiler/ObjectFile/ObjectFileDB.h" + +#include "third-party/fmt/core.h" namespace decompiler { namespace { diff --git a/decompiler/extractor/main.cpp b/decompiler/extractor/main.cpp index 0e799cfe9c..1a5a98d185 100644 --- a/decompiler/extractor/main.cpp +++ b/decompiler/extractor/main.cpp @@ -1,13 +1,16 @@ -#include "third-party/CLI11.hpp" +#include + #include "common/log/log.h" #include "common/util/FileUtil.h" +#include "common/util/read_iso_file.h" + #include "decompiler/Disasm/OpcodeInfo.h" #include "decompiler/ObjectFile/ObjectFileDB.h" -#include "decompiler/level_extractor/extract_level.h" #include "decompiler/config.h" +#include "decompiler/level_extractor/extract_level.h" #include "goalc/compiler/Compiler.h" -#include "common/util/read_iso_file.h" -#include + +#include "third-party/CLI11.hpp" enum class ExtractorErrorCode { SUCCESS = 0, diff --git a/decompiler/level_extractor/BspHeader.cpp b/decompiler/level_extractor/BspHeader.cpp index 8064a41c33..a3159e855b 100644 --- a/decompiler/level_extractor/BspHeader.cpp +++ b/decompiler/level_extractor/BspHeader.cpp @@ -1,10 +1,11 @@ #include "BspHeader.h" +#include "common/dma/dma.h" + #include "decompiler/ObjectFile/LinkedObjectFile.h" #include "decompiler/util/DecompilerTypeSystem.h" -#include "decompiler/util/goal_data_reader.h" #include "decompiler/util/Error.h" -#include "common/dma/dma.h" +#include "decompiler/util/goal_data_reader.h" namespace level_tools { diff --git a/decompiler/level_extractor/BspHeader.h b/decompiler/level_extractor/BspHeader.h index eb66a76dd1..843aa57bb7 100644 --- a/decompiler/level_extractor/BspHeader.h +++ b/decompiler/level_extractor/BspHeader.h @@ -1,13 +1,14 @@ #pragma once -#include "common/common_types.h" -#include #include -#include #include +#include +#include + +#include "common/common_types.h" -#include "decompiler/util/goal_data_reader.h" #include "decompiler/level_extractor/common_formats.h" +#include "decompiler/util/goal_data_reader.h" namespace decompiler { class LinkedObjectFile; diff --git a/decompiler/level_extractor/MercData.cpp b/decompiler/level_extractor/MercData.cpp index 6e9c404336..3da09034ea 100644 --- a/decompiler/level_extractor/MercData.cpp +++ b/decompiler/level_extractor/MercData.cpp @@ -1,8 +1,11 @@ #include "MercData.h" -#include "decompiler/util/DecompilerTypeSystem.h" -#include "third-party/fmt/core.h" + #include "common/dma/gs.h" +#include "decompiler/util/DecompilerTypeSystem.h" + +#include "third-party/fmt/core.h" + namespace decompiler { void MercCtrlHeader::from_ref(TypedRef tr, const DecompilerTypeSystem& dts) { st_magic = read_plain_data_field(tr, "st-magic", dts); diff --git a/decompiler/level_extractor/MercData.h b/decompiler/level_extractor/MercData.h index 4d64f7a459..0155ed6399 100644 --- a/decompiler/level_extractor/MercData.h +++ b/decompiler/level_extractor/MercData.h @@ -2,10 +2,12 @@ #include #include + #include "common/common_types.h" -#include "decompiler/util/goal_data_reader.h" -#include "common/math/Vector.h" #include "common/dma/gs.h" +#include "common/math/Vector.h" + +#include "decompiler/util/goal_data_reader.h" namespace decompiler { diff --git a/decompiler/level_extractor/extract_collide_frags.h b/decompiler/level_extractor/extract_collide_frags.h index 44fc2bf44d..6ae3ee62af 100644 --- a/decompiler/level_extractor/extract_collide_frags.h +++ b/decompiler/level_extractor/extract_collide_frags.h @@ -1,6 +1,7 @@ #pragma once #include "BspHeader.h" + #include "common/custom_data/Tfrag3Data.h" namespace decompiler { diff --git a/decompiler/level_extractor/extract_common.cpp b/decompiler/level_extractor/extract_common.cpp index 8ff25b07f1..216127d2b2 100644 --- a/decompiler/level_extractor/extract_common.cpp +++ b/decompiler/level_extractor/extract_common.cpp @@ -1,6 +1,7 @@ -#include #include "extract_common.h" +#include + u32 clean_up_vertex_indices(std::vector& idx) { std::vector fixed; u32 num_tris = 0; diff --git a/decompiler/level_extractor/extract_common.h b/decompiler/level_extractor/extract_common.h index 55a91495f2..c50030df51 100644 --- a/decompiler/level_extractor/extract_common.h +++ b/decompiler/level_extractor/extract_common.h @@ -1,5 +1,6 @@ #pragma once #include + #include "common/common_types.h" u32 clean_up_vertex_indices(std::vector& idx); \ No newline at end of file diff --git a/decompiler/level_extractor/extract_level.cpp b/decompiler/level_extractor/extract_level.cpp index ec1a12d34a..58922eda34 100644 --- a/decompiler/level_extractor/extract_level.cpp +++ b/decompiler/level_extractor/extract_level.cpp @@ -1,16 +1,18 @@ +#include "extract_level.h" + #include #include -#include "extract_level.h" -#include "decompiler/level_extractor/BspHeader.h" -#include "decompiler/level_extractor/extract_tfrag.h" -#include "decompiler/level_extractor/extract_tie.h" -#include "decompiler/level_extractor/extract_shrub.h" -#include "decompiler/level_extractor/extract_collide_frags.h" -#include "decompiler/level_extractor/extract_merc.h" -#include "common/util/compress.h" #include "common/util/FileUtil.h" #include "common/util/SimpleThreadGroup.h" +#include "common/util/compress.h" + +#include "decompiler/level_extractor/BspHeader.h" +#include "decompiler/level_extractor/extract_collide_frags.h" +#include "decompiler/level_extractor/extract_merc.h" +#include "decompiler/level_extractor/extract_shrub.h" +#include "decompiler/level_extractor/extract_tfrag.h" +#include "decompiler/level_extractor/extract_tie.h" namespace decompiler { diff --git a/decompiler/level_extractor/extract_level.h b/decompiler/level_extractor/extract_level.h index 56996920bb..f83307e0e8 100644 --- a/decompiler/level_extractor/extract_level.h +++ b/decompiler/level_extractor/extract_level.h @@ -3,6 +3,7 @@ #include #include "common/math/Vector.h" + #include "decompiler/ObjectFile/ObjectFileDB.h" namespace decompiler { diff --git a/decompiler/level_extractor/extract_merc.cpp b/decompiler/level_extractor/extract_merc.cpp index ba7f0bb6d6..543f860940 100644 --- a/decompiler/level_extractor/extract_merc.cpp +++ b/decompiler/level_extractor/extract_merc.cpp @@ -1,10 +1,12 @@ #include "extract_merc.h" -#include "decompiler/util/goal_data_reader.h" -#include "decompiler/level_extractor/MercData.h" -#include "decompiler/level_extractor/extract_common.h" + #include "common/util/FileUtil.h" #include "common/util/colors.h" +#include "decompiler/level_extractor/MercData.h" +#include "decompiler/level_extractor/extract_common.h" +#include "decompiler/util/goal_data_reader.h" + namespace decompiler { // number of slots on VU1 data memory to store matrices diff --git a/decompiler/level_extractor/extract_merc.h b/decompiler/level_extractor/extract_merc.h index 3e40dfe69f..35e1a1c3b3 100644 --- a/decompiler/level_extractor/extract_merc.h +++ b/decompiler/level_extractor/extract_merc.h @@ -1,8 +1,9 @@ #pragma once -#include "decompiler/data/TextureDB.h" #include "common/custom_data/Tfrag3Data.h" + #include "decompiler/ObjectFile/ObjectFileDB.h" +#include "decompiler/data/TextureDB.h" #include "decompiler/level_extractor/common_formats.h" namespace decompiler { diff --git a/decompiler/level_extractor/extract_shrub.cpp b/decompiler/level_extractor/extract_shrub.cpp index 560bccf64a..48daeba7c6 100644 --- a/decompiler/level_extractor/extract_shrub.cpp +++ b/decompiler/level_extractor/extract_shrub.cpp @@ -1,11 +1,12 @@ +#include "extract_shrub.h" + #include -#include "extract_shrub.h" -#include "decompiler/level_extractor/extract_common.h" -#include "decompiler/ObjectFile/LinkedObjectFile.h" - #include "common/util/FileUtil.h" +#include "decompiler/ObjectFile/LinkedObjectFile.h" +#include "decompiler/level_extractor/extract_common.h" + namespace decompiler { using namespace level_tools; diff --git a/decompiler/level_extractor/extract_shrub.h b/decompiler/level_extractor/extract_shrub.h index 772615ea92..c57fc376bb 100644 --- a/decompiler/level_extractor/extract_shrub.h +++ b/decompiler/level_extractor/extract_shrub.h @@ -1,9 +1,10 @@ #pragma once -#include "decompiler/level_extractor/BspHeader.h" -#include "common/math/Vector.h" #include "common/custom_data/Tfrag3Data.h" +#include "common/math/Vector.h" + #include "decompiler/data/TextureDB.h" +#include "decompiler/level_extractor/BspHeader.h" namespace decompiler { diff --git a/decompiler/level_extractor/extract_tfrag.cpp b/decompiler/level_extractor/extract_tfrag.cpp index 82a3045d8a..6e4c2dd2e3 100644 --- a/decompiler/level_extractor/extract_tfrag.cpp +++ b/decompiler/level_extractor/extract_tfrag.cpp @@ -1,11 +1,13 @@ #include "extract_tfrag.h" + +#include "common/custom_data/pack_helpers.h" #include "common/dma/dma.h" -#include "decompiler/util/Error.h" -#include "decompiler/ObjectFile/LinkedObjectFile.h" -#include "common/util/FileUtil.h" #include "common/dma/gs.h" #include "common/util/Assert.h" -#include "common/custom_data/pack_helpers.h" +#include "common/util/FileUtil.h" + +#include "decompiler/ObjectFile/LinkedObjectFile.h" +#include "decompiler/util/Error.h" namespace decompiler { namespace { diff --git a/decompiler/level_extractor/extract_tfrag.h b/decompiler/level_extractor/extract_tfrag.h index dbe176661b..9d4d91dbd7 100644 --- a/decompiler/level_extractor/extract_tfrag.h +++ b/decompiler/level_extractor/extract_tfrag.h @@ -1,9 +1,10 @@ #pragma once -#include "decompiler/level_extractor/BspHeader.h" -#include "common/math/Vector.h" #include "common/custom_data/Tfrag3Data.h" +#include "common/math/Vector.h" + #include "decompiler/data/TextureDB.h" +#include "decompiler/level_extractor/BspHeader.h" namespace decompiler { diff --git a/decompiler/level_extractor/extract_tie.cpp b/decompiler/level_extractor/extract_tie.cpp index 9e072478b9..acaeff9fac 100644 --- a/decompiler/level_extractor/extract_tie.cpp +++ b/decompiler/level_extractor/extract_tie.cpp @@ -1,11 +1,11 @@ -#include - #include "extract_tie.h" -#include "decompiler/ObjectFile/LinkedObjectFile.h" +#include #include "common/util/FileUtil.h" +#include "decompiler/ObjectFile/LinkedObjectFile.h" + namespace decompiler { /// diff --git a/decompiler/level_extractor/extract_tie.h b/decompiler/level_extractor/extract_tie.h index 59c5b167f5..6429a775ee 100644 --- a/decompiler/level_extractor/extract_tie.h +++ b/decompiler/level_extractor/extract_tie.h @@ -1,10 +1,12 @@ #pragma once #include "extract_tie.h" -#include "decompiler/level_extractor/BspHeader.h" -#include "decompiler/data/TextureDB.h" + #include "common/custom_data/Tfrag3Data.h" +#include "decompiler/data/TextureDB.h" +#include "decompiler/level_extractor/BspHeader.h" + namespace decompiler { void extract_tie(const level_tools::DrawableTreeInstanceTie* tree, diff --git a/decompiler/main.cpp b/decompiler/main.cpp index 2556b0ab8f..70855ac3bb 100644 --- a/decompiler/main.cpp +++ b/decompiler/main.cpp @@ -1,17 +1,20 @@ #include #include #include -#include "ObjectFile/ObjectFileDB.h" -#include "common/log/log.h" + #include "config.h" + +#include "common/log/log.h" #include "common/util/FileUtil.h" +#include "common/util/Timer.h" +#include "common/util/diff.h" +#include "common/util/os.h" #include "common/versions.h" + +#include "ObjectFile/ObjectFileDB.h" +#include "decompiler/data/TextureDB.h" #include "decompiler/data/streamed_audio.h" #include "decompiler/level_extractor/extract_level.h" -#include "decompiler/data/TextureDB.h" -#include "common/util/os.h" -#include "common/util/diff.h" -#include "common/util/Timer.h" int main(int argc, char** argv) { Timer decomp_timer; diff --git a/decompiler/util/DataParser.cpp b/decompiler/util/DataParser.cpp index 96b1c6ff6e..335ca14167 100644 --- a/decompiler/util/DataParser.cpp +++ b/decompiler/util/DataParser.cpp @@ -1,8 +1,11 @@ -#include #include "DataParser.h" -#include "third-party/fmt/core.h" + +#include + #include "common/util/Assert.h" +#include "third-party/fmt/core.h" + /* * Allowable lines: * L123: - label diff --git a/decompiler/util/DataParser.h b/decompiler/util/DataParser.h index ae6d8e529b..f45882c815 100644 --- a/decompiler/util/DataParser.h +++ b/decompiler/util/DataParser.h @@ -5,10 +5,11 @@ * A parser for the decompiled GOAL data format. */ -#include #include -#include "decompiler/ObjectFile/LinkedWord.h" +#include + #include "decompiler/Disasm/DecompilerLabel.h" +#include "decompiler/ObjectFile/LinkedWord.h" namespace decompiler { struct ParsedData { diff --git a/decompiler/util/DecompilerTypeSystem.cpp b/decompiler/util/DecompilerTypeSystem.cpp index 44cc76e9b1..75c21609c4 100644 --- a/decompiler/util/DecompilerTypeSystem.cpp +++ b/decompiler/util/DecompilerTypeSystem.cpp @@ -1,10 +1,13 @@ #include "DecompilerTypeSystem.h" + +#include "TP_Type.h" + #include "common/goos/Reader.h" +#include "common/log/log.h" #include "common/type_system/defenum.h" #include "common/type_system/deftype.h" + #include "decompiler/Disasm/Register.h" -#include "common/log/log.h" -#include "TP_Type.h" namespace decompiler { DecompilerTypeSystem::DecompilerTypeSystem() { diff --git a/decompiler/util/DecompilerTypeSystem.h b/decompiler/util/DecompilerTypeSystem.h index 1d762dc7d1..0eba85e1bd 100644 --- a/decompiler/util/DecompilerTypeSystem.h +++ b/decompiler/util/DecompilerTypeSystem.h @@ -1,8 +1,9 @@ #pragma once -#include "common/type_system/TypeSystem.h" -#include "decompiler/Disasm/Register.h" #include "common/goos/Reader.h" +#include "common/type_system/TypeSystem.h" + +#include "decompiler/Disasm/Register.h" namespace decompiler { class TP_Type; diff --git a/decompiler/util/Error.h b/decompiler/util/Error.h index 3d507351f4..2e19b91f11 100644 --- a/decompiler/util/Error.h +++ b/decompiler/util/Error.h @@ -1,6 +1,7 @@ #pragma once #include + #include "third-party/fmt/core.h" class Error : public std::runtime_error { diff --git a/decompiler/util/StackSpillMap.h b/decompiler/util/StackSpillMap.h index 7ebe8a6c68..a90bfb21f9 100644 --- a/decompiler/util/StackSpillMap.h +++ b/decompiler/util/StackSpillMap.h @@ -1,8 +1,8 @@ #pragma once +#include #include #include -#include namespace decompiler { /*! diff --git a/decompiler/util/TP_Type.cpp b/decompiler/util/TP_Type.cpp index 841898354d..8b62cf5d94 100644 --- a/decompiler/util/TP_Type.cpp +++ b/decompiler/util/TP_Type.cpp @@ -1,4 +1,5 @@ #include "TP_Type.h" + #include "third-party/fmt/core.h" namespace decompiler { diff --git a/decompiler/util/TP_Type.h b/decompiler/util/TP_Type.h index aab496b972..6b99fb2854 100644 --- a/decompiler/util/TP_Type.h +++ b/decompiler/util/TP_Type.h @@ -1,12 +1,14 @@ #pragma once -#include #include +#include + +#include "common/common_types.h" #include "common/log/log.h" #include "common/type_system/TypeSpec.h" -#include "common/common_types.h" -#include "decompiler/Disasm/Register.h" #include "common/util/Assert.h" +#include "decompiler/Disasm/Register.h" + namespace decompiler { /*! * A TP_Type is a specialized typespec used in the type propagation algorithm. diff --git a/decompiler/util/config_parsers.cpp b/decompiler/util/config_parsers.cpp index 44a3836054..d29209a2dc 100644 --- a/decompiler/util/config_parsers.cpp +++ b/decompiler/util/config_parsers.cpp @@ -1,4 +1,5 @@ #include "config_parsers.h" + #include "common/util/json_util.h" namespace decompiler { diff --git a/decompiler/util/config_parsers.h b/decompiler/util/config_parsers.h index 49fb2a9ca2..7bf13a0cd5 100644 --- a/decompiler/util/config_parsers.h +++ b/decompiler/util/config_parsers.h @@ -1,6 +1,8 @@ #pragma once #include + #include "decompiler/config.h" + #include "third-party/json.hpp" namespace decompiler { diff --git a/decompiler/util/data_decompile.cpp b/decompiler/util/data_decompile.cpp index 7fb2f16937..ea1edef0fd 100644 --- a/decompiler/util/data_decompile.cpp +++ b/decompiler/util/data_decompile.cpp @@ -1,17 +1,20 @@ +#include "data_decompile.h" + #include -#include "data_decompile.h" -#include "third-party/fmt/core.h" -#include "common/type_system/Type.h" #include "common/goos/PrettyPrinter.h" -#include "common/util/math_util.h" #include "common/log/log.h" +#include "common/type_system/Type.h" +#include "common/util/Assert.h" +#include "common/util/math_util.h" #include "common/util/print_float.h" -#include "decompiler/ObjectFile/LinkedObjectFile.h" + #include "decompiler/IR2/Form.h" +#include "decompiler/ObjectFile/LinkedObjectFile.h" #include "decompiler/analysis/final_output.h" #include "decompiler/util/sparticle_decompile.h" -#include "common/util/Assert.h" + +#include "third-party/fmt/core.h" namespace decompiler { diff --git a/decompiler/util/data_decompile.h b/decompiler/util/data_decompile.h index 64f66962ac..8106ecd548 100644 --- a/decompiler/util/data_decompile.h +++ b/decompiler/util/data_decompile.h @@ -1,14 +1,16 @@ #pragma once #include + #include "common/goos/Object.h" -#include "decompiler/Disasm/DecompilerLabel.h" -#include "decompiler/ObjectFile/LinkedWord.h" #include "common/type_system/TypeSpec.h" #include "common/type_system/TypeSystem.h" + +#include "decompiler/Disasm/DecompilerLabel.h" +#include "decompiler/IR2/LabelDB.h" +#include "decompiler/ObjectFile/LinkedWord.h" #include "decompiler/config.h" #include "decompiler/util/DecompilerTypeSystem.h" -#include "decompiler/IR2/LabelDB.h" namespace decompiler { class LinkedObjectFile; diff --git a/decompiler/util/goal_data_reader.cpp b/decompiler/util/goal_data_reader.cpp index 80a89c362f..bdd58bacf2 100644 --- a/decompiler/util/goal_data_reader.cpp +++ b/decompiler/util/goal_data_reader.cpp @@ -1,8 +1,7 @@ #include "goal_data_reader.h" -#include "decompiler/util/DecompilerTypeSystem.h" #include "decompiler/ObjectFile/LinkedObjectFile.h" - +#include "decompiler/util/DecompilerTypeSystem.h" #include "decompiler/util/Error.h" void read_plain_data_field(const TypedRef& object, diff --git a/decompiler/util/goal_data_reader.h b/decompiler/util/goal_data_reader.h index 7132a73412..2d3f074184 100644 --- a/decompiler/util/goal_data_reader.h +++ b/decompiler/util/goal_data_reader.h @@ -1,7 +1,8 @@ #pragma once -#include #include +#include + #include "common/common_types.h" namespace decompiler { diff --git a/decompiler/util/sparticle_decompile.cpp b/decompiler/util/sparticle_decompile.cpp index 632e62b5e5..8a0f829c49 100644 --- a/decompiler/util/sparticle_decompile.cpp +++ b/decompiler/util/sparticle_decompile.cpp @@ -1,8 +1,10 @@ #include "sparticle_decompile.h" -#include "decompiler/util/data_decompile.h" + #include "common/goos/PrettyPrinter.h" -#include "common/util/print_float.h" #include "common/util/Assert.h" +#include "common/util/print_float.h" + +#include "decompiler/util/data_decompile.h" namespace decompiler { // sparticle fields. diff --git a/decompiler/util/sparticle_decompile.h b/decompiler/util/sparticle_decompile.h index 6d6118cbd9..1d3f9866fd 100644 --- a/decompiler/util/sparticle_decompile.h +++ b/decompiler/util/sparticle_decompile.h @@ -2,9 +2,10 @@ #include "common/goos/Object.h" #include "common/type_system/TypeSpec.h" + #include "decompiler/Disasm/DecompilerLabel.h" -#include "decompiler/ObjectFile/LinkedObjectFile.h" #include "decompiler/IR2/Form.h" +#include "decompiler/ObjectFile/LinkedObjectFile.h" namespace decompiler { goos::Object decompile_sparticle_field_init(const TypeSpec& type, diff --git a/game/common/str_rpc_types.h b/game/common/str_rpc_types.h index 763cc91d89..b2da99e0f8 100644 --- a/game/common/str_rpc_types.h +++ b/game/common/str_rpc_types.h @@ -1,6 +1,7 @@ #pragma once #include "common/common_types.h" + #include "game/common/overlord_common.h" constexpr int STR_RPC_ID = 0xdeb5; diff --git a/game/common/vu.h b/game/common/vu.h index 497056f9c8..ffecbdda5b 100644 --- a/game/common/vu.h +++ b/game/common/vu.h @@ -1,8 +1,12 @@ #pragma once -#include "immintrin.h" -#include "common/math/Vector.h" #include +#include "immintrin.h" + +#include "common/common_types.h" +#include "common/math/Vector.h" +#include "common/util/Assert.h" + enum class Mask { NONE = 0, x = 1, diff --git a/game/discord.cpp b/game/discord.cpp index b7f79606c3..0c6ff7d3b1 100644 --- a/game/discord.cpp +++ b/game/discord.cpp @@ -1,11 +1,11 @@ -#include -#include -#include -#include -#include - #include "discord.h" +#include +#include +#include +#include +#include + int gDiscordRpcEnabled; int64_t gStartTime; static const char* APPLICATION_ID = "938876425585434654"; diff --git a/game/discord.h b/game/discord.h index ea879c807a..4a5498a927 100644 --- a/game/discord.h +++ b/game/discord.h @@ -1,5 +1,7 @@ #pragma once +#include + #include "third-party/discord-rpc/include/discord_rpc.h" void init_discord_rpc(); diff --git a/game/graphics/display.cpp b/game/graphics/display.cpp index 7ad73e2e83..d492025084 100644 --- a/game/graphics/display.cpp +++ b/game/graphics/display.cpp @@ -4,6 +4,7 @@ */ #include "display.h" + #include "gfx.h" #include "common/log/log.h" diff --git a/game/graphics/display.h b/game/graphics/display.h index 76a36aa538..e783105b19 100644 --- a/game/graphics/display.h +++ b/game/graphics/display.h @@ -5,11 +5,13 @@ * Display for graphics. This is the game window, distinct from the runtime console. */ -#include #include -#include "common/util/Assert.h" +#include + #include "gfx.h" +#include "common/util/Assert.h" + // a GfxDisplay class is equivalent to a window that displays stuff. This holds an actual internal // window pointer used by whichever renderer. It also contains functions for setting and // retrieving certain window parameters. diff --git a/game/graphics/gfx.cpp b/game/graphics/gfx.cpp index ceb3018883..36cf9a0ef2 100644 --- a/game/graphics/gfx.cpp +++ b/game/graphics/gfx.cpp @@ -3,21 +3,23 @@ * Graphics component for the runtime. Abstraction layer for the main graphics routines. */ -#include -#include -#include - #include "gfx.h" -#include "display.h" -#include "pipelines/opengl.h" -#include "common/symbols.h" +#include +#include +#include + +#include "display.h" + #include "common/log/log.h" +#include "common/symbols.h" #include "common/util/FileUtil.h" + #include "game/common/file_paths.h" #include "game/kernel/kscheme.h" #include "game/runtime.h" #include "game/system/newpad.h" +#include "pipelines/opengl.h" namespace { // initializes a gfx settings. diff --git a/game/graphics/gfx.h b/game/graphics/gfx.h index 92380474b5..e39bb2c59e 100644 --- a/game/graphics/gfx.h +++ b/game/graphics/gfx.h @@ -5,11 +5,12 @@ * Graphics component for the runtime. Abstraction layer for the main graphics routines. */ +#include #include #include -#include #include "common/common_types.h" + #include "game/kernel/kboot.h" #include "game/system/newpad.h" diff --git a/game/graphics/opengl_renderer/BucketRenderer.cpp b/game/graphics/opengl_renderer/BucketRenderer.cpp index 68a55819f3..f16d3e3ce2 100644 --- a/game/graphics/opengl_renderer/BucketRenderer.cpp +++ b/game/graphics/opengl_renderer/BucketRenderer.cpp @@ -1,7 +1,7 @@ #include "BucketRenderer.h" -#include "third-party/imgui/imgui.h" #include "third-party/fmt/core.h" +#include "third-party/imgui/imgui.h" std::string BucketRenderer::name_and_id() const { return fmt::format("[{:2d}] {}", (int)m_my_id, m_name); diff --git a/game/graphics/opengl_renderer/BucketRenderer.h b/game/graphics/opengl_renderer/BucketRenderer.h index c2b5b234ab..8b43835072 100644 --- a/game/graphics/opengl_renderer/BucketRenderer.h +++ b/game/graphics/opengl_renderer/BucketRenderer.h @@ -1,13 +1,15 @@ #pragma once -#include #include +#include + #include "common/dma/dma_chain_read.h" -#include "game/graphics/opengl_renderer/Shader.h" -#include "game/graphics/texture/TexturePool.h" + #include "game/graphics/opengl_renderer/Profiler.h" -#include "game/graphics/opengl_renderer/loader/Loader.h" +#include "game/graphics/opengl_renderer/Shader.h" #include "game/graphics/opengl_renderer/buckets.h" +#include "game/graphics/opengl_renderer/loader/Loader.h" +#include "game/graphics/texture/TexturePool.h" struct LevelVis { bool valid = false; diff --git a/game/graphics/opengl_renderer/DirectRenderer.cpp b/game/graphics/opengl_renderer/DirectRenderer.cpp index 755263238a..8777e84f67 100644 --- a/game/graphics/opengl_renderer/DirectRenderer.cpp +++ b/game/graphics/opengl_renderer/DirectRenderer.cpp @@ -1,11 +1,14 @@ #include "DirectRenderer.h" + #include "common/dma/gs.h" #include "common/log/log.h" -#include "third-party/fmt/core.h" -#include "game/graphics/pipelines/opengl.h" -#include "third-party/imgui/imgui.h" #include "common/util/Assert.h" +#include "game/graphics/pipelines/opengl.h" + +#include "third-party/fmt/core.h" +#include "third-party/imgui/imgui.h" + DirectRenderer::DirectRenderer(const std::string& name, BucketId my_id, int batch_size) : BucketRenderer(name, my_id), m_prim_buffer(batch_size) { glGenBuffers(1, &m_ogl.vertex_buffer); diff --git a/game/graphics/opengl_renderer/DirectRenderer.h b/game/graphics/opengl_renderer/DirectRenderer.h index a88d5e7035..9217879bf2 100644 --- a/game/graphics/opengl_renderer/DirectRenderer.h +++ b/game/graphics/opengl_renderer/DirectRenderer.h @@ -1,12 +1,14 @@ #pragma once #include -#include "game/graphics/opengl_renderer/BucketRenderer.h" + #include "common/dma/gs.h" +#include "common/log/log.h" #include "common/math/Vector.h" #include "common/util/SmallVector.h" + +#include "game/graphics/opengl_renderer/BucketRenderer.h" #include "game/graphics/pipelines/opengl.h" -#include "common/log/log.h" /*! * The direct renderer will handle rendering GIFtags directly. diff --git a/game/graphics/opengl_renderer/DirectRenderer2.cpp b/game/graphics/opengl_renderer/DirectRenderer2.cpp index 3784d92b5d..30383256fb 100644 --- a/game/graphics/opengl_renderer/DirectRenderer2.cpp +++ b/game/graphics/opengl_renderer/DirectRenderer2.cpp @@ -1,8 +1,11 @@ #include "DirectRenderer2.h" -#include "third-party/imgui/imgui.h" -#include "common/log/log.h" + #include +#include "common/log/log.h" + +#include "third-party/imgui/imgui.h" + DirectRenderer2::DirectRenderer2(u32 max_verts, u32 max_inds, u32 max_draws, diff --git a/game/graphics/opengl_renderer/DirectRenderer2.h b/game/graphics/opengl_renderer/DirectRenderer2.h index c99b46905a..57ca0d6af6 100644 --- a/game/graphics/opengl_renderer/DirectRenderer2.h +++ b/game/graphics/opengl_renderer/DirectRenderer2.h @@ -1,10 +1,12 @@ #pragma once #include + #include "common/common_types.h" -#include "game/graphics/opengl_renderer/BucketRenderer.h" #include "common/dma/gs.h" +#include "game/graphics/opengl_renderer/BucketRenderer.h" + class DirectRenderer2 { public: DirectRenderer2(u32 max_verts, diff --git a/game/graphics/opengl_renderer/EyeRenderer.cpp b/game/graphics/opengl_renderer/EyeRenderer.cpp index b5385bc210..64cc80b242 100644 --- a/game/graphics/opengl_renderer/EyeRenderer.cpp +++ b/game/graphics/opengl_renderer/EyeRenderer.cpp @@ -1,7 +1,9 @@ #include "EyeRenderer.h" -#include "game/graphics/opengl_renderer/AdgifHandler.h" #include "common/util/FileUtil.h" + +#include "game/graphics/opengl_renderer/AdgifHandler.h" + #include "third-party/imgui/imgui.h" ///////////////////////// diff --git a/game/graphics/opengl_renderer/EyeRenderer.h b/game/graphics/opengl_renderer/EyeRenderer.h index 21d6a4d990..a85b6e6154 100644 --- a/game/graphics/opengl_renderer/EyeRenderer.h +++ b/game/graphics/opengl_renderer/EyeRenderer.h @@ -1,9 +1,10 @@ #pragma once #include + #include "game/graphics/opengl_renderer/BucketRenderer.h" -#include "game/graphics/pipelines/opengl.h" #include "game/graphics/opengl_renderer/opengl_utils.h" +#include "game/graphics/pipelines/opengl.h" constexpr int EYE_BASE_BLOCK = 8160; constexpr int NUM_EYE_PAIRS = 11; diff --git a/game/graphics/opengl_renderer/OpenGLRenderer.cpp b/game/graphics/opengl_renderer/OpenGLRenderer.cpp index daf707ee02..2c6c26a7e0 100644 --- a/game/graphics/opengl_renderer/OpenGLRenderer.cpp +++ b/game/graphics/opengl_renderer/OpenGLRenderer.cpp @@ -1,23 +1,25 @@ #include "OpenGLRenderer.h" #include "common/log/log.h" -#include "game/graphics/pipelines/opengl.h" -#include "game/graphics/opengl_renderer/DirectRenderer.h" -#include "game/graphics/opengl_renderer/SpriteRenderer.h" -#include "game/graphics/opengl_renderer/TextureUploadHandler.h" -#include "third-party/imgui/imgui.h" #include "common/util/FileUtil.h" -#include "game/graphics/opengl_renderer/SkyRenderer.h" -#include "game/graphics/opengl_renderer/Sprite3.h" -#include "game/graphics/opengl_renderer/background/TFragment.h" -#include "game/graphics/opengl_renderer/background/Tie3.h" -#include "game/graphics/opengl_renderer/background/Shrub.h" + +#include "game/graphics/opengl_renderer/DirectRenderer.h" #include "game/graphics/opengl_renderer/EyeRenderer.h" #include "game/graphics/opengl_renderer/ShadowRenderer.h" +#include "game/graphics/opengl_renderer/SkyRenderer.h" +#include "game/graphics/opengl_renderer/Sprite3.h" +#include "game/graphics/opengl_renderer/SpriteRenderer.h" +#include "game/graphics/opengl_renderer/TextureUploadHandler.h" +#include "game/graphics/opengl_renderer/background/Shrub.h" +#include "game/graphics/opengl_renderer/background/TFragment.h" +#include "game/graphics/opengl_renderer/background/Tie3.h" #include "game/graphics/opengl_renderer/foreground/Generic2.h" #include "game/graphics/opengl_renderer/foreground/Merc2.h" #include "game/graphics/opengl_renderer/ocean/OceanMidAndFar.h" #include "game/graphics/opengl_renderer/ocean/OceanNear.h" +#include "game/graphics/pipelines/opengl.h" + +#include "third-party/imgui/imgui.h" // for the vif callback #include "game/kernel/kmachine.h" diff --git a/game/graphics/opengl_renderer/OpenGLRenderer.h b/game/graphics/opengl_renderer/OpenGLRenderer.h index 124cd1a55e..3e9794409b 100644 --- a/game/graphics/opengl_renderer/OpenGLRenderer.h +++ b/game/graphics/opengl_renderer/OpenGLRenderer.h @@ -4,11 +4,12 @@ #include #include "common/dma/dma_chain_read.h" -#include "game/graphics/opengl_renderer/Shader.h" + #include "game/graphics/opengl_renderer/BucketRenderer.h" -#include "game/graphics/opengl_renderer/Profiler.h" -#include "game/graphics/opengl_renderer/opengl_utils.h" #include "game/graphics/opengl_renderer/CollideMeshRenderer.h" +#include "game/graphics/opengl_renderer/Profiler.h" +#include "game/graphics/opengl_renderer/Shader.h" +#include "game/graphics/opengl_renderer/opengl_utils.h" #include "game/tools/subtitles/subtitle_editor.h" struct RenderOptions { diff --git a/game/graphics/opengl_renderer/Profiler.cpp b/game/graphics/opengl_renderer/Profiler.cpp index 269478fe19..430f6dbc44 100644 --- a/game/graphics/opengl_renderer/Profiler.cpp +++ b/game/graphics/opengl_renderer/Profiler.cpp @@ -1,11 +1,12 @@ -#include - #include "Profiler.h" +#include + #include "common/log/log.h" #include "common/util/colors.h" -#include "third-party/imgui/imgui.h" + #include "third-party/fmt/core.h" +#include "third-party/imgui/imgui.h" ProfilerNode::ProfilerNode(const std::string& name) : m_name(name) {} diff --git a/game/graphics/opengl_renderer/Profiler.h b/game/graphics/opengl_renderer/Profiler.h index 0a9adff14a..ad701c96f1 100644 --- a/game/graphics/opengl_renderer/Profiler.h +++ b/game/graphics/opengl_renderer/Profiler.h @@ -1,12 +1,12 @@ #pragma once +#include #include #include -#include #include "common/common_types.h" -#include "common/util/Timer.h" #include "common/global_profiler/GlobalProfiler.h" +#include "common/util/Timer.h" #include "game/graphics/opengl_renderer/buckets.h" diff --git a/game/graphics/opengl_renderer/Shader.cpp b/game/graphics/opengl_renderer/Shader.cpp index 2c2fda7002..05b072e593 100644 --- a/game/graphics/opengl_renderer/Shader.cpp +++ b/game/graphics/opengl_renderer/Shader.cpp @@ -1,8 +1,10 @@ #include "Shader.h" -#include "common/util/FileUtil.h" + #include "common/log/log.h" -#include "game/graphics/pipelines/opengl.h" #include "common/util/Assert.h" +#include "common/util/FileUtil.h" + +#include "game/graphics/pipelines/opengl.h" Shader::Shader(const std::string& shader_name) { // read the shader source diff --git a/game/graphics/opengl_renderer/ShadowRenderer.cpp b/game/graphics/opengl_renderer/ShadowRenderer.cpp index 163dedef90..4409e9ea05 100644 --- a/game/graphics/opengl_renderer/ShadowRenderer.cpp +++ b/game/graphics/opengl_renderer/ShadowRenderer.cpp @@ -1,8 +1,9 @@ #include "ShadowRenderer.h" -#include "third-party/imgui/imgui.h" #include +#include "third-party/imgui/imgui.h" + ShadowRenderer::ShadowRenderer(const std::string& name, BucketId my_id) : BucketRenderer(name, my_id) { // create OpenGL objects diff --git a/game/graphics/opengl_renderer/ShadowRenderer.h b/game/graphics/opengl_renderer/ShadowRenderer.h index 16f7e4647a..e7eaca1367 100644 --- a/game/graphics/opengl_renderer/ShadowRenderer.h +++ b/game/graphics/opengl_renderer/ShadowRenderer.h @@ -1,8 +1,7 @@ #pragma once -#include "game/graphics/opengl_renderer/BucketRenderer.h" - #include "game/common/vu.h" +#include "game/graphics/opengl_renderer/BucketRenderer.h" class ShadowRenderer : public BucketRenderer { public: diff --git a/game/graphics/opengl_renderer/SkyBlendCPU.cpp b/game/graphics/opengl_renderer/SkyBlendCPU.cpp index 882e539516..0fc81fa979 100644 --- a/game/graphics/opengl_renderer/SkyBlendCPU.cpp +++ b/game/graphics/opengl_renderer/SkyBlendCPU.cpp @@ -1,9 +1,11 @@ #include "SkyBlendCPU.h" -#include "game/graphics/opengl_renderer/AdgifHandler.h" -#include "common/util/os.h" #include +#include "common/util/os.h" + +#include "game/graphics/opengl_renderer/AdgifHandler.h" + SkyBlendCPU::SkyBlendCPU() { for (int i = 0; i < 2; i++) { glGenTextures(1, &m_textures[i].gl); diff --git a/game/graphics/opengl_renderer/SkyBlendCPU.h b/game/graphics/opengl_renderer/SkyBlendCPU.h index 77de41d1b6..116755c4f0 100644 --- a/game/graphics/opengl_renderer/SkyBlendCPU.h +++ b/game/graphics/opengl_renderer/SkyBlendCPU.h @@ -1,9 +1,10 @@ #pragma once #include "common/dma/dma_chain_read.h" + #include "game/graphics/opengl_renderer/BucketRenderer.h" -#include "game/graphics/pipelines/opengl.h" #include "game/graphics/opengl_renderer/SkyBlendCommon.h" +#include "game/graphics/pipelines/opengl.h" class SkyBlendCPU { public: diff --git a/game/graphics/opengl_renderer/SkyBlendGPU.cpp b/game/graphics/opengl_renderer/SkyBlendGPU.cpp index 655822429f..5c0715fdbb 100644 --- a/game/graphics/opengl_renderer/SkyBlendGPU.cpp +++ b/game/graphics/opengl_renderer/SkyBlendGPU.cpp @@ -1,6 +1,7 @@ #include "SkyBlendGPU.h" #include "common/log/log.h" + #include "game/graphics/opengl_renderer/AdgifHandler.h" SkyBlendGPU::SkyBlendGPU() { diff --git a/game/graphics/opengl_renderer/SkyBlendGPU.h b/game/graphics/opengl_renderer/SkyBlendGPU.h index 0b43e33f4e..ddce74a7ac 100644 --- a/game/graphics/opengl_renderer/SkyBlendGPU.h +++ b/game/graphics/opengl_renderer/SkyBlendGPU.h @@ -1,8 +1,9 @@ #include "common/dma/dma_chain_read.h" + #include "game/graphics/opengl_renderer/BucketRenderer.h" -#include "game/graphics/pipelines/opengl.h" #include "game/graphics/opengl_renderer/SkyBlendCommon.h" +#include "game/graphics/pipelines/opengl.h" class SkyBlendGPU { public: diff --git a/game/graphics/opengl_renderer/SkyRenderer.cpp b/game/graphics/opengl_renderer/SkyRenderer.cpp index b58f2521a0..3d3a86172f 100644 --- a/game/graphics/opengl_renderer/SkyRenderer.cpp +++ b/game/graphics/opengl_renderer/SkyRenderer.cpp @@ -1,9 +1,12 @@ #include "SkyRenderer.h" -#include "third-party/imgui/imgui.h" -#include "game/graphics/pipelines/opengl.h" -#include "game/graphics/opengl_renderer/AdgifHandler.h" + #include "common/log/log.h" +#include "game/graphics/opengl_renderer/AdgifHandler.h" +#include "game/graphics/pipelines/opengl.h" + +#include "third-party/imgui/imgui.h" + // The sky texture system blends together sky textures from different levels and times of day // to create the final sky texture. diff --git a/game/graphics/opengl_renderer/SkyRenderer.h b/game/graphics/opengl_renderer/SkyRenderer.h index 019518413f..d677f6ccc1 100644 --- a/game/graphics/opengl_renderer/SkyRenderer.h +++ b/game/graphics/opengl_renderer/SkyRenderer.h @@ -1,10 +1,10 @@ #pragma once +#include "game/graphics//opengl_renderer/SkyBlendCPU.h" +#include "game/graphics//opengl_renderer/SkyBlendGPU.h" #include "game/graphics/opengl_renderer/BucketRenderer.h" #include "game/graphics/opengl_renderer/DirectRenderer.h" #include "game/graphics/opengl_renderer/background/TFragment.h" -#include "game/graphics//opengl_renderer/SkyBlendGPU.h" -#include "game/graphics//opengl_renderer/SkyBlendCPU.h" /*! * Handles texture blending for the sky. diff --git a/game/graphics/opengl_renderer/Sprite3.cpp b/game/graphics/opengl_renderer/Sprite3.cpp index ed51f7a098..f59a125d05 100644 --- a/game/graphics/opengl_renderer/Sprite3.cpp +++ b/game/graphics/opengl_renderer/Sprite3.cpp @@ -2,10 +2,11 @@ #include "Sprite3.h" +#include "game/graphics/opengl_renderer/background/background_common.h" +#include "game/graphics/opengl_renderer/dma_helpers.h" + #include "third-party/fmt/core.h" #include "third-party/imgui/imgui.h" -#include "game/graphics/opengl_renderer/dma_helpers.h" -#include "game/graphics/opengl_renderer/background/background_common.h" namespace { diff --git a/game/graphics/opengl_renderer/Sprite3.h b/game/graphics/opengl_renderer/Sprite3.h index 3ebc43d519..4b20be892f 100644 --- a/game/graphics/opengl_renderer/Sprite3.h +++ b/game/graphics/opengl_renderer/Sprite3.h @@ -1,14 +1,15 @@ #pragma once -#include "game/graphics/opengl_renderer/BucketRenderer.h" -#include "game/graphics/opengl_renderer/DirectRenderer.h" +#include + #include "common/dma/gs.h" #include "common/math/Vector.h" -#include "game/graphics/opengl_renderer/sprite_common.h" -#include "game/graphics/opengl_renderer/background/background_common.h" -#include +#include "game/graphics/opengl_renderer/BucketRenderer.h" +#include "game/graphics/opengl_renderer/DirectRenderer.h" +#include "game/graphics/opengl_renderer/background/background_common.h" +#include "game/graphics/opengl_renderer/sprite_common.h" class Sprite3 : public BucketRenderer { public: diff --git a/game/graphics/opengl_renderer/SpriteRenderer.cpp b/game/graphics/opengl_renderer/SpriteRenderer.cpp index 0bbe697a6b..dcd84df9de 100644 --- a/game/graphics/opengl_renderer/SpriteRenderer.cpp +++ b/game/graphics/opengl_renderer/SpriteRenderer.cpp @@ -1,8 +1,10 @@ +#include "SpriteRenderer.h" + +#include "game/graphics/opengl_renderer/background/background_common.h" +#include "game/graphics/opengl_renderer/dma_helpers.h" + #include "third-party/fmt/core.h" #include "third-party/imgui/imgui.h" -#include "SpriteRenderer.h" -#include "game/graphics/opengl_renderer/dma_helpers.h" -#include "game/graphics/opengl_renderer/background/background_common.h" namespace { diff --git a/game/graphics/opengl_renderer/SpriteRenderer.h b/game/graphics/opengl_renderer/SpriteRenderer.h index e3e0371dfc..fd721be0af 100644 --- a/game/graphics/opengl_renderer/SpriteRenderer.h +++ b/game/graphics/opengl_renderer/SpriteRenderer.h @@ -1,9 +1,10 @@ #pragma once +#include "common/dma/gs.h" +#include "common/math/Vector.h" + #include "game/graphics/opengl_renderer/BucketRenderer.h" #include "game/graphics/opengl_renderer/DirectRenderer.h" -#include "common/dma/gs.h" -#include "common/math/Vector.h" #include "game/graphics/opengl_renderer/sprite_common.h" class SpriteRenderer : public BucketRenderer { diff --git a/game/graphics/opengl_renderer/TextureUploadHandler.cpp b/game/graphics/opengl_renderer/TextureUploadHandler.cpp index ed9f51cb67..fa12a70a47 100644 --- a/game/graphics/opengl_renderer/TextureUploadHandler.cpp +++ b/game/graphics/opengl_renderer/TextureUploadHandler.cpp @@ -1,10 +1,11 @@ +#include "TextureUploadHandler.h" + +#include "game/graphics/opengl_renderer/EyeRenderer.h" +#include "game/graphics/pipelines/opengl.h" + #include "third-party/fmt/core.h" #include "third-party/imgui/imgui.h" -#include "TextureUploadHandler.h" -#include "game/graphics/pipelines/opengl.h" -#include "game/graphics/opengl_renderer/EyeRenderer.h" - TextureUploadHandler::TextureUploadHandler(const std::string& name, BucketId my_id) : BucketRenderer(name, my_id) {} diff --git a/game/graphics/opengl_renderer/background/Shrub.h b/game/graphics/opengl_renderer/background/Shrub.h index 438d9442f9..ed7ef39634 100644 --- a/game/graphics/opengl_renderer/background/Shrub.h +++ b/game/graphics/opengl_renderer/background/Shrub.h @@ -2,12 +2,13 @@ #include -#include "game/graphics/gfx.h" -#include "game/graphics/opengl_renderer/background/background_common.h" -#include "game/graphics/opengl_renderer/BucketRenderer.h" -#include "game/graphics/pipelines/opengl.h" #include "common/util/FilteredValue.h" +#include "game/graphics/gfx.h" +#include "game/graphics/opengl_renderer/BucketRenderer.h" +#include "game/graphics/opengl_renderer/background/background_common.h" +#include "game/graphics/pipelines/opengl.h" + class Shrub : public BucketRenderer { public: Shrub(const std::string& name, BucketId my_id); diff --git a/game/graphics/opengl_renderer/background/TFragment.cpp b/game/graphics/opengl_renderer/background/TFragment.cpp index 6bb39bdac0..43ab439b05 100644 --- a/game/graphics/opengl_renderer/background/TFragment.cpp +++ b/game/graphics/opengl_renderer/background/TFragment.cpp @@ -1,8 +1,9 @@ #include "TFragment.h" -#include "third-party/imgui/imgui.h" #include "game/graphics/opengl_renderer/dma_helpers.h" +#include "third-party/imgui/imgui.h" + namespace { bool looks_like_tfragment_dma(const DmaFollower& follow) { return follow.current_tag_vifcode0().kind == VifCode::Kind::STCYCL; diff --git a/game/graphics/opengl_renderer/background/TFragment.h b/game/graphics/opengl_renderer/background/TFragment.h index 7b92cc784a..cef6da68dc 100644 --- a/game/graphics/opengl_renderer/background/TFragment.h +++ b/game/graphics/opengl_renderer/background/TFragment.h @@ -1,11 +1,12 @@ #pragma once +#include "common/dma/gs.h" +#include "common/math/Vector.h" + #include "game/graphics/opengl_renderer/BucketRenderer.h" #include "game/graphics/opengl_renderer/DirectRenderer.h" #include "game/graphics/opengl_renderer/background/Tfrag3.h" #include "game/graphics/opengl_renderer/background/Tie3.h" -#include "common/dma/gs.h" -#include "common/math/Vector.h" using math::Matrix4f; using math::Vector4f; diff --git a/game/graphics/opengl_renderer/background/Tfrag3.h b/game/graphics/opengl_renderer/background/Tfrag3.h index 295263ee1f..9e67ba6c58 100644 --- a/game/graphics/opengl_renderer/background/Tfrag3.h +++ b/game/graphics/opengl_renderer/background/Tfrag3.h @@ -2,10 +2,11 @@ #include "common/custom_data/Tfrag3Data.h" #include "common/math/Vector.h" + #include "game/graphics/gfx.h" #include "game/graphics/opengl_renderer/BucketRenderer.h" -#include "game/graphics/pipelines/opengl.h" #include "game/graphics/opengl_renderer/background/background_common.h" +#include "game/graphics/pipelines/opengl.h" class Tfrag3 { public: diff --git a/game/graphics/opengl_renderer/background/Tie3.h b/game/graphics/opengl_renderer/background/Tie3.h index 5449a5e6ac..ed819c369a 100644 --- a/game/graphics/opengl_renderer/background/Tie3.h +++ b/game/graphics/opengl_renderer/background/Tie3.h @@ -2,12 +2,13 @@ #include -#include "game/graphics/gfx.h" -#include "game/graphics/opengl_renderer/background/background_common.h" -#include "game/graphics/opengl_renderer/BucketRenderer.h" -#include "game/graphics/pipelines/opengl.h" #include "common/util/FilteredValue.h" +#include "game/graphics/gfx.h" +#include "game/graphics/opengl_renderer/BucketRenderer.h" +#include "game/graphics/opengl_renderer/background/background_common.h" +#include "game/graphics/pipelines/opengl.h" + class Tie3 : public BucketRenderer { public: Tie3(const std::string& name, BucketId my_id, int level_id); diff --git a/game/graphics/opengl_renderer/background/background_common.cpp b/game/graphics/opengl_renderer/background/background_common.cpp index 6b17314fe9..7e5443a3a3 100644 --- a/game/graphics/opengl_renderer/background/background_common.cpp +++ b/game/graphics/opengl_renderer/background/background_common.cpp @@ -1,12 +1,14 @@ #include "background_common.h" -#include "game/graphics/opengl_renderer/BucketRenderer.h" -#include "game/graphics/pipelines/opengl.h" -#include "common/util/os.h" #include +#include "common/util/os.h" + +#include "game/graphics/opengl_renderer/BucketRenderer.h" +#include "game/graphics/pipelines/opengl.h" + DoubleDraw setup_opengl_from_draw_mode(DrawMode mode, u32 tex_unit, bool mipmap) { glActiveTexture(tex_unit); diff --git a/game/graphics/opengl_renderer/background/background_common.h b/game/graphics/opengl_renderer/background/background_common.h index d48a37a13c..1218b96cfe 100644 --- a/game/graphics/opengl_renderer/background/background_common.h +++ b/game/graphics/opengl_renderer/background/background_common.h @@ -1,6 +1,7 @@ #pragma once #include "common/math/Vector.h" + #include "game/graphics/opengl_renderer/BucketRenderer.h" // data passed from game to PC renderers diff --git a/game/graphics/opengl_renderer/debug_gui.cpp b/game/graphics/opengl_renderer/debug_gui.cpp index 516aa667bf..76ad6140f4 100644 --- a/game/graphics/opengl_renderer/debug_gui.cpp +++ b/game/graphics/opengl_renderer/debug_gui.cpp @@ -1,6 +1,8 @@ #include "debug_gui.h" + #include + #include "third-party/imgui/imgui.h" void FrameTimeRecorder::finish_frame() { diff --git a/game/graphics/opengl_renderer/debug_gui.h b/game/graphics/opengl_renderer/debug_gui.h index a21b574133..0dfd366a0b 100644 --- a/game/graphics/opengl_renderer/debug_gui.h +++ b/game/graphics/opengl_renderer/debug_gui.h @@ -5,8 +5,8 @@ * The debug menu-bar and frame timing window */ -#include "common/util/Timer.h" #include "common/dma/dma.h" +#include "common/util/Timer.h" class FrameTimeRecorder { public: diff --git a/game/graphics/opengl_renderer/foreground/Generic2.cpp b/game/graphics/opengl_renderer/foreground/Generic2.cpp index cd79f162ff..1f1183c481 100644 --- a/game/graphics/opengl_renderer/foreground/Generic2.cpp +++ b/game/graphics/opengl_renderer/foreground/Generic2.cpp @@ -1,6 +1,7 @@ #include "Generic2.h" #include "game/graphics/opengl_renderer/AdgifHandler.h" + #include "third-party/imgui/imgui.h" Generic2::Generic2(const std::string& name, diff --git a/game/graphics/opengl_renderer/foreground/Merc2.cpp b/game/graphics/opengl_renderer/foreground/Merc2.cpp index 82f09eb0de..0e70c6b933 100644 --- a/game/graphics/opengl_renderer/foreground/Merc2.cpp +++ b/game/graphics/opengl_renderer/foreground/Merc2.cpp @@ -1,7 +1,9 @@ #include "Merc2.h" -#include "third-party/imgui/imgui.h" + #include "game/graphics/opengl_renderer/background/background_common.h" +#include "third-party/imgui/imgui.h" + Merc2::Merc2(const std::string& name, BucketId my_id) : BucketRenderer(name, my_id) { glGenVertexArrays(1, &m_vao); glBindVertexArray(m_vao); diff --git a/game/graphics/opengl_renderer/loader/Loader.cpp b/game/graphics/opengl_renderer/loader/Loader.cpp index eb344ba977..5121dee7ea 100644 --- a/game/graphics/opengl_renderer/loader/Loader.cpp +++ b/game/graphics/opengl_renderer/loader/Loader.cpp @@ -1,7 +1,9 @@ #include "Loader.h" -#include "common/util/Timer.h" + #include "common/util/FileUtil.h" +#include "common/util/Timer.h" #include "common/util/compress.h" + #include "game/graphics/opengl_renderer/loader/LoaderStages.h" namespace { diff --git a/game/graphics/opengl_renderer/loader/Loader.h b/game/graphics/opengl_renderer/loader/Loader.h index 1db3d404d3..dccdb683ee 100644 --- a/game/graphics/opengl_renderer/loader/Loader.h +++ b/game/graphics/opengl_renderer/loader/Loader.h @@ -1,14 +1,15 @@ #pragma once -#include -#include #include +#include +#include -#include "game/graphics/pipelines/opengl.h" -#include "game/graphics/texture/TexturePool.h" #include "common/custom_data/Tfrag3Data.h" #include "common/util/Timer.h" + #include "game/graphics/opengl_renderer/loader/common.h" +#include "game/graphics/pipelines/opengl.h" +#include "game/graphics/texture/TexturePool.h" class Loader { public: diff --git a/game/graphics/opengl_renderer/loader/LoaderStages.cpp b/game/graphics/opengl_renderer/loader/LoaderStages.cpp index 618ae46611..7208b06bb4 100644 --- a/game/graphics/opengl_renderer/loader/LoaderStages.cpp +++ b/game/graphics/opengl_renderer/loader/LoaderStages.cpp @@ -1,6 +1,7 @@ -#include "Loader.h" #include "LoaderStages.h" +#include "Loader.h" + constexpr float LOAD_BUDGET = 2.5f; /*! diff --git a/game/graphics/opengl_renderer/loader/common.h b/game/graphics/opengl_renderer/loader/common.h index f64d848452..4c60809fa0 100644 --- a/game/graphics/opengl_renderer/loader/common.h +++ b/game/graphics/opengl_renderer/loader/common.h @@ -1,5 +1,13 @@ #pragma once +#include "common/common_types.h" +#include "common/custom_data/Tfrag3Data.h" +#include "common/util/Timer.h" + +#include "game/graphics/texture/TexturePool.h" + +#include "third-party/glad/include/glad/glad.h" + struct LevelData { std::unique_ptr level; std::vector textures; @@ -47,4 +55,4 @@ class LoaderStage { protected: std::string m_name; -}; \ No newline at end of file +}; diff --git a/game/graphics/opengl_renderer/ocean/OceanMid.h b/game/graphics/opengl_renderer/ocean/OceanMid.h index 8f9fac96d3..cae1932d28 100644 --- a/game/graphics/opengl_renderer/ocean/OceanMid.h +++ b/game/graphics/opengl_renderer/ocean/OceanMid.h @@ -1,8 +1,8 @@ #pragma once +#include "game/common/vu.h" #include "game/graphics/opengl_renderer/BucketRenderer.h" #include "game/graphics/opengl_renderer/DirectRenderer.h" -#include "game/common/vu.h" #include "game/graphics/opengl_renderer/ocean/CommonOceanRenderer.h" class OceanMid { diff --git a/game/graphics/opengl_renderer/ocean/OceanMidAndFar.cpp b/game/graphics/opengl_renderer/ocean/OceanMidAndFar.cpp index 4df6660a3f..d3fe99a7a2 100644 --- a/game/graphics/opengl_renderer/ocean/OceanMidAndFar.cpp +++ b/game/graphics/opengl_renderer/ocean/OceanMidAndFar.cpp @@ -1,4 +1,5 @@ #include "OceanMidAndFar.h" + #include "third-party/imgui/imgui.h" OceanMidAndFar::OceanMidAndFar(const std::string& name, BucketId my_id) diff --git a/game/graphics/opengl_renderer/ocean/OceanMidAndFar.h b/game/graphics/opengl_renderer/ocean/OceanMidAndFar.h index 81df49b644..91fedcfb20 100644 --- a/game/graphics/opengl_renderer/ocean/OceanMidAndFar.h +++ b/game/graphics/opengl_renderer/ocean/OceanMidAndFar.h @@ -2,9 +2,9 @@ #include "game/graphics/opengl_renderer/BucketRenderer.h" #include "game/graphics/opengl_renderer/DirectRenderer.h" -#include "game/graphics/opengl_renderer/opengl_utils.h" -#include "game/graphics/opengl_renderer/ocean/OceanTexture.h" #include "game/graphics/opengl_renderer/ocean/OceanMid.h" +#include "game/graphics/opengl_renderer/ocean/OceanTexture.h" +#include "game/graphics/opengl_renderer/opengl_utils.h" /*! * OceanMidAndFar is the handler for the first ocean bucket. diff --git a/game/graphics/opengl_renderer/ocean/OceanNear.cpp b/game/graphics/opengl_renderer/ocean/OceanNear.cpp index d6a0e76a09..66997cb5a5 100644 --- a/game/graphics/opengl_renderer/ocean/OceanNear.cpp +++ b/game/graphics/opengl_renderer/ocean/OceanNear.cpp @@ -1,4 +1,5 @@ #include "OceanNear.h" + #include "third-party/imgui/imgui.h" OceanNear::OceanNear(const std::string& name, BucketId my_id) diff --git a/game/graphics/opengl_renderer/ocean/OceanNear.h b/game/graphics/opengl_renderer/ocean/OceanNear.h index 81f9516a72..9aeca8975d 100644 --- a/game/graphics/opengl_renderer/ocean/OceanNear.h +++ b/game/graphics/opengl_renderer/ocean/OceanNear.h @@ -1,9 +1,9 @@ #pragma once -#include "game/graphics/opengl_renderer/BucketRenderer.h" -#include "game/graphics/opengl_renderer/ocean/OceanTexture.h" #include "game/common/vu.h" +#include "game/graphics/opengl_renderer/BucketRenderer.h" #include "game/graphics/opengl_renderer/ocean/CommonOceanRenderer.h" +#include "game/graphics/opengl_renderer/ocean/OceanTexture.h" class OceanNear : public BucketRenderer { public: diff --git a/game/graphics/opengl_renderer/ocean/OceanTexture.cpp b/game/graphics/opengl_renderer/ocean/OceanTexture.cpp index 849e2799d4..2c5f037cf1 100644 --- a/game/graphics/opengl_renderer/ocean/OceanTexture.cpp +++ b/game/graphics/opengl_renderer/ocean/OceanTexture.cpp @@ -1,5 +1,7 @@ #include "OceanTexture.h" + #include "game/graphics/opengl_renderer/AdgifHandler.h" + #include "third-party/imgui/imgui.h" constexpr int OCEAN_TEX_TBP = 8160; // todo diff --git a/game/graphics/opengl_renderer/ocean/OceanTexture.h b/game/graphics/opengl_renderer/ocean/OceanTexture.h index b4fb7c2ba5..cfa4e13125 100644 --- a/game/graphics/opengl_renderer/ocean/OceanTexture.h +++ b/game/graphics/opengl_renderer/ocean/OceanTexture.h @@ -1,9 +1,9 @@ #pragma once +#include "game/common/vu.h" #include "game/graphics/opengl_renderer/BucketRenderer.h" #include "game/graphics/opengl_renderer/DirectRenderer.h" #include "game/graphics/opengl_renderer/opengl_utils.h" -#include "game/common/vu.h" class OceanTexture { public: diff --git a/game/graphics/opengl_renderer/opengl_utils.cpp b/game/graphics/opengl_renderer/opengl_utils.cpp index 1977649f1e..c17abcfae6 100644 --- a/game/graphics/opengl_renderer/opengl_utils.cpp +++ b/game/graphics/opengl_renderer/opengl_utils.cpp @@ -1,8 +1,11 @@ #include "opengl_utils.h" -#include "game/graphics/opengl_renderer/BucketRenderer.h" -#include "common/util/Assert.h" -#include + #include +#include + +#include "common/util/Assert.h" + +#include "game/graphics/opengl_renderer/BucketRenderer.h" FramebufferTexturePair::FramebufferTexturePair(int w, int h, u64 texture_format, int num_levels) : m_w(w), m_h(h) { diff --git a/game/graphics/opengl_renderer/opengl_utils.h b/game/graphics/opengl_renderer/opengl_utils.h index a9548206aa..2f0bcd9d5d 100644 --- a/game/graphics/opengl_renderer/opengl_utils.h +++ b/game/graphics/opengl_renderer/opengl_utils.h @@ -1,8 +1,9 @@ #pragma once -#include "game/graphics/pipelines/opengl.h" #include "common/math/Vector.h" +#include "game/graphics/pipelines/opengl.h" + struct SharedRenderState; class ScopedProfilerNode; diff --git a/game/graphics/opengl_renderer/sprite_common.h b/game/graphics/opengl_renderer/sprite_common.h index 936b3a10d0..c26daf0a8f 100644 --- a/game/graphics/opengl_renderer/sprite_common.h +++ b/game/graphics/opengl_renderer/sprite_common.h @@ -1,9 +1,10 @@ #pragma once +#include "common/dma/gs.h" +#include "common/math/Vector.h" + #include "game/graphics/opengl_renderer/BucketRenderer.h" #include "game/graphics/opengl_renderer/DirectRenderer.h" -#include "common/dma/gs.h" -#include "common/math/Vector.h" using math::Matrix4f; using math::Vector4f; diff --git a/game/graphics/pipelines/opengl.cpp b/game/graphics/pipelines/opengl.cpp index e59b59247d..e1a0c80dbe 100644 --- a/game/graphics/pipelines/opengl.cpp +++ b/game/graphics/pipelines/opengl.cpp @@ -3,32 +3,33 @@ * Lower-level OpenGL interface. No actual rendering is performed here! */ +#include "opengl.h" + +#include #include #include -#include + +#include "common/dma/dma_copy.h" +#include "common/global_profiler/GlobalProfiler.h" +#include "common/goal_constants.h" +#include "common/log/log.h" +#include "common/util/FileUtil.h" +#include "common/util/FrameLimiter.h" +#include "common/util/Timer.h" +#include "common/util/compress.h" + +#include "game/graphics/display.h" +#include "game/graphics/gfx.h" +#include "game/graphics/opengl_renderer/OpenGLRenderer.h" +#include "game/graphics/opengl_renderer/debug_gui.h" +#include "game/graphics/texture/TexturePool.h" +#include "game/runtime.h" +#include "game/system/newpad.h" #include "third-party/imgui/imgui.h" #include "third-party/imgui/imgui_impl_glfw.h" #include "third-party/imgui/imgui_impl_opengl3.h" - -#include "opengl.h" - -#include "game/graphics/gfx.h" -#include "game/graphics/display.h" -#include "game/graphics/opengl_renderer/OpenGLRenderer.h" -#include "game/graphics/texture/TexturePool.h" -#include "common/dma/dma_copy.h" -#include "game/system/newpad.h" -#include "common/log/log.h" -#include "common/goal_constants.h" #include "third-party/stb_image/stb_image.h" -#include "game/runtime.h" -#include "common/util/Timer.h" -#include "game/graphics/opengl_renderer/debug_gui.h" -#include "common/util/FileUtil.h" -#include "common/util/compress.h" -#include "common/util/FrameLimiter.h" -#include "common/global_profiler/GlobalProfiler.h" namespace { diff --git a/game/graphics/pipelines/opengl.h b/game/graphics/pipelines/opengl.h index 2dd13f6a81..8d170f01b2 100644 --- a/game/graphics/pipelines/opengl.h +++ b/game/graphics/pipelines/opengl.h @@ -6,12 +6,12 @@ */ #define GLFW_INCLUDE_NONE -#include "third-party/glad/include/glad/glad.h" -#include "third-party/glfw/include/GLFW/glfw3.h" - #include "game/graphics/display.h" #include "game/graphics/gfx.h" +#include "third-party/glad/include/glad/glad.h" +#include "third-party/glfw/include/GLFW/glfw3.h" + enum GlfwKeyAction { Release = GLFW_RELEASE, // falling edge of key press Press = GLFW_PRESS, // rising edge of key press diff --git a/game/graphics/sceGraphicsInterface.cpp b/game/graphics/sceGraphicsInterface.cpp index 6aac5303d2..641b76d233 100644 --- a/game/graphics/sceGraphicsInterface.cpp +++ b/game/graphics/sceGraphicsInterface.cpp @@ -1,7 +1,10 @@ #include "game/graphics/sceGraphicsInterface.h" -#include "game/graphics/gfx.h" + #include + #include "common/util/Assert.h" + +#include "game/graphics/gfx.h" #include "game/overlord/srpc.h" /*! diff --git a/game/graphics/texture/TextureConverter.cpp b/game/graphics/texture/TextureConverter.cpp index 00db9ca831..cdc424a40a 100644 --- a/game/graphics/texture/TextureConverter.cpp +++ b/game/graphics/texture/TextureConverter.cpp @@ -1,8 +1,10 @@ #include "TextureConverter.h" -#include "third-party/fmt/core.h" -#include "common/util/FileUtil.h" + #include "common/texture/texture_conversion.h" #include "common/util/Assert.h" +#include "common/util/FileUtil.h" + +#include "third-party/fmt/core.h" TextureConverter::TextureConverter() { m_vram.resize(4 * 1024 * 1024); diff --git a/game/graphics/texture/TexturePool.cpp b/game/graphics/texture/TexturePool.cpp index 8e632d6b46..42e1c07ddd 100644 --- a/game/graphics/texture/TexturePool.cpp +++ b/game/graphics/texture/TexturePool.cpp @@ -1,15 +1,17 @@ -#include -#include - #include "TexturePool.h" +#include +#include + +#include "common/log/log.h" +#include "common/util/Assert.h" +#include "common/util/Timer.h" + +#include "game/graphics/pipelines/opengl.h" +#include "game/graphics/texture/jak1_tpage_dir.h" + #include "third-party/fmt/core.h" #include "third-party/imgui/imgui.h" -#include "common/util/Timer.h" -#include "common/log/log.h" -#include "game/graphics/pipelines/opengl.h" -#include "common/util/Assert.h" -#include "game/graphics/texture/jak1_tpage_dir.h" namespace { const char empty_string[] = ""; diff --git a/game/graphics/texture/TexturePool.h b/game/graphics/texture/TexturePool.h index 8d386cbc37..5b62aceefa 100644 --- a/game/graphics/texture/TexturePool.h +++ b/game/graphics/texture/TexturePool.h @@ -2,15 +2,17 @@ #include #include -#include #include #include +#include #include + #include "common/common_types.h" -#include "game/graphics/texture/TextureConverter.h" #include "common/util/Serializer.h" #include "common/util/SmallVector.h" +#include "game/graphics/texture/TextureConverter.h" + // verify all texture lookups. // will make texture lookups slower and likely caused dropped frames when loading constexpr bool EXTRA_TEX_DEBUG = false; diff --git a/game/graphics/texture/jak1_tpage_dir.cpp b/game/graphics/texture/jak1_tpage_dir.cpp index b785a7ba88..31ecb88597 100644 --- a/game/graphics/texture/jak1_tpage_dir.cpp +++ b/game/graphics/texture/jak1_tpage_dir.cpp @@ -1,6 +1,8 @@ -#include -#include "common/common_types.h" #include "jak1_tpage_dir.h" + +#include + +#include "common/common_types.h" namespace { std::vector tpage_dir = { diff --git a/game/graphics/texture/jak1_tpage_dir.h b/game/graphics/texture/jak1_tpage_dir.h index be28bd12d5..d77702fe24 100644 --- a/game/graphics/texture/jak1_tpage_dir.h +++ b/game/graphics/texture/jak1_tpage_dir.h @@ -1,6 +1,7 @@ #pragma once #include + #include "common/common_types.h" const std::vector get_jak1_tpage_dir(); diff --git a/game/kernel/Ptr.h b/game/kernel/Ptr.h index 2e99ae000e..79f4fb8ec9 100644 --- a/game/kernel/Ptr.h +++ b/game/kernel/Ptr.h @@ -5,10 +5,11 @@ * Representation of a GOAL pointer which can be converted to/from a C pointer. */ -#include "game/runtime.h" #include "common/common_types.h" #include "common/util/Assert.h" +#include "game/runtime.h" + /*! * GOAL pointer to a T. Represented as a 32-bit unsigned offset from g_ee_main_mem. * A NULL pointer has an offset of 0. diff --git a/game/kernel/fileio.cpp b/game/kernel/fileio.cpp index 2e07723940..0caac14aba 100644 --- a/game/kernel/fileio.cpp +++ b/game/kernel/fileio.cpp @@ -4,13 +4,17 @@ * DONE! */ -#include -#include -#include "game/sce/sif_ee.h" #include "fileio.h" + +#include +#include + #include "kprint.h" -#include "common/versions.h" + #include "common/util/Assert.h" +#include "common/versions.h" + +#include "game/sce/sif_ee.h" namespace { // buffer for file paths. This might be static char buffer[512]. Maybe 633 is the line number? diff --git a/game/kernel/fileio.h b/game/kernel/fileio.h index bb52a4598a..0d22a3c340 100644 --- a/game/kernel/fileio.h +++ b/game/kernel/fileio.h @@ -8,10 +8,11 @@ #ifndef RUNTIME_FILEIO_H #define RUNTIME_FILEIO_H -#include "common/common_types.h" #include "Ptr.h" #include "kmalloc.h" +#include "common/common_types.h" + // GOAL File Types enum GoalFileType { LISTENER_TO_KERNEL_FILE_TYPE = 1, diff --git a/game/kernel/kboot.cpp b/game/kernel/kboot.cpp index 7cb2c83bc7..c0670cebd0 100644 --- a/game/kernel/kboot.cpp +++ b/game/kernel/kboot.cpp @@ -4,28 +4,32 @@ * DONE! */ -#include +#include "kboot.h" + #include +#include #include #include #include -#include "common/common_types.h" -#include "common/util/Timer.h" -#include "game/common/game_common_types.h" -#include "game/sce/libscf.h" -#include "kboot.h" +#include "klisten.h" #include "kmachine.h" +#include "kprint.h" #include "kscheme.h" #include "ksocket.h" -#include "klisten.h" -#include "kprint.h" + +#include "common/common_types.h" +#include "common/util/Timer.h" + +#include "game/common/game_common_types.h" +#include "game/sce/libscf.h" #ifdef _WIN32 #define NOMINMAX #define WIN32_LEAN_AND_MEAN -#include "Windows.h" #include + +#include "Windows.h" #elif __linux__ #include #endif diff --git a/game/kernel/kdgo.cpp b/game/kernel/kdgo.cpp index 7c2e7d91dd..45d1e33504 100644 --- a/game/kernel/kdgo.cpp +++ b/game/kernel/kdgo.cpp @@ -4,20 +4,24 @@ * DONE! */ -#include #include "kdgo.h" -#include "kprint.h" -#include "kmalloc.h" + +#include + #include "fileio.h" #include "klink.h" -#include "game/sce/sif_ee.h" +#include "kmalloc.h" +#include "kprint.h" + +#include "common/log/log.h" + #include "game/common/dgo_rpc_types.h" -#include "game/common/player_rpc_types.h" -#include "game/common/ramdisk_rpc_types.h" #include "game/common/loader_rpc_types.h" #include "game/common/play_rpc_types.h" +#include "game/common/player_rpc_types.h" +#include "game/common/ramdisk_rpc_types.h" #include "game/common/str_rpc_types.h" -#include "common/log/log.h" +#include "game/sce/sif_ee.h" using namespace ee; diff --git a/game/kernel/kdgo.h b/game/kernel/kdgo.h index 30eaebd364..16ae0d3add 100644 --- a/game/kernel/kdgo.h +++ b/game/kernel/kdgo.h @@ -6,10 +6,11 @@ * DONE! */ -#include "common/common_types.h" #include "Ptr.h" #include "kmalloc.h" +#include "common/common_types.h" + void kdgo_init_globals(); u32 InitRPC(); void load_and_link_dgo_from_c(const char* name, diff --git a/game/kernel/kdsnetm.cpp b/game/kernel/kdsnetm.cpp index eacc7de04f..ab8d5d3e0e 100644 --- a/game/kernel/kdsnetm.cpp +++ b/game/kernel/kdsnetm.cpp @@ -4,13 +4,17 @@ * DONE! */ -#include +#include "kdsnetm.h" + #include +#include + +#include "kprint.h" + +#include "common/util/Assert.h" + #include "game/sce/deci2.h" #include "game/system/deci_common.h" // todo, reorganize to avoid this include -#include "kdsnetm.h" -#include "kprint.h" -#include "common/util/Assert.h" using namespace ee; diff --git a/game/kernel/kdsnetm.h b/game/kernel/kdsnetm.h index 3e4f46bdea..35179f9d8b 100644 --- a/game/kernel/kdsnetm.h +++ b/game/kernel/kdsnetm.h @@ -10,6 +10,7 @@ #define JAK_KDSNETM_H #include "Ptr.h" + #include "common/listener_common.h" struct GoalProtoBlock { diff --git a/game/kernel/klink.cpp b/game/kernel/klink.cpp index ade87b62e1..422556feb4 100644 --- a/game/kernel/klink.cpp +++ b/game/kernel/klink.cpp @@ -6,19 +6,24 @@ * DONE! */ -#include -#include -#include -#include "common/log/log.h" #include "klink.h" + +#include +#include + #include "fileio.h" -#include "kscheme.h" #include "kboot.h" #include "kprint.h" -#include "common/symbols.h" +#include "kscheme.h" + #include "common/goal_constants.h" -#include "game/mips2c/mips2c_table.h" +#include "common/log/log.h" +#include "common/symbols.h" #include "common/util/Assert.h" +#include + +#include "game/mips2c/mips2c_table.h" + #include "third-party/fmt/core.h" using namespace jak1_symbols; diff --git a/game/kernel/klink.h b/game/kernel/klink.h index bc45781fb7..99300399fa 100644 --- a/game/kernel/klink.h +++ b/game/kernel/klink.h @@ -6,10 +6,13 @@ * DONE! */ +#include + #include "Ptr.h" #include "kmalloc.h" -#include "common/link_types.h" + #include "common/common_types.h" +#include "common/link_types.h" constexpr int LINK_FLAG_OUTPUT_LOAD = 0x1; constexpr int LINK_FLAG_OUTPUT_TRUE = 0x2; diff --git a/game/kernel/klisten.cpp b/game/kernel/klisten.cpp index 41db0f1626..d8837eff5d 100644 --- a/game/kernel/klisten.cpp +++ b/game/kernel/klisten.cpp @@ -4,17 +4,20 @@ * Done */ -#include +#include "klisten.h" + #include #include -#include "klisten.h" +#include + #include "kboot.h" -#include "kprint.h" #include "kdsnetm.h" -#include "ksocket.h" -#include "kmalloc.h" #include "klink.h" +#include "kmalloc.h" +#include "kprint.h" #include "kscheme.h" +#include "ksocket.h" + #include "common/symbols.h" using namespace jak1_symbols; diff --git a/game/kernel/kmachine.cpp b/game/kernel/kmachine.cpp index b1d11a8956..272b690205 100644 --- a/game/kernel/kmachine.cpp +++ b/game/kernel/kmachine.cpp @@ -5,44 +5,46 @@ * are just stubs or commented out for now. Legal splash screen stuff is also missing. */ -#include -#include #include "kmachine.h" -#include "kboot.h" -#include "kprint.h" + +#include +#include + #include "fileio.h" -#include "kmalloc.h" -#include "kdsnetm.h" -#include "ksocket.h" -#include "kscheme.h" -#include "ksound.h" +#include "kboot.h" #include "kdgo.h" -#include "ksound.h" +#include "kdsnetm.h" #include "klink.h" #include "klisten.h" -#include "game/sce/sif_ee.h" +#include "kmalloc.h" +#include "kprint.h" +#include "kscheme.h" +#include "ksocket.h" +#include "ksound.h" +#include "svnrev.h" + +#include "common/dma/dma_chain_read.h" +#include "common/dma/dma_copy.h" +#include "common/global_profiler/GlobalProfiler.h" +#include "common/log/log.h" +#include "common/symbols.h" +#include "common/util/Assert.h" +#include "common/util/FileUtil.h" +#include "common/util/Timer.h" + +#include "game/discord.h" +#include "game/graphics/gfx.h" +#include "game/graphics/sceGraphicsInterface.h" +#include "game/mips2c/mips2c_table.h" #include "game/sce/libcdvd_ee.h" -#include "game/sce/stubs.h" #include "game/sce/libdma.h" #include "game/sce/libgraph.h" #include "game/sce/libpad.h" -#include "common/symbols.h" -#include "common/log/log.h" -#include "common/util/FileUtil.h" -#include "common/util/Timer.h" -#include "game/graphics/sceGraphicsInterface.h" -#include "game/graphics/gfx.h" -#include "common/dma/dma_chain_read.h" -#include "common/dma/dma_copy.h" -#include "game/mips2c/mips2c_table.h" -#include "game/system/vm/vm.h" -#include "game/system/newpad.h" #include "game/sce/libscf.h" -#include "common/util/Assert.h" -#include "game/discord.h" -#include "common/global_profiler/GlobalProfiler.h" - -#include "svnrev.h" +#include "game/sce/sif_ee.h" +#include "game/sce/stubs.h" +#include "game/system/newpad.h" +#include "game/system/vm/vm.h" using namespace jak1_symbols; using namespace ee; diff --git a/game/kernel/kmachine.h b/game/kernel/kmachine.h index 24e40b04c3..dd7ff7938d 100644 --- a/game/kernel/kmachine.h +++ b/game/kernel/kmachine.h @@ -5,9 +5,10 @@ * GOAL Machine. Contains low-level hardware interfaces for GOAL. */ -#include "common/common_types.h" #include "Ptr.h" +#include "common/common_types.h" + //! Toggle to use more memory. To simulate the original game's memory layout, set this to false. // Make sure this matches the const in gcommon.gc. constexpr bool BIG_MEMORY = true; diff --git a/game/kernel/kmalloc.cpp b/game/kernel/kmalloc.cpp index 821f859957..95017426d1 100644 --- a/game/kernel/kmalloc.cpp +++ b/game/kernel/kmalloc.cpp @@ -5,13 +5,16 @@ * DONE */ -#include -#include -#include "common/goal_constants.h" #include "kmalloc.h" + +#include +#include + #include "kprint.h" #include "kscheme.h" +#include "common/goal_constants.h" + // global and debug kernel heaps Ptr kglobalheap; Ptr kdebugheap; diff --git a/game/kernel/kmalloc.h b/game/kernel/kmalloc.h index 4efbaea194..1e6937cf38 100644 --- a/game/kernel/kmalloc.h +++ b/game/kernel/kmalloc.h @@ -10,10 +10,11 @@ #ifndef JAK_KMALLOC_H #define JAK_KMALLOC_H -#include "common/common_types.h" #include "Ptr.h" #include "kmachine.h" +#include "common/common_types.h" + /*! * A kheap has a top/bottom linear allocator */ diff --git a/game/kernel/kmemcard.cpp b/game/kernel/kmemcard.cpp index 4885b16e3d..3fe5a700c6 100644 --- a/game/kernel/kmemcard.cpp +++ b/game/kernel/kmemcard.cpp @@ -4,21 +4,23 @@ * from memory cards to just raw saves. */ +#include "kmemcard.h" + +#include #include #include -#include -#include "third-party/fmt/core.h" - -#include "game/sce/sif_ee.h" -#include "game/sce/sif_ee_memcard.h" -#include "kmemcard.h" -#include "game/kernel/kdgo.h" -#include "game/common/ramdisk_rpc_types.h" -#include "game/kernel/fileio.h" +#include "common/util/Assert.h" #include "common/util/FileUtil.h" #include "common/util/Timer.h" -#include "common/util/Assert.h" + +#include "game/common/ramdisk_rpc_types.h" +#include "game/kernel/fileio.h" +#include "game/kernel/kdgo.h" +#include "game/sce/sif_ee.h" +#include "game/sce/sif_ee_memcard.h" + +#include "third-party/fmt/core.h" static constexpr bool memcard_debug = false; diff --git a/game/kernel/kmemcard.h b/game/kernel/kmemcard.h index a09e20d269..640abc30df 100644 --- a/game/kernel/kmemcard.h +++ b/game/kernel/kmemcard.h @@ -5,9 +5,10 @@ * Memory card interface. Very messy code. */ -#include "common/common_types.h" #include "kmachine.h" +#include "common/common_types.h" + void kmemcard_init_globals(); constexpr s32 SAVE_SIZE = 691; // likely different between versions! 692 on PAL/JPN diff --git a/game/kernel/kprint.cpp b/game/kernel/kprint.cpp index 8eeaa28e22..81a53d54cc 100644 --- a/game/kernel/kprint.cpp +++ b/game/kernel/kprint.cpp @@ -3,27 +3,30 @@ * GOAL Print. Contains GOAL I/O, Print, Format... */ -#include +#include "kprint.h" + #include #include #include +#include + +#include "fileio.h" +#include "kboot.h" +#include "kdsnetm.h" +#include "klink.h" +#include "klisten.h" +#include "kmachine.h" +#include "kmalloc.h" +#include "kscheme.h" -#include "common/goal_constants.h" #include "common/common_types.h" #include "common/cross_os_debug/xdbg.h" -#include "game/sce/sif_ee.h" -#include "kprint.h" -#include "kmachine.h" -#include "kboot.h" -#include "kmalloc.h" -#include "kdsnetm.h" -#include "fileio.h" -#include "kscheme.h" -#include "klisten.h" -#include "klink.h" +#include "common/goal_constants.h" #include "common/symbols.h" #include "common/util/Assert.h" +#include "game/sce/sif_ee.h" + using namespace jak1_symbols; /////////// diff --git a/game/kernel/kscheme.cpp b/game/kernel/kscheme.cpp index 557c545754..ee7f20184f 100644 --- a/game/kernel/kscheme.cpp +++ b/game/kernel/kscheme.cpp @@ -3,27 +3,30 @@ * Implementation of GOAL runtime. */ -#include #include "kscheme.h" + +#include + +#include "fileio.h" +#include "kboot.h" +#include "kdgo.h" +#include "kdsnetm.h" +#include "klink.h" +#include "klisten.h" +#include "kmachine.h" +#include "kmalloc.h" +#include "kmemcard.h" +#include "kprint.h" + #include "common/common_types.h" #include "common/goal_constants.h" -#include "kmachine.h" -#include "klisten.h" -#include "kmalloc.h" -#include "kprint.h" -#include "fileio.h" -#include "kmemcard.h" -#include "kboot.h" -#include "kdsnetm.h" -#include "kdgo.h" -#include "klink.h" -#include "common/symbols.h" -#include "common/versions.h" -#include "common/goal_constants.h" #include "common/log/log.h" -#include "common/util/Timer.h" -#include "game/mips2c/mips2c_table.h" +#include "common/symbols.h" #include "common/util/Assert.h" +#include "common/util/Timer.h" +#include "common/versions.h" + +#include "game/mips2c/mips2c_table.h" using namespace jak1_symbols; diff --git a/game/kernel/kscheme.h b/game/kernel/kscheme.h index 921c4eaf15..8e7e15c02b 100644 --- a/game/kernel/kscheme.h +++ b/game/kernel/kscheme.h @@ -5,11 +5,12 @@ * Implementation of GOAL runtime. */ -#include "common/common_types.h" -#include "common/goal_constants.h" #include "kmachine.h" #include "kmalloc.h" +#include "common/common_types.h" +#include "common/goal_constants.h" + extern u32 FastLink; extern s32 NumSymbols; extern Ptr EnableMethodSet; diff --git a/game/kernel/ksocket.cpp b/game/kernel/ksocket.cpp index 34322c2250..5a24ff20b9 100644 --- a/game/kernel/ksocket.cpp +++ b/game/kernel/ksocket.cpp @@ -5,11 +5,12 @@ */ #include "ksocket.h" -#include "kdsnetm.h" -#include "kprint.h" -#include "kboot.h" + #include "fileio.h" +#include "kboot.h" +#include "kdsnetm.h" #include "klisten.h" +#include "kprint.h" /*! * Update GOAL message header after receiving and verify message is ok. diff --git a/game/kernel/ksocket.h b/game/kernel/ksocket.h index 41397ff1a7..2eb2e5227f 100644 --- a/game/kernel/ksocket.h +++ b/game/kernel/ksocket.h @@ -8,9 +8,10 @@ #ifndef JAK_KSOCKET_H #define JAK_KSOCKET_H -#include "common/common_types.h" -#include "kmachine.h" #include "Ptr.h" +#include "kmachine.h" + +#include "common/common_types.h" /*! * Update GOAL message header after receiving and verify message is ok. diff --git a/game/kernel/ksound.cpp b/game/kernel/ksound.cpp index 785b7ff429..4d2c4e0c11 100644 --- a/game/kernel/ksound.cpp +++ b/game/kernel/ksound.cpp @@ -5,12 +5,15 @@ */ #include "ksound.h" -#include "kscheme.h" + #include "kdgo.h" -#include "game/sound/989snd/ame_handler.h" -#include "game/overlord/srpc.h" +#include "kscheme.h" + #include "common/common_types.h" +#include "game/overlord/srpc.h" +#include "game/sound/989snd/ame_handler.h" + /*! * Does nothing! */ diff --git a/game/main.cpp b/game/main.cpp index 0ca9d8aad2..d689fde7a3 100644 --- a/game/main.cpp +++ b/game/main.cpp @@ -4,12 +4,15 @@ */ #include + #include "runtime.h" -#include "common/versions.h" + #include "common/log/log.h" #include "common/util/FileUtil.h" -#include "game/discord.h" #include "common/util/os.h" +#include "common/versions.h" + +#include "game/discord.h" // Discord RPC extern int64_t gStartTime; diff --git a/game/mips2c/functions/collide_cache.cpp b/game/mips2c/functions/collide_cache.cpp index 67b8e604f5..791c2d06b3 100644 --- a/game/mips2c/functions/collide_cache.cpp +++ b/game/mips2c/functions/collide_cache.cpp @@ -1,9 +1,9 @@ //--------------------------MIPS2C--------------------- -#include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" - #include "common/dma/gs.h" +#include "game/kernel/kscheme.h" +#include "game/mips2c/mips2c_private.h" + namespace { u32 vu0_buffer[1024]; // todo, maybe can be 512. u32 vi1 = 0; diff --git a/game/mips2c/functions/collide_edge_grab.cpp b/game/mips2c/functions/collide_edge_grab.cpp index 82969343e2..0cfd98e23f 100644 --- a/game/mips2c/functions/collide_edge_grab.cpp +++ b/game/mips2c/functions/collide_edge_grab.cpp @@ -1,7 +1,7 @@ //--------------------------MIPS2C--------------------- -#include "game/mips2c/mips2c_private.h" #include "game/kernel/kscheme.h" +#include "game/mips2c/mips2c_private.h" namespace Mips2C { namespace method_16_collide_edge_work { struct Cache { diff --git a/game/mips2c/functions/collide_func.cpp b/game/mips2c/functions/collide_func.cpp index c13bf20d5e..90c8f9f8a9 100644 --- a/game/mips2c/functions/collide_func.cpp +++ b/game/mips2c/functions/collide_func.cpp @@ -1,6 +1,6 @@ //--------------------------MIPS2C--------------------- -#include "game/mips2c/mips2c_private.h" #include "game/kernel/kscheme.h" +#include "game/mips2c/mips2c_private.h" // clang-format off namespace Mips2C { diff --git a/game/mips2c/functions/collide_mesh.cpp b/game/mips2c/functions/collide_mesh.cpp index 0a3d9d2a1f..27c696856d 100644 --- a/game/mips2c/functions/collide_mesh.cpp +++ b/game/mips2c/functions/collide_mesh.cpp @@ -1,6 +1,6 @@ //--------------------------MIPS2C--------------------- -#include "game/mips2c/mips2c_private.h" #include "game/kernel/kscheme.h" +#include "game/mips2c/mips2c_private.h" // clang-format off namespace Mips2C { diff --git a/game/mips2c/functions/generic_effect.cpp b/game/mips2c/functions/generic_effect.cpp index a4fec92ecd..224ad2a910 100644 --- a/game/mips2c/functions/generic_effect.cpp +++ b/game/mips2c/functions/generic_effect.cpp @@ -1,7 +1,7 @@ //--------------------------MIPS2C--------------------- -#include "game/mips2c/mips2c_private.h" #include "game/kernel/kscheme.h" +#include "game/mips2c/mips2c_private.h" // clang-format off diff --git a/game/mips2c/functions/generic_effect2.cpp b/game/mips2c/functions/generic_effect2.cpp index d3e2da0b12..0427154777 100644 --- a/game/mips2c/functions/generic_effect2.cpp +++ b/game/mips2c/functions/generic_effect2.cpp @@ -1,6 +1,6 @@ //--------------------------MIPS2C--------------------- -#include "game/mips2c/mips2c_private.h" #include "game/kernel/kscheme.h" +#include "game/mips2c/mips2c_private.h" namespace Mips2C { // clang-format off diff --git a/game/mips2c/functions/generic_merc.cpp b/game/mips2c/functions/generic_merc.cpp index 5131f0c501..6b00eec6eb 100644 --- a/game/mips2c/functions/generic_merc.cpp +++ b/game/mips2c/functions/generic_merc.cpp @@ -1,5 +1,5 @@ -#include "game/mips2c/mips2c_private.h" #include "game/kernel/kscheme.h" +#include "game/mips2c/mips2c_private.h" namespace Mips2C { namespace generic_prepare_dma_single { diff --git a/game/mips2c/functions/joint.cpp b/game/mips2c/functions/joint.cpp index 3a594da7f6..dbf0bb2f1c 100644 --- a/game/mips2c/functions/joint.cpp +++ b/game/mips2c/functions/joint.cpp @@ -1,6 +1,6 @@ //--------------------------MIPS2C--------------------- -#include "game/mips2c/mips2c_private.h" #include "game/kernel/kscheme.h" +#include "game/mips2c/mips2c_private.h" // clang-format off diff --git a/game/mips2c/functions/ripple.cpp b/game/mips2c/functions/ripple.cpp index fc768aed81..bb342e143f 100644 --- a/game/mips2c/functions/ripple.cpp +++ b/game/mips2c/functions/ripple.cpp @@ -1,7 +1,7 @@ //--------------------------MIPS2C--------------------- -#include "game/mips2c/mips2c_private.h" #include "game/kernel/kscheme.h" +#include "game/mips2c/mips2c_private.h" namespace Mips2C { struct RippleVu0 { diff --git a/game/mips2c/functions/shadow.cpp b/game/mips2c/functions/shadow.cpp index 0e4d6effdf..6cd03cbce7 100644 --- a/game/mips2c/functions/shadow.cpp +++ b/game/mips2c/functions/shadow.cpp @@ -1,6 +1,6 @@ //--------------------------MIPS2C--------------------- -#include "game/mips2c/mips2c_private.h" #include "game/kernel/kscheme.h" +#include "game/mips2c/mips2c_private.h" namespace Mips2C { // clang-format off namespace { diff --git a/game/mips2c/functions/sky_tng.cpp b/game/mips2c/functions/sky_tng.cpp index 8fe39cc8fc..0ecaab6cf4 100644 --- a/game/mips2c/functions/sky_tng.cpp +++ b/game/mips2c/functions/sky_tng.cpp @@ -1,6 +1,6 @@ //--------------------------MIPS2C--------------------- -#include "game/mips2c/mips2c_private.h" #include "game/kernel/kscheme.h" +#include "game/mips2c/mips2c_private.h" namespace Mips2C { diff --git a/game/mips2c/functions/test_func.cpp b/game/mips2c/functions/test_func.cpp index 0a15c880ba..623e535a41 100644 --- a/game/mips2c/functions/test_func.cpp +++ b/game/mips2c/functions/test_func.cpp @@ -1,6 +1,6 @@ //--------------------------MIPS2C--------------------- -#include "game/mips2c/mips2c_private.h" #include "game/kernel/kscheme.h" +#include "game/mips2c/mips2c_private.h" namespace Mips2C { namespace test_func { u64 execute(void* ctxt) { @@ -18,9 +18,9 @@ u64 execute(void* ctxt) { } // namespace Mips2C //--------------------------MIPS2C--------------------- -#include "game/mips2c/mips2c_private.h" -#include "game/kernel/kscheme.h" #include "game/kernel/kprint.h" +#include "game/kernel/kscheme.h" +#include "game/mips2c/mips2c_private.h" namespace Mips2C { namespace goal_call_test { struct Cache { diff --git a/game/mips2c/functions/tfrag.cpp b/game/mips2c/functions/tfrag.cpp index fc0c0dc507..9c29d0e791 100644 --- a/game/mips2c/functions/tfrag.cpp +++ b/game/mips2c/functions/tfrag.cpp @@ -1,7 +1,7 @@ //--------------------------MIPS2C--------------------- -#include "game/mips2c/mips2c_private.h" #include "game/kernel/kscheme.h" +#include "game/mips2c/mips2c_private.h" namespace Mips2C { namespace draw_inline_array_tfrag { struct Cache { diff --git a/game/mips2c/functions/tie_methods.cpp b/game/mips2c/functions/tie_methods.cpp index e3f9cd6ecc..b322297219 100644 --- a/game/mips2c/functions/tie_methods.cpp +++ b/game/mips2c/functions/tie_methods.cpp @@ -1,7 +1,7 @@ //--------------------------MIPS2C--------------------- -#include "game/mips2c/mips2c_private.h" #include "game/kernel/kscheme.h" +#include "game/mips2c/mips2c_private.h" namespace Mips2C { namespace draw_inline_array_instance_tie { struct Cache { diff --git a/game/mips2c/functions/time_of_day.cpp b/game/mips2c/functions/time_of_day.cpp index 8226ee422d..c987e2cc22 100644 --- a/game/mips2c/functions/time_of_day.cpp +++ b/game/mips2c/functions/time_of_day.cpp @@ -1,7 +1,7 @@ //--------------------------MIPS2C--------------------- -#include "game/mips2c/mips2c_private.h" #include "game/kernel/kscheme.h" +#include "game/mips2c/mips2c_private.h" // clang-format off namespace Mips2C { diff --git a/game/mips2c/mips2c_private.h b/game/mips2c/mips2c_private.h index 3e25960b95..a04619534f 100644 --- a/game/mips2c/mips2c_private.h +++ b/game/mips2c/mips2c_private.h @@ -1,16 +1,18 @@ #pragma once -#include -#include #include +#include +#include #include "common/common_types.h" -#include "game/mips2c/mips2c_table.h" -#include "common/util/BitUtils.h" -#include "third-party/fmt/core.h" -#include "common/util/Assert.h" #include "common/dma/dma.h" +#include "common/util/Assert.h" +#include "common/util/BitUtils.h" + #include "game/common/vu.h" +#include "game/mips2c/mips2c_table.h" + +#include "third-party/fmt/core.h" // This file contains utility functions for code generated by the mips2c pass. // This is only useful for diff --git a/game/mips2c/mips2c_table.cpp b/game/mips2c/mips2c_table.cpp index 0cb9432730..535df70adb 100644 --- a/game/mips2c/mips2c_table.cpp +++ b/game/mips2c/mips2c_table.cpp @@ -1,9 +1,10 @@ #include "mips2c_table.h" + #include "common/log/log.h" +#include "common/symbols.h" #include "game/kernel/kmalloc.h" #include "game/kernel/kscheme.h" -#include "common/symbols.h" using namespace jak1_symbols; diff --git a/game/mips2c/mips2c_table.h b/game/mips2c/mips2c_table.h index b2cb64fe82..9b9f9ff0fd 100644 --- a/game/mips2c/mips2c_table.h +++ b/game/mips2c/mips2c_table.h @@ -1,15 +1,16 @@ #pragma once -#include -#include -#include #include #include +#include +#include +#include -#include "game/kernel/Ptr.h" #include "common/common_types.h" #include "common/util/Assert.h" +#include "game/kernel/Ptr.h" + namespace Mips2C { class LinkedFunctionTable { diff --git a/game/overlord/dma.cpp b/game/overlord/dma.cpp index 9f1b7e7311..3164927408 100644 --- a/game/overlord/dma.cpp +++ b/game/overlord/dma.cpp @@ -4,10 +4,13 @@ * This code is not great. */ -#include -#include #include "dma.h" + +#include +#include + #include "common/common_types.h" + #include "game/sce/iop.h" #include "game/sound/sdshim.h" #include "game/sound/sndshim.h" diff --git a/game/overlord/fake_iso.cpp b/game/overlord/fake_iso.cpp index c131424fec..0f1aef2d64 100644 --- a/game/overlord/fake_iso.cpp +++ b/game/overlord/fake_iso.cpp @@ -9,19 +9,23 @@ * should work. */ +#include "fake_iso.h" + #include #include -#include "fake_iso.h" + +#include "isocommon.h" +#include "overlord.h" + +#include "common/log/log.h" +#include "common/util/Assert.h" +#include "common/util/FileUtil.h" + #include "game/overlord/sbank.h" -#include "game/sound/sndshim.h" #include "game/overlord/soundcommon.h" #include "game/overlord/srpc.h" #include "game/sce/iop.h" -#include "isocommon.h" -#include "overlord.h" -#include "common/util/FileUtil.h" -#include "common/log/log.h" -#include "common/util/Assert.h" +#include "game/sound/sndshim.h" using namespace iop; diff --git a/game/overlord/iso.cpp b/game/overlord/iso.cpp index 94fd669a6e..e6b46d98a4 100644 --- a/game/overlord/iso.cpp +++ b/game/overlord/iso.cpp @@ -4,22 +4,26 @@ * This is a huge mess */ -#include "common/log/log.h" -#include -#include -#include "game/overlord/srpc.h" -#include "game/sound/sndshim.h" #include "iso.h" -#include "iso_cd.h" -#include "iso_queue.h" -#include "iso_api.h" -#include "game/sce/iop.h" -#include "stream.h" + +#include +#include + #include "dma.h" #include "fake_iso.h" -#include "game/common/dgo_rpc_types.h" +#include "iso_api.h" +#include "iso_cd.h" +#include "iso_queue.h" +#include "stream.h" + +#include "common/log/log.h" #include "common/util/Assert.h" + +#include "game/common/dgo_rpc_types.h" +#include "game/overlord/srpc.h" +#include "game/sce/iop.h" #include "game/sound/sdshim.h" +#include "game/sound/sndshim.h" using namespace iop; diff --git a/game/overlord/iso.h b/game/overlord/iso.h index e2963de998..7962d342c7 100644 --- a/game/overlord/iso.h +++ b/game/overlord/iso.h @@ -6,9 +6,10 @@ * This is a huge mess */ -#include "common/common_types.h" #include "isocommon.h" +#include "common/common_types.h" + extern s32 gFakeVAGClockPaused; extern s32 gFakeVAGClockRunning; extern s32 gFakeVAGClock; diff --git a/game/overlord/iso_api.cpp b/game/overlord/iso_api.cpp index b250ac4920..40b8b70e2d 100644 --- a/game/overlord/iso_api.cpp +++ b/game/overlord/iso_api.cpp @@ -1,10 +1,13 @@ #include "iso_api.h" + +#include "iso_queue.h" +#include "sbank.h" + +#include "common/log/log.h" +#include "common/util/Assert.h" + #include "game/overlord/srpc.h" #include "game/sce/iop.h" -#include "common/log/log.h" -#include "sbank.h" -#include "common/util/Assert.h" -#include "iso_queue.h" using namespace iop; diff --git a/game/overlord/iso_cd.cpp b/game/overlord/iso_cd.cpp index fb5b32cb7a..ac3e305054 100644 --- a/game/overlord/iso_cd.cpp +++ b/game/overlord/iso_cd.cpp @@ -3,16 +3,20 @@ * IsoFs API for accessing the CD/DVD drive. */ -#include -#include "game/sce/iop.h" -#include "game/sce/stubs.h" #include "iso_cd.h" + +#include + #include "isocommon.h" #include "overlord.h" #include "soundcommon.h" #include "srpc.h" + #include "common/log/log.h" +#include "game/sce/iop.h" +#include "game/sce/stubs.h" + // iso_cd is an implementation of the IsoFs API for loading files from a CD/DVD with an ISO and/or // DUP filesystem. // The DUP filesystem is a custom Naughty Dog filesystem which attempts to hide diff --git a/game/overlord/iso_cd.h b/game/overlord/iso_cd.h index 922d207ea3..93545cc501 100644 --- a/game/overlord/iso_cd.h +++ b/game/overlord/iso_cd.h @@ -8,9 +8,10 @@ #ifndef JAK_ISO_CD_H #define JAK_ISO_CD_H -#include "common/common_types.h" #include "iso.h" +#include "common/common_types.h" + void iso_cd_init_globals(); extern IsoFs iso_cd_; diff --git a/game/overlord/iso_queue.cpp b/game/overlord/iso_queue.cpp index 40dd8e0b67..7f10c418c3 100644 --- a/game/overlord/iso_queue.cpp +++ b/game/overlord/iso_queue.cpp @@ -1,11 +1,15 @@ -#include -#include -#include "common/log/log.h" -#include "game/sce/iop.h" #include "iso_queue.h" + +#include +#include + #include "isocommon.h" + +#include "common/log/log.h" #include "common/util/Assert.h" +#include "game/sce/iop.h" + using namespace iop; constexpr int N_BUFFERS = 4; diff --git a/game/overlord/iso_queue.h b/game/overlord/iso_queue.h index 9675795e61..91072a95ab 100644 --- a/game/overlord/iso_queue.h +++ b/game/overlord/iso_queue.h @@ -1,8 +1,9 @@ #pragma once -#include "common/common_types.h" #include "isocommon.h" +#include "common/common_types.h" + void iso_queue_init_globals(); void InitBuffers(); IsoBufferHeader* AllocateBuffer(uint32_t size); diff --git a/game/overlord/isocommon.cpp b/game/overlord/isocommon.cpp index 07399584eb..47614cd6e1 100644 --- a/game/overlord/isocommon.cpp +++ b/game/overlord/isocommon.cpp @@ -3,9 +3,11 @@ * Common ISO utilities. */ -#include "common/common_types.h" -#include #include "isocommon.h" + +#include + +#include "common/common_types.h" #include "common/util/Assert.h" /*! diff --git a/game/overlord/isocommon.h b/game/overlord/isocommon.h index e26d000d86..85ffcefdbe 100644 --- a/game/overlord/isocommon.h +++ b/game/overlord/isocommon.h @@ -9,8 +9,10 @@ #define JAK_V2_ISOCOMMON_H #include + #include "common/common_types.h" #include "common/link_types.h" + #include "game/common/overlord_common.h" #include "game/overlord/ssound.h" diff --git a/game/overlord/overlord.cpp b/game/overlord/overlord.cpp index 7f55c414b3..7b5a350bdd 100644 --- a/game/overlord/overlord.cpp +++ b/game/overlord/overlord.cpp @@ -1,11 +1,14 @@ -#include #include "overlord.h" -#include "game/sce/iop.h" -#include "ramdisk.h" + +#include + #include "iso.h" -#include "ssound.h" +#include "ramdisk.h" #include "sbank.h" #include "srpc.h" +#include "ssound.h" + +#include "game/sce/iop.h" using namespace iop; diff --git a/game/overlord/ramdisk.cpp b/game/overlord/ramdisk.cpp index 2697e3c1b8..33c87feaa5 100644 --- a/game/overlord/ramdisk.cpp +++ b/game/overlord/ramdisk.cpp @@ -4,16 +4,20 @@ * Also called "Server". */ -#include -#include -#include "common/common_types.h" -#include "game/common/ramdisk_rpc_types.h" #include "ramdisk.h" + +#include +#include + #include "iso.h" #include "iso_api.h" -#include "game/sce/iop.h" + +#include "common/common_types.h" #include "common/util/Assert.h" +#include "game/common/ramdisk_rpc_types.h" +#include "game/sce/iop.h" + // Note - the RAMDISK code supports having multiple files, but it appears only one file can ever be // used at a time. diff --git a/game/overlord/sbank.cpp b/game/overlord/sbank.cpp index 843b897767..54bbbf0271 100644 --- a/game/overlord/sbank.cpp +++ b/game/overlord/sbank.cpp @@ -1,5 +1,7 @@ -#include #include "sbank.h" + +#include + #include "soundcommon.h" constexpr int N_BANKS = 3; diff --git a/game/overlord/soundcommon.cpp b/game/overlord/soundcommon.cpp index d564fc84ef..628626c402 100644 --- a/game/overlord/soundcommon.cpp +++ b/game/overlord/soundcommon.cpp @@ -1,8 +1,10 @@ #include "soundcommon.h" + #include -#include "common/util/Assert.h" #include +#include "common/util/Assert.h" + // TODO strcpy_toupper // TODO atoi // TODO ReadBankSoundNames diff --git a/game/overlord/soundcommon.h b/game/overlord/soundcommon.h index 116d8086d5..ba9ef49490 100644 --- a/game/overlord/soundcommon.h +++ b/game/overlord/soundcommon.h @@ -3,6 +3,7 @@ #ifndef JAK_V2_SOUNDCOMMON_H #define JAK_V2_SOUNDCOMMON_H #include "common/common_types.h" + #include "game/overlord/sbank.h" void PrintBankInfo(SoundBank* buffer); diff --git a/game/overlord/srpc.cpp b/game/overlord/srpc.cpp index 0894de9220..4db46bded8 100644 --- a/game/overlord/srpc.cpp +++ b/game/overlord/srpc.cpp @@ -1,18 +1,23 @@ -#include -#include -#include "game/sound/sndshim.h" #include "srpc.h" -#include "game/sce/iop.h" + +#include +#include + +#include "iso.h" +#include "iso_api.h" +#include "ramdisk.h" +#include "sbank.h" + +#include "common/util/Assert.h" +#include "common/versions.h" + +#include "game/common/game_common_types.h" #include "game/common/loader_rpc_types.h" #include "game/common/player_rpc_types.h" -#include "game/common/game_common_types.h" -#include "common/versions.h" -#include "sbank.h" -#include "iso_api.h" -#include "common/util/Assert.h" +#include "game/sce/iop.h" +#include "game/sound/sndshim.h" + #include "third-party/fmt/core.h" -#include "iso.h" -#include "ramdisk.h" using namespace iop; diff --git a/game/overlord/srpc.h b/game/overlord/srpc.h index ec0fa0f2a9..f8fb8aac43 100644 --- a/game/overlord/srpc.h +++ b/game/overlord/srpc.h @@ -1,6 +1,7 @@ #pragma once #include "ssound.h" + #include "common/common_types.h" void srpc_init_globals(); diff --git a/game/overlord/ssound.cpp b/game/overlord/ssound.cpp index ecf1113189..ec2ec2418c 100644 --- a/game/overlord/ssound.cpp +++ b/game/overlord/ssound.cpp @@ -1,8 +1,11 @@ +#include "ssound.h" + #include #include -#include "game/overlord/srpc.h" -#include "ssound.h" + #include "common/util/Assert.h" + +#include "game/overlord/srpc.h" #include "game/sound/sndshim.h" using namespace iop; diff --git a/game/overlord/ssound.h b/game/overlord/ssound.h index d4f72cafe7..df016bae36 100644 --- a/game/overlord/ssound.h +++ b/game/overlord/ssound.h @@ -2,9 +2,10 @@ #ifndef JAK_V2_SSOUND_H #define JAK_V2_SSOUND_H -#include "game/sce/iop.h" #include "sbank.h" +#include "game/sce/iop.h" + struct VolumePair { s16 left; s16 right; diff --git a/game/overlord/stream.cpp b/game/overlord/stream.cpp index 3b93a060a2..0068c0f35e 100644 --- a/game/overlord/stream.cpp +++ b/game/overlord/stream.cpp @@ -4,17 +4,20 @@ * Supports loading a file directly to the EE, or loading chunks of a chunked file. */ -#include #include "stream.h" -#include "game/sce/iop.h" -#include "game/common/str_rpc_types.h" -#include "game/common/play_rpc_types.h" -#include "game/overlord/isocommon.h" -#include "game/overlord/iso_api.h" -#include "game/overlord/iso.h" -#include "game/overlord/srpc.h" + +#include + #include "common/util/Assert.h" +#include "game/common/play_rpc_types.h" +#include "game/common/str_rpc_types.h" +#include "game/overlord/iso.h" +#include "game/overlord/iso_api.h" +#include "game/overlord/isocommon.h" +#include "game/overlord/srpc.h" +#include "game/sce/iop.h" + using namespace iop; static RPC_Str_Cmd sSTRBuf; diff --git a/game/runtime.cpp b/game/runtime.cpp index 675f455aea..695f61d1c8 100644 --- a/game/runtime.cpp +++ b/game/runtime.cpp @@ -5,9 +5,11 @@ #ifdef __linux__ #include + #include #elif _WIN32 #include + #include "third-party/mman/mman.h" #define NOMINMAX #define WIN32_LEAN_AND_MEAN @@ -18,47 +20,43 @@ #include #include -#include "common/log/log.h" #include "runtime.h" -#include "system/SystemThread.h" -#include "sce/libcdvd_ee.h" -#include "sce/deci2.h" -#include "sce/sif_ee.h" -#include "sce/iop.h" -#include "game/system/Deci2Server.h" +#include "common/cross_os_debug/xdbg.h" +#include "common/goal_constants.h" +#include "common/log/log.h" +#include "common/util/FileUtil.h" + +#include "game/graphics/gfx.h" #include "game/kernel/fileio.h" #include "game/kernel/kboot.h" -#include "game/kernel/klink.h" -#include "game/kernel/kscheme.h" +#include "game/kernel/kdgo.h" #include "game/kernel/kdsnetm.h" +#include "game/kernel/klink.h" #include "game/kernel/klisten.h" #include "game/kernel/kmemcard.h" #include "game/kernel/kprint.h" -#include "game/kernel/kdgo.h" - -#include "game/system/iop_thread.h" - +#include "game/kernel/kscheme.h" #include "game/overlord/dma.h" -#include "game/overlord/iso.h" #include "game/overlord/fake_iso.h" -#include "game/overlord/iso_queue.h" -#include "game/overlord/ramdisk.h" +#include "game/overlord/iso.h" #include "game/overlord/iso_cd.h" +#include "game/overlord/iso_queue.h" #include "game/overlord/overlord.h" -#include "game/overlord/srpc.h" -#include "game/overlord/stream.h" +#include "game/overlord/ramdisk.h" #include "game/overlord/sbank.h" +#include "game/overlord/srpc.h" #include "game/overlord/ssound.h" - -#include "game/graphics/gfx.h" - -#include "game/system/vm/vm.h" +#include "game/overlord/stream.h" +#include "game/system/Deci2Server.h" +#include "game/system/iop_thread.h" #include "game/system/vm/dmac.h" - -#include "common/goal_constants.h" -#include "common/cross_os_debug/xdbg.h" -#include "common/util/FileUtil.h" +#include "game/system/vm/vm.h" +#include "sce/deci2.h" +#include "sce/iop.h" +#include "sce/libcdvd_ee.h" +#include "sce/sif_ee.h" +#include "system/SystemThread.h" u8* g_ee_main_mem = nullptr; std::thread::id g_main_thread_id = std::thread::id(); diff --git a/game/runtime.h b/game/runtime.h index 9799bc302d..21637eadca 100644 --- a/game/runtime.h +++ b/game/runtime.h @@ -8,6 +8,7 @@ #include #include "common/common_types.h" + #include "game/kernel/kboot.h" extern u8* g_ee_main_mem; diff --git a/game/sce/deci2.cpp b/game/sce/deci2.cpp index 9a5c39835a..6a41dcaa5d 100644 --- a/game/sce/deci2.cpp +++ b/game/sce/deci2.cpp @@ -3,13 +3,16 @@ * Implementation of SCE DECI2 library. */ +#include "deci2.h" + #include #include + #include "common/log/log.h" -#include "deci2.h" -#include "game/system/Deci2Server.h" #include "common/util/Assert.h" +#include "game/system/Deci2Server.h" + namespace ee { namespace { diff --git a/game/sce/iop.cpp b/game/sce/iop.cpp index 525a892b90..d0e916ce02 100644 --- a/game/sce/iop.cpp +++ b/game/sce/iop.cpp @@ -1,8 +1,11 @@ -#include #include "iop.h" -#include "game/system/iop_thread.h" + +#include + #include "common/util/Assert.h" +#include "game/system/iop_thread.h" + namespace iop { /*! * Is the SIF initialized? diff --git a/game/sce/libcdvd_ee.cpp b/game/sce/libcdvd_ee.cpp index 5e4182d7f0..a3ab7beb99 100644 --- a/game/sce/libcdvd_ee.cpp +++ b/game/sce/libcdvd_ee.cpp @@ -4,6 +4,7 @@ */ #include "libcdvd_ee.h" + #include "common/util/Assert.h" namespace ee { diff --git a/game/sce/libgraph.cpp b/game/sce/libgraph.cpp index 6d40bb84d7..dbfc64b72a 100644 --- a/game/sce/libgraph.cpp +++ b/game/sce/libgraph.cpp @@ -1,4 +1,5 @@ #include "libgraph.h" + #include "common/log/log.h" namespace ee { diff --git a/game/sce/libpad.cpp b/game/sce/libpad.cpp index c2c1e9ac36..f3f1c7bcdf 100644 --- a/game/sce/libpad.cpp +++ b/game/sce/libpad.cpp @@ -1,9 +1,10 @@ #include "libpad.h" -#include "game/kernel/kmachine.h" -#include "game/graphics/gfx.h" #include "common/util/Assert.h" +#include "game/graphics/gfx.h" +#include "game/kernel/kmachine.h" + /*! * @file libpad.cpp * Stub implementation of the EE pad (controller) library diff --git a/game/sce/sif_ee.cpp b/game/sce/sif_ee.cpp index bb659ea28b..be2358daf4 100644 --- a/game/sce/sif_ee.cpp +++ b/game/sce/sif_ee.cpp @@ -1,11 +1,14 @@ -#include -#include -#include -#include "common/util/FileUtil.h" #include "sif_ee.h" -#include "game/system/iop_thread.h" -#include "game/runtime.h" + +#include +#include +#include + #include "common/util/Assert.h" +#include "common/util/FileUtil.h" + +#include "game/runtime.h" +#include "game/system/iop_thread.h" namespace ee { diff --git a/game/sce/sif_ee_memcard.cpp b/game/sce/sif_ee_memcard.cpp index 8f4fdee63b..9c5d87916b 100644 --- a/game/sce/sif_ee_memcard.cpp +++ b/game/sce/sif_ee_memcard.cpp @@ -1,14 +1,16 @@ -#include -#include -#include -#include - #include "sif_ee_memcard.h" -#include "game/sce/sif_ee.h" -#include "common/util/Serializer.h" -#include "common/util/FileUtil.h" + +#include +#include +#include +#include + #include "common/util/Assert.h" +#include "common/util/FileUtil.h" +#include "common/util/Serializer.h" + +#include "game/sce/sif_ee.h" namespace ee { /*! diff --git a/game/sce/stubs.cpp b/game/sce/stubs.cpp index 1e3dbb3e86..9dc56afb67 100644 --- a/game/sce/stubs.cpp +++ b/game/sce/stubs.cpp @@ -1,5 +1,7 @@ -#include #include "stubs.h" + +#include + #include "common/util/Assert.h" namespace ee { diff --git a/game/sound/989snd/ame_handler.cpp b/game/sound/989snd/ame_handler.cpp index 18c8325472..47295b51dc 100644 --- a/game/sound/989snd/ame_handler.cpp +++ b/game/sound/989snd/ame_handler.cpp @@ -1,8 +1,9 @@ // Copyright: 2021 - 2022, Ziemas // SPDX-License-Identifier: ISC #include "ame_handler.h" -#include "game/sound/989snd/blocksound_handler.h" + #include "game/kernel/ksound.h" +#include "game/sound/989snd/blocksound_handler.h" namespace snd { diff --git a/game/sound/989snd/ame_handler.h b/game/sound/989snd/ame_handler.h index ab9450c7a2..2f9707191c 100644 --- a/game/sound/989snd/ame_handler.h +++ b/game/sound/989snd/ame_handler.h @@ -1,12 +1,14 @@ // Copyright: 2021 - 2022, Ziemas // SPDX-License-Identifier: ISC #pragma once +#include + #include "loader.h" #include "midi_handler.h" #include "sound_handler.h" #include "vagvoice.h" + #include "common/common_types.h" -#include namespace snd { diff --git a/game/sound/989snd/blocksound_handler.cpp b/game/sound/989snd/blocksound_handler.cpp index 89cfe2d09b..79030bf84b 100644 --- a/game/sound/989snd/blocksound_handler.cpp +++ b/game/sound/989snd/blocksound_handler.cpp @@ -1,8 +1,10 @@ #include "blocksound_handler.h" -#include "util.h" + #include #include +#include "util.h" + namespace snd { void blocksound_handler::init() { m_next_grain = 0; diff --git a/game/sound/989snd/blocksound_handler.h b/game/sound/989snd/blocksound_handler.h index 0b6136b969..07f919bb6e 100644 --- a/game/sound/989snd/blocksound_handler.h +++ b/game/sound/989snd/blocksound_handler.h @@ -1,8 +1,10 @@ #pragma once #include + #include "sfxblock.h" -#include "vagvoice.h" #include "sound_handler.h" +#include "vagvoice.h" + #include "common/common_types.h" namespace snd { diff --git a/game/sound/989snd/handle_allocator.h b/game/sound/989snd/handle_allocator.h index 99b3efb478..82707bf0af 100644 --- a/game/sound/989snd/handle_allocator.h +++ b/game/sound/989snd/handle_allocator.h @@ -2,10 +2,11 @@ // SPDX-License-Identifier: ISC #pragma once -#include "common/common_types.h" #include #include +#include "common/common_types.h" + namespace snd { class id_allocator { diff --git a/game/sound/989snd/loader.cpp b/game/sound/989snd/loader.cpp index e1be39bb82..3205dab306 100644 --- a/game/sound/989snd/loader.cpp +++ b/game/sound/989snd/loader.cpp @@ -1,9 +1,12 @@ // Copyright: 2021 - 2022, Ziemas // SPDX-License-Identifier: ISC #include "loader.h" -#include "midi_handler.h" + #include #include + +#include "midi_handler.h" + #include namespace snd { diff --git a/game/sound/989snd/loader.h b/game/sound/989snd/loader.h index 7fb254a770..6fefe9cc28 100644 --- a/game/sound/989snd/loader.h +++ b/game/sound/989snd/loader.h @@ -1,17 +1,20 @@ // Copyright: 2021 - 2022, Ziemas // SPDX-License-Identifier: ISC #pragma once -#include "../common/synth.h" -#include "common/common_types.h" -#include "handle_allocator.h" -#include "sound_handler.h" -#include "musicbank.h" -#include "soundbank.h" -#include "sfxblock.h" #include #include #include +#include "handle_allocator.h" +#include "musicbank.h" +#include "sfxblock.h" +#include "sound_handler.h" +#include "soundbank.h" + +#include "common/common_types.h" + +#include "../common/synth.h" + namespace snd { #define FOURCC(a, b, c, d) ((u32)(((d) << 24) | ((c) << 16) | ((b) << 8) | (a))) diff --git a/game/sound/989snd/midi_handler.cpp b/game/sound/989snd/midi_handler.cpp index 65e5bb84fb..b2690332a6 100644 --- a/game/sound/989snd/midi_handler.cpp +++ b/game/sound/989snd/midi_handler.cpp @@ -1,6 +1,7 @@ // Copyright: 2021 - 2022, Ziemas // SPDX-License-Identifier: ISC #include "midi_handler.h" + #include "ame_handler.h" #include diff --git a/game/sound/989snd/midi_handler.h b/game/sound/989snd/midi_handler.h index c2d9eef086..ed27145959 100644 --- a/game/sound/989snd/midi_handler.h +++ b/game/sound/989snd/midi_handler.h @@ -1,18 +1,20 @@ // Copyright: 2021 - 2022, Ziemas // SPDX-License-Identifier: ISC #pragma once -#include "ame_handler.h" -#include "vagvoice.h" -#include "loader.h" -#include "sound_handler.h" -#include "common/common_types.h" #include -#include #include +#include #include #include #include +#include "ame_handler.h" +#include "loader.h" +#include "sound_handler.h" +#include "vagvoice.h" + +#include "common/common_types.h" + namespace snd { struct ProgData { diff --git a/game/sound/989snd/musicbank.cpp b/game/sound/989snd/musicbank.cpp index ba2ef6cbf1..d85dcb77f4 100644 --- a/game/sound/989snd/musicbank.cpp +++ b/game/sound/989snd/musicbank.cpp @@ -1,6 +1,8 @@ #include "musicbank.h" + #include "ame_handler.h" #include "midi_handler.h" + #include "../common/synth.h" namespace snd { diff --git a/game/sound/989snd/musicbank.h b/game/sound/989snd/musicbank.h index d3ee8c074f..7033440270 100644 --- a/game/sound/989snd/musicbank.h +++ b/game/sound/989snd/musicbank.h @@ -1,5 +1,6 @@ #pragma once #include + #include "soundbank.h" namespace snd { diff --git a/game/sound/989snd/player.cpp b/game/sound/989snd/player.cpp index 8aa446068a..b42705653e 100644 --- a/game/sound/989snd/player.cpp +++ b/game/sound/989snd/player.cpp @@ -1,9 +1,11 @@ // Copyright: 2021 - 2022, Ziemas // SPDX-License-Identifier: ISC #include "player.h" -#include + #include +#include + #ifdef _WIN32 #include #endif diff --git a/game/sound/989snd/player.h b/game/sound/989snd/player.h index 5653133d6a..e2a6ffcceb 100644 --- a/game/sound/989snd/player.h +++ b/game/sound/989snd/player.h @@ -1,22 +1,25 @@ // Copyright: 2021 - 2022, Ziemas // SPDX-License-Identifier: ISC #pragma once -#include "ame_handler.h" -#include "game/sound/989snd/vagvoice.h" -#include "third-party/cubeb/cubeb/include/cubeb/cubeb.h" -#include "midi_handler.h" -#include "sound_handler.h" -#include "loader.h" -#include "../common/synth.h" -#include "common/common_types.h" -#include "handle_allocator.h" #include -#include #include #include #include #include +#include "ame_handler.h" +#include "handle_allocator.h" +#include "loader.h" +#include "midi_handler.h" +#include "sound_handler.h" + +#include "common/common_types.h" + +#include "../common/synth.h" +#include "game/sound/989snd/vagvoice.h" + +#include "third-party/cubeb/cubeb/include/cubeb/cubeb.h" + namespace snd { class player { diff --git a/game/sound/989snd/sfxblock.cpp b/game/sound/989snd/sfxblock.cpp index d72e54a3cb..96c7196612 100644 --- a/game/sound/989snd/sfxblock.cpp +++ b/game/sound/989snd/sfxblock.cpp @@ -1,4 +1,5 @@ #include "sfxblock.h" + #include "blocksound_handler.h" namespace snd { diff --git a/game/sound/989snd/sfxblock.h b/game/sound/989snd/sfxblock.h index af8c21800b..83cae18384 100644 --- a/game/sound/989snd/sfxblock.h +++ b/game/sound/989snd/sfxblock.h @@ -1,5 +1,6 @@ #pragma once #include + #include "soundbank.h" namespace snd { diff --git a/game/sound/989snd/sndplay.cpp b/game/sound/989snd/sndplay.cpp index 6fd103e0e0..b0d5f2cdf0 100644 --- a/game/sound/989snd/sndplay.cpp +++ b/game/sound/989snd/sndplay.cpp @@ -1,6 +1,7 @@ -#include "player.h" #include +#include "player.h" + int main(int argc, char* argv[]) { snd::player player; unsigned bankid = 0; diff --git a/game/sound/989snd/soundbank.h b/game/sound/989snd/soundbank.h index 87217f4a6c..099b98e6f6 100644 --- a/game/sound/989snd/soundbank.h +++ b/game/sound/989snd/soundbank.h @@ -1,9 +1,12 @@ #pragma once #include -#include "vagvoice.h" + #include "locator.h" #include "sound_handler.h" +#include "vagvoice.h" + #include "common/common_types.h" + #include "../common/synth.h" namespace snd { diff --git a/game/sound/989snd/util.h b/game/sound/989snd/util.h index f02d597442..809871c3df 100644 --- a/game/sound/989snd/util.h +++ b/game/sound/989snd/util.h @@ -1,9 +1,11 @@ #pragma once #include -#include "game/sound/989snd/vagvoice.h" + #include "common/common_types.h" +#include "game/sound/989snd/vagvoice.h" + namespace snd { extern const u16 NotePitchTable[]; diff --git a/game/sound/989snd/vagvoice.cpp b/game/sound/989snd/vagvoice.cpp index a074c6a1a1..2a5cbcca59 100644 --- a/game/sound/989snd/vagvoice.cpp +++ b/game/sound/989snd/vagvoice.cpp @@ -1,10 +1,13 @@ // Copyright: 2021 - 2022, Ziemas // SPDX-License-Identifier: ISC #include "vagvoice.h" -#include "util.h" -#include "../common/voice.h" + #include +#include "util.h" + +#include "../common/voice.h" + namespace snd { voice_manager::voice_manager(synth& synth, locator& loc) : m_synth(synth), m_locator(loc) { m_pan_table = normalPanTable; diff --git a/game/sound/989snd/vagvoice.h b/game/sound/989snd/vagvoice.h index 66e6a2266f..5ce8544e99 100644 --- a/game/sound/989snd/vagvoice.h +++ b/game/sound/989snd/vagvoice.h @@ -3,8 +3,11 @@ #pragma once #include #include -#include "common/common_types.h" + #include "locator.h" + +#include "common/common_types.h" + #include "game/sound/common/synth.h" #include "game/sound/common/voice.h" diff --git a/game/sound/common/envelope.cpp b/game/sound/common/envelope.cpp index d4fd06ce9a..372dee0a40 100644 --- a/game/sound/common/envelope.cpp +++ b/game/sound/common/envelope.cpp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: ISC #include "envelope.h" + #include #include diff --git a/game/sound/common/envelope.h b/game/sound/common/envelope.h index 75e2c6ef40..e17a77a78d 100644 --- a/game/sound/common/envelope.h +++ b/game/sound/common/envelope.h @@ -3,6 +3,7 @@ #pragma once #include "bitfield.h" + #include "common/common_types.h" namespace snd { diff --git a/game/sound/common/sound_types.h b/game/sound/common/sound_types.h index 12b856a933..5803ca3451 100644 --- a/game/sound/common/sound_types.h +++ b/game/sound/common/sound_types.h @@ -1,7 +1,8 @@ #pragma once -#include "common/common_types.h" #include +#include "common/common_types.h" + namespace snd { struct vol_pair { diff --git a/game/sound/common/synth.cpp b/game/sound/common/synth.cpp index 5acc599d78..50de71864d 100644 --- a/game/sound/common/synth.cpp +++ b/game/sound/common/synth.cpp @@ -1,6 +1,7 @@ // Copyright: 2021 - 2022, Ziemas // SPDX-License-Identifier: ISC #include "synth.h" + #include namespace snd { diff --git a/game/sound/common/synth.h b/game/sound/common/synth.h index cf9dd9e519..e3457a19cd 100644 --- a/game/sound/common/synth.h +++ b/game/sound/common/synth.h @@ -1,15 +1,17 @@ // Copyright: 2021 - 2022, Ziemas // SPDX-License-Identifier: ISC #pragma once -#include "common/common_types.h" -#include "sound_types.h" -#include "voice.h" -#include "envelope.h" #include #include #include #include +#include "envelope.h" +#include "sound_types.h" +#include "voice.h" + +#include "common/common_types.h" + namespace snd { struct SpuVolume { /* 0 */ s16 left; diff --git a/game/sound/common/voice.cpp b/game/sound/common/voice.cpp index 39d0220ad2..162baf66a1 100644 --- a/game/sound/common/voice.cpp +++ b/game/sound/common/voice.cpp @@ -1,7 +1,9 @@ // Copyright: 2021 - 2022, Ziemas // SPDX-License-Identifier: ISC #include "voice.h" + #include + #include "third-party/fmt/core.h" namespace snd { diff --git a/game/sound/common/voice.h b/game/sound/common/voice.h index 0e91275c31..790e35bc56 100644 --- a/game/sound/common/voice.h +++ b/game/sound/common/voice.h @@ -5,7 +5,9 @@ #include "envelope.h" #include "fifo.h" #include "sound_types.h" + #include "common/common_types.h" + #include "third-party/fmt/core.h" namespace snd { diff --git a/game/sound/sdshim.cpp b/game/sound/sdshim.cpp index ed6f3d56d8..d8958741c5 100644 --- a/game/sound/sdshim.cpp +++ b/game/sound/sdshim.cpp @@ -1,7 +1,11 @@ #include "sdshim.h" + #include + #include "common/common_types.h" + #include "game/sound/common/voice.h" + #include "third-party/fmt/core.h" std::shared_ptr voice; diff --git a/game/sound/sdshim.h b/game/sound/sdshim.h index 19da15c4f2..5d3755d008 100644 --- a/game/sound/sdshim.h +++ b/game/sound/sdshim.h @@ -1,5 +1,6 @@ #pragma once #include "common/common_types.h" + #include "game/sound/common/voice.h" #define SD_VA_SSA ((0x20 << 8) + (0x01 << 6)) diff --git a/game/sound/sndshim.cpp b/game/sound/sndshim.cpp index 08c848c082..e01e0cc682 100644 --- a/game/sound/sndshim.cpp +++ b/game/sound/sndshim.cpp @@ -1,8 +1,11 @@ #include "sndshim.h" -#include "989snd/player.h" -#include "sdshim.h" + #include +#include "sdshim.h" + +#include "989snd/player.h" + std::unique_ptr player; void snd_StartSoundSystem() { diff --git a/game/system/Deci2Server.cpp b/game/system/Deci2Server.cpp index 7eae6cefc6..5519e6d6f6 100644 --- a/game/system/Deci2Server.cpp +++ b/game/system/Deci2Server.cpp @@ -4,10 +4,10 @@ * Works with deci2.cpp (sceDeci2) to implement the networking on target */ +// clang-format off #include "Deci2Server.h" #include "common/cross_sockets/XSocket.h" - #include "common/versions.h" #include #include @@ -21,6 +21,7 @@ #include #include #endif +// clang-format on Deci2Server::~Deci2Server() { // Cleanup the accept thread diff --git a/game/system/Deci2Server.h b/game/system/Deci2Server.h index c119ec86af..ee37e74107 100644 --- a/game/system/Deci2Server.h +++ b/game/system/Deci2Server.h @@ -1,9 +1,10 @@ #pragma once -#include "common/cross_sockets/XSocketServer.h" +#include #include "deci_common.h" -#include + +#include "common/cross_sockets/XSocketServer.h" /// @brief Basic implementation of a DECI2 server. /// Works with deci2.cpp(sceDeci2) to implement the networking on target diff --git a/game/system/IOP_Kernel.cpp b/game/system/IOP_Kernel.cpp index 09c45c0ba7..cd6dd05728 100644 --- a/game/system/IOP_Kernel.cpp +++ b/game/system/IOP_Kernel.cpp @@ -1,8 +1,11 @@ -#include #include "IOP_Kernel.h" -#include "game/sce/iop.h" + +#include + #include "common/util/Assert.h" +#include "game/sce/iop.h" + /*! * Create a new thread. Will not run the thread. */ diff --git a/game/system/IOP_Kernel.h b/game/system/IOP_Kernel.h index 692db9d7b3..629059df62 100644 --- a/game/system/IOP_Kernel.h +++ b/game/system/IOP_Kernel.h @@ -3,15 +3,17 @@ #ifndef JAK_IOP_KERNEL_H #define JAK_IOP_KERNEL_H -#include -#include -#include -#include -#include -#include #include +#include +#include +#include +#include +#include +#include + #include "common/common_types.h" #include "common/util/Assert.h" + #include "game/sce/iop.h" class IOP_Kernel; diff --git a/game/system/SystemThread.cpp b/game/system/SystemThread.cpp index af8f55d759..d96df8f142 100644 --- a/game/system/SystemThread.cpp +++ b/game/system/SystemThread.cpp @@ -1,4 +1,5 @@ #include "SystemThread.h" + #include "common/log/log.h" ////////////////////// diff --git a/game/system/SystemThread.h b/game/system/SystemThread.h index 1fc6664378..569f543a7e 100644 --- a/game/system/SystemThread.h +++ b/game/system/SystemThread.h @@ -8,12 +8,12 @@ #ifndef RUNTIME_SYSTEMTHREAD_H #define RUNTIME_SYSTEMTHREAD_H -#include -#include #include -#include -#include #include +#include +#include +#include +#include #include "common/util/Timer.h" diff --git a/game/system/iop_thread.cpp b/game/system/iop_thread.cpp index 3529c2af93..7c55f5f96b 100644 --- a/game/system/iop_thread.cpp +++ b/game/system/iop_thread.cpp @@ -5,10 +5,10 @@ #elif _WIN32 #include #endif -#include "SystemThread.h" - #include +#include "SystemThread.h" + IOP::IOP() {} void IOP::send_status(IOP_Status new_status) { diff --git a/game/system/iop_thread.h b/game/system/iop_thread.h index 668a091419..bb3c7a157a 100644 --- a/game/system/iop_thread.h +++ b/game/system/iop_thread.h @@ -3,9 +3,10 @@ #ifndef JAK1_IOP_THREAD_H #define JAK1_IOP_THREAD_H -#include "common/common_types.h" #include "IOP_Kernel.h" +#include "common/common_types.h" + enum IOP_Status { IOP_WAIT_FOR_LOAD, IOP_OVERLORD_INIT, IOP_OVERLORD_RUN, IOP_OVERLORD_STOP }; class IOP { diff --git a/game/system/newpad.cpp b/game/system/newpad.cpp index 813f2d4d92..6c9025a6dc 100644 --- a/game/system/newpad.cpp +++ b/game/system/newpad.cpp @@ -5,11 +5,13 @@ */ #include "newpad.h" + #include "common/log/log.h" #include "common/util/Assert.h" -#include "game/graphics/pipelines/opengl.h" // for GLFW macros #include +#include "game/graphics/pipelines/opengl.h" // for GLFW macros + namespace Pad { /* diff --git a/game/system/newpad.h b/game/system/newpad.h index de021e833b..e47f81f316 100644 --- a/game/system/newpad.h +++ b/game/system/newpad.h @@ -14,6 +14,7 @@ */ #include + #include "common/common_types.h" namespace Pad { diff --git a/game/system/vm/dmac.cpp b/game/system/vm/dmac.cpp index 0b3751e10d..d971f61ef7 100644 --- a/game/system/vm/dmac.cpp +++ b/game/system/vm/dmac.cpp @@ -5,11 +5,14 @@ */ #include "dmac.h" + #include "vm.h" -#include "game/runtime.h" -#include "game/kernel/kmalloc.h" + #include "common/log/log.h" +#include "game/kernel/kmalloc.h" +#include "game/runtime.h" + namespace VM { Ptr dmac; diff --git a/game/system/vm/dmac.h b/game/system/vm/dmac.h index 2f0c98ba33..6849b21380 100644 --- a/game/system/vm/dmac.h +++ b/game/system/vm/dmac.h @@ -7,6 +7,7 @@ */ #include "common/common_types.h" + #include "game/kernel/Ptr.h" namespace VM { diff --git a/game/system/vm/vm.cpp b/game/system/vm/vm.cpp index 5dfd96df23..c9dc9b3244 100644 --- a/game/system/vm/vm.cpp +++ b/game/system/vm/vm.cpp @@ -6,12 +6,16 @@ */ #include "vm.h" -#include "dmac.h" -#include "common/log/log.h" -#include "game/kernel/kscheme.h" + #include #include +#include "dmac.h" + +#include "common/log/log.h" + +#include "game/kernel/kscheme.h" + namespace VM { bool use = true; // enable VM by default, since we're debugging right now diff --git a/game/tools/subtitles/subtitle_editor.cpp b/game/tools/subtitles/subtitle_editor.cpp index 1e3075e1f7..a975bdf366 100644 --- a/game/tools/subtitles/subtitle_editor.cpp +++ b/game/tools/subtitles/subtitle_editor.cpp @@ -1,13 +1,15 @@ #include "subtitle_editor.h" -#include "third-party/imgui/imgui.h" -#include "third-party/imgui/imgui_stdlib.h" -#include "third-party/fmt/core.h" -#include "common/util/FileUtil.h" -#include "common/util/json_util.h" #include #include + #include "common/deserialization/subtitles/subtitles.h" +#include "common/util/FileUtil.h" +#include "common/util/json_util.h" + +#include "third-party/fmt/core.h" +#include "third-party/imgui/imgui.h" +#include "third-party/imgui/imgui_stdlib.h" SubtitleEditor::SubtitleEditor() : m_repl(8181) { std::string db_path = (file_util::get_jak_project_dir() / "game" / "assets" / "jak1" / diff --git a/game/tools/subtitles/subtitle_editor.h b/game/tools/subtitles/subtitle_editor.h index 97528a7570..4d979482c2 100644 --- a/game/tools/subtitles/subtitle_editor.h +++ b/game/tools/subtitles/subtitle_editor.h @@ -1,11 +1,13 @@ #pragma once -#include "common/serialization/subtitles/subtitles.h" #include -#include "common/nrepl/ReplClient.h" -#include "third-party/imgui/imgui.h" #include +#include "common/nrepl/ReplClient.h" +#include "common/serialization/subtitles/subtitles.h" + +#include "third-party/imgui/imgui.h" + class SubtitleEditorDB { public: struct Entry { diff --git a/goalc/build_level/FileInfo.cpp b/goalc/build_level/FileInfo.cpp index 1c5367143e..229a674573 100644 --- a/goalc/build_level/FileInfo.cpp +++ b/goalc/build_level/FileInfo.cpp @@ -1,7 +1,9 @@ #include "FileInfo.h" -#include "goalc/data_compiler/DataObjectGenerator.h" + #include "common/versions.h" +#include "goalc/data_compiler/DataObjectGenerator.h" + size_t FileInfo::add_to_object_file(DataObjectGenerator& gen) const { gen.align_to_basic(); gen.add_type_tag("file-info"); diff --git a/goalc/build_level/LevelFile.cpp b/goalc/build_level/LevelFile.cpp index b5902eb988..92a931707e 100644 --- a/goalc/build_level/LevelFile.cpp +++ b/goalc/build_level/LevelFile.cpp @@ -1,4 +1,5 @@ #include "LevelFile.h" + #include "goalc/data_compiler/DataObjectGenerator.h" size_t DrawableTreeArray::add_to_object_file(DataObjectGenerator& gen) const { diff --git a/goalc/build_level/LevelFile.h b/goalc/build_level/LevelFile.h index 29f53dd4c0..5ae7e48d72 100644 --- a/goalc/build_level/LevelFile.h +++ b/goalc/build_level/LevelFile.h @@ -1,16 +1,17 @@ #pragma once -#include -#include #include +#include +#include #include "common/common_types.h" + #include "goalc/build_level/FileInfo.h" #include "goalc/build_level/Tfrag.h" -#include "goalc/build_level/collide_pack.h" -#include "goalc/build_level/collide_common.h" #include "goalc/build_level/collide_bvh.h" +#include "goalc/build_level/collide_common.h" #include "goalc/build_level/collide_drawable.h" +#include "goalc/build_level/collide_pack.h" struct VisibilityString { std::vector bytes; diff --git a/goalc/build_level/ResLump.cpp b/goalc/build_level/ResLump.cpp index f70a09ee2b..541d37a11f 100644 --- a/goalc/build_level/ResLump.cpp +++ b/goalc/build_level/ResLump.cpp @@ -1,4 +1,5 @@ #include "ResLump.h" -#include "third-party/fmt/core.h" #include "goalc/data_compiler/DataObjectGenerator.h" + +#include "third-party/fmt/core.h" diff --git a/goalc/build_level/ResLump.h b/goalc/build_level/ResLump.h index 19b6ee6453..865faeeefc 100644 --- a/goalc/build_level/ResLump.h +++ b/goalc/build_level/ResLump.h @@ -1,7 +1,7 @@ #pragma once +#include #include #include -#include #include "common/common_types.h" diff --git a/goalc/build_level/TexturePool.h b/goalc/build_level/TexturePool.h index 2cef160246..5309eb7515 100644 --- a/goalc/build_level/TexturePool.h +++ b/goalc/build_level/TexturePool.h @@ -1,8 +1,8 @@ #pragma once -#include -#include #include +#include +#include #include "common/custom_data/Tfrag3Data.h" diff --git a/goalc/build_level/Tfrag.cpp b/goalc/build_level/Tfrag.cpp index a15c5483f1..a5ac595584 100644 --- a/goalc/build_level/Tfrag.cpp +++ b/goalc/build_level/Tfrag.cpp @@ -1,9 +1,11 @@ +#include "Tfrag.h" + #include -#include "Tfrag.h" #include "common/custom_data/pack_helpers.h" -#include "goalc/data_compiler/DataObjectGenerator.h" + #include "goalc/build_level/gltf_mesh_extract.h" +#include "goalc/data_compiler/DataObjectGenerator.h" void tfrag_from_gltf(const gltf_mesh_extract::TfragOutput& mesh_extract_out, DrawableTreeTfrag& out, diff --git a/goalc/build_level/Tfrag.h b/goalc/build_level/Tfrag.h index f9c137a473..5fe9198a0c 100644 --- a/goalc/build_level/Tfrag.h +++ b/goalc/build_level/Tfrag.h @@ -3,6 +3,7 @@ #include #include "common/custom_data/Tfrag3Data.h" + #include "goalc/build_level/TexturePool.h" #include "goalc/build_level/gltf_mesh_extract.h" diff --git a/goalc/build_level/build_level.cpp b/goalc/build_level/build_level.cpp index 9edb3586ef..cc5a77a13f 100644 --- a/goalc/build_level/build_level.cpp +++ b/goalc/build_level/build_level.cpp @@ -1,16 +1,17 @@ -#include "third-party/fmt/core.h" -#include "common/util/json_util.h" -#include "common/util/FileUtil.h" +#include "common/custom_data/Tfrag3Data.h" #include "common/log/log.h" -#include "goalc/build_level/LevelFile.h" +#include "common/util/FileUtil.h" +#include "common/util/compress.h" +#include "common/util/json_util.h" + #include "goalc/build_level/FileInfo.h" +#include "goalc/build_level/LevelFile.h" #include "goalc/build_level/Tfrag.h" -#include "goalc/build_level/gltf_mesh_extract.h" #include "goalc/build_level/collide_bvh.h" #include "goalc/build_level/collide_pack.h" +#include "goalc/build_level/gltf_mesh_extract.h" -#include "common/custom_data/Tfrag3Data.h" -#include "common/util/compress.h" +#include "third-party/fmt/core.h" void save_pc_data(const std::string& nickname, tfrag3::Level& data) { Serializer ser; diff --git a/goalc/build_level/build_level.h b/goalc/build_level/build_level.h index afe685daac..e37d1ef15c 100644 --- a/goalc/build_level/build_level.h +++ b/goalc/build_level/build_level.h @@ -1,7 +1,7 @@ #pragma once -#include #include +#include bool run_build_level(const std::string& input_file, const std::string& output_file); std::vector get_build_level_deps(const std::string& input_file); \ No newline at end of file diff --git a/goalc/build_level/collide_bvh.cpp b/goalc/build_level/collide_bvh.cpp index 821c7e93ff..ece6a40b37 100644 --- a/goalc/build_level/collide_bvh.cpp +++ b/goalc/build_level/collide_bvh.cpp @@ -1,8 +1,9 @@ +#include "collide_bvh.h" + #include -#include "collide_bvh.h" -#include "common/util/Assert.h" #include "common/log/log.h" +#include "common/util/Assert.h" #include "common/util/Timer.h" // Collision BVH algorithm diff --git a/goalc/build_level/collide_bvh.h b/goalc/build_level/collide_bvh.h index 11b4f4bdaa..c4abe6c0ca 100644 --- a/goalc/build_level/collide_bvh.h +++ b/goalc/build_level/collide_bvh.h @@ -1,6 +1,7 @@ #pragma once #include + #include "goalc/build_level/collide_common.h" // requirements: diff --git a/goalc/build_level/collide_drawable.cpp b/goalc/build_level/collide_drawable.cpp index 91cde30a47..788f5e0584 100644 --- a/goalc/build_level/collide_drawable.cpp +++ b/goalc/build_level/collide_drawable.cpp @@ -1,7 +1,9 @@ #include "collide_drawable.h" -#include "goalc/data_compiler/DataObjectGenerator.h" + #include "common/util/Assert.h" +#include "goalc/data_compiler/DataObjectGenerator.h" + /* (deftype drawable (basic) ((id int16 :offset-assert 4) diff --git a/goalc/build_level/collide_pack.cpp b/goalc/build_level/collide_pack.cpp index 512167f05a..fe7c9d72ca 100644 --- a/goalc/build_level/collide_pack.cpp +++ b/goalc/build_level/collide_pack.cpp @@ -1,8 +1,9 @@ +#include "collide_pack.h" + #include -#include "collide_pack.h" -#include "common/util/Assert.h" #include "common/log/log.h" +#include "common/util/Assert.h" #include "common/util/Timer.h" struct PackedU16Verts { diff --git a/goalc/build_level/color_quantization.cpp b/goalc/build_level/color_quantization.cpp index 91784dc117..5ff39cb519 100644 --- a/goalc/build_level/color_quantization.cpp +++ b/goalc/build_level/color_quantization.cpp @@ -1,7 +1,9 @@ -#include #include "color_quantization.h" -#include "common/util/Assert.h" + +#include + #include "common/log/log.h" +#include "common/util/Assert.h" /*! * Just removes duplicate colors, which can work if there are only a few unique colors. diff --git a/goalc/build_level/color_quantization.h b/goalc/build_level/color_quantization.h index 44b5ba68cf..f0b92a81de 100644 --- a/goalc/build_level/color_quantization.h +++ b/goalc/build_level/color_quantization.h @@ -1,6 +1,7 @@ #pragma once #include + #include "common/common_types.h" #include "common/math/Vector.h" diff --git a/goalc/build_level/gltf_mesh_extract.cpp b/goalc/build_level/gltf_mesh_extract.cpp index e929052534..26e6c39746 100644 --- a/goalc/build_level/gltf_mesh_extract.cpp +++ b/goalc/build_level/gltf_mesh_extract.cpp @@ -4,11 +4,14 @@ #include #include "gltf_mesh_extract.h" -#include "goalc/build_level/color_quantization.h" -#include "third-party/tiny_gltf/tiny_gltf.h" + #include "common/log/log.h" -#include "common/util/Timer.h" #include "common/math/geometry.h" +#include "common/util/Timer.h" + +#include "goalc/build_level/color_quantization.h" + +#include "third-party/tiny_gltf/tiny_gltf.h" namespace gltf_mesh_extract { diff --git a/goalc/build_level/gltf_mesh_extract.h b/goalc/build_level/gltf_mesh_extract.h index 5bc0e47606..f429f07b9c 100644 --- a/goalc/build_level/gltf_mesh_extract.h +++ b/goalc/build_level/gltf_mesh_extract.h @@ -3,6 +3,7 @@ #include #include "common/custom_data/Tfrag3Data.h" + #include "goalc/build_level/TexturePool.h" #include "goalc/build_level/collide_common.h" diff --git a/goalc/compiler/CodeGenerator.cpp b/goalc/compiler/CodeGenerator.cpp index 50eee36f19..98be758210 100644 --- a/goalc/compiler/CodeGenerator.cpp +++ b/goalc/compiler/CodeGenerator.cpp @@ -5,13 +5,17 @@ * Currently owns the logic for emitting the function prologues/epilogues and stack spill ops. */ -#include -#include "goalc/debugger/DebugInfo.h" -#include "third-party/fmt/core.h" #include "CodeGenerator.h" -#include "goalc/emitter/IGen.h" + +#include + #include "IR.h" +#include "goalc/debugger/DebugInfo.h" +#include "goalc/emitter/IGen.h" + +#include "third-party/fmt/core.h" + using namespace emitter; CodeGenerator::CodeGenerator(FileEnv* env, DebugInfo* debug_info) diff --git a/goalc/compiler/CodeGenerator.h b/goalc/compiler/CodeGenerator.h index bc97bcd5c5..958c197d7e 100644 --- a/goalc/compiler/CodeGenerator.h +++ b/goalc/compiler/CodeGenerator.h @@ -8,6 +8,7 @@ #pragma once #include "Env.h" + #include "goalc/emitter/ObjectGenerator.h" class DebugInfo; diff --git a/goalc/compiler/Compiler.cpp b/goalc/compiler/Compiler.cpp index 52100e7a4c..e6ecf7462d 100644 --- a/goalc/compiler/Compiler.cpp +++ b/goalc/compiler/Compiler.cpp @@ -1,14 +1,19 @@ #include "Compiler.h" + #include #include + #include "CompilerException.h" #include "IR.h" + +#include "common/goos/PrettyPrinter.h" #include "common/link_types.h" + #include "goalc/make/Tools.h" #include "goalc/regalloc/Allocator.h" #include "goalc/regalloc/Allocator_v2.h" + #include "third-party/fmt/core.h" -#include "common/goos/PrettyPrinter.h" using namespace goos; diff --git a/goalc/compiler/Compiler.h b/goalc/compiler/Compiler.h index 03ec68db59..19e8761c2d 100644 --- a/goalc/compiler/Compiler.h +++ b/goalc/compiler/Compiler.h @@ -1,26 +1,26 @@ #pragma once #include +#include #include -#include "third-party/fmt/color.h" -#include "third-party/fmt/core.h" - #include "common/goos/Interpreter.h" #include "common/goos/ReplUtils.h" #include "common/type_system/TypeSystem.h" + #include "goalc/compiler/CompilerException.h" #include "goalc/compiler/CompilerSettings.h" #include "goalc/compiler/Env.h" #include "goalc/compiler/IR.h" #include "goalc/compiler/SymbolInfo.h" +#include "goalc/data_compiler/game_text_common.h" #include "goalc/debugger/Debugger.h" #include "goalc/emitter/Register.h" #include "goalc/listener/Listener.h" #include "goalc/make/MakeSystem.h" -#include "goalc/data_compiler/game_text_common.h" -#include +#include "third-party/fmt/color.h" +#include "third-party/fmt/core.h" enum MathMode { MATH_INT, MATH_BINT, MATH_FLOAT, MATH_INVALID }; diff --git a/goalc/compiler/CompilerSettings.h b/goalc/compiler/CompilerSettings.h index 634e189f61..61d788d3a5 100644 --- a/goalc/compiler/CompilerSettings.h +++ b/goalc/compiler/CompilerSettings.h @@ -3,8 +3,9 @@ #ifndef JAK_COMPILERSETTINGS_H #define JAK_COMPILERSETTINGS_H -#include #include +#include + #include "common/goos/Object.h" class CompilerSettings { diff --git a/goalc/compiler/ConstantValue.h b/goalc/compiler/ConstantValue.h index 44a1c5071e..af02b21ebe 100644 --- a/goalc/compiler/ConstantValue.h +++ b/goalc/compiler/ConstantValue.h @@ -1,10 +1,12 @@ #pragma once #include + #include "common/common_types.h" -#include "common/util/BitUtils.h" -#include "third-party/fmt/core.h" #include "common/util/Assert.h" +#include "common/util/BitUtils.h" + +#include "third-party/fmt/core.h" struct U128 { U128() = default; diff --git a/goalc/compiler/Env.cpp b/goalc/compiler/Env.cpp index a157cf7127..de604c7aa0 100644 --- a/goalc/compiler/Env.cpp +++ b/goalc/compiler/Env.cpp @@ -1,9 +1,13 @@ -#include -#include "third-party/fmt/core.h" #include "Env.h" + +#include + #include "IR.h" + #include "common/goos/Reader.h" +#include "third-party/fmt/core.h" + /////////////////// // Env /////////////////// diff --git a/goalc/compiler/Env.h b/goalc/compiler/Env.h index 2ef9cbcd76..64a3ba7ce0 100644 --- a/goalc/compiler/Env.h +++ b/goalc/compiler/Env.h @@ -6,16 +6,19 @@ * manages the memory for stuff generated during compiling. */ -#include #include +#include #include -#include "common/type_system/TypeSpec.h" -#include "goalc/regalloc/allocator_interface.h" -#include "common/goos/Object.h" -#include "StaticObject.h" + #include "Label.h" +#include "StaticObject.h" #include "Val.h" +#include "common/goos/Object.h" +#include "common/type_system/TypeSpec.h" + +#include "goalc/regalloc/allocator_interface.h" + class FileEnv; class BlockEnv; class FunctionEnv; diff --git a/goalc/compiler/IR.cpp b/goalc/compiler/IR.cpp index 635f0650d4..0cf498fbcc 100644 --- a/goalc/compiler/IR.cpp +++ b/goalc/compiler/IR.cpp @@ -1,9 +1,13 @@ -#include #include "IR.h" -#include "goalc/emitter/IGen.h" -#include "third-party/fmt/core.h" + +#include + #include "common/symbols.h" +#include "goalc/emitter/IGen.h" + +#include "third-party/fmt/core.h" + using namespace emitter; using namespace jak1_symbols; // TODO jak 1 symbols namespace { diff --git a/goalc/compiler/IR.h b/goalc/compiler/IR.h index 6b37e6716b..477d5036fe 100644 --- a/goalc/compiler/IR.h +++ b/goalc/compiler/IR.h @@ -1,11 +1,13 @@ #pragma once #include + #include "CodeGenerator.h" -#include "goalc/regalloc/allocator_interface.h" #include "Val.h" + #include "goalc/emitter/ObjectGenerator.h" #include "goalc/emitter/Register.h" +#include "goalc/regalloc/allocator_interface.h" class IR { public: diff --git a/goalc/compiler/Lambda.h b/goalc/compiler/Lambda.h index 8be93f675b..ed8c17cf31 100644 --- a/goalc/compiler/Lambda.h +++ b/goalc/compiler/Lambda.h @@ -4,6 +4,7 @@ #define JAK_LAMBDA_H #include "common/goos/Object.h" +#include "common/type_system/TypeSpec.h" // note - we cannot easily reuse the GOOS argument system because GOAL's is slightly different. // there's no rest or keyword support. diff --git a/goalc/compiler/StaticObject.cpp b/goalc/compiler/StaticObject.cpp index 6343d13a5d..514c8517e0 100644 --- a/goalc/compiler/StaticObject.cpp +++ b/goalc/compiler/StaticObject.cpp @@ -1,8 +1,11 @@ -#include "third-party/fmt/core.h" #include "StaticObject.h" + #include "common/goal_constants.h" + #include "goalc/compiler/Env.h" +#include "third-party/fmt/core.h" + namespace { template uint32_t push_data_to_byte_vector(T data, std::vector& v) { diff --git a/goalc/compiler/StaticObject.h b/goalc/compiler/StaticObject.h index 95a19ce501..26cd318b68 100644 --- a/goalc/compiler/StaticObject.h +++ b/goalc/compiler/StaticObject.h @@ -2,11 +2,13 @@ #include #include + #include "common/type_system/TypeSpec.h" -#include "goalc/emitter/ObjectGenerator.h" -#include "goalc/compiler/ConstantValue.h" #include "common/util/BitUtils.h" +#include "goalc/compiler/ConstantValue.h" +#include "goalc/emitter/ObjectGenerator.h" + class FunctionEnv; class StaticObject { diff --git a/goalc/compiler/SymbolInfo.h b/goalc/compiler/SymbolInfo.h index ca66c1320d..56f4070b15 100644 --- a/goalc/compiler/SymbolInfo.h +++ b/goalc/compiler/SymbolInfo.h @@ -1,11 +1,12 @@ #pragma once -#include -#include #include -#include "common/util/Trie.h" +#include +#include + #include "common/goos/Object.h" #include "common/util/Assert.h" +#include "common/util/Trie.h" /*! * Info about a single symbol, representing one of: diff --git a/goalc/compiler/Util.cpp b/goalc/compiler/Util.cpp index eb8751aa49..38ec370076 100644 --- a/goalc/compiler/Util.cpp +++ b/goalc/compiler/Util.cpp @@ -1,8 +1,9 @@ -#include "goalc/compiler/Compiler.h" -#include "goalc/compiler/IR.h" #include "common/goos/ParseHelpers.h" #include "common/type_system/deftype.h" +#include "goalc/compiler/Compiler.h" +#include "goalc/compiler/IR.h" + /*! * Parse arguments into a goos::Arguments format. */ diff --git a/goalc/compiler/Val.cpp b/goalc/compiler/Val.cpp index 3a15a1c924..c79c64ea4c 100644 --- a/goalc/compiler/Val.cpp +++ b/goalc/compiler/Val.cpp @@ -1,8 +1,10 @@ -#include "third-party/fmt/core.h" #include "Val.h" + #include "Env.h" #include "IR.h" +#include "third-party/fmt/core.h" + /*! * Fallback to_gpr if a more optimized one is not provided. */ diff --git a/goalc/compiler/Val.h b/goalc/compiler/Val.h index db8e4cc707..12f7958241 100644 --- a/goalc/compiler/Val.h +++ b/goalc/compiler/Val.h @@ -5,15 +5,18 @@ * The GOAL Value. A value represents a place (where the value is stored) and a type. */ -#include -#include -#include #include -#include "common/type_system/TypeSystem.h" -#include "goalc/regalloc/IRegister.h" +#include +#include +#include + #include "Lambda.h" #include "StaticObject.h" + +#include "common/type_system/TypeSystem.h" + #include "goalc/compiler/ConstantValue.h" +#include "goalc/regalloc/IRegister.h" class RegVal; class Env; diff --git a/goalc/compiler/compilation/CompilerControl.cpp b/goalc/compiler/compilation/CompilerControl.cpp index 563a85c31e..0bac51418d 100644 --- a/goalc/compiler/compilation/CompilerControl.cpp +++ b/goalc/compiler/compilation/CompilerControl.cpp @@ -11,6 +11,7 @@ #include "common/util/DgoWriter.h" #include "common/util/FileUtil.h" #include "common/util/Timer.h" + #include "goalc/compiler/Compiler.h" #include "goalc/compiler/IR.h" #include "goalc/data_compiler/dir_tpages.h" diff --git a/goalc/compiler/compilation/ControlFlow.cpp b/goalc/compiler/compilation/ControlFlow.cpp index c8eafb0b33..4a122667d8 100644 --- a/goalc/compiler/compilation/ControlFlow.cpp +++ b/goalc/compiler/compilation/ControlFlow.cpp @@ -3,9 +3,10 @@ * Compiler forms related to conditional branching and control flow. */ -#include "goalc/compiler/Compiler.h" #include "common/goos/ParseHelpers.h" +#include "goalc/compiler/Compiler.h" + /*! * Convert an expression into a GoalCondition for use in a conditional branch. * diff --git a/goalc/compiler/compilation/Debug.cpp b/goalc/compiler/compilation/Debug.cpp index ef5cd8e2d6..4d13ec2939 100644 --- a/goalc/compiler/compilation/Debug.cpp +++ b/goalc/compiler/compilation/Debug.cpp @@ -1,6 +1,8 @@ +#include "common/util/FileUtil.h" + #include "goalc/compiler/Compiler.h" #include "goalc/debugger/disassemble.h" -#include "common/util/FileUtil.h" + #include "third-party/fmt/core.h" u32 Compiler::parse_address_spec(const goos::Object& form) { diff --git a/goalc/compiler/compilation/Define.cpp b/goalc/compiler/compilation/Define.cpp index 313d5f5a33..2d3603a57e 100644 --- a/goalc/compiler/compilation/Define.cpp +++ b/goalc/compiler/compilation/Define.cpp @@ -3,9 +3,10 @@ * Forms which define or set things. */ -#include "goalc/compiler/Compiler.h" #include "common/log/log.h" +#include "goalc/compiler/Compiler.h" + /*! * Define or set a global value. Has some special magic to store data for functions which may be * inlined. diff --git a/goalc/compiler/compilation/Function.cpp b/goalc/compiler/compilation/Function.cpp index 70691a21c9..3e0eac37cc 100644 --- a/goalc/compiler/compilation/Function.cpp +++ b/goalc/compiler/compilation/Function.cpp @@ -5,6 +5,7 @@ #include "goalc/compiler/Compiler.h" #include "goalc/emitter/CallingConvention.h" + #include "third-party/fmt/core.h" namespace { diff --git a/goalc/compiler/compilation/Macro.cpp b/goalc/compiler/compilation/Macro.cpp index 4d67177551..3834ca0097 100644 --- a/goalc/compiler/compilation/Macro.cpp +++ b/goalc/compiler/compilation/Macro.cpp @@ -1,7 +1,9 @@ -#include "goalc/compiler/Compiler.h" -#include "third-party/fmt/core.h" #include "common/goos/PrettyPrinter.h" +#include "goalc/compiler/Compiler.h" + +#include "third-party/fmt/core.h" + using namespace goos; /*! diff --git a/goalc/compiler/compilation/Math.cpp b/goalc/compiler/compilation/Math.cpp index aa04024b6c..0eca1167af 100644 --- a/goalc/compiler/compilation/Math.cpp +++ b/goalc/compiler/compilation/Math.cpp @@ -1,7 +1,9 @@ -#include "goalc/compiler/Compiler.h" -#include "common/util/BitUtils.h" #include +#include "common/util/BitUtils.h" + +#include "goalc/compiler/Compiler.h" + MathMode Compiler::get_math_mode(const TypeSpec& ts) { if (m_ts.tc(m_ts.make_typespec("binteger"), ts)) { return MATH_BINT; diff --git a/goalc/compiler/compilation/State.cpp b/goalc/compiler/compilation/State.cpp index c4068781f4..6ce4d36729 100644 --- a/goalc/compiler/compilation/State.cpp +++ b/goalc/compiler/compilation/State.cpp @@ -1,6 +1,7 @@ -#include "goalc/compiler/Compiler.h" #include "common/type_system/state.h" +#include "goalc/compiler/Compiler.h" + /*! * Helper func for compiling the set!'s within defstates */ diff --git a/goalc/compiler/compilation/Static.cpp b/goalc/compiler/compilation/Static.cpp index 1b562ad66d..b3c9e3297c 100644 --- a/goalc/compiler/compilation/Static.cpp +++ b/goalc/compiler/compilation/Static.cpp @@ -4,10 +4,12 @@ * This is the front end for things in StaticObject.cpp */ -#include "goalc/compiler/Compiler.h" -#include "third-party/fmt/core.h" #include "common/goos/ParseHelpers.h" +#include "goalc/compiler/Compiler.h" + +#include "third-party/fmt/core.h" + /*! * Compile the fields of a static structure into the given StaticStructure*, applying an offset. * This can be used to generate an entire structure (set offset to 0), or to fill out an inline diff --git a/goalc/compiler/compilation/Type.cpp b/goalc/compiler/compilation/Type.cpp index 44c575eae2..c730125754 100644 --- a/goalc/compiler/compilation/Type.cpp +++ b/goalc/compiler/compilation/Type.cpp @@ -1,10 +1,12 @@ -#include "goalc/compiler/Compiler.h" -#include "third-party/fmt/core.h" #include "common/type_system/defenum.h" #include "common/type_system/deftype.h" -#include "goalc/emitter/CallingConvention.h" -#include "common/util/math_util.h" #include "common/type_system/state.h" +#include "common/util/math_util.h" + +#include "goalc/compiler/Compiler.h" +#include "goalc/emitter/CallingConvention.h" + +#include "third-party/fmt/core.h" namespace { diff --git a/goalc/data_compiler/DataObjectGenerator.cpp b/goalc/data_compiler/DataObjectGenerator.cpp index 6864bfa2f6..27d6fb05ad 100644 --- a/goalc/data_compiler/DataObjectGenerator.cpp +++ b/goalc/data_compiler/DataObjectGenerator.cpp @@ -1,6 +1,8 @@ -#include -#include #include "DataObjectGenerator.h" + +#include +#include + #include "common/link_types.h" #include "common/util/Assert.h" diff --git a/goalc/data_compiler/DataObjectGenerator.h b/goalc/data_compiler/DataObjectGenerator.h index 97e5b32dd1..5ef2175be0 100644 --- a/goalc/data_compiler/DataObjectGenerator.h +++ b/goalc/data_compiler/DataObjectGenerator.h @@ -1,10 +1,11 @@ #pragma once -#include "common/common_types.h" -#include #include +#include #include +#include "common/common_types.h" + class DataObjectGenerator { public: int add_word(u32 word); diff --git a/goalc/data_compiler/dir_tpages.cpp b/goalc/data_compiler/dir_tpages.cpp index de2e3b1917..fd898f51bc 100644 --- a/goalc/data_compiler/dir_tpages.cpp +++ b/goalc/data_compiler/dir_tpages.cpp @@ -1,8 +1,9 @@ #include "dir_tpages.h" #include "DataObjectGenerator.h" -#include "common/goos/Reader.h" + #include "common/goos/ParseHelpers.h" +#include "common/goos/Reader.h" #include "common/util/FileUtil.h" void compile_dir_tpages(const std::string& filename) { diff --git a/goalc/data_compiler/game_count.cpp b/goalc/data_compiler/game_count.cpp index c396f2553c..3eeb68ba53 100644 --- a/goalc/data_compiler/game_count.cpp +++ b/goalc/data_compiler/game_count.cpp @@ -1,9 +1,12 @@ +#include "game_count.h" + #include + #include "DataObjectGenerator.h" + #include "common/goos/ParseHelpers.h" #include "common/goos/Reader.h" #include "common/util/FileUtil.h" -#include "game_count.h" void compile_game_count(const std::string& filename) { struct Count { diff --git a/goalc/data_compiler/game_text_common.cpp b/goalc/data_compiler/game_text_common.cpp index 7ff7f36c71..7ae7b15540 100644 --- a/goalc/data_compiler/game_text_common.cpp +++ b/goalc/data_compiler/game_text_common.cpp @@ -11,16 +11,20 @@ * This kind of file is completely custom. */ +#include "game_text_common.h" + #include #include -#include "game_text_common.h" -#include "common/goos/Reader.h" + #include "DataObjectGenerator.h" + +#include "common/goos/ParseHelpers.h" +#include "common/goos/Reader.h" +#include "common/serialization/subtitles/subtitles.h" #include "common/util/FileUtil.h" #include "common/util/FontUtils.h" -#include "common/goos/ParseHelpers.h" + #include "third-party/fmt/core.h" -#include "common/serialization/subtitles/subtitles.h" namespace { diff --git a/goalc/data_compiler/game_text_common.h b/goalc/data_compiler/game_text_common.h index 7f0699cfb9..19200dd25b 100644 --- a/goalc/data_compiler/game_text_common.h +++ b/goalc/data_compiler/game_text_common.h @@ -1,12 +1,13 @@ #pragma once -#include "common/util/FontUtils.h" -#include "common/util/Assert.h" -#include #include +#include +#include #include #include -#include + #include "common/serialization/subtitles/subtitles.h" +#include "common/util/Assert.h" +#include "common/util/FontUtils.h" void compile_game_text(const std::vector& filenames, GameTextVersion text_ver, diff --git a/goalc/debugger/DebugInfo.cpp b/goalc/debugger/DebugInfo.cpp index 52d0870277..1dbc08542c 100644 --- a/goalc/debugger/DebugInfo.cpp +++ b/goalc/debugger/DebugInfo.cpp @@ -1,5 +1,7 @@ -#include #include "DebugInfo.h" + +#include + #include "third-party/fmt/core.h" DebugInfo::DebugInfo(std::string obj_name) : m_obj_name(std::move(obj_name)) {} diff --git a/goalc/debugger/DebugInfo.h b/goalc/debugger/DebugInfo.h index 98640f3d54..c38252ac99 100644 --- a/goalc/debugger/DebugInfo.h +++ b/goalc/debugger/DebugInfo.h @@ -1,15 +1,17 @@ #pragma once -#include -#include -#include #include +#include +#include #include +#include + #include "common/common_types.h" -#include "goalc/emitter/Instruction.h" -#include "goalc/debugger/disassemble.h" #include "common/util/Assert.h" +#include "goalc/debugger/disassemble.h" +#include "goalc/emitter/Instruction.h" + class FunctionEnv; /*! diff --git a/goalc/debugger/Debugger.cpp b/goalc/debugger/Debugger.cpp index d3d3e3b970..f7f1701863 100644 --- a/goalc/debugger/Debugger.cpp +++ b/goalc/debugger/Debugger.cpp @@ -5,14 +5,17 @@ */ #include "Debugger.h" + #include "common/goal_constants.h" #include "common/symbols.h" +#include "common/util/Assert.h" #include "common/util/Timer.h" + #include "goalc/debugger/disassemble.h" #include "goalc/emitter/Register.h" #include "goalc/listener/Listener.h" + #include "third-party/fmt/core.h" -#include "common/util/Assert.h" /*! * Is the target halted? If we don't know or aren't connected, returns false. diff --git a/goalc/debugger/Debugger.h b/goalc/debugger/Debugger.h index 5fc8df3fb9..45a2764aad 100644 --- a/goalc/debugger/Debugger.h +++ b/goalc/debugger/Debugger.h @@ -12,9 +12,12 @@ #include #include #include + #include "DebugInfo.h" + #include "common/common_types.h" #include "common/cross_os_debug/xdbg.h" + #include "goalc/listener/MemoryMap.h" namespace listener { diff --git a/goalc/debugger/disassemble.cpp b/goalc/debugger/disassemble.cpp index 090fb80186..8c014869ac 100644 --- a/goalc/debugger/disassemble.cpp +++ b/goalc/debugger/disassemble.cpp @@ -1,10 +1,13 @@ #include "disassemble.h" + +#include "common/goos/Reader.h" + #include "Zydis/Zydis.h" -#include "third-party/fmt/core.h" #include "goalc/compiler/Env.h" #include "goalc/compiler/IR.h" -#include "common/goos/Reader.h" + #include "third-party/fmt/color.h" +#include "third-party/fmt/core.h" std::string disassemble_x86(u8* data, int len, u64 base_addr) { std::string result; diff --git a/goalc/debugger/disassemble.h b/goalc/debugger/disassemble.h index 526b47e1e7..b75a5af0c1 100644 --- a/goalc/debugger/disassemble.h +++ b/goalc/debugger/disassemble.h @@ -2,7 +2,9 @@ #include #include + #include "common/common_types.h" + #include "goalc/emitter/Instruction.h" class FunctionEnv; diff --git a/goalc/emitter/CallingConvention.cpp b/goalc/emitter/CallingConvention.cpp index 4228a39588..0e64a9b839 100644 --- a/goalc/emitter/CallingConvention.cpp +++ b/goalc/emitter/CallingConvention.cpp @@ -1,4 +1,5 @@ #include "CallingConvention.h" + #include "common/util/Assert.h" CallingConvention get_function_calling_convention(const TypeSpec& function_type, diff --git a/goalc/emitter/CallingConvention.h b/goalc/emitter/CallingConvention.h index a6338d4441..5ac144c561 100644 --- a/goalc/emitter/CallingConvention.h +++ b/goalc/emitter/CallingConvention.h @@ -1,9 +1,10 @@ #pragma once -#include #include +#include #include "common/type_system/TypeSystem.h" + #include "goalc/emitter/Register.h" struct CallingConvention { diff --git a/goalc/emitter/CodeTester.cpp b/goalc/emitter/CodeTester.cpp index 542df8945a..479fbceb62 100644 --- a/goalc/emitter/CodeTester.cpp +++ b/goalc/emitter/CodeTester.cpp @@ -13,8 +13,10 @@ #endif #include + #include "CodeTester.h" #include "IGen.h" + #include "third-party/fmt/core.h" namespace emitter { diff --git a/goalc/emitter/CodeTester.h b/goalc/emitter/CodeTester.h index 3a087c20ef..aaa9650856 100644 --- a/goalc/emitter/CodeTester.h +++ b/goalc/emitter/CodeTester.h @@ -11,11 +11,14 @@ #ifndef JAK_CODETESTER_H #define JAK_CODETESTER_H -#include -#include "common/common_types.h" -#include "Register.h" -#include "Instruction.h" +#include #include +#include + +#include "Instruction.h" +#include "Register.h" + +#include "common/common_types.h" namespace emitter { class CodeTester { diff --git a/goalc/emitter/IGen.h b/goalc/emitter/IGen.h index 261bab823c..24ac7554b1 100644 --- a/goalc/emitter/IGen.h +++ b/goalc/emitter/IGen.h @@ -1,8 +1,10 @@ #pragma once -#include "Register.h" -#include "Instruction.h" #include + +#include "Instruction.h" +#include "Register.h" + #include "common/util/Assert.h" namespace emitter { diff --git a/goalc/emitter/ObjectFileData.h b/goalc/emitter/ObjectFileData.h index 8ae8565438..9cb62803e0 100644 --- a/goalc/emitter/ObjectFileData.h +++ b/goalc/emitter/ObjectFileData.h @@ -5,6 +5,7 @@ #include #include + #include "common/common_types.h" #include "common/link_types.h" diff --git a/goalc/emitter/ObjectGenerator.cpp b/goalc/emitter/ObjectGenerator.cpp index 538a6b43ca..40249f10e6 100644 --- a/goalc/emitter/ObjectGenerator.cpp +++ b/goalc/emitter/ObjectGenerator.cpp @@ -14,10 +14,13 @@ */ #include "ObjectGenerator.h" -#include "goalc/debugger/DebugInfo.h" + #include "common/goal_constants.h" -#include "common/versions.h" #include "common/type_system/TypeSystem.h" +#include "common/versions.h" + +#include "goalc/debugger/DebugInfo.h" + #include "third-party/fmt/core.h" namespace emitter { diff --git a/goalc/emitter/ObjectGenerator.h b/goalc/emitter/ObjectGenerator.h index 11cb400e1b..90702b5ae3 100644 --- a/goalc/emitter/ObjectGenerator.h +++ b/goalc/emitter/ObjectGenerator.h @@ -8,8 +8,10 @@ #include #include #include -#include "ObjectFileData.h" + #include "Instruction.h" +#include "ObjectFileData.h" + #include "goalc/debugger/DebugInfo.h" struct FunctionDebugInfo; diff --git a/goalc/emitter/Register.cpp b/goalc/emitter/Register.cpp index 57ac46e8ff..30bd7b6d20 100644 --- a/goalc/emitter/Register.cpp +++ b/goalc/emitter/Register.cpp @@ -1,4 +1,5 @@ #include "Register.h" + #include namespace emitter { diff --git a/goalc/emitter/Register.h b/goalc/emitter/Register.h index 4edce8b644..a819657888 100644 --- a/goalc/emitter/Register.h +++ b/goalc/emitter/Register.h @@ -6,8 +6,9 @@ */ #include -#include #include +#include + #include "common/common_types.h" #include "common/goal_constants.h" #include "common/util/Assert.h" diff --git a/goalc/listener/Listener.cpp b/goalc/listener/Listener.cpp index 27a8b7e9b3..84943bcd99 100644 --- a/goalc/listener/Listener.cpp +++ b/goalc/listener/Listener.cpp @@ -3,10 +3,12 @@ * The Listener can connect to a Deci2Server for debugging. */ +// clang-format off #ifdef __linux__ #include -#include + #include +#include #include #elif _WIN32 #define WIN32_LEAN_AND_MEAN @@ -18,18 +20,20 @@ #undef max #endif -#include "common/cross_sockets/XSocket.h" - -#include -#include -#include -#include #include -#include "Listener.h" +#include +#include +#include +#include + +#include "common/cross_sockets/XSocket.h" +#include "common/util/Assert.h" #include "common/versions.h" +#include "Listener.h" + #include "third-party/fmt/core.h" -#include "common/util/Assert.h" +// clang-format on using namespace versions; constexpr bool debug_listener = false; diff --git a/goalc/listener/Listener.h b/goalc/listener/Listener.h index 7865fe1a6c..ff58b00fe1 100644 --- a/goalc/listener/Listener.h +++ b/goalc/listener/Listener.h @@ -5,19 +5,23 @@ * The Listener can connect to a Deci2Server for debugging. */ +// clang-format off #ifndef JAK1_LISTENER_H #define JAK1_LISTENER_H -#include -#include -#include #include +#include +#include #include +#include + #include "common/common_types.h" -#include "common/listener_common.h" #include "common/cross_os_debug/xdbg.h" +#include "common/listener_common.h" + #include "goalc/debugger/Debugger.h" #include "MemoryMap.h" +// clang-format on namespace listener { diff --git a/goalc/listener/MemoryMap.cpp b/goalc/listener/MemoryMap.cpp index 7750c42cde..9d3dc934bc 100644 --- a/goalc/listener/MemoryMap.cpp +++ b/goalc/listener/MemoryMap.cpp @@ -1,10 +1,13 @@ +#include "MemoryMap.h" + #include #include -#include "MemoryMap.h" -#include "third-party/fmt/core.h" + #include "common/link_types.h" -#include "common/util/BitUtils.h" #include "common/util/Assert.h" +#include "common/util/BitUtils.h" + +#include "third-party/fmt/core.h" namespace listener { std::string LoadEntry::print() const { diff --git a/goalc/listener/MemoryMap.h b/goalc/listener/MemoryMap.h index c6b7f63bb7..ba6001aa6c 100644 --- a/goalc/listener/MemoryMap.h +++ b/goalc/listener/MemoryMap.h @@ -1,8 +1,9 @@ #pragma once #include -#include #include +#include + #include "common/common_types.h" namespace listener { diff --git a/goalc/main.cpp b/goalc/main.cpp index cb3246797f..81282b9a78 100644 --- a/goalc/main.cpp +++ b/goalc/main.cpp @@ -1,16 +1,17 @@ #include -#include "goalc/compiler/Compiler.h" -#include "common/versions.h" -#include "common/util/FileUtil.h" -#include "common/log/log.h" - -#include "third-party/CLI11.hpp" -#include "third-party/fmt/core.h" -#include "third-party/fmt/color.h" +#include #include "common/goos/ReplUtils.h" -#include +#include "common/log/log.h" #include "common/nrepl/ReplServer.h" +#include "common/util/FileUtil.h" +#include "common/versions.h" + +#include "goalc/compiler/Compiler.h" + +#include "third-party/CLI11.hpp" +#include "third-party/fmt/color.h" +#include "third-party/fmt/core.h" void setup_logging() { lg::set_file(file_util::get_file_path({"log/compiler.txt"})); diff --git a/goalc/make/MakeSystem.cpp b/goalc/make/MakeSystem.cpp index 21f9c1b8d8..d7c2f1e534 100644 --- a/goalc/make/MakeSystem.cpp +++ b/goalc/make/MakeSystem.cpp @@ -1,15 +1,15 @@ -#include - #include "MakeSystem.h" -#include "third-party/fmt/color.h" -#include "third-party/fmt/core.h" +#include #include "common/goos/ParseHelpers.h" +#include "common/util/FileUtil.h" #include "common/util/Timer.h" #include "goalc/make/Tools.h" -#include "common/util/FileUtil.h" + +#include "third-party/fmt/color.h" +#include "third-party/fmt/core.h" std::string MakeStep::print() const { std::string result = fmt::format("Tool {} with inputs", tool); diff --git a/goalc/make/MakeSystem.h b/goalc/make/MakeSystem.h index ad96d5fefd..35ce58e52a 100644 --- a/goalc/make/MakeSystem.h +++ b/goalc/make/MakeSystem.h @@ -1,6 +1,7 @@ #pragma once #include "common/goos/Interpreter.h" + #include "goalc/make/Tool.h" struct MakeStep { diff --git a/goalc/make/Tool.cpp b/goalc/make/Tool.cpp index 8ee74454da..e2e7fa2b98 100644 --- a/goalc/make/Tool.cpp +++ b/goalc/make/Tool.cpp @@ -1,12 +1,13 @@ +#include "Tool.h" + #include #include -#include "third-party/fmt/core.h" - -#include "Tool.h" #include "common/util/FileUtil.h" +#include "third-party/fmt/core.h" + Tool::Tool(const std::string& name) : m_name(name) {} bool Tool::needs_run(const ToolInput& task) { diff --git a/goalc/make/Tool.h b/goalc/make/Tool.h index fe477295b6..d1d2168a94 100644 --- a/goalc/make/Tool.h +++ b/goalc/make/Tool.h @@ -3,6 +3,7 @@ #include #include #include + #include "common/goos/Object.h" struct ToolInput { diff --git a/goalc/make/Tools.cpp b/goalc/make/Tools.cpp index 01194a4ceb..b17f6df1e8 100644 --- a/goalc/make/Tools.cpp +++ b/goalc/make/Tools.cpp @@ -1,15 +1,18 @@ #include "Tools.h" #include -#include "goalc/compiler/Compiler.h" + #include "common/goos/ParseHelpers.h" #include "common/util/DgoWriter.h" #include "common/util/FileUtil.h" -#include "third-party/fmt/core.h" + +#include "goalc/build_level/build_level.h" +#include "goalc/compiler/Compiler.h" #include "goalc/data_compiler/dir_tpages.h" #include "goalc/data_compiler/game_count.h" #include "goalc/data_compiler/game_text_common.h" -#include "goalc/build_level/build_level.h" + +#include "third-party/fmt/core.h" CompilerTool::CompilerTool(Compiler* compiler) : Tool("goalc"), m_compiler(compiler) {} diff --git a/goalc/make/Tools.h b/goalc/make/Tools.h index 966a1820f2..59a0390d08 100644 --- a/goalc/make/Tools.h +++ b/goalc/make/Tools.h @@ -1,8 +1,9 @@ #pragma once -#include "goalc/make/Tool.h" #include "common/goos/Reader.h" +#include "goalc/make/Tool.h" + class Compiler; class CompilerTool : public Tool { diff --git a/goalc/regalloc/Allocator.cpp b/goalc/regalloc/Allocator.cpp index 5c85be8bba..fc3d1459c8 100644 --- a/goalc/regalloc/Allocator.cpp +++ b/goalc/regalloc/Allocator.cpp @@ -3,11 +3,14 @@ * Implementation of register allocation algorithms */ -#include -#include "third-party/fmt/core.h" #include "Allocator.h" + +#include + #include "goalc/regalloc/allocator_interface.h" +#include "third-party/fmt/core.h" + std::string LiveInfo::print_assignment() { std::string result = "Assignment for var " + std::to_string(var) + "\n"; for (uint32_t i = 0; i < assignment.size(); i++) { diff --git a/goalc/regalloc/Allocator.h b/goalc/regalloc/Allocator.h index 7f18b3b098..d4a8a356dc 100644 --- a/goalc/regalloc/Allocator.h +++ b/goalc/regalloc/Allocator.h @@ -1,9 +1,10 @@ #pragma once -#include #include -#include "IRegSet.h" #include +#include + +#include "IRegSet.h" #include "IRegister.h" #include "allocator_interface.h" diff --git a/goalc/regalloc/Allocator_v2.cpp b/goalc/regalloc/Allocator_v2.cpp index 9674278db9..43b948f05a 100644 --- a/goalc/regalloc/Allocator_v2.cpp +++ b/goalc/regalloc/Allocator_v2.cpp @@ -1,9 +1,12 @@ -#include +#include "Allocator_v2.h" + #include #include -#include "third-party/fmt/core.h" +#include + #include "common/util/Range.h" -#include "Allocator_v2.h" + +#include "third-party/fmt/core.h" /*! Documentation: diff --git a/goalc/regalloc/IRegSet.h b/goalc/regalloc/IRegSet.h index 5da9d86730..a83b861844 100644 --- a/goalc/regalloc/IRegSet.h +++ b/goalc/regalloc/IRegSet.h @@ -14,6 +14,7 @@ * The space used is (highest_set_reg + 63) / 64 + constant overhead (vector + int) */ #include + #include "common/common_types.h" #include "common/util/Assert.h" diff --git a/goalc/regalloc/IRegister.cpp b/goalc/regalloc/IRegister.cpp index 2b994dad6b..2af3ab29a7 100644 --- a/goalc/regalloc/IRegister.cpp +++ b/goalc/regalloc/IRegister.cpp @@ -1,7 +1,9 @@ -#include "third-party/fmt/core.h" #include "IRegister.h" + #include "common/util/Assert.h" +#include "third-party/fmt/core.h" + std::string IRegister::to_string() const { // if (with_constraints) { // std::string result = fmt::format("i{}-{}\n", emitter::to_string(kind), id); diff --git a/goalc/regalloc/IRegister.h b/goalc/regalloc/IRegister.h index 52cba278d7..6da5caf23c 100644 --- a/goalc/regalloc/IRegister.h +++ b/goalc/regalloc/IRegister.h @@ -6,6 +6,7 @@ #include #include + #include "goalc/emitter/Register.h" struct IRegister { diff --git a/goalc/regalloc/allocator_interface.cpp b/goalc/regalloc/allocator_interface.cpp index e5be037464..949b663e8d 100644 --- a/goalc/regalloc/allocator_interface.cpp +++ b/goalc/regalloc/allocator_interface.cpp @@ -3,10 +3,11 @@ * Runs the register allocator. */ +#include "allocator_interface.h" + #include #include "third-party/fmt/core.h" -#include "allocator_interface.h" /*! * Print out the input data for debugging. diff --git a/goalc/regalloc/allocator_interface.h b/goalc/regalloc/allocator_interface.h index 4b8092a450..a1dfe554bd 100644 --- a/goalc/regalloc/allocator_interface.h +++ b/goalc/regalloc/allocator_interface.h @@ -9,8 +9,9 @@ * allocate_registers algorithm. */ -#include #include +#include + #include "goalc/emitter/Register.h" #include "goalc/regalloc/IRegSet.h" #include "goalc/regalloc/IRegister.h" diff --git a/test/decompiler/FormRegressionTest.cpp b/test/decompiler/FormRegressionTest.cpp index 56638b8a8f..5f4d9a7484 100644 --- a/test/decompiler/FormRegressionTest.cpp +++ b/test/decompiler/FormRegressionTest.cpp @@ -1,18 +1,20 @@ #include "FormRegressionTest.h" -#include "decompiler/analysis/type_analysis.h" -#include "decompiler/analysis/variable_naming.h" -#include "decompiler/analysis/reg_usage.h" +#include "common/goos/PrettyPrinter.h" +#include "common/util/json_util.h" + +#include "decompiler/IR2/Form.h" #include "decompiler/analysis/cfg_builder.h" #include "decompiler/analysis/expression_build.h" #include "decompiler/analysis/final_output.h" -#include "decompiler/analysis/stack_spill.h" -#include "decompiler/analysis/insert_lets.h" #include "decompiler/analysis/inline_asm_rewrite.h" +#include "decompiler/analysis/insert_lets.h" +#include "decompiler/analysis/reg_usage.h" +#include "decompiler/analysis/stack_spill.h" +#include "decompiler/analysis/type_analysis.h" +#include "decompiler/analysis/variable_naming.h" #include "decompiler/util/config_parsers.h" -#include "common/goos/PrettyPrinter.h" -#include "common/util/json_util.h" -#include "decompiler/IR2/Form.h" + #include "third-party/json.hpp" using namespace decompiler; diff --git a/test/decompiler/FormRegressionTest.h b/test/decompiler/FormRegressionTest.h index e428749623..1690b41465 100644 --- a/test/decompiler/FormRegressionTest.h +++ b/test/decompiler/FormRegressionTest.h @@ -1,11 +1,12 @@ #pragma once #include -#include "gtest/gtest.h" + #include "decompiler/Disasm/InstructionParser.h" -#include "decompiler/util/DecompilerTypeSystem.h" #include "decompiler/Function/Function.h" #include "decompiler/ObjectFile/LinkedObjectFile.h" +#include "decompiler/util/DecompilerTypeSystem.h" +#include "gtest/gtest.h" namespace decompiler { struct RegisterTypeCast; diff --git a/test/decompiler/test_AtomicOpBuilder.cpp b/test/decompiler/test_AtomicOpBuilder.cpp index fcad915c7a..e4c7c0501b 100644 --- a/test/decompiler/test_AtomicOpBuilder.cpp +++ b/test/decompiler/test_AtomicOpBuilder.cpp @@ -1,11 +1,13 @@ #include -#include "gtest/gtest.h" + +#include "decompiler/Disasm/InstructionParser.h" +#include "decompiler/Function/Warnings.h" #include "decompiler/IR2/AtomicOp.h" #include "decompiler/analysis/atomic_op_builder.h" -#include "decompiler/Disasm/InstructionParser.h" +#include "gtest/gtest.h" + #include "third-party/fmt/core.h" #include "third-party/fmt/format.h" -#include "decompiler/Function/Warnings.h" using namespace decompiler; diff --git a/test/decompiler/test_DataParser.cpp b/test/decompiler/test_DataParser.cpp index f4bfb31f85..8528f6f3e1 100644 --- a/test/decompiler/test_DataParser.cpp +++ b/test/decompiler/test_DataParser.cpp @@ -1,12 +1,14 @@ -#include "gtest/gtest.h" -#include "decompiler/util/DataParser.h" -#include "decompiler/Disasm/DecompilerLabel.h" -#include "decompiler/util/data_decompile.h" -#include "decompiler/util/DecompilerTypeSystem.h" -#include "third-party/fmt/core.h" #include "common/goos/PrettyPrinter.h" +#include "decompiler/Disasm/DecompilerLabel.h" +#include "decompiler/util/DataParser.h" +#include "decompiler/util/DecompilerTypeSystem.h" +#include "decompiler/util/data_decompile.h" +#include "gtest/gtest.h" + +#include "third-party/fmt/core.h" + using namespace decompiler; class DataDecompTest : public ::testing::Test { diff --git a/test/decompiler/test_DisasmVifDecompile.cpp b/test/decompiler/test_DisasmVifDecompile.cpp index 44d4ba2333..f7f1371b29 100644 --- a/test/decompiler/test_DisasmVifDecompile.cpp +++ b/test/decompiler/test_DisasmVifDecompile.cpp @@ -1,6 +1,7 @@ +#include "FormRegressionTest.h" + #include "gtest/gtest.h" -#include "FormRegressionTest.h" using namespace decompiler; diff --git a/test/decompiler/test_FormBeforeExpressions.cpp b/test/decompiler/test_FormBeforeExpressions.cpp index 5f909a5502..46f5bc0227 100644 --- a/test/decompiler/test_FormBeforeExpressions.cpp +++ b/test/decompiler/test_FormBeforeExpressions.cpp @@ -1,6 +1,7 @@ -#include "gtest/gtest.h" #include "FormRegressionTest.h" +#include "gtest/gtest.h" + using namespace decompiler; TEST_F(FormRegressionTest, StringTest) { diff --git a/test/decompiler/test_FormExpressionBuild.cpp b/test/decompiler/test_FormExpressionBuild.cpp index db1d974903..af322a0664 100644 --- a/test/decompiler/test_FormExpressionBuild.cpp +++ b/test/decompiler/test_FormExpressionBuild.cpp @@ -1,6 +1,7 @@ -#include "gtest/gtest.h" #include "FormRegressionTest.h" +#include "gtest/gtest.h" + using namespace decompiler; TEST_F(FormRegressionTest, ExprIdentity) { diff --git a/test/decompiler/test_FormExpressionBuild2.cpp b/test/decompiler/test_FormExpressionBuild2.cpp index 885771a602..05c332e2e2 100644 --- a/test/decompiler/test_FormExpressionBuild2.cpp +++ b/test/decompiler/test_FormExpressionBuild2.cpp @@ -1,6 +1,7 @@ -#include "gtest/gtest.h" #include "FormRegressionTest.h" +#include "gtest/gtest.h" + using namespace decompiler; // tests stack variables diff --git a/test/decompiler/test_FormExpressionBuild3.cpp b/test/decompiler/test_FormExpressionBuild3.cpp index a7ff033c6b..626669dd04 100644 --- a/test/decompiler/test_FormExpressionBuild3.cpp +++ b/test/decompiler/test_FormExpressionBuild3.cpp @@ -1,6 +1,7 @@ -#include "gtest/gtest.h" #include "FormRegressionTest.h" +#include "gtest/gtest.h" + using namespace decompiler; // vector-rad<-vector-deg/2! diff --git a/test/decompiler/test_FormExpressionBuildLong.cpp b/test/decompiler/test_FormExpressionBuildLong.cpp index a5f2afb118..7526641651 100644 --- a/test/decompiler/test_FormExpressionBuildLong.cpp +++ b/test/decompiler/test_FormExpressionBuildLong.cpp @@ -1,6 +1,7 @@ -#include "gtest/gtest.h" #include "FormRegressionTest.h" +#include "gtest/gtest.h" + using namespace decompiler; TEST_F(FormRegressionTest, ExprArrayMethod2) { diff --git a/test/decompiler/test_InstructionDecode.cpp b/test/decompiler/test_InstructionDecode.cpp index 849b011196..9489c4aa24 100644 --- a/test/decompiler/test_InstructionDecode.cpp +++ b/test/decompiler/test_InstructionDecode.cpp @@ -1,7 +1,7 @@ -#include "gtest/gtest.h" #include "decompiler/Disasm/InstructionDecode.h" #include "decompiler/Disasm/OpcodeInfo.h" #include "decompiler/ObjectFile/LinkedObjectFile.h" +#include "gtest/gtest.h" using namespace decompiler; diff --git a/test/decompiler/test_InstructionParser.cpp b/test/decompiler/test_InstructionParser.cpp index 632e7b46fb..8834e90645 100644 --- a/test/decompiler/test_InstructionParser.cpp +++ b/test/decompiler/test_InstructionParser.cpp @@ -1,6 +1,6 @@ -#include "gtest/gtest.h" -#include "decompiler/Disasm/InstructionParser.h" #include "decompiler/Disasm/DecompilerLabel.h" +#include "decompiler/Disasm/InstructionParser.h" +#include "gtest/gtest.h" using namespace decompiler; diff --git a/test/decompiler/test_VuDisasm.cpp b/test/decompiler/test_VuDisasm.cpp index 7dcbf8d892..160bcb86db 100644 --- a/test/decompiler/test_VuDisasm.cpp +++ b/test/decompiler/test_VuDisasm.cpp @@ -1,9 +1,11 @@ +#include "common/util/FileUtil.h" + +#include "decompiler/VuDisasm/VuDisassembler.h" +#include "decompiler/util/DataParser.h" +#include "gtest/gtest.h" + #include "third-party/fmt/core.h" -#include "gtest/gtest.h" -#include "decompiler/util/DataParser.h" -#include "decompiler/VuDisasm/VuDisassembler.h" -#include "common/util/FileUtil.h" using namespace decompiler; diff --git a/test/decompiler/test_gkernel_decomp.cpp b/test/decompiler/test_gkernel_decomp.cpp index a56f1df642..dd2e503fae 100644 --- a/test/decompiler/test_gkernel_decomp.cpp +++ b/test/decompiler/test_gkernel_decomp.cpp @@ -1,6 +1,7 @@ -#include "gtest/gtest.h" #include "FormRegressionTest.h" +#include "gtest/gtest.h" + using namespace decompiler; TEST_F(FormRegressionTest, ExprMethod7Object) { diff --git a/test/decompiler/test_math_decomp.cpp b/test/decompiler/test_math_decomp.cpp index fb562efa12..24793b11c9 100644 --- a/test/decompiler/test_math_decomp.cpp +++ b/test/decompiler/test_math_decomp.cpp @@ -1,6 +1,7 @@ -#include "gtest/gtest.h" #include "FormRegressionTest.h" +#include "gtest/gtest.h" + using namespace decompiler; TEST_F(FormRegressionTest, ExprTruncate) { diff --git a/test/goalc/framework/test_runner.cpp b/test/goalc/framework/test_runner.cpp index 3b01212a56..c05270d5dd 100644 --- a/test/goalc/framework/test_runner.cpp +++ b/test/goalc/framework/test_runner.cpp @@ -1,19 +1,20 @@ #include "test_runner.h" -#include "third-party/fmt/core.h" +#include #include -#include "gtest/gtest.h" #include "inja.hpp" -#include "third-party/json.hpp" - -#include "game/runtime.h" -#include "goalc/listener/Listener.h" -#include "goalc/compiler/Compiler.h" #include "common/util/FileUtil.h" -#include + +#include "game/runtime.h" +#include "goalc/compiler/Compiler.h" +#include "goalc/listener/Listener.h" +#include "gtest/gtest.h" + +#include "third-party/fmt/core.h" +#include "third-party/json.hpp" namespace GoalTest { diff --git a/test/goalc/framework/test_runner.h b/test/goalc/framework/test_runner.h index ad682359f0..d7cd58f889 100644 --- a/test/goalc/framework/test_runner.h +++ b/test/goalc/framework/test_runner.h @@ -1,10 +1,11 @@ #pragma once +#include #include #include -#include #include "inja.hpp" + #include "goalc/compiler/Compiler.h" namespace GoalTest { diff --git a/test/goalc/test_arithmetic.cpp b/test/goalc/test_arithmetic.cpp index 8b8ac040d9..e7740c77a7 100644 --- a/test/goalc/test_arithmetic.cpp +++ b/test/goalc/test_arithmetic.cpp @@ -1,24 +1,22 @@ // https://github.com/google/googletest/blob/master/googletest/docs/advanced.md#value-parameterized-tests -#include #include - -#include "gtest/gtest.h" -#include "game/runtime.h" -#include "goalc/listener/Listener.h" -#include "goalc/compiler/Compiler.h" - -#include "inja.hpp" -#include "third-party/json.hpp" - -#include "test/goalc/framework/test_runner.h" - -#include -#include #include -#include #include #include +#include +#include +#include + +#include "inja.hpp" + +#include "game/runtime.h" +#include "goalc/compiler/Compiler.h" +#include "goalc/listener/Listener.h" +#include "gtest/gtest.h" +#include "test/goalc/framework/test_runner.h" + +#include "third-party/json.hpp" // -------- // This is a very over-engineered integer test, but it serves as a decent example of how to use the diff --git a/test/goalc/test_collections.cpp b/test/goalc/test_collections.cpp index fcbf5b8c68..4163039707 100644 --- a/test/goalc/test_collections.cpp +++ b/test/goalc/test_collections.cpp @@ -1,22 +1,21 @@ -#include #include - -#include "gtest/gtest.h" -#include "game/runtime.h" -#include "goalc/listener/Listener.h" -#include "goalc/compiler/Compiler.h" - -#include "inja.hpp" -#include "third-party/json.hpp" -#include "test/goalc/framework/test_runner.h" - -#include -#include #include -#include +#include #include #include -#include +#include +#include +#include + +#include "inja.hpp" + +#include "game/runtime.h" +#include "goalc/compiler/Compiler.h" +#include "goalc/listener/Listener.h" +#include "gtest/gtest.h" +#include "test/goalc/framework/test_runner.h" + +#include "third-party/json.hpp" struct CollectionParam { // TODO - Not Needed Yet diff --git a/test/goalc/test_compiler.cpp b/test/goalc/test_compiler.cpp index 81bc1b7720..3ac88d8eed 100644 --- a/test/goalc/test_compiler.cpp +++ b/test/goalc/test_compiler.cpp @@ -1,10 +1,10 @@ -#include #include +#include -#include "gtest/gtest.h" #include "game/runtime.h" -#include "goalc/listener/Listener.h" #include "goalc/compiler/Compiler.h" +#include "goalc/listener/Listener.h" +#include "gtest/gtest.h" TEST(CompilerAndRuntime, ConstructCompiler) { Compiler compiler; diff --git a/test/goalc/test_control_statements.cpp b/test/goalc/test_control_statements.cpp index fc89fdb757..f267f7e55b 100644 --- a/test/goalc/test_control_statements.cpp +++ b/test/goalc/test_control_statements.cpp @@ -1,22 +1,21 @@ -#include #include - -#include "gtest/gtest.h" -#include "game/runtime.h" -#include "goalc/listener/Listener.h" -#include "goalc/compiler/Compiler.h" - -#include "inja.hpp" -#include "third-party/json.hpp" -#include "test/goalc/framework/test_runner.h" - -#include -#include #include -#include +#include #include #include -#include +#include +#include +#include + +#include "inja.hpp" + +#include "game/runtime.h" +#include "goalc/compiler/Compiler.h" +#include "goalc/listener/Listener.h" +#include "gtest/gtest.h" +#include "test/goalc/framework/test_runner.h" + +#include "third-party/json.hpp" struct ControlStatementParam { // TODO - Not Needed Yet diff --git a/test/goalc/test_debugger.cpp b/test/goalc/test_debugger.cpp index 7185e7655c..0feadb25db 100644 --- a/test/goalc/test_debugger.cpp +++ b/test/goalc/test_debugger.cpp @@ -1,9 +1,10 @@ -#include "gtest/gtest.h" -#include "goalc/compiler/Compiler.h" -#include "test/goalc/framework/test_runner.h" #include "common/log/log.h" #include "common/util/Timer.h" +#include "goalc/compiler/Compiler.h" +#include "gtest/gtest.h" +#include "test/goalc/framework/test_runner.h" + #ifdef __linux namespace { diff --git a/test/goalc/test_game_no_debug.cpp b/test/goalc/test_game_no_debug.cpp index 245b6d0c92..d717905797 100644 --- a/test/goalc/test_game_no_debug.cpp +++ b/test/goalc/test_game_no_debug.cpp @@ -1,7 +1,7 @@ // Test the game running without loading debug segments. -#include "gtest/gtest.h" #include "goalc/compiler/Compiler.h" +#include "gtest/gtest.h" #include "test/goalc/framework/test_runner.h" TEST(GameNoDebugSegment, Init) { diff --git a/test/goalc/test_goal_kernel.cpp b/test/goalc/test_goal_kernel.cpp index 917b2146b9..2e72432b73 100644 --- a/test/goalc/test_goal_kernel.cpp +++ b/test/goalc/test_goal_kernel.cpp @@ -1,8 +1,9 @@ -#include #include +#include + #include "goalc/compiler/Compiler.h" -#include "test/goalc/framework/test_runner.h" #include "gtest/gtest.h" +#include "test/goalc/framework/test_runner.h" class KernelTest : public testing::Test { public: diff --git a/test/goalc/test_variables.cpp b/test/goalc/test_variables.cpp index e01423f34a..0e1022793c 100644 --- a/test/goalc/test_variables.cpp +++ b/test/goalc/test_variables.cpp @@ -1,22 +1,21 @@ -#include #include - -#include "gtest/gtest.h" -#include "game/runtime.h" -#include "goalc/listener/Listener.h" -#include "goalc/compiler/Compiler.h" - -#include "inja.hpp" -#include "third-party/json.hpp" -#include "test/goalc/framework/test_runner.h" - -#include -#include #include -#include +#include #include #include -#include +#include +#include +#include + +#include "inja.hpp" + +#include "game/runtime.h" +#include "goalc/compiler/Compiler.h" +#include "goalc/listener/Listener.h" +#include "gtest/gtest.h" +#include "test/goalc/framework/test_runner.h" + +#include "third-party/json.hpp" struct VariableParam { // TODO - Not Needed Yet diff --git a/test/goalc/test_with_game.cpp b/test/goalc/test_with_game.cpp index d3f2bcc221..04e0608cae 100644 --- a/test/goalc/test_with_game.cpp +++ b/test/goalc/test_with_game.cpp @@ -1,26 +1,26 @@ -#include #include - -#include "gtest/gtest.h" -#include "game/runtime.h" -#include "goalc/listener/Listener.h" -#include "goalc/compiler/Compiler.h" -#include "game/mips2c/mips2c_table.h" - -#include "inja.hpp" -#include "third-party/json.hpp" -#include "common/util/FileUtil.h" -#include "test/goalc/framework/test_runner.h" -#include "third-party/fmt/core.h" - -#include -#include #include -#include +#include #include #include -#include #include +#include +#include +#include + +#include "inja.hpp" + +#include "common/util/FileUtil.h" + +#include "game/mips2c/mips2c_table.h" +#include "game/runtime.h" +#include "goalc/compiler/Compiler.h" +#include "goalc/listener/Listener.h" +#include "gtest/gtest.h" +#include "test/goalc/framework/test_runner.h" + +#include "third-party/fmt/core.h" +#include "third-party/json.hpp" class WithGameTests : public ::testing::Test { public: diff --git a/test/offline/offline_test_main.cpp b/test/offline/offline_test_main.cpp index 33f49b0202..7f4743af95 100644 --- a/test/offline/offline_test_main.cpp +++ b/test/offline/offline_test_main.cpp @@ -1,17 +1,19 @@ +#include #include #include #include -#include + +#include "common/common_types.h" +#include "common/log/log.h" +#include "common/util/FileUtil.h" +#include "common/util/Timer.h" +#include "common/util/diff.h" +#include "common/util/json_util.h" + +#include "decompiler/ObjectFile/ObjectFileDB.h" +#include "goalc/compiler/Compiler.h" #include "third-party/fmt/format.h" -#include "common/log/log.h" -#include "common/common_types.h" -#include "common/util/FileUtil.h" -#include "common/util/json_util.h" -#include "decompiler/ObjectFile/ObjectFileDB.h" -#include "common/util/diff.h" -#include "goalc/compiler/Compiler.h" -#include "common/util/Timer.h" namespace fs = std::filesystem; diff --git a/test/test_CodeTester.cpp b/test/test_CodeTester.cpp index 276771fb8e..a70c1e77eb 100644 --- a/test/test_CodeTester.cpp +++ b/test/test_CodeTester.cpp @@ -7,9 +7,9 @@ * can generate prologues/epilogues, and execute them without crashing. */ -#include "gtest/gtest.h" #include "goalc/emitter/CodeTester.h" #include "goalc/emitter/IGen.h" +#include "gtest/gtest.h" using namespace emitter; diff --git a/test/test_common_util.cpp b/test/test_common_util.cpp index bf5961e8fa..f5077e6465 100644 --- a/test/test_common_util.cpp +++ b/test/test_common_util.cpp @@ -1,22 +1,24 @@ -#include -#include #include +#include #include +#include -#include "common/util/FileUtil.h" -#include "common/util/Trie.h" +#include "common/util/Assert.h" #include "common/util/BitUtils.h" -#include "gtest/gtest.h" -#include "test/all_jak1_symbols.h" +#include "common/util/CopyOnWrite.h" +#include "common/util/FileUtil.h" +#include "common/util/Range.h" +#include "common/util/SmallVector.h" +#include "common/util/Trie.h" +#include "common/util/crc32.h" #include "common/util/json_util.h" #include "common/util/os.h" -#include "common/util/Range.h" -#include "third-party/fmt/core.h" #include "common/util/print_float.h" -#include "common/util/CopyOnWrite.h" -#include "common/util/SmallVector.h" -#include "common/util/crc32.h" -#include "common/util/Assert.h" + +#include "gtest/gtest.h" +#include "test/all_jak1_symbols.h" + +#include "third-party/fmt/core.h" TEST(CommonUtil, CpuInfo) { setup_cpu_info(); diff --git a/test/test_emitter.cpp b/test/test_emitter.cpp index ac335512df..5662e949f8 100644 --- a/test/test_emitter.cpp +++ b/test/test_emitter.cpp @@ -1,6 +1,6 @@ -#include "gtest/gtest.h" #include "goalc/emitter/CodeTester.h" #include "goalc/emitter/IGen.h" +#include "gtest/gtest.h" using namespace emitter; diff --git a/test/test_emitter_avx.cpp b/test/test_emitter_avx.cpp index 794cc6963d..f905eab983 100644 --- a/test/test_emitter_avx.cpp +++ b/test/test_emitter_avx.cpp @@ -1,6 +1,6 @@ -#include "gtest/gtest.h" #include "goalc/emitter/CodeTester.h" #include "goalc/emitter/IGen.h" +#include "gtest/gtest.h" using namespace emitter; diff --git a/test/test_goos.cpp b/test/test_goos.cpp index 66237fb06f..e488f97fb7 100644 --- a/test/test_goos.cpp +++ b/test/test_goos.cpp @@ -3,9 +3,10 @@ * Tests for the GOOS macro language. */ -#include "gtest/gtest.h" #include "common/goos/Interpreter.h" +#include "gtest/gtest.h" + using namespace goos; namespace { diff --git a/test/test_kernel.cpp b/test/test_kernel.cpp index 687a9b54ca..a39d490cba 100644 --- a/test/test_kernel.cpp +++ b/test/test_kernel.cpp @@ -1,15 +1,17 @@ #include #include #include -#include "gtest/gtest.h" -#include "common/symbols.h" + #include "common/goal_constants.h" +#include "common/symbols.h" + +#include "all_jak1_symbols.h" #include "game/kernel/fileio.h" #include "game/kernel/kboot.h" -#include "game/kernel/kprint.h" #include "game/kernel/kdsnetm.h" +#include "game/kernel/kprint.h" #include "game/kernel/kscheme.h" -#include "all_jak1_symbols.h" +#include "gtest/gtest.h" using namespace jak1_symbols; diff --git a/test/test_listener_deci2.cpp b/test/test_listener_deci2.cpp index cf7e706be8..4bf5b929d0 100644 --- a/test/test_listener_deci2.cpp +++ b/test/test_listener_deci2.cpp @@ -1,6 +1,6 @@ -#include "gtest/gtest.h" -#include "goalc/listener/Listener.h" #include "game/system/Deci2Server.h" +#include "goalc/listener/Listener.h" +#include "gtest/gtest.h" using namespace listener; diff --git a/test/test_main.cpp b/test/test_main.cpp index f08fdcbd33..ed083c6be0 100644 --- a/test/test_main.cpp +++ b/test/test_main.cpp @@ -1,11 +1,11 @@ #include -#include "gtest/gtest.h" - -#include "common/util/FileUtil.h" #include "common/log/log.h" +#include "common/util/FileUtil.h" #include "common/util/os.h" +#include "gtest/gtest.h" + // Running subsets of tests, see: // - // https://github.com/google/googletest/blob/620659ed92829a88ee34134c782bf5b5aa5a0a0c/googletest/docs/advanced.md#running-a-subset-of-the-tests diff --git a/test/test_math.cpp b/test/test_math.cpp index 7c735c8104..7394f6e762 100644 --- a/test/test_math.cpp +++ b/test/test_math.cpp @@ -1,6 +1,7 @@ -#include "gtest/gtest.h" #include "common/math/geometry.h" +#include "gtest/gtest.h" + TEST(Math, RaySphereOrigin) { math::Vector sphere(0, 0, 0); math::Vector line_origin(0, 0, 0); diff --git a/test/test_pretty_print.cpp b/test/test_pretty_print.cpp index 72020f1ffb..6885091db6 100644 --- a/test/test_pretty_print.cpp +++ b/test/test_pretty_print.cpp @@ -1,8 +1,10 @@ -#include "gtest/gtest.h" -#include "common/goos/Reader.h" -#include "common/util/FileUtil.h" #include "common/goos/PrettyPrinter.h" #include "common/goos/PrettyPrinter2.h" +#include "common/goos/Reader.h" +#include "common/util/FileUtil.h" + +#include "gtest/gtest.h" + #include "third-party/fmt/core.h" using namespace goos; diff --git a/test/test_reader.cpp b/test/test_reader.cpp index d49d075e91..aeba24a666 100644 --- a/test/test_reader.cpp +++ b/test/test_reader.cpp @@ -4,10 +4,11 @@ * For some reason this runs at ~5 fps in CLion IDE. */ -#include "gtest/gtest.h" #include "common/goos/Reader.h" #include "common/util/FileUtil.h" +#include "gtest/gtest.h" + using namespace goos; TEST(GoosReader, Construction) { diff --git a/test/test_type_system.cpp b/test/test_type_system.cpp index 8f63ccbfef..6c7080a1cd 100644 --- a/test/test_type_system.cpp +++ b/test/test_type_system.cpp @@ -1,8 +1,9 @@ -#include "gtest/gtest.h" -#include "common/type_system/TypeSystem.h" -#include "common/goos/Reader.h" -#include "common/type_system/deftype.h" #include "common/goos/ParseHelpers.h" +#include "common/goos/Reader.h" +#include "common/type_system/TypeSystem.h" +#include "common/type_system/deftype.h" + +#include "gtest/gtest.h" TEST(TypeSystem, Construction) { // test that we can add all builtin types without any type errors diff --git a/test/test_zstd.cpp b/test/test_zstd.cpp index 1519da99ae..4d66c6a187 100644 --- a/test/test_zstd.cpp +++ b/test/test_zstd.cpp @@ -3,11 +3,12 @@ #include #include "common/common_types.h" +#include "common/util/compress.h" #include "gtest/gtest.h" #include "test/all_jak1_symbols.h" + #include "third-party/zstd/lib/zstd.h" -#include "common/util/compress.h" TEST(ZSTD, Basic) { std::string all; diff --git a/test/test_zydis.cpp b/test/test_zydis.cpp index 2311397615..363c7175ba 100644 --- a/test/test_zydis.cpp +++ b/test/test_zydis.cpp @@ -1,5 +1,7 @@ -#include "gtest/gtest.h" #include "common/common_types.h" + +#include "gtest/gtest.h" + #include "third-party/zydis/include/Zydis/Zydis.h" TEST(Zydis, Basic) {