From 2d595c1ac0bf128c91b638728d98e79c42f50883 Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Wed, 22 Jun 2022 23:37:46 -0400 Subject: [PATCH] lint: add include sorting config to clang-format (#1517) --- .clang-format | 16 ++++- common/audio/audio_formats.cpp | 2 + common/audio/audio_formats.h | 2 +- common/cross_os_debug/xdbg.cpp | 20 ++++--- common/cross_os_debug/xdbg.h | 3 +- common/cross_sockets/XSocket.cpp | 4 +- common/cross_sockets/XSocket.h | 10 ++-- common/cross_sockets/XSocketClient.cpp | 6 +- common/cross_sockets/XSocketClient.h | 8 +-- common/cross_sockets/XSocketServer.cpp | 6 +- common/cross_sockets/XSocketServer.h | 8 +-- common/custom_data/TFrag3Data.cpp | 6 +- common/custom_data/Tfrag3Data.h | 2 +- common/custom_data/pack_helpers.cpp | 1 + .../deserialization/subtitles/subtitles.cpp | 6 +- common/dma/dma.cpp | 3 +- common/dma/dma.h | 4 +- common/dma/dma_chain_read.h | 1 + common/dma/dma_copy.cpp | 8 ++- common/dma/gs.cpp | 3 +- common/global_profiler/GlobalProfiler.cpp | 12 ++-- common/global_profiler/GlobalProfiler.h | 7 ++- common/goos/Interpreter.cpp | 6 +- common/goos/Interpreter.h | 1 + common/goos/Object.cpp | 7 ++- common/goos/Object.h | 7 ++- common/goos/ParseHelpers.cpp | 1 + common/goos/ParseHelpers.h | 3 +- common/goos/PrettyPrinter.cpp | 11 ++-- common/goos/PrettyPrinter.h | 5 +- common/goos/PrettyPrinter2.cpp | 4 +- common/goos/PrettyPrinter2.h | 3 +- common/goos/Printer.cpp | 1 + common/goos/Printer.h | 1 + common/goos/Reader.cpp | 8 ++- common/goos/Reader.h | 9 ++- common/goos/ReplUtils.cpp | 3 +- common/goos/TextDB.cpp | 7 ++- common/goos/TextDB.h | 8 +-- common/log/log.cpp | 4 +- common/log/log.h | 1 + common/nrepl/ReplClient.cpp | 4 +- common/nrepl/ReplClient.h | 3 +- common/nrepl/ReplServer.cpp | 4 +- common/nrepl/ReplServer.h | 5 +- common/serialization/subtitles/subtitles.cpp | 4 +- common/serialization/subtitles/subtitles.h | 15 ++--- common/texture/texture_conversion.h | 1 + common/type_system/Type.cpp | 7 ++- common/type_system/Type.h | 6 +- common/type_system/TypeFieldLookup.cpp | 4 +- common/type_system/TypeSpec.cpp | 4 +- common/type_system/TypeSpec.h | 7 ++- common/type_system/TypeSystem.cpp | 11 ++-- common/type_system/TypeSystem.h | 10 ++-- common/type_system/defenum.cpp | 7 ++- common/type_system/defenum.h | 1 + common/type_system/deftype.cpp | 4 +- common/type_system/deftype.h | 1 + common/type_system/state.cpp | 1 + common/type_system/state.h | 1 + common/util/BinaryReader.h | 1 + common/util/BinaryWriter.h | 5 +- common/util/BitUtils.h | 3 +- common/util/CopyOnWrite.h | 1 + common/util/DgoReader.cpp | 14 +++-- common/util/DgoReader.h | 3 +- common/util/DgoWriter.cpp | 3 +- common/util/DgoWriter.h | 2 +- common/util/FileUtil.cpp | 20 ++++--- common/util/FileUtil.h | 5 +- common/util/FontUtils.cpp | 4 +- common/util/FontUtils.h | 10 ++-- common/util/FrameLimiter.cpp | 1 + common/util/Serializer.h | 1 + common/util/SimpleThreadGroup.cpp | 1 + common/util/SimpleThreadGroup.h | 2 +- common/util/SmallVector.h | 1 + common/util/Timer.h | 1 + common/util/Trie.h | 3 +- common/util/compress.cpp | 10 ++-- common/util/compress.h | 1 + common/util/crc32.h | 1 + common/util/dgo_util.cpp | 9 ++- common/util/dgo_util.h | 1 + common/util/diff.cpp | 4 +- common/util/json_util.cpp | 3 +- common/util/json_util.h | 2 + common/util/print_float.cpp | 8 ++- common/util/print_float.h | 1 + common/util/read_iso_file.cpp | 3 +- common/util/read_iso_file.h | 3 +- decompiler/Disasm/Instruction.cpp | 7 ++- decompiler/Disasm/Instruction.h | 1 + decompiler/Disasm/InstructionDecode.cpp | 7 ++- decompiler/Disasm/InstructionMatching.cpp | 1 + decompiler/Disasm/InstructionMatching.h | 1 + decompiler/Disasm/InstructionParser.cpp | 11 ++-- decompiler/Disasm/InstructionParser.h | 3 +- decompiler/Disasm/OpcodeInfo.cpp | 1 + decompiler/Disasm/Register.cpp | 5 +- decompiler/Disasm/Register.h | 1 + decompiler/Function/BasicBlocks.cpp | 9 ++- decompiler/Function/BasicBlocks.h | 2 +- decompiler/Function/CfgVtx.cpp | 9 ++- decompiler/Function/CfgVtx.h | 4 ++ decompiler/Function/Function.cpp | 11 ++-- decompiler/Function/Function.h | 19 +++--- decompiler/Function/Warnings.h | 6 +- decompiler/IR2/AtomicOp.cpp | 19 +++--- decompiler/IR2/AtomicOp.h | 13 +++-- decompiler/IR2/AtomicOpForm.cpp | 8 ++- decompiler/IR2/AtomicOpTypeAnalysis.cpp | 15 +++-- decompiler/IR2/Env.cpp | 12 ++-- decompiler/IR2/Env.h | 8 ++- decompiler/IR2/ExpressionHelpers.cpp | 8 ++- decompiler/IR2/Form.cpp | 6 +- decompiler/IR2/Form.h | 18 +++--- decompiler/IR2/FormExpressionAnalysis.cpp | 18 +++--- decompiler/IR2/FormStack.cpp | 5 +- decompiler/IR2/FormStack.h | 1 + decompiler/IR2/IR2_common.h | 7 ++- decompiler/IR2/LabelDB.cpp | 4 +- decompiler/IR2/LabelDB.h | 8 ++- decompiler/IR2/OpenGoalMapping.cpp | 4 +- decompiler/IR2/OpenGoalMapping.h | 19 +++--- decompiler/IR2/bitfields.cpp | 9 +-- decompiler/IR2/bitfields.h | 3 +- decompiler/ObjectFile/LinkedObjectFile.cpp | 14 +++-- decompiler/ObjectFile/LinkedObjectFile.h | 7 ++- .../ObjectFile/LinkedObjectFileCreation.cpp | 11 ++-- decompiler/ObjectFile/LinkedWord.h | 3 +- decompiler/ObjectFile/ObjectFileDB.cpp | 31 +++++----- decompiler/ObjectFile/ObjectFileDB.h | 14 +++-- decompiler/ObjectFile/ObjectFileDB_IR2.cpp | 32 +++++----- decompiler/VuDisasm/VuDisassembler.cpp | 12 ++-- decompiler/VuDisasm/VuDisassembler.h | 3 +- decompiler/VuDisasm/VuInstruction.cpp | 4 +- decompiler/VuDisasm/VuInstruction.h | 5 +- decompiler/config.cpp | 7 ++- decompiler/config.h | 14 +++-- decompiler/data/LinkedWordReader.h | 8 ++- decompiler/data/StrFileReader.cpp | 7 ++- decompiler/data/StrFileReader.h | 1 + decompiler/data/TextureDB.cpp | 8 ++- decompiler/data/TextureDB.h | 5 +- decompiler/data/dir_tpages.cpp | 6 +- decompiler/data/dir_tpages.h | 2 +- decompiler/data/game_count.cpp | 7 ++- decompiler/data/game_count.h | 3 +- decompiler/data/game_text.cpp | 12 ++-- decompiler/data/game_text.h | 1 + decompiler/data/streamed_audio.cpp | 15 ++--- decompiler/data/tpage.cpp | 11 ++-- decompiler/extractor/main.cpp | 11 ++-- decompiler/level_extractor/BspHeader.cpp | 5 +- decompiler/level_extractor/BspHeader.h | 9 +-- decompiler/level_extractor/MercData.cpp | 7 ++- decompiler/level_extractor/MercData.h | 6 +- .../level_extractor/extract_collide_frags.h | 1 + decompiler/level_extractor/extract_common.cpp | 3 +- decompiler/level_extractor/extract_common.h | 1 + decompiler/level_extractor/extract_level.cpp | 18 +++--- decompiler/level_extractor/extract_level.h | 1 + decompiler/level_extractor/extract_merc.cpp | 8 ++- decompiler/level_extractor/extract_merc.h | 3 +- decompiler/level_extractor/extract_shrub.cpp | 9 +-- decompiler/level_extractor/extract_shrub.h | 5 +- decompiler/level_extractor/extract_tfrag.cpp | 10 ++-- decompiler/level_extractor/extract_tfrag.h | 5 +- decompiler/level_extractor/extract_tie.cpp | 6 +- decompiler/level_extractor/extract_tie.h | 6 +- decompiler/main.cpp | 15 +++-- decompiler/util/DataParser.cpp | 7 ++- decompiler/util/DataParser.h | 5 +- decompiler/util/DecompilerTypeSystem.cpp | 7 ++- decompiler/util/DecompilerTypeSystem.h | 5 +- decompiler/util/Error.h | 1 + decompiler/util/StackSpillMap.h | 2 +- decompiler/util/TP_Type.cpp | 1 + decompiler/util/TP_Type.h | 8 ++- decompiler/util/config_parsers.cpp | 1 + decompiler/util/config_parsers.h | 2 + decompiler/util/data_decompile.cpp | 15 +++-- decompiler/util/data_decompile.h | 8 ++- decompiler/util/goal_data_reader.cpp | 3 +- decompiler/util/goal_data_reader.h | 3 +- decompiler/util/sparticle_decompile.cpp | 6 +- decompiler/util/sparticle_decompile.h | 3 +- game/common/str_rpc_types.h | 1 + game/common/vu.h | 8 ++- game/discord.cpp | 12 ++-- game/discord.h | 2 + game/graphics/display.cpp | 1 + game/graphics/display.h | 6 +- game/graphics/gfx.cpp | 16 ++--- game/graphics/gfx.h | 3 +- .../opengl_renderer/BucketRenderer.cpp | 2 +- .../graphics/opengl_renderer/BucketRenderer.h | 10 ++-- .../opengl_renderer/DirectRenderer.cpp | 9 ++- .../graphics/opengl_renderer/DirectRenderer.h | 6 +- .../opengl_renderer/DirectRenderer2.cpp | 7 ++- .../opengl_renderer/DirectRenderer2.h | 4 +- game/graphics/opengl_renderer/EyeRenderer.cpp | 4 +- game/graphics/opengl_renderer/EyeRenderer.h | 3 +- .../opengl_renderer/OpenGLRenderer.cpp | 22 +++---- .../graphics/opengl_renderer/OpenGLRenderer.h | 7 ++- game/graphics/opengl_renderer/Profiler.cpp | 7 ++- game/graphics/opengl_renderer/Profiler.h | 4 +- game/graphics/opengl_renderer/Shader.cpp | 6 +- .../opengl_renderer/ShadowRenderer.cpp | 3 +- .../graphics/opengl_renderer/ShadowRenderer.h | 3 +- game/graphics/opengl_renderer/SkyBlendCPU.cpp | 6 +- game/graphics/opengl_renderer/SkyBlendCPU.h | 3 +- game/graphics/opengl_renderer/SkyBlendGPU.cpp | 1 + game/graphics/opengl_renderer/SkyBlendGPU.h | 3 +- game/graphics/opengl_renderer/SkyRenderer.cpp | 9 ++- game/graphics/opengl_renderer/SkyRenderer.h | 4 +- game/graphics/opengl_renderer/Sprite3.cpp | 5 +- game/graphics/opengl_renderer/Sprite3.h | 11 ++-- .../opengl_renderer/SpriteRenderer.cpp | 8 ++- .../graphics/opengl_renderer/SpriteRenderer.h | 5 +- .../opengl_renderer/TextureUploadHandler.cpp | 9 +-- .../opengl_renderer/background/Shrub.h | 9 +-- .../opengl_renderer/background/TFragment.cpp | 3 +- .../opengl_renderer/background/TFragment.h | 5 +- .../opengl_renderer/background/Tfrag3.h | 3 +- .../opengl_renderer/background/Tie3.h | 9 +-- .../background/background_common.cpp | 8 ++- .../background/background_common.h | 1 + game/graphics/opengl_renderer/debug_gui.cpp | 2 + game/graphics/opengl_renderer/debug_gui.h | 2 +- .../opengl_renderer/foreground/Generic2.cpp | 1 + .../opengl_renderer/foreground/Merc2.cpp | 4 +- .../opengl_renderer/loader/Loader.cpp | 4 +- game/graphics/opengl_renderer/loader/Loader.h | 9 +-- .../opengl_renderer/loader/LoaderStages.cpp | 3 +- game/graphics/opengl_renderer/loader/common.h | 10 +++- .../graphics/opengl_renderer/ocean/OceanMid.h | 2 +- .../opengl_renderer/ocean/OceanMidAndFar.cpp | 1 + .../opengl_renderer/ocean/OceanMidAndFar.h | 4 +- .../opengl_renderer/ocean/OceanNear.cpp | 1 + .../opengl_renderer/ocean/OceanNear.h | 4 +- .../opengl_renderer/ocean/OceanTexture.cpp | 2 + .../opengl_renderer/ocean/OceanTexture.h | 2 +- .../graphics/opengl_renderer/opengl_utils.cpp | 9 ++- game/graphics/opengl_renderer/opengl_utils.h | 3 +- game/graphics/opengl_renderer/sprite_common.h | 5 +- game/graphics/pipelines/opengl.cpp | 39 +++++++------ game/graphics/pipelines/opengl.h | 6 +- game/graphics/sceGraphicsInterface.cpp | 5 +- game/graphics/texture/TextureConverter.cpp | 6 +- game/graphics/texture/TexturePool.cpp | 18 +++--- game/graphics/texture/TexturePool.h | 6 +- game/graphics/texture/jak1_tpage_dir.cpp | 6 +- game/graphics/texture/jak1_tpage_dir.h | 1 + game/kernel/Ptr.h | 3 +- game/kernel/fileio.cpp | 12 ++-- game/kernel/fileio.h | 3 +- game/kernel/kboot.cpp | 22 ++++--- game/kernel/kdgo.cpp | 18 +++--- game/kernel/kdgo.h | 3 +- game/kernel/kdsnetm.cpp | 12 ++-- game/kernel/kdsnetm.h | 1 + game/kernel/klink.cpp | 19 +++--- game/kernel/klink.h | 5 +- game/kernel/klisten.cpp | 13 +++-- game/kernel/kmachine.cpp | 58 ++++++++++--------- game/kernel/kmachine.h | 3 +- game/kernel/kmalloc.cpp | 9 ++- game/kernel/kmalloc.h | 3 +- game/kernel/kmemcard.cpp | 22 +++---- game/kernel/kmemcard.h | 3 +- game/kernel/kprint.cpp | 27 +++++---- game/kernel/kscheme.cpp | 35 ++++++----- game/kernel/kscheme.h | 5 +- game/kernel/ksocket.cpp | 7 ++- game/kernel/ksocket.h | 5 +- game/kernel/ksound.cpp | 9 ++- game/main.cpp | 7 ++- game/mips2c/functions/collide_cache.cpp | 6 +- game/mips2c/functions/collide_edge_grab.cpp | 2 +- game/mips2c/functions/collide_func.cpp | 2 +- game/mips2c/functions/collide_mesh.cpp | 2 +- game/mips2c/functions/generic_effect.cpp | 2 +- game/mips2c/functions/generic_effect2.cpp | 2 +- game/mips2c/functions/generic_merc.cpp | 2 +- game/mips2c/functions/joint.cpp | 2 +- game/mips2c/functions/ripple.cpp | 2 +- game/mips2c/functions/shadow.cpp | 2 +- game/mips2c/functions/sky_tng.cpp | 2 +- game/mips2c/functions/test_func.cpp | 6 +- game/mips2c/functions/tfrag.cpp | 2 +- game/mips2c/functions/tie_methods.cpp | 2 +- game/mips2c/functions/time_of_day.cpp | 2 +- game/mips2c/mips2c_private.h | 14 +++-- game/mips2c/mips2c_table.cpp | 3 +- game/mips2c/mips2c_table.h | 9 +-- game/overlord/dma.cpp | 7 ++- game/overlord/fake_iso.cpp | 18 +++--- game/overlord/iso.cpp | 26 +++++---- game/overlord/iso.h | 3 +- game/overlord/iso_api.cpp | 11 ++-- game/overlord/iso_cd.cpp | 10 +++- game/overlord/iso_cd.h | 3 +- game/overlord/iso_queue.cpp | 12 ++-- game/overlord/iso_queue.h | 3 +- game/overlord/isocommon.cpp | 6 +- game/overlord/isocommon.h | 2 + game/overlord/overlord.cpp | 11 ++-- game/overlord/ramdisk.cpp | 14 +++-- game/overlord/sbank.cpp | 4 +- game/overlord/soundcommon.cpp | 4 +- game/overlord/soundcommon.h | 1 + game/overlord/srpc.cpp | 27 +++++---- game/overlord/srpc.h | 1 + game/overlord/ssound.cpp | 7 ++- game/overlord/ssound.h | 3 +- game/overlord/stream.cpp | 19 +++--- game/runtime.cpp | 50 ++++++++-------- game/runtime.h | 1 + game/sce/deci2.cpp | 7 ++- game/sce/iop.cpp | 7 ++- game/sce/libcdvd_ee.cpp | 1 + game/sce/libgraph.cpp | 1 + game/sce/libpad.cpp | 5 +- game/sce/sif_ee.cpp | 15 +++-- game/sce/sif_ee_memcard.cpp | 18 +++--- game/sce/stubs.cpp | 4 +- game/sound/989snd/ame_handler.cpp | 3 +- game/sound/989snd/ame_handler.h | 4 +- game/sound/989snd/blocksound_handler.cpp | 4 +- game/sound/989snd/blocksound_handler.h | 4 +- game/sound/989snd/handle_allocator.h | 3 +- game/sound/989snd/loader.cpp | 5 +- game/sound/989snd/loader.h | 17 +++--- game/sound/989snd/midi_handler.cpp | 1 + game/sound/989snd/midi_handler.h | 14 +++-- game/sound/989snd/musicbank.cpp | 2 + game/sound/989snd/musicbank.h | 1 + game/sound/989snd/player.cpp | 4 +- game/sound/989snd/player.h | 23 ++++---- game/sound/989snd/sfxblock.cpp | 1 + game/sound/989snd/sfxblock.h | 1 + game/sound/989snd/sndplay.cpp | 3 +- game/sound/989snd/soundbank.h | 5 +- game/sound/989snd/util.h | 4 +- game/sound/989snd/vagvoice.cpp | 7 ++- game/sound/989snd/vagvoice.h | 5 +- game/sound/common/envelope.cpp | 1 + game/sound/common/envelope.h | 1 + game/sound/common/sound_types.h | 3 +- game/sound/common/synth.cpp | 1 + game/sound/common/synth.h | 10 ++-- game/sound/common/voice.cpp | 2 + game/sound/common/voice.h | 2 + game/sound/sdshim.cpp | 4 ++ game/sound/sdshim.h | 1 + game/sound/sndshim.cpp | 7 ++- game/system/Deci2Server.cpp | 3 +- game/system/Deci2Server.h | 5 +- game/system/IOP_Kernel.cpp | 7 ++- game/system/IOP_Kernel.h | 14 +++-- game/system/SystemThread.cpp | 1 + game/system/SystemThread.h | 8 +-- game/system/iop_thread.cpp | 4 +- game/system/iop_thread.h | 3 +- game/system/newpad.cpp | 4 +- game/system/newpad.h | 1 + game/system/vm/dmac.cpp | 7 ++- game/system/vm/dmac.h | 1 + game/system/vm/vm.cpp | 10 +++- game/tools/subtitles/subtitle_editor.cpp | 12 ++-- game/tools/subtitles/subtitle_editor.h | 8 ++- goalc/build_level/FileInfo.cpp | 4 +- goalc/build_level/LevelFile.cpp | 1 + goalc/build_level/LevelFile.h | 9 +-- goalc/build_level/ResLump.cpp | 3 +- goalc/build_level/ResLump.h | 2 +- goalc/build_level/TexturePool.h | 4 +- goalc/build_level/Tfrag.cpp | 6 +- goalc/build_level/Tfrag.h | 1 + goalc/build_level/build_level.cpp | 15 ++--- goalc/build_level/build_level.h | 2 +- goalc/build_level/collide_bvh.cpp | 5 +- goalc/build_level/collide_bvh.h | 1 + goalc/build_level/collide_drawable.cpp | 4 +- goalc/build_level/collide_pack.cpp | 5 +- goalc/build_level/color_quantization.cpp | 6 +- goalc/build_level/color_quantization.h | 1 + goalc/build_level/gltf_mesh_extract.cpp | 9 ++- goalc/build_level/gltf_mesh_extract.h | 1 + goalc/compiler/CodeGenerator.cpp | 12 ++-- goalc/compiler/CodeGenerator.h | 1 + goalc/compiler/Compiler.cpp | 7 ++- goalc/compiler/Compiler.h | 10 ++-- goalc/compiler/CompilerSettings.h | 3 +- goalc/compiler/ConstantValue.h | 6 +- goalc/compiler/Env.cpp | 8 ++- goalc/compiler/Env.h | 13 +++-- goalc/compiler/IR.cpp | 10 +++- goalc/compiler/IR.h | 4 +- goalc/compiler/Lambda.h | 1 + goalc/compiler/StaticObject.cpp | 5 +- goalc/compiler/StaticObject.h | 6 +- goalc/compiler/SymbolInfo.h | 7 ++- goalc/compiler/Util.cpp | 5 +- goalc/compiler/Val.cpp | 4 +- goalc/compiler/Val.h | 13 +++-- .../compiler/compilation/CompilerControl.cpp | 1 + goalc/compiler/compilation/ControlFlow.cpp | 3 +- goalc/compiler/compilation/Debug.cpp | 4 +- goalc/compiler/compilation/Define.cpp | 3 +- goalc/compiler/compilation/Function.cpp | 1 + goalc/compiler/compilation/Macro.cpp | 6 +- goalc/compiler/compilation/Math.cpp | 6 +- goalc/compiler/compilation/State.cpp | 3 +- goalc/compiler/compilation/Static.cpp | 6 +- goalc/compiler/compilation/Type.cpp | 10 ++-- goalc/data_compiler/DataObjectGenerator.cpp | 6 +- goalc/data_compiler/DataObjectGenerator.h | 5 +- goalc/data_compiler/dir_tpages.cpp | 3 +- goalc/data_compiler/game_count.cpp | 5 +- goalc/data_compiler/game_text_common.cpp | 12 ++-- goalc/data_compiler/game_text_common.h | 9 +-- goalc/debugger/DebugInfo.cpp | 4 +- goalc/debugger/DebugInfo.h | 12 ++-- goalc/debugger/Debugger.cpp | 5 +- goalc/debugger/Debugger.h | 3 + goalc/debugger/disassemble.cpp | 7 ++- goalc/debugger/disassemble.h | 2 + goalc/emitter/CallingConvention.cpp | 1 + goalc/emitter/CallingConvention.h | 3 +- goalc/emitter/CodeTester.cpp | 2 + goalc/emitter/CodeTester.h | 11 ++-- goalc/emitter/IGen.h | 6 +- goalc/emitter/ObjectFileData.h | 1 + goalc/emitter/ObjectGenerator.cpp | 7 ++- goalc/emitter/ObjectGenerator.h | 4 +- goalc/emitter/Register.cpp | 1 + goalc/emitter/Register.h | 3 +- goalc/listener/Listener.cpp | 22 ++++--- goalc/listener/Listener.h | 12 ++-- goalc/listener/MemoryMap.cpp | 9 ++- goalc/listener/MemoryMap.h | 3 +- goalc/main.cpp | 19 +++--- goalc/make/MakeSystem.cpp | 10 ++-- goalc/make/MakeSystem.h | 1 + goalc/make/Tool.cpp | 7 ++- goalc/make/Tool.h | 1 + goalc/make/Tools.cpp | 9 ++- goalc/make/Tools.h | 3 +- goalc/regalloc/Allocator.cpp | 7 ++- goalc/regalloc/Allocator.h | 5 +- goalc/regalloc/Allocator_v2.cpp | 9 ++- goalc/regalloc/IRegSet.h | 1 + goalc/regalloc/IRegister.cpp | 4 +- goalc/regalloc/IRegister.h | 1 + goalc/regalloc/allocator_interface.cpp | 3 +- goalc/regalloc/allocator_interface.h | 3 +- test/decompiler/FormRegressionTest.cpp | 18 +++--- test/decompiler/FormRegressionTest.h | 5 +- test/decompiler/test_AtomicOpBuilder.cpp | 8 ++- test/decompiler/test_DataParser.cpp | 14 +++-- test/decompiler/test_DisasmVifDecompile.cpp | 3 +- .../decompiler/test_FormBeforeExpressions.cpp | 3 +- test/decompiler/test_FormExpressionBuild.cpp | 3 +- test/decompiler/test_FormExpressionBuild2.cpp | 3 +- test/decompiler/test_FormExpressionBuild3.cpp | 3 +- .../test_FormExpressionBuildLong.cpp | 3 +- test/decompiler/test_InstructionDecode.cpp | 2 +- test/decompiler/test_InstructionParser.cpp | 4 +- test/decompiler/test_VuDisasm.cpp | 10 ++-- test/decompiler/test_gkernel_decomp.cpp | 3 +- test/decompiler/test_math_decomp.cpp | 3 +- test/goalc/framework/test_runner.cpp | 17 +++--- test/goalc/framework/test_runner.h | 3 +- test/goalc/test_arithmetic.cpp | 28 +++++---- test/goalc/test_collections.cpp | 29 +++++----- test/goalc/test_compiler.cpp | 6 +- test/goalc/test_control_statements.cpp | 29 +++++----- test/goalc/test_debugger.cpp | 7 ++- test/goalc/test_game_no_debug.cpp | 2 +- test/goalc/test_goal_kernel.cpp | 5 +- test/goalc/test_variables.cpp | 29 +++++----- test/goalc/test_with_game.cpp | 36 ++++++------ test/offline/offline_test_main.cpp | 20 ++++--- test/test_CodeTester.cpp | 2 +- test/test_common_util.cpp | 26 +++++---- test/test_emitter.cpp | 2 +- test/test_emitter_avx.cpp | 2 +- test/test_goos.cpp | 3 +- test/test_kernel.cpp | 10 ++-- test/test_listener_deci2.cpp | 4 +- test/test_main.cpp | 6 +- test/test_math.cpp | 3 +- test/test_pretty_print.cpp | 8 ++- test/test_reader.cpp | 3 +- test/test_type_system.cpp | 9 +-- test/test_zstd.cpp | 3 +- test/test_zydis.cpp | 4 +- 501 files changed, 2085 insertions(+), 1264 deletions(-) diff --git a/.clang-format b/.clang-format index a724b7fdd..87f9bf8e9 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 33abd67a2..b6f3216eb 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 ea72c50f5..0b5d2b248 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 ba591240e..3768baab3 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 4629fd54f..d928c37c9 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 c6f4fe05e..5ff7bd1e6 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 0e80f3513..ce9143cc9 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 e698e8e29..025b445a7 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 10c7b4894..6ca49d2ed 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 37e7e67f2..40a1ba246 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 c7db82206..5d9e0899b 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 879ee585d..85acad65b 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 826806b1b..a573f8fb7 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 0dd17d700..0025c596b 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 5751e12e3..cf704eb67 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 7ff1b6799..77b024058 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 fd79fa94e..6b50e6600 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 34e458545..5e6f5f582 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 898d98c5f..b02f10df5 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 55beacfc9..932f00e9e 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 3e713a7f5..54b563da2 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 b96d9611e..b155a646c 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 9800af299..092c1b1b4 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 b85565883..cb78fc30d 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 301216333..cfe01f09d 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 8e711bb6b..09cea4691 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 cf69b4385..0963bd4eb 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 47df3575d..53fe4e1d3 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 947e1b525..ee3c994c1 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 71eeeb84b..a5924555b 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 a31ab6b84..bdabb9ea6 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 bcc0516c4..2b42fdd1b 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 51466d6c1..a34bb55a9 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 20d285027..1052b9426 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 54a356737..a601443ac 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 357ff52d3..9dd725ab9 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 90ec42e00..77a02d7d2 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 38dda75ff..03ca3a2e0 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 b6b62a114..735b80ac6 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 e2ee06d46..a0eebfd49 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 5de1cca8e..225ddcbd5 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 bbadd67ce..eb19cd28b 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 2c0815487..28eafa14a 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 828ef5284..1d709802b 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 58759d3b6..4cd5e09ba 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 26a9699a0..865ffbace 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 7fc0a9443..8628a0d6c 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 520769cda..a5394f296 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 29282a5da..e816b8634 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 c5d8fdafd..7ced6b862 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 4733c7266..cc013e71e 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 2765bd022..6932c86f8 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 defbc1be1..8978f134c 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 a3788edd5..4b1ecd60b 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 c21467558..c7a52165c 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 c0a83c3e1..b6faf17c0 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 3650ee6d9..5ca25c6de 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 053b189db..388021482 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 dc0559aab..d6aa240af 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 64d32ad7c..aa2cc38b7 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 b1ecb9801..cf992455a 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 066ba37df..5eee37d8f 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 5232f62cc..a4a7b22c6 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 e57a94ee2..f6fec2790 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 3916e47a5..2a8ba2c28 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 0d360b0f9..2203ba460 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 ff7693fdb..456db7cb6 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 d75680fbd..3cd184241 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 87117a9e0..d192abe1c 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 2beb0f67b..d55357540 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 8abeee971..2f5eada17 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 83faf654a..b48f4e14e 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 5792bca4b..4bfa31d2b 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 a4f6ed573..8c8f1e606 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 a960c7a60..b8c1fff2d 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 a64779954..aea1917a4 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 b800648e3..a28acfc85 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 9dfe4c482..e328ea3de 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 762ed923a..9be850341 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 34f03c572..0767f164f 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 fb931db3c..39f8fd6f8 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 aff7e5902..b0ef58b8d 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 d0f3f845c..2cd5fad94 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 3d940b29e..b328d2740 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 5915bfea9..06d22b6e0 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 62f873344..7b6890e80 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 428a0c4b7..0dfbcac67 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 9e3a21f6d..1e210a097 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 f25f4b554..1f4c605c0 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 b88dc9b0b..e502d90fb 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 6e65ddf43..74b836c37 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 6109d90cc..ef9fae8b7 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 a43383863..3cb018d75 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 6034c5de2..7a6bc85d2 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 daff8a784..ecf3eaccc 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 b8df563cf..25580b66e 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 b9efc4474..51bfd8b82 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 1c62bbd70..dd7221130 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 6bbcaa480..47cda29f0 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 7e7c1cbcc..91084eb55 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 674fd6410..12c3529b5 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 696aff35e..14c1cbd41 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 5b50d8927..113258515 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 a9be9ecb5..d265238a3 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 7abe855cc..ac2426f1d 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 aaf2fd958..9bd920534 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 b04a59688..e7d700f9a 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 6d8f37f08..80f434887 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 0180c6368..adb9c6a3b 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 ea68a0e02..a8bd27ebe 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 b2fd83836..d2d9353a5 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 ac961f456..d3c3509f0 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 6c294b10c..4e39e10c0 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 46d5b2300..b520dbc95 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 8edab5ea6..cc2385205 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 4db004b0e..abbee45fc 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 750e0f073..81f0d6320 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 2687fe428..af812262c 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 1873591cb..80b49185c 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 154b7b2f5..0507d98a5 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 bb5e74200..680d560c0 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 9f1f8ea05..9248de12e 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 9980f0e88..4d9dc8a4b 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 208f09865..d9247ee93 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 27b01bee4..13f3ba143 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 41ec97d22..cd575af10 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 0cd7b9752..124fc4821 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 0f43bf544..ca492b904 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 c0de24895..d76a1da96 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 f1870a26c..d94c2839a 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 4234bebe0..97c25b726 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 dc278d7bf..7559362ff 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 1748df3eb..0172e313a 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 f0daf965e..2e640f18c 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 f9ffd7e7c..2331f6c01 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 84f099fee..0d72667e3 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 073f0204b..0ba268c59 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 5da13d4ce..7bfaf0073 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 716992826..db470777e 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 b161bbe00..a85510332 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 b9bab1243..2c5da2643 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 7371b5306..590254759 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 8dc68b25d..83c94ddc9 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 5a492f69c..c97685cbb 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 45d46d114..34a53985c 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 79ac412c8..23e8c0ae4 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 8b5e0cde3..b7f823f5d 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 ddf6034f8..f2dc95d73 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 ded897cc7..d30a0267f 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 530c21440..a12458848 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 74f5c6dfb..f7f67af96 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 1d3a1f54b..a1b73458f 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 7d1855b4c..e26aa410e 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 acdd932f9..4d020c097 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 0e799cfe9..1a5a98d18 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 8064a41c3..a3159e855 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 eb66a76dd..843aa57bb 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 6e9c40433..3da09034e 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 4d64f7a45..0155ed639 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 44fc2bf44..6ae3ee62a 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 8ff25b07f..216127d2b 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 55a91495f..c50030df5 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 ec1a12d34..58922eda3 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 56996920b..f83307e0e 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 ba7f0bb6d..543f86094 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 3e40dfe69..35e1a1c3b 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 560bccf64..48daeba7c 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 772615ea9..c57fc376b 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 82a3045d8..6e4c2dd2e 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 dbe176661..9d4d91dbd 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 9e072478b..acaeff9fa 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 59c5b167f..6429a775e 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 2556b0ab8..70855ac3b 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 96b1c6ff6..335ca1416 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 ae6d8e529..f45882c81 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 44cc76e9b..75c21609c 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 1d762dc7d..0eba85e1b 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 3d507351f..2e19b91f1 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 7ebe8a6c6..a90bfb21f 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 841898354..8b62cf5d9 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 aab496b97..6b99fb285 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 44a383605..d29209a2d 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 49fb2a9ca..7bf13a0cd 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 7fb2f1693..ea1edef0f 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 64f66962a..8106ecd54 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 80a89c362..bdd58bacf 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 7132a7341..2d3f07418 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 632e62b5e..8a0f829c4 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 6d6118cbd..1d3f9866f 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 763cc91d8..b2da99e0f 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 497056f9c..ffecbdda5 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 b7f79606c..0c6ff7d3b 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 ea879c807..4a5498a92 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 7ad73e2e8..d49202508 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 76a36aa53..e783105b1 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 ceb301888..36cf9a0ef 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 92380474b..e39bb2c59 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 68a55819f..f16d3e3ce 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 c2b5b234a..8b4383507 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 755263238..8777e84f6 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 a88d5e703..9217879bf 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 3784d92b5..30383256f 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 c99b46905..57ca0d6af 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 b5385bc21..64cc80b24 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 21d6a4d99..a85b6e615 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 daf707ee0..2c6c26a7e 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 124cd1a55..3e9794409 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 269478fe1..430f6dbc4 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 0a9adff14..ad701c96f 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 2c2fda700..05b072e59 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 163dedef9..4409e9ea0 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 16f7e4647..e7eaca136 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 882e53951..0fc81fa97 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 77de41d1b..116755c4f 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 655822429..5c0715fdb 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 0b43e33f4..ddce74a7a 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 b58f2521a..3d3a86172 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 019518413..d677f6ccc 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 ed51f7a09..f59a125d0 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 3ebc43d51..4b20be892 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 0bbe697a6..dcd84df9d 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 e3e0371df..fd721be0a 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 ed9f51cb6..fa12a70a4 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 438d9442f..ed7ef3963 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 6bb39bdac..43ab439b0 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 7b92cc784..cef6da68d 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 295263ee1..9e67ba6c5 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 5449a5e6a..ed819c369 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 6b17314fe..7e5443a3a 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 d48a37a13..1218b96cf 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 516aa667b..76ad6140f 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 a21b57413..0dfd366a0 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 cd79f162f..1f1183c48 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 82f09eb0d..0e70c6b93 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 eb344ba97..5121dee7e 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 1db3d404d..dccdb683e 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 618ae4661..7208b06bb 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 f64d84845..4c60809fa 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 8f9fac96d..cae1932d2 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 4df6660a3..d3fe99a7a 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 81df49b64..91fedcfb2 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 d6a0e76a0..66997cb5a 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 81f9516a7..9aeca8975 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 849e2799d..2c5f037cf 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 b4fb7c2ba..cfa4e1312 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 1977649f1..c17abcfae 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 a9548206a..2f0bcd9d5 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 936b3a10d..c26daf0a8 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 e59b59247..e1a0c80db 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 2dd13f6a8..8d170f01b 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 6aac5303d..641b76d23 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 00db9ca83..cdc424a40 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 8e632d6b4..42e1c07dd 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 8d386cbc3..5b62aceef 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 b785a7ba8..31ecb8859 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 be28bd12d..d77702fe2 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 2e99ae000..79f4fb8ec 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 2e0772394..0caac14ab 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 bb52a4598..0d22a3c34 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 7cb2c83bc..c0670cebd 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 7c2e7d91d..45d1e3350 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 30eaebd36..16ae0d3ad 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 eacc7de04..ab8d5d3e0 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 3e4f46bde..35179f9d8 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 ade87b62e..422556feb 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 bc45781fb..99300399f 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 41db0f162..d8837eff5 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 b1d11a895..272b69020 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 24e40b04c..dd7ff7938 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 821f85995..95017426d 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 4efbaea19..1e6937cf3 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 4885b16e3..3fe5a700c 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 a09e20d26..640abc30d 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 8eeaa28e2..81a53d54c 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 557c54575..ee7f20184 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 921c4eaf1..8e7e15c02 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 34322c225..5a24ff20b 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 41397ff1a..2eb2e5227 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 785b7ff42..4d2c4e0c1 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 0ca9d8aad..d689fde7a 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 67b8e604f..791c2d06b 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 82969343e..0cfd98e23 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 c13bf20d5..90c8f9f8a 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 0a3d9d2a1..27c696856 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 a4fec92ec..224ad2a91 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 d3e2da0b1..042715477 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 5131f0c50..6b00eec6e 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 3a594da7f..dbf0bb2f1 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 fc768aed8..bb342e143 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 0e4d6effd..6cd03cbce 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 8fe39cc8f..0ecaab6cf 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 0a15c880b..623e535a4 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 fc0c0dc50..9c29d0e79 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 e3f9cd6ec..b32229721 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 8226ee422..c987e2cc2 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 3e25960b9..a04619534 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 0cb943273..535df70ad 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 b2cb64fe8..9b9f9ff0f 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 9f1b7e731..316492740 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 c131424fe..0f1aef2d6 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 94fd669a6..e6b46d98a 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 e2963de99..7962d342c 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 b250ac492..40b8b70e2 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 fb5b32cb7..ac3e30505 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 922d207ea..93545cc50 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 40dd8e0b6..7f10c418c 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 9675795e6..91072a95a 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 07399584e..47614cd6e 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 e26d000d8..85ffcefdb 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 7f55c414b..7b5a350bd 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 2697e3c1b..33c87feaa 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 843b89776..54bbbf027 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 d564fc84e..628626c40 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 116d8086d..ba9ef4949 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 0894de922..4db46bded 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 ec0fa0f2a..f8fb8aac4 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 ecf111318..ec2ec2418 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 d4f72cafe..df016bae3 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 3b93a060a..0068c0f35 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 675f455ae..695f61d1c 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 9799bc302..21637eadc 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 9a5c39835..6a41dcaa5 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 525a892b9..d0e916ce0 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 5e4182d7f..a3ab7beb9 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 6d40bb84d..dbfc64b72 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 c2c1e9ac3..f3f1c7bcd 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 bb659ea28..be2358daf 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 8f4fdee63..9c5d87916 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 1e3dbb3e8..9dc56afb6 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 18c832547..47295b51d 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 ab9450c7a..2f9707191 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 89cfe2d09..79030bf84 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 0b6136b96..07f919bb6 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 99b3efb47..82707bf0a 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 e1be39bb8..3205dab30 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 7fb254a77..6fefe9cc2 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 65e5bb84f..b2690332a 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 c2d9eef08..ed2714595 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 ba2ef6cbf..d85dcb77f 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 d3ee8c074..703344027 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 8aa446068..b42705653 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 5653133d6..e2a6ffcce 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 d72e54a3c..96c719661 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 af8c21800..83cae1838 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 6fd103e0e..b0d5f2cdf 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 87217f4a6..099b98e6f 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 f02d59744..809871c3d 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 a074c6a1a..2a5cbcca5 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 66e6a2266..5ce8544e9 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 d4fd06ce9..372dee0a4 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 75e2c6ef4..e17a77a78 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 12b856a93..5803ca345 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 5acc599d7..50de71864 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 cf9dd9e51..e3457a19c 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 39d0220ad..162baf66a 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 0e91275c3..790e35bc5 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 ed6f3d56d..d8958741c 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 19da15c4f..5d3755d00 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 08c848c08..e01e0cc68 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 7eae6cefc..5519e6d6f 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 c119ec86a..ee37e7410 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 09c45c0ba..cd6dd0572 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 692db9d7b..629059df6 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 af8f55d75..d96df8f14 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 1fc666437..569f543a7 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 3529c2af9..7c55f5f96 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 668a09141..bb3c7a157 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 813f2d4d9..6c9025a6d 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 de021e833..e47f81f31 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 0b3751e10..d971f61ef 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 2f0c98ba3..6849b2138 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 5dfd96df2..c9dc9b324 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 1e3075e1f..a975bdf36 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 97528a757..4d979482c 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 1c5367143..229a67457 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 b5902eb98..92a931707 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 29f53dd4c..5ae7e48d7 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 f70a09ee2..541d37a11 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 19b6ee645..865faeeef 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 2cef16024..5309eb751 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 a15c5483f..a5ac59558 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 f9c137a47..5fe9198a0 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 9edb3586e..cc5a77a13 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 afe685daa..e37d1ef15 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 821c7e93f..ece6a40b3 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 11b4f4bda..c4abe6c0c 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 91cde30a4..788f5e058 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 512167f05..fe7c9d72c 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 91784dc11..5ff39cb51 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 44b5ba68c..f0b92a81d 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 e92905253..26e6c3974 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 5bc0e4760..f429f07b9 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 50eee36f1..98be75821 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 bc97bcd5c..958c197d7 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 52100e7a4..e6ecf7462 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 03ec68db5..19e8761c2 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 634e189f6..61d788d3a 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 44a1c5071..af02b21eb 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 a157cf712..de604c7aa 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 2ef9cbcd7..64a3ba7ce 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 635f0650d..0cf498fbc 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 6b37e6716..477d5036f 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 8be93f675..ed8c17cf3 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 6343d13a5..514c8517e 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 95a19ce50..26cd318b6 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 ca66c1320..56f4070b1 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 eb8751aa4..38ec37007 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 3a15a1c92..c79c64ea4 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 db8e4cc70..12f795824 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 563a85c31..0bac51418 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 c8eafb0b3..4a122667d 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 ef5cd8e2d..4d13ec293 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 313d5f5a3..2d3603a57 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 70691a21c..3e0eac37c 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 4d6717755..3834ca009 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 aa04024b6..0eca1167a 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 c4068781f..6ce4d3672 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 1b562ad66..b3c9e3297 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 44c575eae..c73012575 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 6864bfa2f..27d6fb05a 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 97e5b32dd..5ef2175be 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 de2e3b191..fd898f51b 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 c396f2553..3eeb68ba5 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 7ff7f36c7..7ae7b1554 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 7f0699cfb..19200dd25 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 52d087027..1dbc08542 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 98640f3d5..c38252ac9 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 d3d3e3b97..f7f170186 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 5fc8df3fb..45a2764aa 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 090fb8018..8c014869a 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 526b47e1e..b75a5af0c 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 4228a3958..0e64a9b83 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 a6338d444..5ac144c56 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 542df8945..479fbceb6 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 3a087c20e..aaa965085 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 261bab823..24ac7554b 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 8ae856543..9cb62803e 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 538a6b43c..40249f10e 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 11cb400e1..90702b5ae 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 57ac46e8f..30bd7b6d2 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 4edce8b64..a81965788 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 27a8b7e9b..84943bcd9 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 7865fe1a6..ff58b00fe 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 7750c42cd..9d3dc934b 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 c6b7f63bb..ba6001aa6 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 cb3246797..81282b9a7 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 21f9c1b8d..d7c2f1e53 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 ad96d5fef..35ce58e52 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 8ee74454d..e2e7fa2b9 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 fe477295b..d1d2168a9 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 01194a4ce..b17f6df1e 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 966a1820f..59a0390d0 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 5c85be8bb..fc3d1459c 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 7f18b3b09..d4a8a356d 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 9674278db..43b948f05 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 5da9d8673..a83b86184 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 2b994dad6..2af3ab29a 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 52cba278d..6da5caf23 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 e5be03746..949b663e8 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 4b8092a45..a1dfe554b 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 56638b8a8..5f4d9a748 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 e42874962..1690b4146 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 fcad915c7..e4c7c0501 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 f4bfb31f8..8528f6f3e 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 44d4ba233..f7f1371b2 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 5f909a550..46f5bc022 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 db1d97490..af322a066 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 885771a60..05c332e2e 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 a7ff033c6..626669dd0 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 a5f2afb11..752664165 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 849b01119..9489c4aa2 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 632e7b46f..8834e9064 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 7dcbf8d89..160bcb86d 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 a56f1df64..dd2e503fa 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 fb562efa1..24793b11c 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 3b01212a5..c05270d5d 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 ad682359f..d7cd58f88 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 8b8ac040d..e7740c77a 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 fcbf5b8c6..416303970 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 81bc1b772..3ac88d8ee 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 fc89fdb75..f267f7e55 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 7185e7655..0feadb25d 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 245b6d0c9..d71790579 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 917b2146b..2e72432b7 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 e01423f34..0e1022793 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 d3f2bcc22..04e0608ca 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 33f49b020..7f4743af9 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 276771fb8..a70c1e77e 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 bf5961e8f..f5077e646 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 ac335512d..5662e949f 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 794cc6963..f905eab98 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 66237fb06..e488f97fb 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 687a9b54c..a39d490cb 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 cf7e706be..4bf5b929d 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 f08fdcbd3..ed083c6be 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 7c735c810..7394f6e76 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 72020f1ff..6885091db 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 d49d075e9..aeba24a66 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 8f63ccbfe..6c7080a1c 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 1519da99a..4d66c6a18 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 231139761..363c7175b 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) {