From c8883a1e541be6fd59ff0b1b1db674c7f2df6b63 Mon Sep 17 00:00:00 2001 From: scawful Date: Thu, 16 Jan 2025 03:44:37 -0500 Subject: [PATCH] Remove unused includes and clean up header files --- src/app/core/common.cc | 3 --- src/app/core/common.h | 3 --- src/app/editor/code/memory_editor.h | 18 ----------------- src/app/editor/dungeon/dungeon_editor.h | 1 - src/app/editor/graphics/gfx_group_editor.cc | 1 - src/app/editor/graphics/graphics_editor.cc | 1 - src/app/editor/music/music_editor.cc | 1 - src/app/editor/music/music_editor.h | 12 ++++------- src/app/editor/overworld/entity.h | 5 ++++- src/app/editor/overworld/overworld_editor.cc | 1 - src/app/editor/overworld/overworld_editor.h | 21 -------------------- src/app/editor/sprite/sprite_editor.h | 5 ++++- src/app/editor/sprite/zsprite.h | 3 --- src/app/editor/system/popup_manager.cc | 5 ----- src/app/editor/system/popup_manager.h | 1 - src/app/emu/audio/dsp.cc | 2 -- src/app/emu/audio/dsp.h | 4 ---- src/app/emu/cpu/cpu.cc | 1 + src/app/emu/cpu/cpu.h | 7 +------ src/app/emu/cpu/internal/addressing.cc | 3 +-- src/app/emu/cpu/internal/instructions.cc | 11 +--------- src/app/emu/emulator.cc | 1 + src/app/gfx/snes_palette.cc | 6 ++---- src/app/gui/color.cc | 5 ----- src/app/gui/input.cc | 1 - src/app/rom.h | 1 - src/app/zelda3/dungeon/object_names.h | 6 +----- src/app/zelda3/dungeon/object_renderer.cc | 4 ---- src/app/zelda3/dungeon/object_renderer.h | 7 +------ src/test/gfx/snes_palette_test.cc | 1 - 30 files changed, 21 insertions(+), 120 deletions(-) diff --git a/src/app/core/common.cc b/src/app/core/common.cc index 0dfc1045..f404b763 100644 --- a/src/app/core/common.cc +++ b/src/app/core/common.cc @@ -4,14 +4,11 @@ #include #include -#include #include #include -#include "absl/status/statusor.h" #include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" -#include "absl/strings/string_view.h" namespace yaze { namespace core { diff --git a/src/app/core/common.h b/src/app/core/common.h index a53e8ba6..d1319c8d 100644 --- a/src/app/core/common.h +++ b/src/app/core/common.h @@ -5,11 +5,8 @@ #include #include #include -#include #include -#include "absl/container/flat_hash_map.h" -#include "absl/status/statusor.h" #include "absl/strings/str_format.h" #include "absl/strings/str_cat.h" diff --git a/src/app/editor/code/memory_editor.h b/src/app/editor/code/memory_editor.h index ea5290bc..28e4131d 100644 --- a/src/app/editor/code/memory_editor.h +++ b/src/app/editor/code/memory_editor.h @@ -1,30 +1,12 @@ #ifndef YAZE_APP_EDITOR_CODE_MEMORY_EDITOR_H #define YAZE_APP_EDITOR_CODE_MEMORY_EDITOR_H -#include "absl/status/status.h" #include "app/core/constants.h" #include "app/core/platform/file_dialog.h" -#include "app/core/project.h" -#include "app/editor/code/assembly_editor.h" #include "app/editor/code/memory_editor.h" -#include "app/editor/dungeon/dungeon_editor.h" -#include "app/editor/editor.h" -#include "app/editor/graphics/graphics_editor.h" -#include "app/editor/graphics/palette_editor.h" -#include "app/editor/graphics/screen_editor.h" -#include "app/editor/music/music_editor.h" -#include "app/editor/overworld/overworld_editor.h" -#include "app/editor/sprite/sprite_editor.h" -#include "app/emu/emulator.h" -#include "app/gfx/snes_palette.h" -#include "app/gfx/snes_tile.h" -#include "app/gui/canvas.h" -#include "app/gui/icons.h" #include "app/gui/input.h" -#include "app/gui/style.h" #include "app/rom.h" #include "imgui/imgui.h" -#include "imgui/misc/cpp/imgui_stdlib.h" #include "imgui_memory_editor.h" namespace yaze { diff --git a/src/app/editor/dungeon/dungeon_editor.h b/src/app/editor/dungeon/dungeon_editor.h index 076150bd..d06e5619 100644 --- a/src/app/editor/dungeon/dungeon_editor.h +++ b/src/app/editor/dungeon/dungeon_editor.h @@ -2,7 +2,6 @@ #define YAZE_APP_EDITOR_DUNGEONEDITOR_H #include "absl/container/flat_hash_map.h" -#include "app/core/common.h" #include "app/editor/editor.h" #include "app/editor/graphics/gfx_group_editor.h" #include "app/editor/graphics/palette_editor.h" diff --git a/src/app/editor/graphics/gfx_group_editor.cc b/src/app/editor/graphics/gfx_group_editor.cc index ee210269..90d2d1c5 100644 --- a/src/app/editor/graphics/gfx_group_editor.cc +++ b/src/app/editor/graphics/gfx_group_editor.cc @@ -2,7 +2,6 @@ #include "absl/status/status.h" #include "absl/strings/str_cat.h" -#include "app/gfx/bitmap.h" #include "app/gfx/snes_palette.h" #include "app/gui/canvas.h" #include "app/gui/color.h" diff --git a/src/app/editor/graphics/graphics_editor.cc b/src/app/editor/graphics/graphics_editor.cc index 556885b4..1f6485cf 100644 --- a/src/app/editor/graphics/graphics_editor.cc +++ b/src/app/editor/graphics/graphics_editor.cc @@ -7,7 +7,6 @@ #include "app/core/platform/clipboard.h" #include "app/core/platform/file_dialog.h" #include "app/core/platform/renderer.h" -#include "app/editor/graphics/palette_editor.h" #include "app/gfx/bitmap.h" #include "app/gfx/compression.h" #include "app/gfx/scad_format.h" diff --git a/src/app/editor/music/music_editor.cc b/src/app/editor/music/music_editor.cc index f78aeefd..06b0d058 100644 --- a/src/app/editor/music/music_editor.cc +++ b/src/app/editor/music/music_editor.cc @@ -4,7 +4,6 @@ #include "absl/strings/str_format.h" #include "app/editor/code/assembly_editor.h" -#include "app/gui/canvas.h" #include "app/gui/icons.h" #include "app/gui/input.h" diff --git a/src/app/editor/music/music_editor.h b/src/app/editor/music/music_editor.h index d1ee9260..bdb543b5 100644 --- a/src/app/editor/music/music_editor.h +++ b/src/app/editor/music/music_editor.h @@ -1,12 +1,8 @@ #ifndef YAZE_APP_EDITOR_MUSIC_EDITOR_H #define YAZE_APP_EDITOR_MUSIC_EDITOR_H -#include "absl/strings/str_format.h" #include "app/editor/code/assembly_editor.h" #include "app/editor/editor.h" -#include "app/gui/canvas.h" -#include "app/gui/icons.h" -#include "app/gui/input.h" #include "app/rom.h" #include "app/zelda3/music/tracker.h" #include "imgui/imgui.h" @@ -50,6 +46,10 @@ static constexpr absl::string_view kSongNotes[] = { "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B", "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B", "C"}; +const ImGuiTableFlags toolset_table_flags_ = ImGuiTableFlags_SizingFixedFit; +const ImGuiTableFlags music_editor_flags_ = ImGuiTableFlags_SizingFixedFit | + ImGuiTableFlags_Resizable | + ImGuiTableFlags_Reorderable; /** * @class MusicEditor * @brief A class for editing music data in a Rom. @@ -77,10 +77,6 @@ class MusicEditor : public SharedRom, public Editor { zelda3::music::Tracker music_tracker_; AssemblyEditor assembly_editor_; - ImGuiTableFlags toolset_table_flags_ = ImGuiTableFlags_SizingFixedFit; - ImGuiTableFlags music_editor_flags_ = ImGuiTableFlags_SizingFixedFit | - ImGuiTableFlags_Resizable | - ImGuiTableFlags_Reorderable; }; } // namespace editor diff --git a/src/app/editor/overworld/entity.h b/src/app/editor/overworld/entity.h index f38e3d78..43980f30 100644 --- a/src/app/editor/overworld/entity.h +++ b/src/app/editor/overworld/entity.h @@ -4,7 +4,10 @@ #include "imgui/imgui.h" #include "app/zelda3/common.h" -#include "app/zelda3/overworld/overworld.h" +#include "app/zelda3/overworld/overworld_exit.h" +#include "app/zelda3/overworld/overworld_item.h" +#include "app/zelda3/overworld/overworld_entrance.h" +#include "app/zelda3/sprite/sprite.h" namespace yaze { namespace editor { diff --git a/src/app/editor/overworld/overworld_editor.cc b/src/app/editor/overworld/overworld_editor.cc index b22d0e8b..2236fe04 100644 --- a/src/app/editor/overworld/overworld_editor.cc +++ b/src/app/editor/overworld/overworld_editor.cc @@ -15,7 +15,6 @@ #include "app/gfx/bitmap.h" #include "app/gfx/snes_palette.h" #include "app/gui/canvas.h" -#include "app/gui/color.h" #include "app/gui/icons.h" #include "app/gui/input.h" #include "app/gui/style.h" diff --git a/src/app/editor/overworld/overworld_editor.h b/src/app/editor/overworld/overworld_editor.h index f2e07744..cdb78424 100644 --- a/src/app/editor/overworld/overworld_editor.h +++ b/src/app/editor/overworld/overworld_editor.h @@ -89,8 +89,6 @@ class OverworldEditor : public Editor, public gfx::GfxContext { } absl::Status Save(); - auto overworld() { return &overworld_; } - int jump_to_tab() { return jump_to_tab_; } int jump_to_tab_ = -1; @@ -104,24 +102,9 @@ class OverworldEditor : public Editor, public gfx::GfxContext { absl::Status LoadGraphics(); private: - /** - * @brief Draws the canvas, tile16 selector, and toolset in fullscreen - */ void DrawFullscreenCanvas(); - - /** - * @brief Toolset for entrances, exits, items, sprites, and transports. - */ void DrawToolset(); - - /** - * @brief Draws the overworld map settings. Graphics, palettes, etc. - */ void DrawOverworldMapSettings(); - - /** - * @brief Draw the overworld settings for ZSCustomOverworld. - */ void DrawCustomOverworldMapSettings(); void RefreshChildMap(int i); @@ -163,10 +146,6 @@ class OverworldEditor : public Editor, public gfx::GfxContext { */ absl::Status CheckForCurrentMap(); void CheckForMousePan(); - - /** - * @brief Allows the user to make changes to the overworld map. - */ void DrawOverworldCanvas(); absl::Status DrawTile16Selector(); diff --git a/src/app/editor/sprite/sprite_editor.h b/src/app/editor/sprite/sprite_editor.h index 6a01bf71..04f29420 100644 --- a/src/app/editor/sprite/sprite_editor.h +++ b/src/app/editor/sprite/sprite_editor.h @@ -1,6 +1,9 @@ #ifndef YAZE_APP_EDITOR_SPRITE_EDITOR_H #define YAZE_APP_EDITOR_SPRITE_EDITOR_H +#include +#include + #include "absl/status/status.h" #include "app/editor/sprite/zsprite.h" #include "app/editor/editor.h" @@ -112,4 +115,4 @@ class SpriteEditor : public SharedRom, public Editor { } // namespace editor } // namespace yaze -#endif // YAZE_APP_EDITOR_SPRITE_EDITOR_H \ No newline at end of file +#endif // YAZE_APP_EDITOR_SPRITE_EDITOR_H diff --git a/src/app/editor/sprite/zsprite.h b/src/app/editor/sprite/zsprite.h index ac8494b5..4c2c055f 100644 --- a/src/app/editor/sprite/zsprite.h +++ b/src/app/editor/sprite/zsprite.h @@ -1,7 +1,6 @@ #ifndef YAZE_APP_EDITOR_SPRITE_ZSPRITE_H #define YAZE_APP_EDITOR_SPRITE_ZSPRITE_H -#include #include #include #include @@ -9,8 +8,6 @@ #include "app/core/constants.h" #include "absl/status/status.h" -#include "app/gfx/snes_tile.h" -#include "imgui/imgui.h" namespace yaze { namespace editor { diff --git a/src/app/editor/system/popup_manager.cc b/src/app/editor/system/popup_manager.cc index 1667e86b..b73175b5 100644 --- a/src/app/editor/system/popup_manager.cc +++ b/src/app/editor/system/popup_manager.cc @@ -1,7 +1,5 @@ #include "popup_manager.h" -#include "imgui/imgui.h" - namespace yaze { namespace editor { @@ -11,8 +9,5 @@ PopupManager::PopupManager() { PopupManager::~PopupManager() { } - - } // namespace editor - } // namespace yaze diff --git a/src/app/editor/system/popup_manager.h b/src/app/editor/system/popup_manager.h index 2e296ea9..e45422c3 100644 --- a/src/app/editor/system/popup_manager.h +++ b/src/app/editor/system/popup_manager.h @@ -14,7 +14,6 @@ class PopupManager { }; } // namespace editor - } // namespace yaze #endif // YAZE_APP_EDITOR_POPUP_MANAGER_H diff --git a/src/app/emu/audio/dsp.cc b/src/app/emu/audio/dsp.cc index 7281d025..571c86d0 100644 --- a/src/app/emu/audio/dsp.cc +++ b/src/app/emu/audio/dsp.cc @@ -2,8 +2,6 @@ #include -#include "app/emu/memory/memory.h" - namespace yaze { namespace emu { diff --git a/src/app/emu/audio/dsp.h b/src/app/emu/audio/dsp.h index 647397ee..78987d58 100644 --- a/src/app/emu/audio/dsp.h +++ b/src/app/emu/audio/dsp.h @@ -2,12 +2,8 @@ #define YAZE_APP_EMU_AUDIO_S_DSP_H #include -#include #include -#include "app/emu/audio/spc700.h" -#include "app/emu/memory/memory.h" - namespace yaze { namespace emu { diff --git a/src/app/emu/cpu/cpu.cc b/src/app/emu/cpu/cpu.cc index b2aa9361..0f33805b 100644 --- a/src/app/emu/cpu/cpu.cc +++ b/src/app/emu/cpu/cpu.cc @@ -6,6 +6,7 @@ #include #include +#include "app/core/common.h" #include "app/emu/cpu/internal/opcodes.h" namespace yaze { diff --git a/src/app/emu/cpu/cpu.h b/src/app/emu/cpu/cpu.h index dded241e..1898784f 100644 --- a/src/app/emu/cpu/cpu.h +++ b/src/app/emu/cpu/cpu.h @@ -3,13 +3,9 @@ #include #include -#include -#include #include -#include "app/core/common.h" #include "app/emu/cpu/clock.h" -#include "app/emu/cpu/internal/opcodes.h" #include "app/emu/memory/memory.h" namespace yaze { @@ -797,7 +793,6 @@ class Cpu { }; } // namespace emu - } // namespace yaze -#endif // YAZE_APP_EMU_CPU_H_ \ No newline at end of file +#endif // YAZE_APP_EMU_CPU_H_ diff --git a/src/app/emu/cpu/internal/addressing.cc b/src/app/emu/cpu/internal/addressing.cc index 16a763a6..ddda7c81 100644 --- a/src/app/emu/cpu/internal/addressing.cc +++ b/src/app/emu/cpu/internal/addressing.cc @@ -185,5 +185,4 @@ uint16_t Cpu::StackRelative() { } } // namespace emu - -} // namespace yaze \ No newline at end of file +} // namespace yaze diff --git a/src/app/emu/cpu/internal/instructions.cc b/src/app/emu/cpu/internal/instructions.cc index 77121173..720b3dd5 100644 --- a/src/app/emu/cpu/internal/instructions.cc +++ b/src/app/emu/cpu/internal/instructions.cc @@ -1,16 +1,8 @@ -#include -#include -#include - #include "app/emu/cpu/cpu.h" namespace yaze { namespace emu { -/** - * 65816 Instruction Set - */ - void Cpu::And(uint32_t low, uint32_t high) { if (GetAccumulatorSize()) { CheckInt(); @@ -397,5 +389,4 @@ void Cpu::ORA(uint32_t low, uint32_t high) { } } // namespace emu - -} // namespace yaze \ No newline at end of file +} // namespace yaze diff --git a/src/app/emu/emulator.cc b/src/app/emu/emulator.cc index 411016b8..199fc16c 100644 --- a/src/app/emu/emulator.cc +++ b/src/app/emu/emulator.cc @@ -5,6 +5,7 @@ #include "app/core/platform/file_dialog.h" #include "app/core/platform/renderer.h" +#include "app/emu/cpu/internal/opcodes.h" #include "app/gui/icons.h" #include "app/gui/input.h" #include "app/gui/zeml.h" diff --git a/src/app/gfx/snes_palette.cc b/src/app/gfx/snes_palette.cc index 33471721..7a63af0e 100644 --- a/src/app/gfx/snes_palette.cc +++ b/src/app/gfx/snes_palette.cc @@ -5,12 +5,10 @@ #include #include #include -#include -#include #include -#include "absl/container/flat_hash_map.h" // for flat_hash_map -#include "absl/status/status.h" // for Status +#include "absl/container/flat_hash_map.h" +#include "absl/status/status.h" #include "absl/status/statusor.h" #include "app/core/constants.h" #include "app/gfx/snes_color.h" diff --git a/src/app/gui/color.cc b/src/app/gui/color.cc index ab37f8d3..fc1bd5ed 100644 --- a/src/app/gui/color.cc +++ b/src/app/gui/color.cc @@ -1,9 +1,5 @@ #include "color.h" -#include -#include - -#include "app/gfx/bitmap.h" #include "app/gfx/snes_color.h" #include "app/gfx/snes_palette.h" #include "imgui/imgui.h" @@ -168,5 +164,4 @@ void SelectablePalettePipeline(uint64_t& palette_id, bool& refresh_graphics, } } // namespace gui - } // namespace yaze diff --git a/src/app/gui/input.cc b/src/app/gui/input.cc index a6aa9db7..ff47eaf9 100644 --- a/src/app/gui/input.cc +++ b/src/app/gui/input.cc @@ -1,7 +1,6 @@ #include "input.h" #include -#include #include #include "absl/strings/string_view.h" diff --git a/src/app/rom.h b/src/app/rom.h index 7b44b4e2..3a5cadd1 100644 --- a/src/app/rom.h +++ b/src/app/rom.h @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include diff --git a/src/app/zelda3/dungeon/object_names.h b/src/app/zelda3/dungeon/object_names.h index d7756546..82f4484b 100644 --- a/src/app/zelda3/dungeon/object_names.h +++ b/src/app/zelda3/dungeon/object_names.h @@ -6,7 +6,6 @@ namespace yaze { namespace zelda3 { - constexpr static inline absl::string_view Type1RoomObjectNames[] = { "Ceiling ↔", "Wall (top, north) ↔", @@ -456,10 +455,7 @@ constexpr static inline absl::string_view Type3RoomObjectNames[] = { "Nothing", }; - - } // namespace zelda3 - } // namespace yaze -#endif // YAZE_APP_ZELDA3_DUNGEON_OBJECT_NAMES_H \ No newline at end of file +#endif // YAZE_APP_ZELDA3_DUNGEON_OBJECT_NAMES_H diff --git a/src/app/zelda3/dungeon/object_renderer.cc b/src/app/zelda3/dungeon/object_renderer.cc index 1c5f34ed..f0b5296b 100644 --- a/src/app/zelda3/dungeon/object_renderer.cc +++ b/src/app/zelda3/dungeon/object_renderer.cc @@ -3,7 +3,6 @@ namespace yaze { namespace zelda3 { - void DungeonObjectRenderer::LoadObject(uint32_t routine_ptr, std::array& sheet_ids) { vram_.sheets = sheet_ids; @@ -111,8 +110,5 @@ void DungeonObjectRenderer::UpdateObjectBitmap() { bitmap_.Create(256, 256, 8, tilemap_); } - - } // namespace zelda3 - } // namespace yaze diff --git a/src/app/zelda3/dungeon/object_renderer.h b/src/app/zelda3/dungeon/object_renderer.h index 76424d29..61076235 100644 --- a/src/app/zelda3/dungeon/object_renderer.h +++ b/src/app/zelda3/dungeon/object_renderer.h @@ -1,7 +1,4 @@ #include -#include -#include -#include #include #include "app/emu/cpu/cpu.h" @@ -9,9 +6,7 @@ #include "app/emu/video/ppu.h" #include "app/gfx/bitmap.h" #include "app/gfx/snes_palette.h" -#include "app/gfx/snes_tile.h" #include "app/rom.h" -#include "app/zelda3/dungeon/object_names.h" namespace yaze { namespace zelda3 { @@ -50,4 +45,4 @@ class DungeonObjectRenderer : public SharedRom { }; } // namespace zelda3 -} // namespace yaze \ No newline at end of file +} // namespace yaze diff --git a/src/test/gfx/snes_palette_test.cc b/src/test/gfx/snes_palette_test.cc index 81a74dab..6fa925ce 100644 --- a/src/test/gfx/snes_palette_test.cc +++ b/src/test/gfx/snes_palette_test.cc @@ -12,7 +12,6 @@ using ::testing::ElementsAreArray; using yaze::gfx::ConvertRgbToSnes; using yaze::gfx::ConvertSnesToRgb; using yaze::gfx::Extract; -using yaze::gfx::SnesPalette; namespace { unsigned int test_convert(snes_color col) {