From 8b37d1cbf20fc75e86a6e72e0e766ae6e3d9d59a Mon Sep 17 00:00:00 2001 From: Andrei Alexeyev Date: Fri, 17 May 2024 04:41:28 +0200 Subject: [PATCH] src: the great #include massacre of 2024 --- src/aniplayer.c | 2 +- src/aniplayer.h | 1 - src/arch_switch.c | 2 + src/assert.h | 2 +- src/audio/audio.c | 7 +++- src/audio/backend.c | 3 +- src/audio/null/audio_null.c | 3 +- src/audio/sdl/audio_sdl.c | 2 +- src/audio/stream/mixer.c | 1 + src/audio/stream/stream.c | 4 +- src/audio/stream/stream_opus.c | 2 + src/audio/stream/stream_pcm.c | 1 + src/boss.c | 16 ++++--- src/boss.h | 9 ++-- src/camcontrol.c | 4 +- src/cli.c | 15 ++++--- src/color.c | 3 +- src/color.h | 26 ++++++------ src/common_tasks.c | 4 +- src/common_tasks.h | 8 ++-- src/config.c | 10 +++-- src/coroutine.h | 18 -------- src/coroutine/coevent.c | 6 ++- src/coroutine/coevent.h | 6 ++- src/coroutine/coevent_internal.h | 2 + src/coroutine/coroutine.c | 4 +- src/coroutine/cosched.c | 5 ++- src/coroutine/cotask.c | 6 ++- src/coroutine/cotask.h | 1 - src/coroutine/cotask_internal.h | 2 + src/coroutine/internal.h | 21 ---------- src/credits.c | 18 +++++--- src/cutscenes/cutscene.c | 6 ++- src/dialog.c | 2 + src/dialog.h | 2 +- src/dialog/dialog_interface.h | 5 +-- src/dialog/dialog_macros.h | 6 +-- src/dialog/marisa.h | 2 +- src/dialog/reimu.h | 2 +- src/dialog/youmu.h | 2 +- src/difficulty.c | 1 - src/dynstage.c | 9 ++-- src/enemy.c | 8 ++-- src/enemy.h | 6 +-- src/enemy_classes.c | 2 +- src/entity.c | 7 ++-- src/entity.h | 4 +- src/eventloop/eventloop.c | 8 ++-- src/eventloop/executor_synchro.c | 6 +-- src/events.c | 3 +- src/events.h | 2 +- src/filewatch/filewatch_inotify.c | 4 +- src/framerate.c | 1 - src/gamepad.c | 8 +++- src/gamepad.h | 4 +- src/global.c | 3 ++ src/global.h | 42 +++++-------------- src/hashtable.c | 3 +- src/hashtable.inc.h | 1 - src/hirestime.c | 7 +++- src/item.c | 2 + src/item.h | 3 -- src/laser.h | 13 ------ src/lasers/draw.c | 11 +++-- src/lasers/internal.h | 1 - src/lasers/laser.c | 7 +--- src/lasers/laser.h | 9 ++-- src/lasers/rules.h | 1 + src/list.c | 1 - src/log.c | 18 ++++---- src/log.h | 6 +-- src/main.c | 41 +++++++++--------- src/memory/allocator.c | 3 +- src/memory/arena.c | 2 + src/memory/memory.c | 1 + src/menu/charprofile.c | 12 +++--- src/menu/charselect.c | 14 ++++--- src/menu/common.c | 18 ++++---- src/menu/cutsceneview.c | 11 ++--- src/menu/difficultyselect.c | 8 ++-- src/menu/difficultyselect.h | 2 +- src/menu/gameovermenu.c | 5 ++- src/menu/ingamemenu.c | 13 +++--- src/menu/mainmenu.c | 18 ++++---- src/menu/media.c | 7 ++-- src/menu/menu.c | 7 +++- src/menu/menu.h | 3 +- src/menu/musicroom.c | 7 ++-- src/menu/options.c | 13 +++--- src/menu/replayview.c | 14 ++++--- src/menu/savereplay.c | 13 ++++-- src/menu/savereplay.h | 1 - src/menu/spellpractice.c | 4 +- src/menu/stagepractice.c | 5 ++- src/menu/stagepractice.h | 2 +- src/menu/stageselect.c | 8 ++-- src/menu/submenus.c | 10 +++-- src/objectpool.c | 3 +- src/objectpool.h | 1 - src/pch/taisei_pch.h | 11 ++++- src/pixmap/conversion.c | 2 +- src/pixmap/fileformats/internal.c | 2 + src/pixmap/fileformats/png.c | 3 +- src/pixmap/fileformats/webp.c | 3 +- src/pixmap/pixmap.c | 4 ++ src/pixmap/pixmap_conversion.inc.h | 1 + src/player.c | 13 +++--- src/player.h | 12 +++--- src/plrmodes.c | 10 ++--- src/plrmodes.h | 6 +-- src/plrmodes/marisa.c | 5 ++- src/plrmodes/marisa.h | 7 ++-- src/plrmodes/marisa_a.c | 8 +++- src/plrmodes/marisa_a.h | 14 ------- src/plrmodes/marisa_b.c | 9 ++-- src/plrmodes/marisa_b.h | 14 ------- src/plrmodes/reimu.c | 4 +- src/plrmodes/reimu.h | 1 - src/plrmodes/reimu_a.c | 8 +++- src/plrmodes/reimu_b.c | 8 +++- src/plrmodes/youmu.c | 4 +- src/plrmodes/youmu.h | 7 ++-- src/plrmodes/youmu_a.c | 6 ++- src/plrmodes/youmu_a.h | 14 ------- src/plrmodes/youmu_b.c | 7 +++- src/plrmodes/youmu_b.h | 14 ------- src/portrait.c | 2 +- src/progress.c | 7 ++-- src/projectile.h | 13 +++--- src/projectile_prototypes.c | 2 - src/random.c | 4 +- src/random.h | 3 -- src/renderer/api.c | 9 ++-- src/renderer/api.h | 14 +++++-- src/renderer/common/backend.c | 3 ++ src/renderer/common/matstack.c | 4 +- src/renderer/common/matstack.h | 2 +- src/renderer/common/models.c | 3 +- src/renderer/common/shaderlib/cache.c | 4 +- src/renderer/common/shaderlib/defs.h | 2 + src/renderer/common/shaderlib/lang_glsl.c | 6 ++- src/renderer/common/shaderlib/lang_spirv.c | 1 + .../common/shaderlib/lang_spirv_aux.c | 5 ++- .../common/shaderlib/lang_spirv_stub.c | 5 ++- src/renderer/common/shaderlib/shaderlib.h | 3 +- src/renderer/common/sprite_batch.c | 2 +- src/renderer/common/state.c | 2 +- src/renderer/gl33/common_buffer.c | 1 + src/renderer/gl33/framebuffer.c | 4 +- src/renderer/gl33/framebuffer.h | 3 +- src/renderer/gl33/framebuffer_async_read.c | 2 + src/renderer/gl33/gl33.c | 25 ++++++----- src/renderer/gl33/gl33.h | 4 +- src/renderer/gl33/index_buffer.c | 3 +- src/renderer/gl33/opengl.h | 2 +- src/renderer/gl33/shader_object.c | 3 +- src/renderer/gl33/shader_object.h | 4 +- src/renderer/gl33/shader_program.c | 10 +++-- src/renderer/gl33/shader_program.h | 1 - src/renderer/gl33/texture.c | 6 ++- src/renderer/gl33/texture.h | 5 +-- src/renderer/gl33/vertex_array.c | 7 ++-- src/renderer/gl33/vertex_buffer.c | 3 +- src/renderer/glcommon/debug.c | 3 +- src/renderer/glcommon/opengl.c | 6 ++- src/renderer/glcommon/opengl.h | 2 - src/renderer/glcommon/shaders.c | 5 ++- src/renderer/glcommon/texture.c | 2 +- src/renderer/gles20/gles20.c | 7 ++-- src/renderer/gles30/fbcopy_fallback.c | 6 +-- src/renderer/gles30/gles30.c | 7 +++- src/renderer/glescommon/angle_egl.c | 3 ++ src/renderer/glescommon/angle_egl.h | 2 + src/renderer/glescommon/angle_egl_stub.c | 3 +- src/renderer/glescommon/gles.c | 3 ++ src/renderer/glescommon/gles.h | 2 +- src/renderer/null/null.c | 1 - src/replay/demoplayer.c | 8 +++- src/replay/replay.c | 1 - src/replay/rw_common.c | 2 + src/replay/stage.h | 1 - src/replay/state.c | 3 +- src/replay/tsrtool.c | 5 ++- src/replay/write.c | 1 + src/resource/animation.c | 6 +-- src/resource/bgm.c | 4 +- src/resource/font.c | 15 +++---- src/resource/font.h | 5 +-- src/resource/material.c | 4 ++ src/resource/model.c | 7 ++-- src/resource/model.h | 8 ---- src/resource/postprocess.c | 7 ++-- src/resource/postprocess.h | 2 +- src/resource/resource.c | 16 ++++--- src/resource/resource.h | 2 +- src/resource/sfx.c | 4 +- src/resource/sfxbgm_common.c | 2 +- src/resource/shader_object.c | 3 +- src/resource/shader_program.c | 3 +- src/resource/sprite.c | 3 +- src/resource/texture.c | 2 +- src/resource/texture.h | 2 +- src/resource/texture_loader/basisu.c | 5 ++- src/resource/texture_loader/basisu_cache.c | 3 ++ src/resource/texture_loader/basisu_cache.h | 2 +- src/resource/texture_loader/texture_loader.c | 4 ++ src/resource/texture_loader/texture_loader.h | 1 - src/ringbuf.h | 1 - src/rwops/rwops_autobuf.c | 1 - src/rwops/rwops_crc32.c | 1 - src/rwops/rwops_dummy.c | 1 - src/rwops/rwops_segment.c | 2 +- src/rwops/rwops_sha256.c | 1 - src/rwops/rwops_trace.c | 2 +- src/rwops/rwops_util.c | 2 +- src/rwops/rwops_zlib.c | 10 +++-- src/rwops/rwops_zstd.c | 4 +- src/stage.c | 30 ++++++------- src/stage.h | 6 --- src/stagedraw.c | 15 ++++--- src/stagedraw.h | 5 ++- src/stageinfo.h | 4 +- src/stageobjects.c | 7 ---- src/stageobjects.h | 7 ++++ src/stages/common_imports.h | 18 ++++++++ src/stages/dpstest.c | 5 ++- src/stages/stage1/background_anim.c | 1 + src/stages/stage1/cirno.h | 2 +- src/stages/stage1/draw.c | 3 +- src/stages/stage1/draw.h | 2 +- src/stages/stage1/misc.c | 2 + src/stages/stage1/misc.h | 2 +- src/stages/stage1/nonspells/boss_nonspell_1.c | 4 -- src/stages/stage1/nonspells/boss_nonspell_2.c | 5 --- .../stage1/nonspells/midboss_nonspell_1.c | 5 --- src/stages/stage1/nonspells/nonspells.h | 4 +- src/stages/stage1/spells/benchmark.c | 3 -- src/stages/stage1/spells/crystal_blizzard.c | 5 --- src/stages/stage1/spells/crystal_rain.c | 5 --- src/stages/stage1/spells/icicle_cascade.c | 3 -- src/stages/stage1/spells/perfect_freeze.c | 5 --- src/stages/stage1/spells/snow_halation.c | 5 --- src/stages/stage1/spells/spells.h | 6 ++- src/stages/stage1/stage1.c | 7 ++-- src/stages/stage1/timeline.c | 16 ++++--- src/stages/stage1/timeline.h | 2 +- src/stages/stage2/background_anim.c | 3 -- src/stages/stage2/draw.c | 2 +- src/stages/stage2/draw.h | 2 +- src/stages/stage2/hina.c | 1 + src/stages/stage2/hina.h | 2 +- src/stages/stage2/nonspells/boss_nonspell_1.c | 3 -- src/stages/stage2/nonspells/boss_nonspell_2.c | 3 -- src/stages/stage2/nonspells/boss_nonspell_3.c | 4 -- .../stage2/nonspells/midboss_nonspell_1.c | 3 -- src/stages/stage2/nonspells/nonspells.h | 7 +--- src/stages/stage2/spells/amulet_of_harm.c | 3 -- src/stages/stage2/spells/bad_pick.c | 3 -- src/stages/stage2/spells/monty_hall_danmaku.c | 3 -- src/stages/stage2/spells/spells.h | 3 +- src/stages/stage2/spells/wheel_of_fortune.c | 3 -- src/stages/stage2/stage2.c | 10 +++-- src/stages/stage2/timeline.c | 14 +++---- src/stages/stage2/timeline.h | 2 +- src/stages/stage2/wriggle.c | 4 +- src/stages/stage2/wriggle.h | 2 +- src/stages/stage3/draw.c | 2 +- src/stages/stage3/draw.h | 3 +- src/stages/stage3/nonspells/boss_nonspells.c | 4 -- .../stage3/nonspells/midboss_nonspell_1.c | 4 -- src/stages/stage3/nonspells/nonspells.h | 5 ++- src/stages/stage3/scuttle.h | 2 +- src/stages/stage3/spells/firefly_storm.c | 4 -- src/stages/stage3/spells/light_singularity.c | 4 -- src/stages/stage3/spells/logic_bomb.c | 4 -- src/stages/stage3/spells/moonlight_rocket.c | 4 -- src/stages/stage3/spells/moths_to_a_flame.c | 4 -- src/stages/stage3/spells/spells.h | 4 +- src/stages/stage3/stage3.c | 10 +++-- src/stages/stage3/timeline.c | 17 ++++---- src/stages/stage3/timeline.h | 2 +- src/stages/stage3/wriggle.h | 4 +- src/stages/stage4/draw.c | 4 +- src/stages/stage4/draw.h | 2 +- src/stages/stage4/kurumi.c | 1 + src/stages/stage4/kurumi.h | 2 +- src/stages/stage4/nonspells/boss_nonspell_1.c | 3 -- src/stages/stage4/nonspells/boss_nonspell_2.c | 3 -- src/stages/stage4/nonspells/nonspells.h | 4 +- src/stages/stage4/spells/animate_wall.c | 4 -- src/stages/stage4/spells/blow_the_walls.c | 3 -- src/stages/stage4/spells/gate_of_walachia.c | 8 +--- src/stages/stage4/spells/red_spike.c | 4 -- src/stages/stage4/spells/spells.h | 3 +- src/stages/stage4/spells/vampiric_vapour.c | 4 -- src/stages/stage4/spells/vlads_army.c | 4 -- src/stages/stage4/stage4.c | 11 ++--- src/stages/stage4/timeline.c | 13 ++---- src/stages/stage4/timeline.h | 2 +- src/stages/stage5/background_anim.c | 3 +- src/stages/stage5/background_anim.h | 2 - src/stages/stage5/draw.c | 2 +- src/stages/stage5/draw.h | 2 +- src/stages/stage5/iku.c | 2 - src/stages/stage5/iku.h | 4 +- src/stages/stage5/nonspells/nonspells.h | 6 +-- src/stages/stage5/spells/spells.h | 6 +-- src/stages/stage5/stage5.c | 5 ++- src/stages/stage5/timeline.c | 7 +--- src/stages/stage5/timeline.h | 4 +- src/stages/stage6/background_anim.c | 3 +- src/stages/stage6/background_anim.h | 2 - src/stages/stage6/draw.c | 4 +- src/stages/stage6/draw.h | 4 +- src/stages/stage6/elly.c | 7 +++- src/stages/stage6/elly.h | 1 - src/stages/stage6/nonspells/nonspells.h | 7 +--- src/stages/stage6/spells/broglie.c | 2 - src/stages/stage6/spells/eigenstate.c | 8 ++-- src/stages/stage6/spells/forgotten.c | 2 - src/stages/stage6/spells/kepler.c | 2 - src/stages/stage6/spells/lhc.c | 2 - src/stages/stage6/spells/maxwell.c | 2 - src/stages/stage6/spells/newton.c | 2 - src/stages/stage6/spells/ricci.c | 2 - src/stages/stage6/spells/spells.h | 6 +-- src/stages/stage6/spells/toe.c | 4 +- src/stages/stage6/stage6.c | 4 +- src/stages/stage6/timeline.c | 10 ++--- src/stages/stage6/timeline.h | 4 +- src/stages/stages.h | 2 +- src/stagetext.c | 4 +- src/stagetext.h | 2 - src/stageutils.c | 6 +-- src/stageutils.h | 3 +- src/stats.c | 1 - src/taisei.h | 11 +++-- src/taskmanager.c | 8 +++- src/thread.c | 3 +- src/transition.c | 4 +- src/util.h | 22 ++-------- src/util/assert.c | 2 + src/util/compat.h | 30 ++++++------- src/util/crap.h | 2 + src/util/env.c | 3 +- src/util/fbmgr.c | 6 ++- src/util/fbmgr.h | 2 +- src/util/fbpair.c | 2 - src/util/gamemode.c | 4 +- src/util/gamemode_stub.c | 2 +- src/util/glm.h | 4 +- src/util/graphics.c | 2 - src/util/graphics.h | 1 - src/util/io.c | 8 ++-- src/util/kvparser.c | 3 +- src/util/miscmath.c | 1 - src/util/platform_posix.c | 4 +- src/util/sha256_openssl.c | 2 +- src/util/stringops.c | 1 - src/util/stringops.h | 1 - src/version.h | 3 +- src/vfs/decompress_wrapper.c | 4 ++ src/vfs/decompress_wrapper.h | 1 - src/vfs/emscripten_fetch.c | 2 +- src/vfs/error.h | 3 +- src/vfs/loadpacks.c | 6 ++- src/vfs/nodeapi.c | 1 + src/vfs/pathutil.c | 5 ++- src/vfs/platform_paths/cache_apple.m | 2 - src/vfs/platform_paths/cache_win32.c | 2 +- src/vfs/platform_paths/cache_xdg.c | 2 +- src/vfs/platform_paths/resroot_sdl.c | 3 +- src/vfs/platform_paths/storage_sdl.c | 3 +- src/vfs/private.c | 5 +++ src/vfs/private.h | 8 ++-- src/vfs/public.c | 3 ++ src/vfs/public.h | 11 ++--- src/vfs/readonly_wrapper.c | 3 ++ src/vfs/readonly_wrapper.h | 3 +- src/vfs/resindex_layered_public.h | 2 - src/vfs/setup_generic.c | 6 +-- src/vfs/setup_switch.c | 4 +- src/vfs/sync_emscripten.c | 3 +- src/vfs/syspath.h | 1 - src/vfs/syspath_posix.c | 12 +++--- src/vfs/syspath_win32.c | 5 ++- src/vfs/union.c | 3 ++ src/vfs/union.h | 1 - src/vfs/vdir.c | 2 + src/vfs/zipfile_impl.h | 2 +- src/vfs/zippath.c | 2 - src/vfs/zippath_rwops.c | 2 - src/video.c | 16 ++++--- src/video_postprocess.c | 6 +-- src/watchdog.c | 3 +- 395 files changed, 1025 insertions(+), 1067 deletions(-) delete mode 100644 src/coroutine.h delete mode 100644 src/coroutine/internal.h delete mode 100644 src/laser.h delete mode 100644 src/plrmodes/marisa_a.h delete mode 100644 src/plrmodes/marisa_b.h delete mode 100644 src/plrmodes/youmu_a.h delete mode 100644 src/plrmodes/youmu_b.h create mode 100644 src/stages/common_imports.h diff --git a/src/aniplayer.c b/src/aniplayer.c index b5c6ee82f0..842497691e 100644 --- a/src/aniplayer.c +++ b/src/aniplayer.c @@ -7,8 +7,8 @@ */ #include "aniplayer.h" + #include "list.h" -#include "global.h" #include "stageobjects.h" void aniplayer_create(AniPlayer *plr, Animation *ani, const char *startsequence) { diff --git a/src/aniplayer.h b/src/aniplayer.h index 513e77a1fa..a8e1d3231f 100644 --- a/src/aniplayer.h +++ b/src/aniplayer.h @@ -66,7 +66,6 @@ // Similar examples occur throughout the code so if you want context, you can just look there. // #include "resource/animation.h" -#include "stageobjects.h" #include "list.h" typedef struct AniQueueEntry AniQueueEntry; diff --git a/src/arch_switch.c b/src/arch_switch.c index 023d1cf681..70a9a3d062 100644 --- a/src/arch_switch.c +++ b/src/arch_switch.c @@ -7,6 +7,8 @@ #include "arch_switch.h" #include "renderer/glcommon/debug.h" +#include "util/env.h" +#include "util/io.h" #include #include diff --git a/src/assert.h b/src/assert.h index af81e651a4..a71c098e20 100644 --- a/src/assert.h +++ b/src/assert.h @@ -10,4 +10,4 @@ #include "taisei.h" // WARNING: This file intentionally shadows the standard header! -#include "util/assert.h" +#include "util/assert.h" // IWYU pragma: export diff --git a/src/audio/audio.c b/src/audio/audio.c index 8c4f673651..a7f60012a9 100644 --- a/src/audio/audio.c +++ b/src/audio/audio.c @@ -7,12 +7,15 @@ */ #include "audio.h" + #include "backend.h" -#include "resource/resource.h" +#include "events.h" +#include "global.h" #include "resource/bgm.h" +#include "resource/resource.h" #include "resource/sfx.h" -#include "global.h" #include "stage.h" +#include "util/kvparser.h" #define LOOPTIMEOUTFRAMES 10 #define DEFAULT_SFX_VOLUME 100 diff --git a/src/audio/backend.c b/src/audio/backend.c index f2ac7442b3..2ad7ef38d9 100644 --- a/src/audio/backend.c +++ b/src/audio/backend.c @@ -7,7 +7,8 @@ */ #include "backend.h" -#include "util.h" + +#include "util/env.h" #undef A #define A(x) extern AudioBackend _a_backend_##x; diff --git a/src/audio/null/audio_null.c b/src/audio/null/audio_null.c index da80ea174f..9b00dc5d4d 100644 --- a/src/audio/null/audio_null.c +++ b/src/audio/null/audio_null.c @@ -7,7 +7,8 @@ */ #include "../backend.h" -#include "util.h" + +#include "util/env.h" static bool audio_null_init(void) { if(strcmp(env_get("TAISEI_AUDIO_BACKEND", ""), "null")) { // don't warn if we asked for this diff --git a/src/audio/sdl/audio_sdl.c b/src/audio/sdl/audio_sdl.c index 13e8edc3f5..dd8b90a1de 100644 --- a/src/audio/sdl/audio_sdl.c +++ b/src/audio/sdl/audio_sdl.c @@ -9,9 +9,9 @@ #include "../backend.h" #include "../stream/mixer.h" -#include "util.h" #include "rwops/rwops_autobuf.h" #include "config.h" +#include "util/io.h" #define AUDIO_FREQ 48000 #define AUDIO_FORMAT AUDIO_F32SYS diff --git a/src/audio/stream/mixer.c b/src/audio/stream/mixer.c index 6e2018c831..b168b65995 100644 --- a/src/audio/stream/mixer.c +++ b/src/audio/stream/mixer.c @@ -7,6 +7,7 @@ */ #include "mixer.h" + #include "util.h" #include "../backend.h" diff --git a/src/audio/stream/stream.c b/src/audio/stream/stream.c index f0e2f82ba5..0cbe904da3 100644 --- a/src/audio/stream/stream.c +++ b/src/audio/stream/stream.c @@ -8,7 +8,9 @@ #include "stream.h" #include "stream_opus.h" -#include "util.h" + +#include "log.h" +#include "util/miscmath.h" #define PROCS(stream) (*NOT_NULL((stream)->procs)) #define PROC(stream, proc) (NOT_NULL(PROCS(stream).proc)) diff --git a/src/audio/stream/stream_opus.c b/src/audio/stream/stream_opus.c index eab1cb52a8..47d60eda71 100644 --- a/src/audio/stream/stream_opus.c +++ b/src/audio/stream/stream_opus.c @@ -7,6 +7,8 @@ */ #include "stream_opus.h" + +#include "log.h" #include "util.h" #include diff --git a/src/audio/stream/stream_pcm.c b/src/audio/stream/stream_pcm.c index 44df929369..b23bc995de 100644 --- a/src/audio/stream/stream_pcm.c +++ b/src/audio/stream/stream_pcm.c @@ -8,6 +8,7 @@ #include "stream_pcm.h" +#include "log.h" #include "util.h" static ssize_t astream_pcm_read(AudioStream *stream, size_t buffer_size, void *buffer) { diff --git a/src/boss.c b/src/boss.c index 1fd3f1c672..1dc16a8d72 100644 --- a/src/boss.c +++ b/src/boss.c @@ -7,16 +7,20 @@ */ #include "boss.h" + +#include "audio/audio.h" +#include "dynstage.h" +#include "entity.h" #include "global.h" +#include "portrait.h" #include "stage.h" -#include "stagetext.h" #include "stagedraw.h" -#include "entity.h" -#include "util/glm.h" -#include "portrait.h" -#include "stages/stage5/stage5.h" // for unlockable bonus BGM #include "stageobjects.h" -#include "dynstage.h" +#include "stages/stage5/stage5.h" // for unlockable bonus BGM +#include "stagetext.h" +#include "util/env.h" +#include "util/glm.h" +#include "util/graphics.h" #define DAMAGE_PER_POWER_POINT 500.0f #define DAMAGE_PER_POWER_ITEM (DAMAGE_PER_POWER_POINT * POWER_VALUE) diff --git a/src/boss.h b/src/boss.h index 2eb4d46c41..ba6f5dafa9 100644 --- a/src/boss.h +++ b/src/boss.h @@ -9,13 +9,14 @@ #pragma once #include "taisei.h" -#include "util.h" -#include "difficulty.h" +#include "move.h" +#include "taisei.h" + #include "aniplayer.h" #include "color.h" -#include "projectile.h" +#include "coroutine/taskdsl.h" +#include "difficulty.h" #include "entity.h" -#include "coroutine.h" #include "resource/resource.h" #define BOSS_HURT_RADIUS 16 diff --git a/src/camcontrol.c b/src/camcontrol.c index 1079704abe..2f095779c0 100644 --- a/src/camcontrol.c +++ b/src/camcontrol.c @@ -8,11 +8,13 @@ #include "camcontrol.h" +#include "events.h" +#include "global.h" #include "stagetext.h" -#include "coroutine.h" #include "util/glm.h" #include "video.h" #include "entity.h" +#include "coroutine/taskdsl.h" #define CAMCTRL_MOVE_SPEED 0.1 // for scroll wheel move speed adjustment diff --git a/src/cli.c b/src/cli.c index 1e2741568a..3b2adcbe9a 100644 --- a/src/cli.c +++ b/src/cli.c @@ -6,17 +6,20 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include - #include "cli.h" + +#include "cutscenes/cutscene.h" +#include "cutscenes/scenes.h" #include "difficulty.h" -#include "util.h" #include "log.h" -#include "stage.h" #include "plrmodes.h" +#include "stageinfo.h" +#include "util.h" +#include "util/env.h" +#include "util/io.h" #include "version.h" -#include "cutscenes/cutscene.h" -#include "cutscenes/scenes.h" + +#include struct TsOption { struct option opt; const char *help; const char *argname; }; diff --git a/src/color.c b/src/color.c index 06f0450258..15d3f01925 100644 --- a/src/color.c +++ b/src/color.c @@ -7,6 +7,7 @@ */ #include "color.h" +#include "util/stringops.h" #define COLOR_OP(c1, op, c2) do { \ (c1)->r = (c1)->r op (c2)->r; \ @@ -184,7 +185,7 @@ bool color_equals(const Color *clr, const Color *clr2) { ); } -char* color_str(const Color *clr) { +char *color_str(const Color *clr) { return strfmt( "RGBA(%f, %f, %f, %f) at %p", clr->r, diff --git a/src/color.h b/src/color.h index baceaf43ff..9c2c12e3bf 100644 --- a/src/color.h +++ b/src/color.h @@ -9,7 +9,7 @@ #pragma once #include "taisei.h" -#include "util.h" +#include "util/miscmath.h" typedef union Color3 { struct { float r, g, b; }; @@ -51,37 +51,37 @@ Color* color_hsla(Color *clr, float h, float s, float l, float a) void color_get_hsl(const Color *c, float *out_h, float *out_s, float *out_l) attr_nonnull(1); -Color* color_add(Color *clr, const Color *clr2) +Color *color_add(Color *clr, const Color *clr2) attr_nonnull(1) attr_returns_nonnull; -Color* color_sub(Color *clr, const Color *clr2) +Color *color_sub(Color *clr, const Color *clr2) attr_nonnull(1) attr_returns_nonnull; -Color* color_mul(Color *clr, const Color *clr2) +Color *color_mul(Color *clr, const Color *clr2) attr_nonnull(1) attr_returns_nonnull; -Color* color_mul_alpha(Color *clr) +Color *color_mul_alpha(Color *clr) attr_nonnull(1) attr_returns_nonnull; -Color* color_mul_scalar(Color *clr, float scalar) +Color *color_mul_scalar(Color *clr, float scalar) attr_nonnull(1) attr_returns_nonnull; -Color* color_div(Color *clr, const Color *clr2) +Color *color_div(Color *clr, const Color *clr2) attr_nonnull(1) attr_returns_nonnull; -Color* color_div_alpha(Color *clr) +Color *color_div_alpha(Color *clr) attr_nonnull(1) attr_returns_nonnull; -Color* color_div_scalar(Color *clr, float scalar) +Color *color_div_scalar(Color *clr, float scalar) attr_nonnull(1) attr_returns_nonnull; -Color* color_lerp(Color *clr, const Color *clr2, float a) +Color *color_lerp(Color *clr, const Color *clr2, float a) attr_nonnull(1) attr_returns_nonnull; -Color* color_approach(Color *clr, const Color *clr2, float delta) +Color *color_approach(Color *clr, const Color *clr2, float delta) attr_nonnull(1) attr_returns_nonnull; -Color* color_set_opacity(Color *clr, float opacity) +Color *color_set_opacity(Color *clr, float opacity) attr_nonnull(1) attr_returns_nonnull; /* @@ -91,5 +91,5 @@ Color* color_set_opacity(Color *clr, float opacity) bool color_equals(const Color *clr, const Color *clr2) attr_nonnull(1, 2); -char* color_str(const Color *clr) +char *color_str(const Color *clr) attr_nonnull(1) attr_returns_allocated; diff --git a/src/common_tasks.c b/src/common_tasks.c index 261e59bb5b..c21c2aad15 100644 --- a/src/common_tasks.c +++ b/src/common_tasks.c @@ -7,9 +7,11 @@ */ #include "common_tasks.h" + +#include "audio/audio.h" #include "random.h" -#include "util/glm.h" #include "stage.h" +#include "util/glm.h" void common_drop_items(cmplx pos, const ItemCounts *items) { for(int i = 0; i < ARRAY_SIZE(items->as_array); ++i) { diff --git a/src/common_tasks.h b/src/common_tasks.h index 73013a5ecd..2b5a94cce8 100644 --- a/src/common_tasks.h +++ b/src/common_tasks.h @@ -9,11 +9,13 @@ #pragma once #include "taisei.h" -#include "coroutine.h" -#include "item.h" -#include "move.h" +// IWYU pragma: always_keep + +#include "coroutine/taskdsl.h" #include "entity.h" #include "global.h" +#include "item.h" +#include "move.h" #include "util/glm.h" DECLARE_EXTERN_TASK( diff --git a/src/config.c b/src/config.c index 8c98173cd8..9b801f97a8 100644 --- a/src/config.c +++ b/src/config.c @@ -7,10 +7,14 @@ */ #include "config.h" -#include "global.h" -#include "version.h" -#include "util/strbuf.h" + #include "bitarray.h" +#include "gamepad.h" +#include "global.h" // IWYU pragma: keep +#include "util/kvparser.h" +#include "util/strbuf.h" +#include "version.h" +#include "vfs/public.h" #define CONFIG_FILE "storage/config" diff --git a/src/coroutine.h b/src/coroutine.h deleted file mode 100644 index 8923a74ce1..0000000000 --- a/src/coroutine.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * This software is licensed under the terms of the MIT License. - * See COPYING for further information. - * --- - * Copyright (c) 2011-2024, Lukas Weber . - * Copyright (c) 2012-2024, Andrei Alexeyev . - */ - -#pragma once -#include "taisei.h" - -// TODO: Remove this file and adjust includes. - -#include "coroutine/coroutine.h" -#include "coroutine/cotask.h" -#include "coroutine/coevent.h" -#include "coroutine/cosched.h" -#include "coroutine/taskdsl.h" diff --git a/src/coroutine/coevent.c b/src/coroutine/coevent.c index 986a697e3e..e9a3b05009 100644 --- a/src/coroutine/coevent.c +++ b/src/coroutine/coevent.c @@ -6,7 +6,11 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "internal.h" +#include "coroutine/coevent.h" +#include "coroutine/coevent_internal.h" +#include "coroutine/cotask_internal.h" + +#include "util.h" void coevent_init(CoEvent *evt) { static uint32_t g_uid; diff --git a/src/coroutine/coevent.h b/src/coroutine/coevent.h index 5884262188..f5e01837f0 100644 --- a/src/coroutine/coevent.h +++ b/src/coroutine/coevent.h @@ -11,14 +11,14 @@ #include "dynarray.h" -#include "cotask.h" - typedef enum CoEventStatus { CO_EVENT_PENDING, CO_EVENT_SIGNALED, CO_EVENT_CANCELED, } CoEventStatus; +typedef struct BoxedTask BoxedTask; + typedef struct CoEvent { DYNAMIC_ARRAY(BoxedTask) subscribers; uint32_t unique_id; @@ -40,6 +40,8 @@ typedef COEVENTS_ARRAY( finished ) CoTaskEvents; +#include "cotask.h" + void coevent_init(CoEvent *evt); void coevent_signal(CoEvent *evt); void coevent_signal_once(CoEvent *evt); diff --git a/src/coroutine/coevent_internal.h b/src/coroutine/coevent_internal.h index d21e45cfa0..4b4c278aee 100644 --- a/src/coroutine/coevent_internal.h +++ b/src/coroutine/coevent_internal.h @@ -9,6 +9,8 @@ #pragma once #include "taisei.h" +#include "coevent.h" + // #define EVT_DEBUG #ifdef EVT_DEBUG diff --git a/src/coroutine/coroutine.c b/src/coroutine/coroutine.c index 56754b263e..2e04007c46 100644 --- a/src/coroutine/coroutine.c +++ b/src/coroutine/coroutine.c @@ -6,8 +6,8 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "internal.h" -#include "util.h" +#include "coroutine/coroutine.h" +#include "coroutine/cotask_internal.h" void coroutines_init(void) { cotask_global_init(); diff --git a/src/coroutine/cosched.c b/src/coroutine/cosched.c index 6447c07b4a..c401384150 100644 --- a/src/coroutine/cosched.c +++ b/src/coroutine/cosched.c @@ -6,7 +6,10 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "internal.h" +#include "coroutine/cosched.h" +#include "coroutine/cotask.h" +#include "coroutine/cotask_internal.h" +#include "hashtable.h" void cosched_init(CoSched *sched) { memset(sched, 0, sizeof(*sched)); diff --git a/src/coroutine/cotask.c b/src/coroutine/cotask.c index efc69cc97b..d5d48d4db2 100644 --- a/src/coroutine/cotask.c +++ b/src/coroutine/cotask.c @@ -6,7 +6,11 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "internal.h" +#include "coroutine/cotask.h" +#include "coroutine/cotask_internal.h" +#include "coroutine/coevent_internal.h" +#include "log.h" +#include "thread.h" static CoTaskList task_pool; static koishi_coroutine_t *co_main; diff --git a/src/coroutine/cotask.h b/src/coroutine/cotask.h index c2776b1fe8..f6865ebc96 100644 --- a/src/coroutine/cotask.h +++ b/src/coroutine/cotask.h @@ -13,7 +13,6 @@ #include "list.h" #include "entity.h" -#include "util/debug.h" // #define CO_TASK_DEBUG diff --git a/src/coroutine/cotask_internal.h b/src/coroutine/cotask_internal.h index 60859d0414..ead6ec6472 100644 --- a/src/coroutine/cotask_internal.h +++ b/src/coroutine/cotask_internal.h @@ -9,6 +9,8 @@ #pragma once #include "taisei.h" +#include "cotask.h" + #ifdef __EMSCRIPTEN__ #define CO_STACK_SIZE (64 * 1024) #else diff --git a/src/coroutine/internal.h b/src/coroutine/internal.h deleted file mode 100644 index 33173c8f93..0000000000 --- a/src/coroutine/internal.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * This software is licensed under the terms of the MIT License. - * See COPYING for further information. - * --- - * Copyright (c) 2011-2024, Lukas Weber . - * Copyright (c) 2012-2024, Andrei Alexeyev . - */ - -#pragma once -#include "taisei.h" - -#include "log.h" -#include "util.h" - -#include "coroutine.h" -#include "cotask.h" -#include "coevent.h" -#include "cosched.h" - -#include "cotask_internal.h" -#include "coevent_internal.h" diff --git a/src/credits.c b/src/credits.c index d430972752..59025a6a62 100644 --- a/src/credits.c +++ b/src/credits.c @@ -7,16 +7,22 @@ */ #include "credits.h" + +#include "audio/audio.h" +#include "dynarray.h" +#include "eventloop/eventloop.h" +#include "events.h" #include "global.h" -#include "stages/stage6/draw.h" -#include "video.h" -#include "resource/model.h" +#include "menu/menu.h" #include "renderer/api.h" +#include "replay/demoplayer.h" +#include "resource/font.h" +#include "stageutils.h" +#include "transition.h" #include "util/fbmgr.h" #include "util/glm.h" -#include "dynarray.h" -#include "eventloop/eventloop.h" -#include "replay/demoplayer.h" +#include "util/graphics.h" +#include "video.h" typedef struct CreditsEntry { char **data; diff --git a/src/cutscenes/cutscene.c b/src/cutscenes/cutscene.c index 6b77a34694..7ef800a962 100644 --- a/src/cutscenes/cutscene.c +++ b/src/cutscenes/cutscene.c @@ -12,15 +12,17 @@ #include "audio/audio.h" #include "color.h" +#include "eventloop/eventloop.h" +#include "events.h" #include "global.h" #include "progress.h" #include "renderer/api.h" +#include "replay/demoplayer.h" +#include "transition.h" #include "util/fbmgr.h" #include "util/glm.h" #include "util/graphics.h" #include "video.h" -#include "eventloop/eventloop.h" -#include "replay/demoplayer.h" #include "watchdog.h" #define SKIP_DELAY 3 diff --git a/src/dialog.c b/src/dialog.c index 85d813d163..6a99954611 100644 --- a/src/dialog.c +++ b/src/dialog.c @@ -7,8 +7,10 @@ */ #include "dialog.h" + #include "global.h" #include "portrait.h" +#include "resource/font.h" void dialog_init(Dialog *d) { memset(d, 0, sizeof(*d)); diff --git a/src/dialog.h b/src/dialog.h index e6db95c309..f3b6da778b 100644 --- a/src/dialog.h +++ b/src/dialog.h @@ -12,7 +12,7 @@ #include "color.h" #include "resource/resource.h" #include "resource/sprite.h" -#include "coroutine.h" +#include "coroutine/coevent.h" typedef enum DialogSide { DIALOG_SIDE_RIGHT, diff --git a/src/dialog/dialog_interface.h b/src/dialog/dialog_interface.h index bae64b453e..9161a1337c 100644 --- a/src/dialog/dialog_interface.h +++ b/src/dialog/dialog_interface.h @@ -9,9 +9,8 @@ #pragma once #include "taisei.h" -#include "dialog.h" -#include "resource/resource.h" - +#include "dialog.h" // IWYU pragma: export +#include "coroutine/taskdsl.h" #define DIALOG_SCRIPTS \ WITH_EVENTS (Stage1PreBoss, (boss_appears, music_changes)) \ diff --git a/src/dialog/dialog_macros.h b/src/dialog/dialog_macros.h index 1cdb092501..35184bf3ac 100644 --- a/src/dialog/dialog_macros.h +++ b/src/dialog/dialog_macros.h @@ -9,9 +9,9 @@ #pragma once #include "taisei.h" -#include "dialog.h" -#include "stage.h" -#include "portrait.h" +#include "dialog.h" // IWYU pragma: export +#include "stage.h" // IWYU pragma: export +#include "portrait.h" // IWYU pragma: export #define DIALOG_BEGIN(_interface) \ if(ARGS.called_for_preload) { \ diff --git a/src/dialog/marisa.h b/src/dialog/marisa.h index 5f49ee593e..5674080e69 100644 --- a/src/dialog/marisa.h +++ b/src/dialog/marisa.h @@ -9,6 +9,6 @@ #pragma once #include "taisei.h" -#include "dialog.h" +#include "dialog_interface.h" extern PlayerDialogTasks dialog_tasks_marisa; diff --git a/src/dialog/reimu.h b/src/dialog/reimu.h index f2ee7214a6..07acc282f1 100644 --- a/src/dialog/reimu.h +++ b/src/dialog/reimu.h @@ -9,6 +9,6 @@ #pragma once #include "taisei.h" -#include "dialog.h" +#include "dialog_interface.h" extern PlayerDialogTasks dialog_tasks_reimu; diff --git a/src/dialog/youmu.h b/src/dialog/youmu.h index e38178396a..d3f698ac23 100644 --- a/src/dialog/youmu.h +++ b/src/dialog/youmu.h @@ -9,6 +9,6 @@ #pragma once #include "taisei.h" -#include "dialog.h" +#include "dialog_interface.h" extern PlayerDialogTasks dialog_tasks_youmu; diff --git a/src/difficulty.c b/src/difficulty.c index f01a771c9e..6819fc3779 100644 --- a/src/difficulty.c +++ b/src/difficulty.c @@ -8,7 +8,6 @@ #include "difficulty.h" #include "resource/resource.h" -#include "global.h" typedef struct DiffDef { const char *name; diff --git a/src/dynstage.c b/src/dynstage.c index 88b60aeb80..4c1ec13868 100644 --- a/src/dynstage.c +++ b/src/dynstage.c @@ -6,14 +6,15 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#ifndef TAISEI_BUILDCONF_HAVE_POSIX -#error Stage hot reloading is only supported on POSIX systems -#endif - #include "dynstage.h" + #include "events.h" #include "filewatch/filewatch.h" +#ifndef TAISEI_BUILDCONF_HAVE_POSIX +#error Stage hot reloading is only supported on POSIX systems +#endif + #include #include #include diff --git a/src/enemy.c b/src/enemy.c index 7ae4d045a4..c1bd4fa921 100644 --- a/src/enemy.c +++ b/src/enemy.c @@ -6,16 +6,16 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "resource/resource.h" #include "enemy.h" +#include "audio/audio.h" +#include "entity.h" #include "global.h" -#include "projectile.h" #include "list.h" -#include "aniplayer.h" +#include "projectile.h" +#include "resource/resource.h" #include "stageobjects.h" #include "util/glm.h" -#include "entity.h" #ifdef create_enemy_p #undef create_enemy_p diff --git a/src/enemy.h b/src/enemy.h index 35d6a4edb1..dfe852dc38 100644 --- a/src/enemy.h +++ b/src/enemy.h @@ -9,13 +9,11 @@ #pragma once #include "taisei.h" -#include "util.h" -#include "projectile.h" -#include "objectpool.h" +#include "coroutine/coevent.h" #include "entity.h" -#include "coroutine.h" #include "move.h" #include "resource/resource.h" +#include "util.h" #ifdef DEBUG #define ENEMY_DEBUG diff --git a/src/enemy_classes.c b/src/enemy_classes.c index 943b0d0c7f..37c1fb6a92 100644 --- a/src/enemy_classes.c +++ b/src/enemy_classes.c @@ -7,9 +7,9 @@ */ #include "enemy_classes.h" + #include "common_tasks.h" #include "global.h" -#include "coroutine.h" #define ECLASS_HP_SWIRL 100 #define ECLASS_HP_FAIRY 400 diff --git a/src/entity.c b/src/entity.c index c8c4dd4cff..83c5e850ee 100644 --- a/src/entity.c +++ b/src/entity.c @@ -7,10 +7,11 @@ */ #include "entity.h" -#include "util.h" -#include "renderer/api.h" -#include "global.h" + #include "dynarray.h" +#include "global.h" +#include "renderer/api.h" +#include "util.h" typedef struct EntityDrawHook EntityDrawHook; typedef LIST_ANCHOR(EntityDrawHook) EntityDrawHookList; diff --git a/src/entity.h b/src/entity.h index 223f25c7db..442a8d0cfc 100644 --- a/src/entity.h +++ b/src/entity.h @@ -9,10 +9,10 @@ #pragma once #include "taisei.h" -#include "objectpool.h" +#include "known_entities.h" +#include "list.h" #include "util/geometry.h" #include "util/macrohax.h" -#include "known_entities.h" #define LAYER_LOW_BITS 16 #define LAYER_LOW_MASK ((1 << LAYER_LOW_BITS) - 1) diff --git a/src/eventloop/eventloop.c b/src/eventloop/eventloop.c index 675827fcea..33cdc7ca49 100644 --- a/src/eventloop/eventloop.c +++ b/src/eventloop/eventloop.c @@ -6,12 +6,14 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ +#include "eventloop.h" #include "eventloop_private.h" -#include "util.h" + #include "global.h" -#include "video.h" -#include "vfs/public.h" #include "thread.h" +#include "util.h" +#include "vfs/public.h" +#include "video.h" struct evloop_s evloop; diff --git a/src/eventloop/executor_synchro.c b/src/eventloop/executor_synchro.c index 24c51664ad..50ec8f0291 100644 --- a/src/eventloop/executor_synchro.c +++ b/src/eventloop/executor_synchro.c @@ -7,10 +7,10 @@ */ #include "eventloop_private.h" -#include "util.h" -#include "framerate.h" -#include "thread.h" + #include "global.h" +#include "thread.h" +#include "util/env.h" void eventloop_run(void) { assert(thread_current_is_main()); diff --git a/src/events.c b/src/events.c index b6893b2a40..30bb73388f 100644 --- a/src/events.c +++ b/src/events.c @@ -7,10 +7,11 @@ */ #include "events.h" + #include "config.h" #include "global.h" +#include "transition.h" #include "video.h" -#include "gamepad.h" static hrtime_t keyrepeat_paused_until; static int global_handlers_lock = 0; diff --git a/src/events.h b/src/events.h index 10b40b4bd5..aa0c1c82ff 100644 --- a/src/events.h +++ b/src/events.h @@ -9,7 +9,7 @@ #pragma once #include "taisei.h" -#include "util.h" +#include typedef enum { TE_INVALID = -1, diff --git a/src/filewatch/filewatch_inotify.c b/src/filewatch/filewatch_inotify.c index 8e3b885aa7..cae4dfc565 100644 --- a/src/filewatch/filewatch_inotify.c +++ b/src/filewatch/filewatch_inotify.c @@ -7,8 +7,10 @@ */ #include "filewatch.h" -#include "util.h" + #include "events.h" +#include "hashtable.h" +#include "list.h" #include "vfs/syspath_public.h" #include diff --git a/src/framerate.c b/src/framerate.c index bffb9404ec..2b8c39124d 100644 --- a/src/framerate.c +++ b/src/framerate.c @@ -8,7 +8,6 @@ #include "framerate.h" #include "global.h" -#include "video.h" void fpscounter_reset(FPSCounter *fps) { hrtime_t frametime = HRTIME_RESOLUTION / FPS; diff --git a/src/gamepad.c b/src/gamepad.c index b42787dd75..35ad410587 100644 --- a/src/gamepad.c +++ b/src/gamepad.c @@ -7,10 +7,16 @@ */ #include "gamepad.h" + #include "config.h" +#include "dynarray.h" #include "events.h" -#include "global.h" #include "hirestime.h" +#include "log.h" +#include "transition.h" +#include "util/miscmath.h" +#include "util/stringops.h" +#include "vfs/public.h" typedef struct GamepadAxisState { int16_t raw; diff --git a/src/gamepad.h b/src/gamepad.h index 99a88ce463..99180da8e7 100644 --- a/src/gamepad.h +++ b/src/gamepad.h @@ -9,11 +9,11 @@ #pragma once #include "taisei.h" -#include - #include "events.h" #include "config.h" +#include + typedef enum GamepadAxisDigitalValue { AXISVAL_LEFT = -1, AXISVAL_RIGHT = 1, diff --git a/src/global.c b/src/global.c index bf1affde9d..b628527e8d 100644 --- a/src/global.c +++ b/src/global.c @@ -8,6 +8,9 @@ #include "global.h" +#include "util/env.h" +#include "gamepad.h" + Global global; void init_global(CLIAction *cli) { diff --git a/src/global.h b/src/global.h index 905ed7d3dd..8234722752 100644 --- a/src/global.h +++ b/src/global.h @@ -9,43 +9,21 @@ #pragma once #include "taisei.h" -#include -#include - -#include "util.h" -#include "color.h" - -#include "resource/sfx.h" -#include "resource/bgm.h" -#include "resource/font.h" -#include "resource/animation.h" - -#include "menu/menu.h" - -#include "player.h" -#include "projectile.h" +#include "cli.h" +#include "config.h" +#include "dialog.h" #include "enemy.h" +#include "framerate.h" #include "item.h" -#include "boss.h" -#include "laser.h" -#include "dialog.h" -#include "list.h" -#include "config.h" -#include "resource/resource.h" -#include "replay/state.h" +#include "lasers/laser.h" +#include "projectile.h" #include "random.h" -#include "events.h" -#include "difficulty.h" -#include "color.h" -#include "audio/audio.h" -#include "rwops/all.h" -#include "cli.h" -#include "hirestime.h" -#include "log.h" -#include "framerate.h" -#include "renderer/api.h" +#include "replay/state.h" #include "stageinfo.h" +#include +#include + enum { // defaults RESX = 800, diff --git a/src/hashtable.c b/src/hashtable.c index 87a618382a..a7432e65eb 100644 --- a/src/hashtable.c +++ b/src/hashtable.c @@ -6,8 +6,7 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "hashtable.h" -#include "util.h" +#include "hashtable.h" // IWYU pragma: keep #define HT_IMPL #include "hashtable_predefs.inc.h" diff --git a/src/hashtable.inc.h b/src/hashtable.inc.h index 172c00297a..60b2988619 100644 --- a/src/hashtable.inc.h +++ b/src/hashtable.inc.h @@ -4,7 +4,6 @@ #include "hashtable.h" #include "list.h" #include "util/stringops.h" -#include "util/assert.h" #include "log.h" #include diff --git a/src/hirestime.c b/src/hirestime.c index fd0ed6e627..1bfb86edac 100644 --- a/src/hirestime.c +++ b/src/hirestime.c @@ -6,9 +6,14 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "util.h" #include "hirestime.h" + +#include "log.h" #include "thread.h" +#include "util/env.h" +#include "util/miscmath.h" + +#include static bool use_hires; static hrtime_t time_current; diff --git a/src/item.c b/src/item.c index 6f01a75654..c589306513 100644 --- a/src/item.c +++ b/src/item.c @@ -7,6 +7,8 @@ */ #include "item.h" + +#include "audio/audio.h" #include "global.h" #include "list.h" #include "stage.h" diff --git a/src/item.h b/src/item.h index 48a7f44cd6..9255633645 100644 --- a/src/item.h +++ b/src/item.h @@ -9,11 +9,8 @@ #pragma once #include "taisei.h" -#include "util.h" #include "resource/resource.h" -#include "resource/texture.h" #include "resource/sprite.h" -#include "objectpool.h" #include "entity.h" typedef LIST_ANCHOR(Item) ItemList; diff --git a/src/laser.h b/src/laser.h deleted file mode 100644 index 42ac79cc3e..0000000000 --- a/src/laser.h +++ /dev/null @@ -1,13 +0,0 @@ -/* - * This software is licensed under the terms of the MIT License. - * See COPYING for further information. - * --- - * Copyright (c) 2011-2024, Lukas Weber . - * Copyright (c) 2012-2024, Andrei Alexeyev . - */ - -#pragma once -#include "taisei.h" - -// TODO remove this stub header -#include "lasers/laser.h" diff --git a/src/lasers/draw.c b/src/lasers/draw.c index ba2e98ddcb..99b2810a9b 100644 --- a/src/lasers/draw.c +++ b/src/lasers/draw.c @@ -6,20 +6,19 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "laser.h" #include "draw.h" +#include "laser.h" #include "internal.h" +#include "config.h" +#include "memory/allocator.h" +#include "memory/arena.h" #include "renderer/api.h" -#include "resource/model.h" +#include "util.h" #include "util/fbmgr.h" #include "util/glm.h" #include "util/rectpack.h" #include "video.h" -#include "config.h" -#include "global.h" -#include "memory/allocator.h" -#include "memory/arena.h" /* * LASER RENDERING OVERVIEW diff --git a/src/lasers/internal.h b/src/lasers/internal.h index 3cec7acf01..bccf950fcd 100644 --- a/src/lasers/internal.h +++ b/src/lasers/internal.h @@ -10,7 +10,6 @@ #include "taisei.h" #include "laser.h" -#include "util.h" #include "dynarray.h" typedef struct LaserInternalData { diff --git a/src/lasers/laser.c b/src/lasers/laser.c index ba7b9f40cd..1730309773 100644 --- a/src/lasers/laser.c +++ b/src/lasers/laser.c @@ -12,13 +12,10 @@ #include "global.h" #include "list.h" -#include "stageobjects.h" -#include "stagedraw.h" #include "renderer/api.h" -#include "resource/model.h" -#include "util/fbmgr.h" +#include "stage.h" +#include "stageobjects.h" #include "util/glm.h" -#include "video.h" typedef struct LaserSamplingParams { uint num_samples; diff --git a/src/lasers/laser.h b/src/lasers/laser.h index b8d573bd86..a64c7fb24e 100644 --- a/src/lasers/laser.h +++ b/src/lasers/laser.h @@ -9,11 +9,8 @@ #pragma once #include "taisei.h" -#include "draw.h" - -#include "util.h" -#include "projectile.h" -#include "resource/shader_program.h" +#include "color.h" +#include "coroutine/taskdsl.h" #include "entity.h" typedef cmplx LaserRuleFunc(Laser *p, real t, void *ruledata); @@ -111,4 +108,4 @@ DECLARE_EXTERN_TASK(laser_charge, { float target_width; }); -#include "rules.h" +#include "rules.h" // IWYU pragma: export diff --git a/src/lasers/rules.h b/src/lasers/rules.h index 3594bf2260..89c173ecc0 100644 --- a/src/lasers/rules.h +++ b/src/lasers/rules.h @@ -10,6 +10,7 @@ #include "taisei.h" #include "laser.h" +#include "move.h" #include "ringbuf.h" typedef struct LaserRuleLinearData { diff --git a/src/list.c b/src/list.c index 1bd3b5cc38..f81ecde2bb 100644 --- a/src/list.c +++ b/src/list.c @@ -7,7 +7,6 @@ */ #include "list.h" -#include "global.h" #undef list_insert List* list_insert(List **dest, List *elem) { diff --git a/src/log.c b/src/log.c index 3cacc6b67a..99abb00941 100644 --- a/src/log.c +++ b/src/log.c @@ -6,16 +6,20 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include -#include - #include "log.h" -#include "util.h" + +#include "coroutine/cotask.h" #include "list.h" -#include "util/strbuf.h" -#include "thread.h" #include "random.h" -#include "coroutine/cotask.h" +#include "thread.h" +#include "util.h" +#include "util/env.h" +#include "util/io.h" +#include "util/strbuf.h" +#include "util/stringops.h" + +#include +#include typedef struct Logger { LIST_INTERFACE(struct Logger); diff --git a/src/log.h b/src/log.h index bd3d1a70a6..45923c5f27 100644 --- a/src/log.h +++ b/src/log.h @@ -9,10 +9,10 @@ #pragma once #include "taisei.h" -#include - -#include "util/strbuf.h" #include "thread.h" +#include "util/strbuf.h" + +#include enum { _LOG_DEBUG_ID, diff --git a/src/main.c b/src/main.c index 870a066a47..21b268afa5 100644 --- a/src/main.c +++ b/src/main.c @@ -6,35 +6,38 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include -#include -#include - -#include "global.h" -#include "video.h" #include "audio/audio.h" -#include "stageinfo.h" -#include "menu/mainmenu.h" -#include "menu/savereplay.h" -#include "gamepad.h" -#include "progress.h" -#include "log.h" #include "cli.h" -#include "vfs/setup.h" -#include "version.h" +#include "coroutine/coroutine.h" #include "credits.h" -#include "taskmanager.h" -#include "coroutine.h" -#include "util/gamemode.h" #include "cutscenes/cutscene.h" -#include "replay/struct.h" -#include "filewatch/filewatch.h" #include "dynstage.h" #include "eventloop/eventloop.h" +#include "filewatch/filewatch.h" +#include "gamepad.h" +#include "global.h" +#include "log.h" +#include "menu/mainmenu.h" +#include "menu/savereplay.h" +#include "progress.h" #include "replay/demoplayer.h" +#include "replay/struct.h" #include "replay/tsrtool.h" +#include "stage.h" +#include "stageobjects.h" +#include "taskmanager.h" +#include "util/env.h" +#include "util/gamemode.h" +#include "util/io.h" +#include "version.h" +#include "vfs/setup.h" +#include "video.h" #include "watchdog.h" +#include +#include +#include + static bool watchdog_handler(SDL_Event *evt, void *arg) { assert(evt->type == MAKE_TAISEI_EVENT(TE_WATCHDOG)); config_reset(); diff --git a/src/memory/allocator.c b/src/memory/allocator.c index 4b6edf9a9e..731f5e80c6 100644 --- a/src/memory/allocator.c +++ b/src/memory/allocator.c @@ -7,8 +7,9 @@ */ #include "allocator.h" + +#include "log.h" #include "util.h" -#include "../util.h" static void *allocator_default_alloc(Allocator *alloc, size_t size) { return mem_alloc(size); diff --git a/src/memory/arena.c b/src/memory/arena.c index 58ebdb41de..ac3340b92d 100644 --- a/src/memory/arena.c +++ b/src/memory/arena.c @@ -7,7 +7,9 @@ */ #include "arena.h" + #include "util.h" +#include "util/miscmath.h" #include "../util.h" #define ARENA_MIN_ALLOC 4096 diff --git a/src/memory/memory.c b/src/memory/memory.c index 4a1127f7b3..29615323dc 100644 --- a/src/memory/memory.c +++ b/src/memory/memory.c @@ -7,6 +7,7 @@ */ #include "memory.h" + #include "util.h" #include "../util.h" diff --git a/src/menu/charprofile.c b/src/menu/charprofile.c index 517ce2e25b..1f09f3aa08 100644 --- a/src/menu/charprofile.c +++ b/src/menu/charprofile.c @@ -6,16 +6,16 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "events.h" -#include "resource/resource.h" #include "charprofile.h" + +#include "audio/audio.h" +#include "common.h" +#include "events.h" #include "mainmenu.h" #include "portrait.h" -#include "common.h" #include "progress.h" -#include "options.h" -#include "global.h" -#include "portrait.h" +#include "resource/font.h" +#include "resource/resource.h" #include "util/glm.h" #include "video.h" diff --git a/src/menu/charselect.c b/src/menu/charselect.c index 221865cc35..a8ea7982cd 100644 --- a/src/menu/charselect.c +++ b/src/menu/charselect.c @@ -7,14 +7,18 @@ */ #include "charselect.h" -#include "menu.h" -#include "mainmenu.h" + +#include "audio/audio.h" #include "common.h" -#include "global.h" -#include "video.h" +#include "events.h" +#include "menu.h" +#include "menu/mainmenu.h" +#include "plrmodes.h" +#include "portrait.h" +#include "progress.h" #include "util/glm.h" #include "util/graphics.h" -#include "portrait.h" +#include "video.h" #define SELECTED_SUBSHOT(m) (((CharMenuContext*)(m)->context)->subshot) #define DESCRIPTION_WIDTH (SCREEN_W / 3 + 40) diff --git a/src/menu/common.c b/src/menu/common.c index 343920e4cc..8c758baa03 100644 --- a/src/menu/common.c +++ b/src/menu/common.c @@ -7,20 +7,22 @@ */ #include "common.h" -#include "global.h" -#include "menu.h" -#include "savereplay.h" -#include "difficultyselect.h" -#include "cutscenes/cutscene.h" + +#include "audio/audio.h" #include "charselect.h" #include "credits.h" +#include "cutscenes/cutscene.h" +#include "difficultyselect.h" +#include "global.h" #include "mainmenu.h" +#include "menu.h" #include "progress.h" -#include "video.h" -#include "replay/struct.h" #include "replay/state.h" -#include "util/graphics.h" +#include "replay/struct.h" +#include "resource/font.h" +#include "savereplay.h" #include "stage.h" +#include "video.h" typedef struct StartGameContext { StageInfo *restart_stage; diff --git a/src/menu/cutsceneview.c b/src/menu/cutsceneview.c index 1ecc27541a..0f5d9fb112 100644 --- a/src/menu/cutsceneview.c +++ b/src/menu/cutsceneview.c @@ -6,15 +6,16 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "util/callchain.h" -#include "menu/menu.h" #include "cutsceneview.h" + +#include "audio/audio.h" #include "common.h" -#include "options.h" -#include "global.h" -#include "video.h" #include "cutscenes/cutscene.h" +#include "menu/menu.h" +#include "options.h" #include "progress.h" +#include "util/callchain.h" +#include "video.h" static void draw_cutsceneview_menu(MenuData *m) { draw_options_menu_bg(m); diff --git a/src/menu/difficultyselect.c b/src/menu/difficultyselect.c index e9f79451f1..ccaae7dc0e 100644 --- a/src/menu/difficultyselect.c +++ b/src/menu/difficultyselect.c @@ -6,11 +6,13 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "difficulty.h" #include "difficultyselect.h" -#include "mainmenu.h" + #include "common.h" -#include "global.h" +#include "difficulty.h" +#include "mainmenu.h" +#include "progress.h" +#include "resource/font.h" #include "video.h" // FIXME: put this into the menu struct somehow (drawdata is a bad system) diff --git a/src/menu/difficultyselect.h b/src/menu/difficultyselect.h index cf14b06f1d..9fb20f894a 100644 --- a/src/menu/difficultyselect.h +++ b/src/menu/difficultyselect.h @@ -11,5 +11,5 @@ #include "menu.h" -MenuData* create_difficulty_menu(void); +MenuData *create_difficulty_menu(void); void draw_difficulty_menu(MenuData *m); diff --git a/src/menu/gameovermenu.c b/src/menu/gameovermenu.c index 86a01470fc..42a7d042b6 100644 --- a/src/menu/gameovermenu.c +++ b/src/menu/gameovermenu.c @@ -6,11 +6,12 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "menu.h" #include "gameovermenu.h" + +#include "global.h" #include "ingamemenu.h" +#include "menu.h" #include "stats.h" -#include "global.h" typedef struct GameoverMenuContext { IngameMenuContext base; diff --git a/src/menu/ingamemenu.c b/src/menu/ingamemenu.c index c2eee91303..f72c2e4afc 100644 --- a/src/menu/ingamemenu.c +++ b/src/menu/ingamemenu.c @@ -6,15 +6,18 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "menu.h" -#include "common.h" #include "ingamemenu.h" -#include "submenus.h" + +#include "common.h" +#include "events.h" #include "global.h" +#include "menu.h" +#include "renderer/api.h" +#include "resource/font.h" #include "stagedraw.h" +#include "submenus.h" +#include "util/graphics.h" #include "video.h" -#include "options.h" -#include "renderer/api.h" static void return_to_title(MenuData *m, void *arg) { global.gameover = GAMEOVER_ABORT; diff --git a/src/menu/mainmenu.c b/src/menu/mainmenu.c index 46f5fb2f30..b6956e4bd6 100644 --- a/src/menu/mainmenu.c +++ b/src/menu/mainmenu.c @@ -7,21 +7,19 @@ */ #include "mainmenu.h" -#include "menu.h" -#include "submenus.h" -#include "common.h" - -#include "savereplay.h" -#include "stagepractice.h" -#include "difficultyselect.h" #include "charselect.h" +#include "common.h" +#include "menu.h" +#include "submenus.h" +#include "audio/audio.h" +#include "events.h" #include "global.h" -#include "video.h" -#include "stage.h" +#include "resource/font.h" +#include "util/graphics.h" #include "version.h" -#include "plrmodes.h" +#include "video.h" #include "watchdog.h" static MenuEntry *spell_practice_entry; diff --git a/src/menu/media.c b/src/menu/media.c index 18591cdfbe..c3a7764036 100644 --- a/src/menu/media.c +++ b/src/menu/media.c @@ -7,12 +7,13 @@ */ #include "media.h" -#include "musicroom.h" -#include "cutsceneview.h" + #include "charprofile.h" #include "common.h" +#include "cutsceneview.h" +#include "musicroom.h" + #include "options.h" -#include "global.h" #include "video.h" static void menu_action_enter_musicroom(MenuData *menu, void *arg) { diff --git a/src/menu/menu.c b/src/menu/menu.c index 1fd6ec1ef2..c012232120 100644 --- a/src/menu/menu.c +++ b/src/menu/menu.c @@ -7,11 +7,14 @@ */ #include "menu.h" -#include "global.h" -#include "video.h" + +#include "audio/audio.h" #include "eventloop/eventloop.h" +#include "events.h" +#include "global.h" #include "replay/demoplayer.h" #include "util/graphics.h" +#include "video.h" #include "watchdog.h" MenuEntry *add_menu_entry(MenuData *menu, const char *name, MenuAction action, void *arg) { diff --git a/src/menu/menu.h b/src/menu/menu.h index d019ce4fe7..ef4c88b66d 100644 --- a/src/menu/menu.h +++ b/src/menu/menu.h @@ -10,10 +10,11 @@ #include "taisei.h" #include "transition.h" -#include "events.h" #include "util/callchain.h" #include "dynarray.h" +#include + #define IMENU_BLUR 0.05 enum { diff --git a/src/menu/musicroom.c b/src/menu/musicroom.c index 6049f8b211..023c11c9a8 100644 --- a/src/menu/musicroom.c +++ b/src/menu/musicroom.c @@ -7,13 +7,14 @@ */ #include "musicroom.h" -#include "resource/resource.h" -#include "resource/font.h" + #include "audio/audio.h" -#include "progress.h" #include "common.h" #include "options.h" +#include "progress.h" #include "renderer/api.h" +#include "resource/font.h" +#include "resource/resource.h" #include "video.h" enum { diff --git a/src/menu/options.c b/src/menu/options.c index aa3b46bcc3..3df46e9e4d 100644 --- a/src/menu/options.c +++ b/src/menu/options.c @@ -6,15 +6,18 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include +#include "options.h" -#include "menu.h" #include "common.h" -#include "options.h" #include "mainmenu.h" -#include "global.h" -#include "video.h" +#include "menu.h" + +#include "audio/audio.h" +#include "gamepad.h" #include "util/graphics.h" +#include "video.h" + +#include typedef struct OptionBinding OptionBinding; diff --git a/src/menu/replayview.c b/src/menu/replayview.c index 14f80884fb..e1597fa778 100644 --- a/src/menu/replayview.c +++ b/src/menu/replayview.c @@ -6,16 +6,18 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "global.h" +#include "replayview.h" + +#include "common.h" #include "menu.h" #include "options.h" -#include "mainmenu.h" -#include "replayview.h" + +#include "audio/audio.h" #include "plrmodes.h" -#include "video.h" -#include "common.h" -#include "replay/state.h" #include "replay/struct.h" +#include "resource/font.h" +#include "stageinfo.h" +#include "video.h" // Type of MenuData.context typedef struct ReplayviewContext { diff --git a/src/menu/savereplay.c b/src/menu/savereplay.c index 8ced605232..1dbcabdd2d 100644 --- a/src/menu/savereplay.c +++ b/src/menu/savereplay.c @@ -7,13 +7,18 @@ */ #include "savereplay.h" + +#include "common.h" #include "mainmenu.h" -#include "global.h" -#include "replay/struct.h" + +#include "config.h" +#include "difficulty.h" +#include "events.h" #include "plrmodes.h" -#include "common.h" -#include "video.h" +#include "progress.h" +#include "replay/struct.h" #include "util/graphics.h" +#include "video.h" attr_nonnull_all static void do_save_replay(Replay *rpy) { diff --git a/src/menu/savereplay.h b/src/menu/savereplay.h index 6a08745a0a..5171a098a7 100644 --- a/src/menu/savereplay.h +++ b/src/menu/savereplay.h @@ -9,7 +9,6 @@ #pragma once #include "taisei.h" -#include "menu.h" #include "util/callchain.h" #include "replay/replay.h" diff --git a/src/menu/spellpractice.c b/src/menu/spellpractice.c index 50d1a8b6b6..460c04e1db 100644 --- a/src/menu/spellpractice.c +++ b/src/menu/spellpractice.c @@ -7,9 +7,11 @@ */ #include "spellpractice.h" + #include "common.h" #include "options.h" -#include "global.h" + +#include "stageinfo.h" #include "video.h" static void draw_spell_menu(MenuData *m) { diff --git a/src/menu/stagepractice.c b/src/menu/stagepractice.c index 84c1d0e58c..92653e02cb 100644 --- a/src/menu/stagepractice.c +++ b/src/menu/stagepractice.c @@ -7,11 +7,12 @@ */ #include "stagepractice.h" + #include "common.h" #include "options.h" -#include "global.h" -#include "video.h" + #include "stageinfo.h" +#include "video.h" static void draw_stgpract_menu(MenuData *m) { draw_options_menu_bg(m); diff --git a/src/menu/stagepractice.h b/src/menu/stagepractice.h index ea12d66369..45564e2889 100644 --- a/src/menu/stagepractice.h +++ b/src/menu/stagepractice.h @@ -12,4 +12,4 @@ #include "menu.h" #include "difficulty.h" -MenuData* create_stgpract_menu(Difficulty diff); +MenuData *create_stgpract_menu(Difficulty diff); diff --git a/src/menu/stageselect.c b/src/menu/stageselect.c index a986a5d855..016c7d72c2 100644 --- a/src/menu/stageselect.c +++ b/src/menu/stageselect.c @@ -6,12 +6,12 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "global.h" -#include "menu.h" -#include "options.h" -#include "stage.h" #include "stageselect.h" + #include "common.h" +#include "menu.h" +#include "options.h" + #include "video.h" #include "stageinfo.h" diff --git a/src/menu/submenus.c b/src/menu/submenus.c index b6c27a369b..13d69adbcd 100644 --- a/src/menu/submenus.c +++ b/src/menu/submenus.c @@ -6,16 +6,18 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ +#include "submenus.h" + +#include "difficultyselect.h" +#include "media.h" #include "menu.h" #include "options.h" -#include "stageselect.h" #include "replayview.h" #include "spellpractice.h" #include "stagepractice.h" -#include "difficultyselect.h" -#include "media.h" +#include "stageselect.h" + #include "global.h" -#include "submenus.h" static void on_leave_options(CallChainResult ccr) { MenuData *m = ccr.result; diff --git a/src/objectpool.c b/src/objectpool.c index 012cc8b92d..1b0fe896fd 100644 --- a/src/objectpool.c +++ b/src/objectpool.c @@ -7,8 +7,7 @@ */ #include "objectpool.h" -#include "util.h" -#include "list.h" + #include "memory/arena.h" void objpool_init( diff --git a/src/objectpool.h b/src/objectpool.h index e65969461a..2b594bf86e 100644 --- a/src/objectpool.h +++ b/src/objectpool.h @@ -9,7 +9,6 @@ #pragma once #include "taisei.h" -#include "list.h" #include "memory/arena.h" typedef struct ObjectPool ObjectPool; diff --git a/src/pch/taisei_pch.h b/src/pch/taisei_pch.h index 3b9a5b22b1..6795c82068 100644 --- a/src/pch/taisei_pch.h +++ b/src/pch/taisei_pch.h @@ -11,6 +11,15 @@ #include "taisei.h" -#include "global.h" +#include "coroutine/taskdsl.h" // IWYU pragma: keep +#include "dynarray.h" // IWYU pragma: keep +#include "global.h" // IWYU pragma: keep +#include "log.h" // IWYU pragma: keep +#include "renderer/api.h" // IWYU pragma: keep +#include "resource/resource.h" // IWYU pragma: keep +#include "stageobjects.h" // IWYU pragma: keep +#include "stages/common_imports.h" // IWYU pragma: keep +#include "util.h" // IWYU pragma: keep +#include "util/miscmath.h" // IWYU pragma: keep #endif // IGUARD_pch_taisei_pch_h diff --git a/src/pixmap/conversion.c b/src/pixmap/conversion.c index e9b37e9732..2f5b9ab3ec 100644 --- a/src/pixmap/conversion.c +++ b/src/pixmap/conversion.c @@ -6,8 +6,8 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ +#include "log.h" #include "pixmap.h" -#include "util.h" // NOTE: this is pretty stupid and not at all optimized, patches welcome diff --git a/src/pixmap/fileformats/internal.c b/src/pixmap/fileformats/internal.c index 46b0b064f3..6f7d145766 100644 --- a/src/pixmap/fileformats/internal.c +++ b/src/pixmap/fileformats/internal.c @@ -7,6 +7,8 @@ */ #include "fileformats.h" + +#include "log.h" #include "rwops/rwops_crc32.h" #include "util.h" diff --git a/src/pixmap/fileformats/png.c b/src/pixmap/fileformats/png.c index c49b3d8486..f4a9042a48 100644 --- a/src/pixmap/fileformats/png.c +++ b/src/pixmap/fileformats/png.c @@ -7,7 +7,8 @@ */ #include "fileformats.h" -#include "util.h" + +#include "log.h" #include "util/pngcruft.h" static const uint8_t png_magic[] = { 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A }; diff --git a/src/pixmap/fileformats/webp.c b/src/pixmap/fileformats/webp.c index d486cd4052..5cf09d2db7 100644 --- a/src/pixmap/fileformats/webp.c +++ b/src/pixmap/fileformats/webp.c @@ -6,8 +6,9 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "util.h" #include "fileformats.h" +#include "log.h" +#include "util/io.h" #include diff --git a/src/pixmap/pixmap.c b/src/pixmap/pixmap.c index 83d3081eb8..d14dd15dd0 100644 --- a/src/pixmap/pixmap.c +++ b/src/pixmap/pixmap.c @@ -7,8 +7,12 @@ */ #include "pixmap.h" + #include "fileformats/fileformats.h" +#include "log.h" #include "util.h" +#include "util/io.h" +#include "vfs/public.h" static PixmapFileFormatHandler *fileformat_handlers[] = { [PIXMAP_FILEFORMAT_INTERNAL] = &pixmap_fileformat_internal, diff --git a/src/pixmap/pixmap_conversion.inc.h b/src/pixmap/pixmap_conversion.inc.h index db635aca87..27561ab0df 100644 --- a/src/pixmap/pixmap_conversion.inc.h +++ b/src/pixmap/pixmap_conversion.inc.h @@ -1,4 +1,5 @@ +#include "util/miscmath.h" #include "util/macrohax.h" #define _CONV_IN_IS_FLOAT ((float)_CONV_IN_MAX == 1.0f) diff --git a/src/player.c b/src/player.c index 95959586ab..35a679b57d 100644 --- a/src/player.c +++ b/src/player.c @@ -8,17 +8,20 @@ #include "player.h" -#include "projectile.h" +#include "audio/audio.h" +#include "entity.h" +#include "gamepad.h" #include "global.h" #include "plrmodes.h" +#include "projectile.h" +#include "replay/stage.h" +#include "replay/struct.h" #include "stage.h" -#include "stagetext.h" #include "stagedraw.h" +#include "stagetext.h" #include "stats.h" -#include "entity.h" #include "util/glm.h" -#include "replay/stage.h" -#include "replay/struct.h" +#include "util/graphics.h" DEFINE_ENTITY_TYPE(PlayerIndicators, { Player *plr; diff --git a/src/player.h b/src/player.h index f4e569103b..a616e8aa50 100644 --- a/src/player.h +++ b/src/player.h @@ -9,16 +9,14 @@ #pragma once #include "taisei.h" -#include "util.h" -#include "enemy.h" -#include "gamepad.h" #include "aniplayer.h" -#include "stats.h" -#include "resource/resource.h" -#include "resource/animation.h" +#include "color.h" +#include "coroutine/coevent.h" #include "entity.h" -#include "replay/state.h" #include "replay/eventcodes.h" +#include "replay/state.h" +#include "resource/resource.h" +#include "stats.h" #ifdef DEBUG #define PLR_DPS_STATS diff --git a/src/plrmodes.c b/src/plrmodes.c index bf19d69fcd..819a198f5e 100644 --- a/src/plrmodes.c +++ b/src/plrmodes.c @@ -6,15 +6,13 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "player.h" -#include "global.h" -#include "stage.h" -#include "portrait.h" - #include "plrmodes.h" + +#include "plrmodes/reimu.h" #include "plrmodes/marisa.h" #include "plrmodes/youmu.h" -#include "plrmodes/reimu.h" + +#include "portrait.h" static PlayerCharacter *player_characters[] = { &character_reimu, diff --git a/src/plrmodes.h b/src/plrmodes.h index dff56efe0c..0dee4608f7 100644 --- a/src/plrmodes.h +++ b/src/plrmodes.h @@ -9,12 +9,10 @@ #pragma once #include "taisei.h" -#include "enemy.h" -#include "projectile.h" -#include "player.h" #include "cutscenes/cutscene.h" -#include "dialog.h" +#include "dialog/dialog_interface.h" #include "endings.h" +#include "player.h" typedef enum { // WARNING: Reordering this will break current replays, and possibly even progress files. diff --git a/src/plrmodes/marisa.c b/src/plrmodes/marisa.c index bffb0b6748..67bf1702d5 100644 --- a/src/plrmodes/marisa.c +++ b/src/plrmodes/marisa.c @@ -6,10 +6,13 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ +#include "marisa.h" + +#include "audio/audio.h" #include "global.h" #include "plrmodes.h" -#include "marisa.h" #include "stagedraw.h" +#include "util/graphics.h" PlayerCharacter character_marisa = { .id = PLR_CHAR_MARISA, diff --git a/src/plrmodes/marisa.h b/src/plrmodes/marisa.h index e3acef98d6..e3f7c17a37 100644 --- a/src/plrmodes/marisa.h +++ b/src/plrmodes/marisa.h @@ -10,12 +10,11 @@ #include "taisei.h" #include "plrmodes.h" -#include "marisa_a.h" -#include "marisa_b.h" -#include "dialog/marisa.h" -#include "color.h" +#include "coroutine/taskdsl.h" extern PlayerCharacter character_marisa; +extern PlayerMode plrmode_marisa_a; +extern PlayerMode plrmode_marisa_b; typedef struct MarisaBeamInfo { cmplx origin; diff --git a/src/plrmodes/marisa_a.c b/src/plrmodes/marisa_a.c index 96b78bbac4..92cdd21c00 100644 --- a/src/plrmodes/marisa_a.c +++ b/src/plrmodes/marisa_a.c @@ -6,12 +6,16 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ +#include "marisa.h" + +#include "audio/audio.h" +#include "common_tasks.h" +#include "dialog/marisa.h" #include "global.h" #include "plrmodes.h" -#include "marisa.h" #include "renderer/api.h" #include "stagedraw.h" -#include "common_tasks.h" +#include "util/graphics.h" #define SHOT_FORWARD_DAMAGE 60 #define SHOT_FORWARD_DELAY 6 diff --git a/src/plrmodes/marisa_a.h b/src/plrmodes/marisa_a.h deleted file mode 100644 index 9726157468..0000000000 --- a/src/plrmodes/marisa_a.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This software is licensed under the terms of the MIT License. - * See COPYING for further information. - * --- - * Copyright (c) 2011-2024, Lukas Weber . - * Copyright (c) 2012-2024, Andrei Alexeyev . - */ - -#pragma once -#include "taisei.h" - -#include "plrmodes.h" - -extern PlayerMode plrmode_marisa_a; diff --git a/src/plrmodes/marisa_b.c b/src/plrmodes/marisa_b.c index f347c93368..46864a7602 100644 --- a/src/plrmodes/marisa_b.c +++ b/src/plrmodes/marisa_b.c @@ -6,13 +6,16 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ +#include "marisa.h" + +#include "audio/audio.h" +#include "common_tasks.h" +#include "dialog/marisa.h" #include "global.h" #include "plrmodes.h" -#include "marisa.h" #include "renderer/api.h" -#include "common_tasks.h" -#include "util/glm.h" #include "stagedraw.h" +#include "util/glm.h" #define SHOT_FORWARD_DAMAGE 60 #define SHOT_FORWARD_DELAY 6 diff --git a/src/plrmodes/marisa_b.h b/src/plrmodes/marisa_b.h deleted file mode 100644 index c6864a2a7b..0000000000 --- a/src/plrmodes/marisa_b.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This software is licensed under the terms of the MIT License. - * See COPYING for further information. - * --- - * Copyright (c) 2011-2024, Lukas Weber . - * Copyright (c) 2012-2024, Andrei Alexeyev . - */ - -#pragma once -#include "taisei.h" - -#include "plrmodes.h" - -extern PlayerMode plrmode_marisa_b; diff --git a/src/plrmodes/reimu.c b/src/plrmodes/reimu.c index 2177d9e4a8..78f1a5f1fc 100644 --- a/src/plrmodes/reimu.c +++ b/src/plrmodes/reimu.c @@ -6,10 +6,12 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ +#include "reimu.h" + #include "global.h" #include "plrmodes.h" -#include "reimu.h" #include "stagedraw.h" +#include "util/graphics.h" static Framebuffer *bomb_buffer; diff --git a/src/plrmodes/reimu.h b/src/plrmodes/reimu.h index 73652e0968..ccce924bae 100644 --- a/src/plrmodes/reimu.h +++ b/src/plrmodes/reimu.h @@ -10,7 +10,6 @@ #include "taisei.h" #include "plrmodes.h" -#include "dialog/reimu.h" extern PlayerCharacter character_reimu; extern PlayerMode plrmode_reimu_a; diff --git a/src/plrmodes/reimu_a.c b/src/plrmodes/reimu_a.c index 4c445682cc..3db5a0a73a 100644 --- a/src/plrmodes/reimu_a.c +++ b/src/plrmodes/reimu_a.c @@ -6,11 +6,15 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ +#include "reimu.h" + +#include "audio/audio.h" +#include "common_tasks.h" +#include "dialog/reimu.h" #include "global.h" #include "plrmodes.h" -#include "reimu.h" #include "stagedraw.h" -#include "common_tasks.h" +#include "util/graphics.h" #define SHOT_FORWARD_DMG 50 #define SHOT_FORWARD_DELAY 3 diff --git a/src/plrmodes/reimu_b.c b/src/plrmodes/reimu_b.c index 4c4edcd797..4d801166a4 100644 --- a/src/plrmodes/reimu_b.c +++ b/src/plrmodes/reimu_b.c @@ -6,11 +6,15 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ +#include "reimu.h" + +#include "audio/audio.h" +#include "common_tasks.h" +#include "dialog/reimu.h" #include "global.h" #include "plrmodes.h" -#include "reimu.h" #include "stagedraw.h" -#include "common_tasks.h" +#include "util/graphics.h" #define SHOT_FORWARD_DMG 35 #define SHOT_FORWARD_DELAY 6 diff --git a/src/plrmodes/youmu.c b/src/plrmodes/youmu.c index a3eb38c4e8..e151782106 100644 --- a/src/plrmodes/youmu.c +++ b/src/plrmodes/youmu.c @@ -6,10 +6,12 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ +#include "youmu.h" + #include "global.h" #include "plrmodes.h" -#include "youmu.h" #include "stagedraw.h" +#include "util/graphics.h" PlayerCharacter character_youmu = { .id = PLR_CHAR_YOUMU, diff --git a/src/plrmodes/youmu.h b/src/plrmodes/youmu.h index e385bea9f5..6fbfa84472 100644 --- a/src/plrmodes/youmu.h +++ b/src/plrmodes/youmu.h @@ -9,12 +9,13 @@ #pragma once #include "taisei.h" +#include "move.h" #include "plrmodes.h" -#include "youmu_a.h" -#include "youmu_b.h" -#include "dialog/youmu.h" +#include "renderer/api.h" extern PlayerCharacter character_youmu; +extern PlayerMode plrmode_youmu_a; +extern PlayerMode plrmode_youmu_b; typedef struct YoumuBombBGData { Framebuffer *buffer; diff --git a/src/plrmodes/youmu_a.c b/src/plrmodes/youmu_a.c index fb98748667..7a962f598f 100644 --- a/src/plrmodes/youmu_a.c +++ b/src/plrmodes/youmu_a.c @@ -6,11 +6,15 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ +#include "youmu.h" + +#include "audio/audio.h" +#include "dialog/youmu.h" #include "global.h" #include "plrmodes.h" -#include "youmu.h" #include "renderer/api.h" #include "stagedraw.h" +#include "util/graphics.h" #define SHOT_SELF_DELAY 6 #define SHOT_SELF_DAMAGE 60 diff --git a/src/plrmodes/youmu_a.h b/src/plrmodes/youmu_a.h deleted file mode 100644 index 4d2cc7074d..0000000000 --- a/src/plrmodes/youmu_a.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This software is licensed under the terms of the MIT License. - * See COPYING for further information. - * --- - * Copyright (c) 2011-2024, Lukas Weber . - * Copyright (c) 2012-2024, Andrei Alexeyev . - */ - -#pragma once -#include "taisei.h" - -#include "plrmodes.h" - -extern PlayerMode plrmode_youmu_a; diff --git a/src/plrmodes/youmu_b.c b/src/plrmodes/youmu_b.c index 9ccb43080b..d87d405e2f 100644 --- a/src/plrmodes/youmu_b.c +++ b/src/plrmodes/youmu_b.c @@ -6,11 +6,14 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ +#include "youmu.h" + +#include "audio/audio.h" +#include "dialog/youmu.h" #include "global.h" #include "plrmodes.h" -#include "youmu.h" +#include "stage.h" #include "util/glm.h" -#include "stagedraw.h" #define SHOT_BASIC_DAMAGE 60 #define SHOT_BASIC_DELAY 6 diff --git a/src/plrmodes/youmu_b.h b/src/plrmodes/youmu_b.h deleted file mode 100644 index fafacb28f6..0000000000 --- a/src/plrmodes/youmu_b.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * This software is licensed under the terms of the MIT License. - * See COPYING for further information. - * --- - * Copyright (c) 2011-2024, Lukas Weber . - * Copyright (c) 2012-2024, Andrei Alexeyev . - */ - -#pragma once -#include "taisei.h" - -#include "plrmodes.h" - -extern PlayerMode plrmode_youmu_b; diff --git a/src/portrait.c b/src/portrait.c index 40fb7cade6..74fd38e013 100644 --- a/src/portrait.c +++ b/src/portrait.c @@ -7,8 +7,8 @@ */ #include "portrait.h" + #include "renderer/api.h" -#include "config.h" #define RETURN_RESOURCE_NAME(name1, suffix, name2) \ assert(bufsize >= strlen(PORTRAIT_PREFIX) + strlen(name1) + strlen(suffix) + strlen(name2) + 1); \ diff --git a/src/progress.c b/src/progress.c index 85baaf1e3c..33c0d0ac30 100644 --- a/src/progress.c +++ b/src/progress.c @@ -6,14 +6,15 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include - #include "progress.h" + #include "stageinfo.h" +#include "util.h" #include "version.h" -#include "rwops/rwops_autobuf.h" #include "rwops/rwops_zstd.h" +#include + /* This module implements a persistent storage of a player's game progress, such as unlocked stages, high-scores etc. diff --git a/src/projectile.h b/src/projectile.h index 9f63d183c9..4868bc9fdb 100644 --- a/src/projectile.h +++ b/src/projectile.h @@ -9,16 +9,15 @@ #pragma once #include "taisei.h" -#include "util.h" -#include "resource/resource.h" -#include "resource/sprite.h" -#include "resource/shader_program.h" #include "color.h" -#include "objectpool.h" -#include "renderer/api.h" +#include "coroutine/coevent.h" #include "entity.h" #include "move.h" -#include "coroutine.h" +#include "renderer/api.h" +#include "resource/resource.h" +#include "resource/shader_program.h" +#include "resource/sprite.h" +#include "util.h" #if defined(DEBUG) && !defined(RNG_API_CHECK) #define PROJ_DEBUG diff --git a/src/projectile_prototypes.c b/src/projectile_prototypes.c index dd83d4b39d..33ea5301cb 100644 --- a/src/projectile_prototypes.c +++ b/src/projectile_prototypes.c @@ -7,8 +7,6 @@ */ #include "projectile.h" -#include "util.h" -#include "random.h" typedef struct PPBasicPriv { const char *sprite_name; diff --git a/src/random.c b/src/random.c index c1d230ad82..f60b02e13f 100644 --- a/src/random.c +++ b/src/random.c @@ -7,9 +7,9 @@ */ #include "random.h" -#include "util.h" -#include +#include "util.h" +#include "util/miscmath.h" static RandomState *rng_active_state; diff --git a/src/random.h b/src/random.h index edbea6a733..c7565b8e1e 100644 --- a/src/random.h +++ b/src/random.h @@ -9,9 +9,6 @@ #pragma once #include "taisei.h" -#include "util/crap.h" -#include "util/miscmath.h" - typedef struct RandomState { uint64_t state[4]; #ifdef DEBUG diff --git a/src/renderer/api.c b/src/renderer/api.c index fbb6e64402..e1ad4c833f 100644 --- a/src/renderer/api.c +++ b/src/renderer/api.c @@ -7,17 +7,16 @@ */ #include "api.h" + #include "common/backend.h" #include "common/matstack.h" -#include "common/sprite_batch.h" #include "common/models.h" +#include "common/sprite_batch.h" #include "common/state.h" -#include "util/glm.h" -#include "util/graphics.h" +#include "coroutine/coroutine.h" #include "resource/resource.h" #include "resource/texture.h" -#include "resource/sprite.h" -#include "coroutine.h" +#include "util/glm.h" #define B _r_backend.funcs diff --git a/src/renderer/api.h b/src/renderer/api.h index e9780b1003..5d80fe8fa3 100644 --- a/src/renderer/api.h +++ b/src/renderer/api.h @@ -9,14 +9,12 @@ #pragma once #include "taisei.h" -#include "util.h" -#include "pixmap/pixmap.h" #include "color.h" -#include "common/shaderlib/shaderlib.h" +#include "pixmap/pixmap.h" +#include "renderer/common/shaderlib/shaderlib.h" #include "resource/resource.h" #include "resource/shader_program.h" #include "resource/texture.h" -#include "memory/allocator.h" typedef struct Texture Texture; typedef struct Framebuffer Framebuffer; @@ -230,6 +228,14 @@ typedef enum Primitive { PRIM_TRIANGLES, } Primitive; +struct Model { + VertexArray *vertex_array; + size_t num_vertices; + size_t num_indices; + size_t offset; + Primitive primitive; +}; + typedef enum VertexAttribType { VA_FLOAT, VA_BYTE, diff --git a/src/renderer/common/backend.c b/src/renderer/common/backend.c index 0c6dc937cc..c938728abc 100644 --- a/src/renderer/common/backend.c +++ b/src/renderer/common/backend.c @@ -8,6 +8,9 @@ #include "backend.h" +#include "util.h" +#include "util/env.h" + #undef R #define R(x) extern RendererBackend _r_backend_##x; TAISEI_BUILDCONF_RENDERER_BACKENDS diff --git a/src/renderer/common/matstack.c b/src/renderer/common/matstack.c index 50bb983885..9eb63fbc24 100644 --- a/src/renderer/common/matstack.c +++ b/src/renderer/common/matstack.c @@ -6,10 +6,10 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "../api.h" #include "matstack.h" + +#include "../api.h" #include "util/glm.h" -#include "state.h" void matstack_reset(MatrixStack *ms) { ms->head = ms->stack; diff --git a/src/renderer/common/matstack.h b/src/renderer/common/matstack.h index 9864789da8..ea572b7f9c 100644 --- a/src/renderer/common/matstack.h +++ b/src/renderer/common/matstack.h @@ -9,7 +9,7 @@ #pragma once #include "taisei.h" -#include "util.h" +#include "util/glm.h" enum { MATSTACK_LIMIT = 32, diff --git a/src/renderer/common/models.c b/src/renderer/common/models.c index ba1773f5fe..c86620a5cd 100644 --- a/src/renderer/common/models.c +++ b/src/renderer/common/models.c @@ -7,8 +7,9 @@ */ #include "models.h" + #include "../api.h" -#include "resource/model.h" +#include "util.h" static struct { VertexBuffer *vbuf; diff --git a/src/renderer/common/shaderlib/cache.c b/src/renderer/common/shaderlib/cache.c index 030453fc78..74d1e39db5 100644 --- a/src/renderer/common/shaderlib/cache.c +++ b/src/renderer/common/shaderlib/cache.c @@ -7,12 +7,14 @@ */ #include "shaderlib.h" +#include "cache.h" -#include "util.h" +#include "log.h" #include "util/sha256.h" #include "rwops/rwops_crc32.h" #include "rwops/rwops_autobuf.h" #include "rwops/rwops_zstd.h" +#include "vfs/public.h" #define CACHE_VERSION 5 #define CRC_INIT 0 diff --git a/src/renderer/common/shaderlib/defs.h b/src/renderer/common/shaderlib/defs.h index fc7941bf1c..b650f16d3c 100644 --- a/src/renderer/common/shaderlib/defs.h +++ b/src/renderer/common/shaderlib/defs.h @@ -9,6 +9,8 @@ #pragma once #include "taisei.h" +// IWYU pragma: private, include "renderer/common/shaderlib/shaderlib.h" + typedef enum ShaderStage { SHADER_STAGE_INVALID, SHADER_STAGE_VERTEX, diff --git a/src/renderer/common/shaderlib/lang_glsl.c b/src/renderer/common/shaderlib/lang_glsl.c index 0fa7430cee..fab2ca542c 100644 --- a/src/renderer/common/shaderlib/lang_glsl.c +++ b/src/renderer/common/shaderlib/lang_glsl.c @@ -6,11 +6,15 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ +#include "lang_glsl.h" #include "shaderlib.h" + +#include "log.h" #include "rwops/rwops_autobuf.h" +#include "util/io.h" +#include "util/stringops.h" #include "vfs/pathutil.h" #include "vfs/public.h" -#include "util.h" enum { GLSL_INCLUDE_DEPTH = 42, diff --git a/src/renderer/common/shaderlib/lang_spirv.c b/src/renderer/common/shaderlib/lang_spirv.c index 57d8d939fe..a18b450261 100644 --- a/src/renderer/common/shaderlib/lang_spirv.c +++ b/src/renderer/common/shaderlib/lang_spirv.c @@ -6,6 +6,7 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ +#include "log.h" #include "shaderlib.h" #include "lang_spirv_private.h" diff --git a/src/renderer/common/shaderlib/lang_spirv_aux.c b/src/renderer/common/shaderlib/lang_spirv_aux.c index 315f6122a7..8e8db2e2a5 100644 --- a/src/renderer/common/shaderlib/lang_spirv_aux.c +++ b/src/renderer/common/shaderlib/lang_spirv_aux.c @@ -6,8 +6,11 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "shaderlib.h" #include "lang_spirv_private.h" +#include "shaderlib.h" +#include "cache.h" + +#include "log.h" #include "util.h" static bool shader_cache_entry_name( diff --git a/src/renderer/common/shaderlib/lang_spirv_stub.c b/src/renderer/common/shaderlib/lang_spirv_stub.c index 8dc2bd2c3f..7c7b98f48b 100644 --- a/src/renderer/common/shaderlib/lang_spirv_stub.c +++ b/src/renderer/common/shaderlib/lang_spirv_stub.c @@ -6,9 +6,10 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "shaderlib.h" #include "lang_spirv_private.h" -#include "util.h" +#include "shaderlib.h" + +#include "log.h" void spirv_init_compiler(void) { } void spirv_shutdown_compiler(void) { } diff --git a/src/renderer/common/shaderlib/shaderlib.h b/src/renderer/common/shaderlib/shaderlib.h index 668411c599..092e8b087b 100644 --- a/src/renderer/common/shaderlib/shaderlib.h +++ b/src/renderer/common/shaderlib/shaderlib.h @@ -9,8 +9,7 @@ #pragma once #include "taisei.h" -#include "defs.h" -#include "cache.h" +#include "defs.h" // IWYU prama: export #include "lang_glsl.h" #include "lang_spirv.h" diff --git a/src/renderer/common/sprite_batch.c b/src/renderer/common/sprite_batch.c index b284da24f7..05693842b8 100644 --- a/src/renderer/common/sprite_batch.c +++ b/src/renderer/common/sprite_batch.c @@ -7,10 +7,10 @@ */ #include "sprite_batch.h" + #include "../api.h" #include "util/glm.h" #include "resource/sprite.h" -#include "resource/model.h" #define SPRITE_BATCH_STATS 0 diff --git a/src/renderer/common/state.c b/src/renderer/common/state.c index abca853179..bcadfd3f1d 100644 --- a/src/renderer/common/state.c +++ b/src/renderer/common/state.c @@ -7,8 +7,8 @@ */ #include "state.h" + #include "backend.h" -#include "matstack.h" #define RSTATE_STACK_SIZE 16 diff --git a/src/renderer/gl33/common_buffer.c b/src/renderer/gl33/common_buffer.c index c3e172795c..a027612fb4 100644 --- a/src/renderer/gl33/common_buffer.c +++ b/src/renderer/gl33/common_buffer.c @@ -7,6 +7,7 @@ */ #include "common_buffer.h" + #include "gl33.h" #define STREAM_CBUF(rw) ((CommonBuffer*)rw) diff --git a/src/renderer/gl33/framebuffer.c b/src/renderer/gl33/framebuffer.c index da1ce77ac6..4d9c05ce8a 100644 --- a/src/renderer/gl33/framebuffer.c +++ b/src/renderer/gl33/framebuffer.c @@ -7,8 +7,10 @@ */ #include "framebuffer.h" -#include "gl33.h" + #include "../glcommon/debug.h" +#include "gl33.h" +#include "texture.h" GLuint r_attachment_to_gl_attachment[] = { [FRAMEBUFFER_ATTACH_DEPTH] = GL_DEPTH_ATTACHMENT, diff --git a/src/renderer/gl33/framebuffer.h b/src/renderer/gl33/framebuffer.h index 4ae9fa6b42..a0fa150d28 100644 --- a/src/renderer/gl33/framebuffer.h +++ b/src/renderer/gl33/framebuffer.h @@ -10,8 +10,9 @@ #include "taisei.h" #include "../api.h" +#include "../common/backend.h" +#include "../glcommon/texture.h" #include "opengl.h" -#include "texture.h" struct Framebuffer { Texture *attachments[FRAMEBUFFER_MAX_ATTACHMENTS]; diff --git a/src/renderer/gl33/framebuffer_async_read.c b/src/renderer/gl33/framebuffer_async_read.c index 78b2edcbab..0e25dc0be7 100644 --- a/src/renderer/gl33/framebuffer_async_read.c +++ b/src/renderer/gl33/framebuffer_async_read.c @@ -8,9 +8,11 @@ #include "framebuffer_async_read.h" #include "framebuffer.h" + #include "../glcommon/texture.h" #include "gl33.h" #include "opengl.h" +#include "util.h" typedef struct FramebufferReadRequest { FramebufferReadAsyncCallback callback; diff --git a/src/renderer/gl33/gl33.c b/src/renderer/gl33/gl33.c index 544ef1db3b..60c6c19d86 100644 --- a/src/renderer/gl33/gl33.c +++ b/src/renderer/gl33/gl33.c @@ -7,25 +7,24 @@ */ #include "gl33.h" + #include "../api.h" -#include "../common/matstack.h" #include "../common/backend.h" +#include "../common/matstack.h" #include "../common/sprite_batch.h" -#include "texture.h" -#include "shader_object.h" -#include "shader_program.h" -#include "framebuffer.h" -#include "framebuffer_async_read.h" -#include "common_buffer.h" -#include "vertex_buffer.h" -#include "index_buffer.h" -#include "vertex_array.h" #include "../glcommon/debug.h" #include "../glcommon/vtable.h" -#include "resource/resource.h" -#include "resource/model.h" -#include "util/glm.h" +#include "common_buffer.h" +#include "framebuffer_async_read.h" +#include "framebuffer.h" +#include "index_buffer.h" +#include "shader_object.h" +#include "shader_program.h" +#include "texture.h" #include "util/env.h" +#include "util/glm.h" +#include "vertex_array.h" +#include "vertex_buffer.h" // #define GL33_DEBUG_TEXUNITS // #define GL33_DRAW_STATS diff --git a/src/renderer/gl33/gl33.h b/src/renderer/gl33/gl33.h index 37b6966d1d..402002ab1a 100644 --- a/src/renderer/gl33/gl33.h +++ b/src/renderer/gl33/gl33.h @@ -10,10 +10,10 @@ #include "taisei.h" #include "../api.h" -#include "opengl.h" -#include "resource/texture.h" #include "../common/backend.h" #include "common_buffer.h" +#include "opengl.h" +#include "resource/texture.h" typedef struct TextureUnit TextureUnit; diff --git a/src/renderer/gl33/index_buffer.c b/src/renderer/gl33/index_buffer.c index 4adc6901d0..2508f58e0c 100644 --- a/src/renderer/gl33/index_buffer.c +++ b/src/renderer/gl33/index_buffer.c @@ -7,8 +7,9 @@ */ #include "index_buffer.h" -#include "gl33.h" + #include "../glcommon/debug.h" +#include "gl33.h" static void gl33_index_buffer_pre_bind(CommonBuffer *cbuf) { IndexBuffer *ibuf = (IndexBuffer*)cbuf; diff --git a/src/renderer/gl33/opengl.h b/src/renderer/gl33/opengl.h index d50b3ba9f6..f13b3e85ab 100644 --- a/src/renderer/gl33/opengl.h +++ b/src/renderer/gl33/opengl.h @@ -9,4 +9,4 @@ #pragma once #include "taisei.h" -#include "../glcommon/opengl.h" +#include "../glcommon/opengl.h" // IWYU pragma: export diff --git a/src/renderer/gl33/shader_object.c b/src/renderer/gl33/shader_object.c index 43cfbe0e12..d581b22e7b 100644 --- a/src/renderer/gl33/shader_object.c +++ b/src/renderer/gl33/shader_object.c @@ -6,9 +6,8 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "util.h" -#include "gl33.h" #include "shader_object.h" + #include "../glcommon/debug.h" #include "../glcommon/shaders.h" diff --git a/src/renderer/gl33/shader_object.h b/src/renderer/gl33/shader_object.h index d21014d1f3..a686629585 100644 --- a/src/renderer/gl33/shader_object.h +++ b/src/renderer/gl33/shader_object.h @@ -9,8 +9,10 @@ #pragma once #include "taisei.h" -#include "resource/shader_object.h" +#include "../api.h" +#include "../common/shaderlib/shaderlib.h" #include "opengl.h" +#include "resource/shader_object.h" struct ShaderObject { GLuint gl_handle; diff --git a/src/renderer/gl33/shader_program.c b/src/renderer/gl33/shader_program.c index d91af39803..af474afe8e 100644 --- a/src/renderer/gl33/shader_program.c +++ b/src/renderer/gl33/shader_program.c @@ -6,12 +6,14 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "gl33.h" #include "shader_program.h" -#include "shader_object.h" -#include "texture.h" -#include "../glcommon/debug.h" +#include "shader_object.h" // IWYU pragma: keep + #include "../api.h" +#include "../glcommon/debug.h" +#include "gl33.h" +#include "texture.h" +#include "util.h" static Uniform *sampler_uniforms; diff --git a/src/renderer/gl33/shader_program.h b/src/renderer/gl33/shader_program.h index c5e324e67e..780d8c6667 100644 --- a/src/renderer/gl33/shader_program.h +++ b/src/renderer/gl33/shader_program.h @@ -9,7 +9,6 @@ #pragma once #include "taisei.h" -#include "util.h" #include "hashtable.h" #include "../api.h" #include "opengl.h" diff --git a/src/renderer/gl33/texture.c b/src/renderer/gl33/texture.c index f3ffc4f567..d80ef5c88f 100644 --- a/src/renderer/gl33/texture.c +++ b/src/renderer/gl33/texture.c @@ -7,10 +7,12 @@ */ #include "texture.h" + #include "../api.h" -#include "opengl.h" -#include "gl33.h" #include "../glcommon/debug.h" +#include "gl33.h" +#include "opengl.h" +#include "util.h" static GLenum class_to_gltarget(TextureClass cls) { switch(cls) { diff --git a/src/renderer/gl33/texture.h b/src/renderer/gl33/texture.h index d3d1d23970..f18cfe670f 100644 --- a/src/renderer/gl33/texture.h +++ b/src/renderer/gl33/texture.h @@ -9,11 +9,10 @@ #pragma once #include "taisei.h" -#include "gl33.h" #include "../api.h" -#include "resource/resource.h" +#include "../glcommon/texture.h" +#include "gl33.h" #include "resource/texture.h" -#include "../glcommon/vtable.h" typedef struct Texture { GLTextureFormatInfo *fmt_info; diff --git a/src/renderer/gl33/vertex_array.c b/src/renderer/gl33/vertex_array.c index e969f21802..4e516eaea5 100644 --- a/src/renderer/gl33/vertex_array.c +++ b/src/renderer/gl33/vertex_array.c @@ -7,10 +7,11 @@ */ #include "vertex_array.h" -#include "vertex_buffer.h" -#include "index_buffer.h" -#include "gl33.h" + #include "../glcommon/debug.h" +#include "gl33.h" +#include "index_buffer.h" +#include "vertex_buffer.h" static GLenum va_type_to_gl_type[] = { [VA_FLOAT] = GL_FLOAT, diff --git a/src/renderer/gl33/vertex_buffer.c b/src/renderer/gl33/vertex_buffer.c index 068fe33807..f1917aa45c 100644 --- a/src/renderer/gl33/vertex_buffer.c +++ b/src/renderer/gl33/vertex_buffer.c @@ -7,8 +7,9 @@ */ #include "vertex_buffer.h" -#include "gl33.h" + #include "../glcommon/debug.h" +#include "gl33.h" VertexBuffer* gl33_vertex_buffer_create(size_t capacity, void *data) { VertexBuffer *vbuf = (VertexBuffer*)gl33_buffer_create(GL33_BUFFER_BINDING_ARRAY, sizeof(VertexBuffer)); diff --git a/src/renderer/glcommon/debug.c b/src/renderer/glcommon/debug.c index 0abd84c536..6fac78fa78 100644 --- a/src/renderer/glcommon/debug.c +++ b/src/renderer/glcommon/debug.c @@ -7,8 +7,9 @@ */ #include "debug.h" -#include "util.h" + #include "../api.h" +#include "util/env.h" #ifndef STATIC_GLES3 diff --git a/src/renderer/glcommon/opengl.c b/src/renderer/glcommon/opengl.c index cba9248df4..c62ebf95e0 100644 --- a/src/renderer/glcommon/opengl.c +++ b/src/renderer/glcommon/opengl.c @@ -6,12 +6,14 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "util.h" -#include "rwops/rwops_autobuf.h" #include "opengl.h" + #include "debug.h" +#include "rwops/rwops_autobuf.h" #include "shaders.h" #include "texture.h" +#include "util/env.h" +#include "util/io.h" struct glext_s glext = { 0 }; diff --git a/src/renderer/glcommon/opengl.h b/src/renderer/glcommon/opengl.h index 5075ecf8cb..859157bec9 100644 --- a/src/renderer/glcommon/opengl.h +++ b/src/renderer/glcommon/opengl.h @@ -99,8 +99,6 @@ typedef void (APIENTRY *PFNGLREQUESTEXTENSIONANGLEPROC) (const GLchar *name); typedef void (APIENTRY *PFNGLDISABLEEXTENSIONANGLEPROC) (const GLchar *name); #endif /* GL_ANGLE_request_extension */ -#include "assert.h" - // NOTE: The ability to query supported GLSL versions was added in GL 4.3, // but it's not exposed by any extension. This is pretty silly. #ifndef GL_NUM_SHADING_LANGUAGE_VERSIONS diff --git a/src/renderer/glcommon/shaders.c b/src/renderer/glcommon/shaders.c index 66f3753471..383eae7cb2 100644 --- a/src/renderer/glcommon/shaders.c +++ b/src/renderer/glcommon/shaders.c @@ -7,9 +7,12 @@ */ #include "shaders.h" -#include "util.h" + +#include "log.h" #include "opengl.h" #include "rwops/rwops_autobuf.h" +#include "util/io.h" +#include "util/stringops.h" ShaderLangInfoArray glcommon_shader_lang_table = { 0 }; diff --git a/src/renderer/glcommon/texture.c b/src/renderer/glcommon/texture.c index 5b248e62d7..1af9aaa1c9 100644 --- a/src/renderer/glcommon/texture.c +++ b/src/renderer/glcommon/texture.c @@ -7,7 +7,7 @@ */ #include "texture.h" -#include "vtable.h" + #include "../api.h" #include "util.h" diff --git a/src/renderer/gles20/gles20.c b/src/renderer/gles20/gles20.c index 61a8647062..e1e2c28a51 100644 --- a/src/renderer/gles20/gles20.c +++ b/src/renderer/gles20/gles20.c @@ -7,9 +7,11 @@ */ #include "gles20.h" -#include "../glescommon/gles.h" + #include "../gl33/gl33.h" -#include "../gl33/vertex_array.h" +#include "../gl33/vertex_array.h" // IWYU pragma: keep +#include "../glcommon/vtable.h" +#include "../glescommon/gles.h" #include "index_buffer.h" static void gles20_init(void) { @@ -58,7 +60,6 @@ RendererBackend _r_backend_gles20 = { .funcs = { .init = gles20_init, .texture_dump = gles_texture_dump, - .screenshot = gles_screenshot, .index_buffer_create = gles20_index_buffer_create, .index_buffer_get_capacity = gles20_index_buffer_get_capacity, .index_buffer_get_index_size = gles20_index_buffer_get_index_size, diff --git a/src/renderer/gles30/fbcopy_fallback.c b/src/renderer/gles30/fbcopy_fallback.c index b5f0ec28a6..70ca7309fa 100644 --- a/src/renderer/gles30/fbcopy_fallback.c +++ b/src/renderer/gles30/fbcopy_fallback.c @@ -7,10 +7,8 @@ */ #include "fbcopy_fallback.h" -#include "gles30.h" -#include "../glescommon/gles.h" -#include "../gl33/gl33.h" -#include "resource/model.h" + +#include "util.h" static ShaderProgram *blit_shader; static struct { diff --git a/src/renderer/gles30/gles30.c b/src/renderer/gles30/gles30.c index 14caa45695..07e24e6286 100644 --- a/src/renderer/gles30/gles30.c +++ b/src/renderer/gles30/gles30.c @@ -7,9 +7,9 @@ */ #include "gles30.h" + +#include "../glcommon/vtable.h" #include "../glescommon/gles.h" -#include "../gl33/gl33.h" -#include "fbcopy_fallback.h" // NOTE: Actually WebGL #ifdef STATIC_GLES3 @@ -28,6 +28,9 @@ static void gles30_init(void) { } #if BROKEN_GL_BLIT_FRAMEBUFFER +#include "../gl33/gl33.h" +#include "fbcopy_fallback.h" + static void gles30_init_context(SDL_Window *w) { gles_init_context(w); gles30_fbcopyfallback_init(); diff --git a/src/renderer/glescommon/angle_egl.c b/src/renderer/glescommon/angle_egl.c index 35b5d60815..7edd9179bf 100644 --- a/src/renderer/glescommon/angle_egl.c +++ b/src/renderer/glescommon/angle_egl.c @@ -7,9 +7,12 @@ */ #include "angle_egl.h" + #include "../glcommon/debug.h" #include "glad/egl.h" +#include "log.h" #include "util.h" +#include "util/env.h" /* * All this garbage here serves one purpose: create a WebGL-compatible ANGLE context. diff --git a/src/renderer/glescommon/angle_egl.h b/src/renderer/glescommon/angle_egl.h index 2a35079f40..0686e7e015 100644 --- a/src/renderer/glescommon/angle_egl.h +++ b/src/renderer/glescommon/angle_egl.h @@ -9,4 +9,6 @@ #pragma once #include "taisei.h" +#include + SDL_GLContext gles_create_context_angle(SDL_Window *window, int major, int minor, bool webgl); diff --git a/src/renderer/glescommon/angle_egl_stub.c b/src/renderer/glescommon/angle_egl_stub.c index 6f7733d619..6f606dcc01 100644 --- a/src/renderer/glescommon/angle_egl_stub.c +++ b/src/renderer/glescommon/angle_egl_stub.c @@ -7,7 +7,8 @@ */ #include "angle_egl.h" -#include "util.h" + +#include "log.h" SDL_GLContext gles_create_context_angle(SDL_Window *window, int major, int minor, bool webgl) { log_fatal("Built without custom ANGLE EGL code path"); diff --git a/src/renderer/glescommon/gles.c b/src/renderer/glescommon/gles.c index 0cbedf2bb3..f9a39b2fcc 100644 --- a/src/renderer/glescommon/gles.c +++ b/src/renderer/glescommon/gles.c @@ -7,9 +7,12 @@ */ #include "gles.h" + #include "../common/backend.h" #include "../gl33/gl33.h" +#include "../glcommon/vtable.h" #include "angle_egl.h" +#include "util/env.h" #ifdef _WIN32 // Enable WebGL compatibility mode on Windows, because cubemaps are broken in the D3D11 backend diff --git a/src/renderer/glescommon/gles.h b/src/renderer/glescommon/gles.h index 1d46921be3..699de5f1c0 100644 --- a/src/renderer/glescommon/gles.h +++ b/src/renderer/glescommon/gles.h @@ -9,7 +9,7 @@ #pragma once #include "taisei.h" -#include "../glcommon/vtable.h" +#include "../common/backend.h" void gles_init(RendererBackend *gles_backend, int major, int minor); void gles_init_context(SDL_Window *w); diff --git a/src/renderer/null/null.c b/src/renderer/null/null.c index bf91aa1f3d..032c810d9c 100644 --- a/src/renderer/null/null.c +++ b/src/renderer/null/null.c @@ -7,7 +7,6 @@ */ #include "../api.h" -#include "resource/shader_object.h" #include "../common/backend.h" static char placeholder; diff --git a/src/replay/demoplayer.c b/src/replay/demoplayer.c index 39388e5353..376bac5aba 100644 --- a/src/replay/demoplayer.c +++ b/src/replay/demoplayer.c @@ -7,11 +7,15 @@ */ #include "demoplayer.h" + +#include "events.h" +#include "global.h" +#include "menu/menu.h" #include "replay.h" #include "replay/struct.h" -#include "global.h" +#include "transition.h" +#include "util/env.h" #include "vfs/public.h" -#include "events.h" #define DEMOPLAYER_DIR_PATH "res/demos" #define DEMOPLAYER_WAIT_TIME (60 * FPS) diff --git a/src/replay/replay.c b/src/replay/replay.c index 5b89dfda45..7606966e87 100644 --- a/src/replay/replay.c +++ b/src/replay/replay.c @@ -9,7 +9,6 @@ #include "replay.h" #include "struct.h" #include "stage.h" -#include "state.h" void replay_destroy_events(Replay *rpy) { dynarray_foreach_elem(&rpy->stages, ReplayStage *stg, { diff --git a/src/replay/rw_common.c b/src/replay/rw_common.c index d75eb81843..27eeb5d52d 100644 --- a/src/replay/rw_common.c +++ b/src/replay/rw_common.c @@ -7,6 +7,8 @@ */ #include "rw_common.h" + +#include "log.h" #include "rwops/rwops_zlib.h" #include "rwops/rwops_zstd.h" diff --git a/src/replay/stage.h b/src/replay/stage.h index a033d701c8..cdff757d41 100644 --- a/src/replay/stage.h +++ b/src/replay/stage.h @@ -10,7 +10,6 @@ #include "taisei.h" #include "replay.h" -#include "player.h" #include "stageinfo.h" #include "difficulty.h" diff --git a/src/replay/state.c b/src/replay/state.c index c8cdd173f1..8ef4945597 100644 --- a/src/replay/state.c +++ b/src/replay/state.c @@ -7,11 +7,10 @@ */ #include "state.h" +#include "log.h" #include "struct.h" #include "eventcodes.h" -#include "util.h" - void replay_state_init_play(ReplayState *rst, Replay *rpy, ReplayStage *rstage) { memset(rst, 0, sizeof(*rst)); rst->replay = rpy; diff --git a/src/replay/tsrtool.c b/src/replay/tsrtool.c index f0abd23f20..9c20c974e1 100644 --- a/src/replay/tsrtool.c +++ b/src/replay/tsrtool.c @@ -7,13 +7,14 @@ */ #include "tsrtool.h" + #include "replay.h" -#include "struct.h" #include "stage.h" +#include "struct.h" +#include "plrmodes.h" #include "util.h" #include "util/strbuf.h" -#include "plrmodes.h" typedef struct Command { const char *name; diff --git a/src/replay/write.c b/src/replay/write.c index effc08b619..5549cd1948 100644 --- a/src/replay/write.c +++ b/src/replay/write.c @@ -6,6 +6,7 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ +#include "log.h" #include "replay.h" #include "rw_common.h" diff --git a/src/resource/animation.c b/src/resource/animation.c index 009b135417..663b3bdabd 100644 --- a/src/resource/animation.c +++ b/src/resource/animation.c @@ -7,10 +7,10 @@ */ #include "animation.h" -#include "texture.h" -#include "resource.h" -#include "list.h" + #include "renderer/api.h" +#include "resource.h" +#include "util/kvparser.h" static char *animation_path(const char *name) { return strjoin(ANI_PATH_PREFIX, name, ANI_EXTENSION, NULL); diff --git a/src/resource/bgm.c b/src/resource/bgm.c index a5dfae6013..e2a7eba61a 100644 --- a/src/resource/bgm.c +++ b/src/resource/bgm.c @@ -6,11 +6,11 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "resource.h" #include "bgm.h" + +#include "resource.h" #include "audio/backend.h" #include "sfxbgm_common.h" -#include "util.h" static char *bgm_path(const char *name) { return sfxbgm_make_path(BGM_PATH_PREFIX, name, true); diff --git a/src/resource/font.c b/src/resource/font.c index 92805695e6..95217be4d4 100644 --- a/src/resource/font.c +++ b/src/resource/font.c @@ -6,21 +6,22 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include -#include FT_FREETYPE_H -#include FT_STROKER_H -#include FT_MODULE_H - #include "font.h" + #include "config.h" +#include "dynarray.h" #include "events.h" #include "renderer/api.h" #include "util.h" #include "util/glm.h" -#include "util/graphics.h" +#include "util/kvparser.h" #include "util/rectpack.h" #include "video.h" -#include "dynarray.h" + +#include +#include FT_FREETYPE_H +#include FT_STROKER_H +#include FT_MODULE_H static void init_fonts(void); static void post_init_fonts(void); diff --git a/src/resource/font.h b/src/resource/font.h index 2b08b8c03d..d358b36172 100644 --- a/src/resource/font.h +++ b/src/resource/font.h @@ -9,10 +9,9 @@ #pragma once #include "taisei.h" -#include "sprite.h" -#include "hashtable.h" -#include "resource.h" #include "renderer/api.h" +#include "resource.h" +#include "sprite.h" typedef enum { ALIGN_LEFT = 0, // must be 0 diff --git a/src/resource/material.c b/src/resource/material.c index b91d9b5dc0..cf7f97d41d 100644 --- a/src/resource/material.c +++ b/src/resource/material.c @@ -8,6 +8,10 @@ #include "material.h" +#include "util.h" +#include "util/io.h" +#include "util/kvparser.h" + static char *material_path(const char *basename); static bool material_check_path(const char *path); static void material_load_stage1(ResourceLoadState *st); diff --git a/src/resource/model.c b/src/resource/model.c index a1c6a75bad..4757abf07a 100644 --- a/src/resource/model.c +++ b/src/resource/model.c @@ -7,10 +7,11 @@ */ #include "model.h" -#include "list.h" -#include "resource.h" -#include "renderer/api.h" + #include "iqm.h" +#include "renderer/api.h" +#include "resource.h" +#include "util.h" #define MDL_PATH_PREFIX "res/models/" #define MDL_EXTENSION ".iqm" diff --git a/src/resource/model.h b/src/resource/model.h index 4bdcd4ad65..e1be19e5dc 100644 --- a/src/resource/model.h +++ b/src/resource/model.h @@ -12,14 +12,6 @@ #include "resource.h" #include "renderer/api.h" -struct Model { - VertexArray *vertex_array; - size_t num_vertices; - size_t num_indices; - size_t offset; - Primitive primitive; -}; - DEFINE_RESOURCE_GETTER(Model, res_model, RES_MODEL) DEFINE_OPTIONAL_RESOURCE_GETTER(Model, res_model_optional, RES_MODEL) diff --git a/src/resource/postprocess.c b/src/resource/postprocess.c index 4d07b286a9..37a54f47aa 100644 --- a/src/resource/postprocess.c +++ b/src/resource/postprocess.c @@ -6,12 +6,13 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include - -#include "util.h" #include "postprocess.h" + #include "resource.h" #include "renderer/api.h" +#include "util/kvparser.h" + +#include #define PP_PATH_PREFIX SHPROG_PATH_PREFIX #define PP_EXTENSION ".pp" diff --git a/src/resource/postprocess.h b/src/resource/postprocess.h index 1e0161aaa0..23353354f2 100644 --- a/src/resource/postprocess.h +++ b/src/resource/postprocess.h @@ -12,7 +12,7 @@ #include "resource.h" #include "shader_program.h" #include "renderer/api.h" -#include "util/graphics.h" +#include "util/fbpair.h" typedef struct PostprocessShader PostprocessShader; typedef struct PostprocessShaderUniform PostprocessShaderUniform; diff --git a/src/resource/resource.c b/src/resource/resource.c index 620b7ab803..ac7a6a21b2 100644 --- a/src/resource/resource.c +++ b/src/resource/resource.c @@ -8,15 +8,6 @@ #include "resource.h" -#include "config.h" -#include "events.h" -#include "filewatch/filewatch.h" -#include "menu/mainmenu.h" -#include "renderer/common/backend.h" -#include "taskmanager.h" -#include "video.h" -#include "eventloop/eventloop.h" - #include "animation.h" #include "bgm.h" #include "font.h" @@ -29,6 +20,13 @@ #include "sprite.h" #include "texture.h" +#include "eventloop/eventloop.h" +#include "events.h" +#include "filewatch/filewatch.h" +#include "taskmanager.h" +#include "util.h" +#include "util/env.h" + #define DEBUG_LOAD 0 #define DEBUG_LOCKS 0 diff --git a/src/resource/resource.h b/src/resource/resource.h index e38554b661..c88188e148 100644 --- a/src/resource/resource.h +++ b/src/resource/resource.h @@ -9,8 +9,8 @@ #pragma once #include "taisei.h" -#include "hashtable.h" #include "dynarray.h" +#include "hashtable.h" #include "vfs/public.h" typedef enum ResourceType { diff --git a/src/resource/sfx.c b/src/resource/sfx.c index 1a4301cb79..530ee0b42e 100644 --- a/src/resource/sfx.c +++ b/src/resource/sfx.c @@ -7,10 +7,10 @@ */ #include "resource.h" + +#include "audio/audio.h" #include "sfx.h" -#include "audio/backend.h" #include "sfxbgm_common.h" -#include "util.h" static char *sound_path(const char *name) { return sfxbgm_make_path(SFX_PATH_PREFIX, name, false); diff --git a/src/resource/sfxbgm_common.c b/src/resource/sfxbgm_common.c index 16f03509d0..1c89e40b9f 100644 --- a/src/resource/sfxbgm_common.c +++ b/src/resource/sfxbgm_common.c @@ -8,7 +8,7 @@ #include "sfxbgm_common.h" #include "audio/backend.h" -#include "util.h" +#include "util/io.h" static const char *const *get_exts(bool isbgm, uint *numexts) { const char *const *exts = (isbgm diff --git a/src/resource/shader_object.c b/src/resource/shader_object.c index 534ff8447b..b82dd58520 100644 --- a/src/resource/shader_object.c +++ b/src/resource/shader_object.c @@ -6,9 +6,10 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "util.h" #include "shader_object.h" + #include "renderer/api.h" +#include "util/io.h" struct shobj_type { const char *ext; diff --git a/src/resource/shader_program.c b/src/resource/shader_program.c index 8ae7580d82..dc9acc7b68 100644 --- a/src/resource/shader_program.c +++ b/src/resource/shader_program.c @@ -6,9 +6,10 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "util.h" #include "shader_program.h" + #include "renderer/api.h" +#include "util/kvparser.h" static char *shader_program_path(const char *name) { return strjoin(SHPROG_PATH_PREFIX, name, SHPROG_EXT, NULL); diff --git a/src/resource/sprite.c b/src/resource/sprite.c index ff3abdfe49..8c210178f2 100644 --- a/src/resource/sprite.c +++ b/src/resource/sprite.c @@ -7,8 +7,9 @@ */ #include "sprite.h" -#include "video.h" + #include "renderer/api.h" +#include "util/kvparser.h" static char *sprite_path(const char *name) { char *path = strjoin(SPRITE_PATH_PREFIX, name, SPRITE_EXTENSION, NULL); diff --git a/src/resource/texture.c b/src/resource/texture.c index d94f332c0d..99bc246acd 100644 --- a/src/resource/texture.c +++ b/src/resource/texture.c @@ -9,8 +9,8 @@ #include "texture_loader/texture_loader.h" #include "global.h" -#include "video.h" #include "renderer/api.h" +#include "video.h" static bool texture_transfer(void *dst, void *src) { return r_texture_transfer(dst, src); diff --git a/src/resource/texture.h b/src/resource/texture.h index 0cc0a0a69c..7a9ef7e180 100644 --- a/src/resource/texture.h +++ b/src/resource/texture.h @@ -9,8 +9,8 @@ #pragma once #include "taisei.h" -#include "util.h" #include "resource.h" +#include "util/geometry.h" typedef struct Texture Texture; diff --git a/src/resource/texture_loader/basisu.c b/src/resource/texture_loader/basisu.c index 4c4a11824e..8d26f48066 100644 --- a/src/resource/texture_loader/basisu.c +++ b/src/resource/texture_loader/basisu.c @@ -8,8 +8,11 @@ #include "basisu.h" #include "basisu_cache.h" -#include "util/io.h" + #include "rwops/rwops_sha256.h" +#include "util.h" +#include "util/env.h" +#include "util/io.h" #include diff --git a/src/resource/texture_loader/basisu_cache.c b/src/resource/texture_loader/basisu_cache.c index c7a2de7a12..1958d8d0e7 100644 --- a/src/resource/texture_loader/basisu_cache.c +++ b/src/resource/texture_loader/basisu_cache.c @@ -7,6 +7,9 @@ */ #include "basisu_cache.h" +#include "basisu.h" + +#include "log.h" #include "pixmap/pixmap.h" #include "rwops/rwops_zstd.h" diff --git a/src/resource/texture_loader/basisu_cache.h b/src/resource/texture_loader/basisu_cache.h index a6625a3f7c..6d21c85e66 100644 --- a/src/resource/texture_loader/basisu_cache.h +++ b/src/resource/texture_loader/basisu_cache.h @@ -9,7 +9,7 @@ #pragma once #include "taisei.h" -#include "basisu.h" +#include "pixmap/pixmap.h" #include diff --git a/src/resource/texture_loader/texture_loader.c b/src/resource/texture_loader/texture_loader.c index dfd778acba..ebf443d51b 100644 --- a/src/resource/texture_loader/texture_loader.c +++ b/src/resource/texture_loader/texture_loader.c @@ -9,6 +9,10 @@ #include "texture_loader.h" #include "basisu.h" +#include "util.h" +#include "util/io.h" +#include "util/kvparser.h" + void texture_loader_cleanup_stage1(TextureLoadData *ld) { mem_free(ld->src_paths.main); ld->src_paths.main = NULL; diff --git a/src/resource/texture_loader/texture_loader.h b/src/resource/texture_loader/texture_loader.h index bd2a4124d4..22947c0e47 100644 --- a/src/resource/texture_loader/texture_loader.h +++ b/src/resource/texture_loader/texture_loader.h @@ -11,7 +11,6 @@ #include "renderer/api.h" #include "resource/resource.h" -#include "resource/texture.h" typedef struct TextureLoadCubemap { Pixmap faces[6]; diff --git a/src/ringbuf.h b/src/ringbuf.h index e447237f62..70e84c8d76 100644 --- a/src/ringbuf.h +++ b/src/ringbuf.h @@ -10,7 +10,6 @@ #include "taisei.h" #include "util/compat.h" -#include "util/macrohax.h" typedef int32_t ringbuf_size_t; diff --git a/src/rwops/rwops_autobuf.c b/src/rwops/rwops_autobuf.c index 559a02706f..d187d102fb 100644 --- a/src/rwops/rwops_autobuf.c +++ b/src/rwops/rwops_autobuf.c @@ -7,7 +7,6 @@ */ #include "rwops_autobuf.h" -#include "rwops_segment.h" #define BUFFER(rw) ((Buffer*)((rw)->hidden.unknown.data1)) diff --git a/src/rwops/rwops_crc32.c b/src/rwops/rwops_crc32.c index 1ea70ac6ea..13a34cbb32 100644 --- a/src/rwops/rwops_crc32.c +++ b/src/rwops/rwops_crc32.c @@ -7,7 +7,6 @@ */ #include "rwops_crc32.h" -#include "util.h" #include diff --git a/src/rwops/rwops_dummy.c b/src/rwops/rwops_dummy.c index fb6ba2f750..d6aab5e122 100644 --- a/src/rwops/rwops_dummy.c +++ b/src/rwops/rwops_dummy.c @@ -7,7 +7,6 @@ */ #include "rwops_dummy.h" -#include "util.h" #define DUMMY_SOURCE(rw) ((SDL_RWops*)((rw)->hidden.unknown.data1)) #define DUMMY_AUTOCLOSE(rw) ((bool)((rw)->hidden.unknown.data2)) diff --git a/src/rwops/rwops_segment.c b/src/rwops/rwops_segment.c index 3224c176da..1bbc627427 100644 --- a/src/rwops/rwops_segment.c +++ b/src/rwops/rwops_segment.c @@ -7,7 +7,7 @@ */ #include "rwops_segment.h" -#include "util.h" +#include "log.h" typedef struct Segment { SDL_RWops *wrapped; diff --git a/src/rwops/rwops_sha256.c b/src/rwops/rwops_sha256.c index 80054a661c..d700e2e607 100644 --- a/src/rwops/rwops_sha256.c +++ b/src/rwops/rwops_sha256.c @@ -7,7 +7,6 @@ */ #include "rwops_sha256.h" -#include "util.h" struct sha256_data { SDL_RWops *src; diff --git a/src/rwops/rwops_trace.c b/src/rwops/rwops_trace.c index e0b326d746..4840582868 100644 --- a/src/rwops/rwops_trace.c +++ b/src/rwops/rwops_trace.c @@ -7,7 +7,7 @@ */ #include "rwops_trace.h" -#include "util.h" +#include "log.h" #define TRACE_SOURCE(rw) ((SDL_RWops*)((rw)->hidden.unknown.data1)) #define TRACE_TDATA(rw) ((TData*)((rw)->hidden.unknown.data2)) diff --git a/src/rwops/rwops_util.c b/src/rwops/rwops_util.c index 51342c2b24..87439a4384 100644 --- a/src/rwops/rwops_util.c +++ b/src/rwops/rwops_util.c @@ -7,7 +7,7 @@ */ #include "rwops_util.h" -#include "util.h" +#include "util/miscmath.h" int64_t rwutil_compute_seek_pos(int64_t offset, int whence, int64_t pos, int64_t size) { int64_t new_pos; diff --git a/src/rwops/rwops_zlib.c b/src/rwops/rwops_zlib.c index a209a9c4d8..3c3ed7284b 100644 --- a/src/rwops/rwops_zlib.c +++ b/src/rwops/rwops_zlib.c @@ -6,12 +6,14 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include -#include - #include "rwops_zlib.h" + +#include "log.h" #include "rwops_util.h" -#include "util.h" +#include "util/miscmath.h" + +#include +#include #define MIN_CHUNK_SIZE 1024 diff --git a/src/rwops/rwops_zstd.c b/src/rwops/rwops_zstd.c index f15d4b77c9..1bce9a75f1 100644 --- a/src/rwops/rwops_zstd.c +++ b/src/rwops/rwops_zstd.c @@ -8,7 +8,9 @@ #include "rwops_zstd.h" #include "rwops_util.h" -#include "util.h" + +#include "log.h" +#include "util/miscmath.h" #include diff --git a/src/stage.c b/src/stage.c index 6946fd784d..f826c61ac1 100644 --- a/src/stage.c +++ b/src/stage.c @@ -6,28 +6,30 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "util.h" #include "stage.h" + +#include "audio/audio.h" +#include "common_tasks.h" // IWYU pragma: keep +#include "config.h" +#include "dynstage.h" +#include "eventloop/eventloop.h" +#include "events.h" #include "global.h" -#include "video.h" -#include "resource/bgm.h" +#include "lasers/draw.h" +#include "log.h" +#include "menu/gameovermenu.h" +#include "menu/ingamemenu.h" +#include "player.h" #include "replay/demoplayer.h" #include "replay/stage.h" #include "replay/state.h" #include "replay/struct.h" -#include "config.h" -#include "player.h" -#include "menu/ingamemenu.h" -#include "menu/gameovermenu.h" -#include "audio/audio.h" -#include "log.h" -#include "stagetext.h" +#include "resource/bgm.h" #include "stagedraw.h" -#include "stageobjects.h" -#include "eventloop/eventloop.h" -#include "common_tasks.h" #include "stageinfo.h" -#include "dynstage.h" +#include "stageobjects.h" +#include "stagetext.h" +#include "util/env.h" #include "watchdog.h" typedef struct StageFrameState { diff --git a/src/stage.h b/src/stage.h index 576da34ea1..57c08bf970 100644 --- a/src/stage.h +++ b/src/stage.h @@ -9,13 +9,7 @@ #pragma once #include "taisei.h" -#include "projectile.h" -#include "boss.h" -#include "difficulty.h" -#include "util/graphics.h" #include "dialog.h" -#include "coroutine.h" -#include "dynarray.h" #include "stageinfo.h" #include "resource/resource.h" diff --git a/src/stagedraw.c b/src/stagedraw.c index 0ed4ab0c06..48d14c532b 100644 --- a/src/stagedraw.c +++ b/src/stagedraw.c @@ -6,14 +6,19 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "global.h" #include "stagedraw.h" -#include "stagetext.h" -#include "video.h" -#include "resource/postprocess.h" + #include "entity.h" -#include "util/fbmgr.h" +#include "events.h" +#include "global.h" #include "replay/struct.h" +#include "resource/postprocess.h" +#include "stageobjects.h" +#include "stagetext.h" +#include "util/env.h" +#include "util/fbmgr.h" +#include "util/graphics.h" +#include "video.h" #ifdef DEBUG #define GRAPHS_DEFAULT 1 diff --git a/src/stagedraw.h b/src/stagedraw.h index 09f0bea7d0..e3c55c2f92 100644 --- a/src/stagedraw.h +++ b/src/stagedraw.h @@ -9,9 +9,10 @@ #pragma once #include "taisei.h" -#include "stage.h" #include "resource/resource.h" -#include "util/graphics.h" +#include "stage.h" +#include "util/fbpair.h" +#include "util/fbutil.h" typedef enum StageFBPair { FBPAIR_BG, diff --git a/src/stageinfo.h b/src/stageinfo.h index 26c19e2bcc..d6b23ec168 100644 --- a/src/stageinfo.h +++ b/src/stageinfo.h @@ -9,10 +9,10 @@ #pragma once #include "taisei.h" -#include "renderer/api.h" -#include "difficulty.h" #include "boss.h" +#include "difficulty.h" #include "progress.h" +#include "renderer/api.h" typedef void (*StageProc)(void); typedef void (*StagePreloadProc)(ResourceGroup *rg); diff --git a/src/stageobjects.c b/src/stageobjects.c index e5dad73e79..a4e503a5a3 100644 --- a/src/stageobjects.c +++ b/src/stageobjects.c @@ -7,13 +7,6 @@ */ #include "stageobjects.h" -#include "projectile.h" -#include "item.h" -#include "enemy.h" -#include "laser.h" -#include "stagetext.h" -#include "boss.h" -#include "aniplayer.h" #define INIT_ARENA_SIZE (8 << 20) diff --git a/src/stageobjects.h b/src/stageobjects.h index 6b5dfe6c9d..b6a56b4286 100644 --- a/src/stageobjects.h +++ b/src/stageobjects.h @@ -10,6 +10,13 @@ #include "taisei.h" #include "objectpool.h" +#include "aniplayer.h" // IWYU pragma: export +#include "projectile.h" // IWYU pragma: export +#include "item.h" // IWYU pragma: export +#include "enemy.h" // IWYU pragma: export +#include "lasers/laser.h" // IWYU pragma: export +#include "stagetext.h" // IWYU pragma: export +#include "boss.h" // IWYU pragma: export #define OBJECT_POOLS \ OBJECT_POOL(Projectile, projectiles) \ diff --git a/src/stages/common_imports.h b/src/stages/common_imports.h new file mode 100644 index 0000000000..08d2133150 --- /dev/null +++ b/src/stages/common_imports.h @@ -0,0 +1,18 @@ +/* + * This software is licensed under the terms of the MIT License. + * See COPYING for further information. + * --- + * Copyright (c) 2011-2024, Lukas Weber . + * Copyright (c) 2012-2024, Andrei Alexeyev . + */ + +#pragma once +#include "taisei.h" + +#include "audio/audio.h" // IWYU pragma: export +#include "common_tasks.h" // IWYU pragma: export +#include "enemy_classes.h" // IWYU pragma: export +#include "log.h" // IWYU pragma: export +#include "stage.h" // IWYU pragma: export +#include "stageobjects.h" // IWYU pragma: export +#include "util.h" // IWYU pragma: export diff --git a/src/stages/dpstest.c b/src/stages/dpstest.c index 55c6fefa79..b0a4991d94 100644 --- a/src/stages/dpstest.c +++ b/src/stages/dpstest.c @@ -7,9 +7,10 @@ */ #include "dpstest.h" -#include "global.h" -#include "enemy.h" + #include "enemy_classes.h" +#include "enemy.h" +#include "global.h" TASK(single_fairy) { for(;;) { diff --git a/src/stages/stage1/background_anim.c b/src/stages/stage1/background_anim.c index 5d3780f814..e518ae062a 100644 --- a/src/stages/stage1/background_anim.c +++ b/src/stages/stage1/background_anim.c @@ -9,6 +9,7 @@ #include "background_anim.h" #include "draw.h" +#include "global.h" #include "stageutils.h" void stage1_bg_raise_camera(void) { diff --git a/src/stages/stage1/cirno.h b/src/stages/stage1/cirno.h index 660f5c7118..bf1357c99b 100644 --- a/src/stages/stage1/cirno.h +++ b/src/stages/stage1/cirno.h @@ -9,7 +9,7 @@ #pragma once #include "taisei.h" -#include "boss.h" +#include "entity.h" Boss *stage1_spawn_cirno(cmplx pos); void stage1_draw_cirno_spellbg(Boss *boss, int time); diff --git a/src/stages/stage1/draw.c b/src/stages/stage1/draw.c index d4b6c1f52f..b3468956f7 100644 --- a/src/stages/stage1/draw.c +++ b/src/stages/stage1/draw.c @@ -8,10 +8,11 @@ #include "draw.h" +#include "global.h" #include "stagedraw.h" #include "stageutils.h" -#include "global.h" #include "util/glm.h" +#include "util/graphics.h" static Stage1DrawData *stage1_draw_data; diff --git a/src/stages/stage1/draw.h b/src/stages/stage1/draw.h index d66c1a2882..7d9e8c5193 100644 --- a/src/stages/stage1/draw.h +++ b/src/stages/stage1/draw.h @@ -9,8 +9,8 @@ #pragma once #include "taisei.h" +#include "stageinfo.h" #include "util/fbpair.h" -#include "stagedraw.h" typedef struct Stage1DrawData { FBPair water_fbpair; diff --git a/src/stages/stage1/misc.c b/src/stages/stage1/misc.c index 5ac03dd3e9..7a4f4207cc 100644 --- a/src/stages/stage1/misc.c +++ b/src/stages/stage1/misc.c @@ -8,6 +8,8 @@ #include "misc.h" +#include "stages/common_imports.h" + Projectile *stage1_spawn_stain(cmplx pos, float angle, int to) { return PARTICLE( .sprite = "stain", diff --git a/src/stages/stage1/misc.h b/src/stages/stage1/misc.h index dc7f9c4aea..d83e2f0e80 100644 --- a/src/stages/stage1/misc.h +++ b/src/stages/stage1/misc.h @@ -9,6 +9,6 @@ #pragma once #include "taisei.h" -#include "stage.h" +#include "entity.h" Projectile *stage1_spawn_stain(cmplx pos, float angle, int to); diff --git a/src/stages/stage1/nonspells/boss_nonspell_1.c b/src/stages/stage1/nonspells/boss_nonspell_1.c index ddc0acc0a7..66c68017c5 100644 --- a/src/stages/stage1/nonspells/boss_nonspell_1.c +++ b/src/stages/stage1/nonspells/boss_nonspell_1.c @@ -7,10 +7,6 @@ */ #include "nonspells.h" -#include "../cirno.h" -#include "../misc.h" - -#include "global.h" DEFINE_EXTERN_TASK(stage1_boss_nonspell_1) { Boss *boss = INIT_BOSS_ATTACK(&ARGS); diff --git a/src/stages/stage1/nonspells/boss_nonspell_2.c b/src/stages/stage1/nonspells/boss_nonspell_2.c index fca3469e55..690c1fad4e 100644 --- a/src/stages/stage1/nonspells/boss_nonspell_2.c +++ b/src/stages/stage1/nonspells/boss_nonspell_2.c @@ -7,11 +7,6 @@ */ #include "nonspells.h" -#include "../cirno.h" -#include "../misc.h" - -#include "common_tasks.h" -#include "global.h" TASK(snowburst, { BoxedBoss boss; }) { Boss *boss = TASK_BIND(ARGS.boss); diff --git a/src/stages/stage1/nonspells/midboss_nonspell_1.c b/src/stages/stage1/nonspells/midboss_nonspell_1.c index f0a241bac8..cd14c53ee4 100644 --- a/src/stages/stage1/nonspells/midboss_nonspell_1.c +++ b/src/stages/stage1/nonspells/midboss_nonspell_1.c @@ -7,11 +7,6 @@ */ #include "nonspells.h" -#include "../cirno.h" -#include "../misc.h" - -#include "common_tasks.h" -#include "global.h" #define SNOWFLAKE_ARMS 6 diff --git a/src/stages/stage1/nonspells/nonspells.h b/src/stages/stage1/nonspells/nonspells.h index 2dcec0c135..03658cb319 100644 --- a/src/stages/stage1/nonspells/nonspells.h +++ b/src/stages/stage1/nonspells/nonspells.h @@ -9,8 +9,8 @@ #pragma once #include "taisei.h" -#include "boss.h" -#include "stage.h" +#include "stages/common_imports.h" // IWYU pragma: export +#include "../cirno.h" // IWYU pragma: export DECLARE_EXTERN_TASK_WITH_INTERFACE(stage1_midboss_nonspell_1, BossAttack); DECLARE_EXTERN_TASK_WITH_INTERFACE(stage1_boss_nonspell_1, BossAttack); diff --git a/src/stages/stage1/spells/benchmark.c b/src/stages/stage1/spells/benchmark.c index be0ab530b5..b8205c7dcb 100644 --- a/src/stages/stage1/spells/benchmark.c +++ b/src/stages/stage1/spells/benchmark.c @@ -7,12 +7,9 @@ */ #include "spells.h" -#include "../cirno.h" #ifdef SPELL_BENCHMARK -#include "global.h" - static void stage1_spell_benchmark_proc(Boss *b, int t) { int N = 5000; // number of particles on the screen diff --git a/src/stages/stage1/spells/crystal_blizzard.c b/src/stages/stage1/spells/crystal_blizzard.c index 2f0ffcd95e..3ef1a9bb47 100644 --- a/src/stages/stage1/spells/crystal_blizzard.c +++ b/src/stages/stage1/spells/crystal_blizzard.c @@ -7,11 +7,6 @@ */ #include "spells.h" -#include "../cirno.h" -#include "../misc.h" - -#include "common_tasks.h" -#include "global.h" TASK(crystal_wall) { int num_crystals = difficulty_value(18, 21, 24, 27); diff --git a/src/stages/stage1/spells/crystal_rain.c b/src/stages/stage1/spells/crystal_rain.c index 70875bc296..790af9853d 100644 --- a/src/stages/stage1/spells/crystal_rain.c +++ b/src/stages/stage1/spells/crystal_rain.c @@ -7,11 +7,6 @@ */ #include "spells.h" -#include "../cirno.h" - -#include "stage.h" -#include "common_tasks.h" -#include "global.h" TASK(crystal_rain_drops) { const int nshots = difficulty_value(1, 2, 4, 5); diff --git a/src/stages/stage1/spells/icicle_cascade.c b/src/stages/stage1/spells/icicle_cascade.c index 340682d6bd..2cffdc3784 100644 --- a/src/stages/stage1/spells/icicle_cascade.c +++ b/src/stages/stage1/spells/icicle_cascade.c @@ -7,9 +7,6 @@ */ #include "spells.h" -#include "../cirno.h" - -#include "global.h" TASK(cirno_icicle, { cmplx pos; cmplx vel; }) { Projectile *p = TASK_BIND(PROJECTILE( diff --git a/src/stages/stage1/spells/perfect_freeze.c b/src/stages/stage1/spells/perfect_freeze.c index 9ed9eb804c..8680fcf843 100644 --- a/src/stages/stage1/spells/perfect_freeze.c +++ b/src/stages/stage1/spells/perfect_freeze.c @@ -7,11 +7,6 @@ */ #include "spells.h" -#include "../cirno.h" -#include "../misc.h" - -#include "common_tasks.h" -#include "global.h" TASK(move_frozen, { BoxedProjectileArray *parray; }) { DECLARE_ENT_ARRAY(Projectile, projs, ARGS.parray->size); diff --git a/src/stages/stage1/spells/snow_halation.c b/src/stages/stage1/spells/snow_halation.c index ce69bcf802..bb755d021b 100644 --- a/src/stages/stage1/spells/snow_halation.c +++ b/src/stages/stage1/spells/snow_halation.c @@ -7,11 +7,6 @@ */ #include "spells.h" -#include "../cirno.h" -#include "../misc.h" - -#include "stagetext.h" -#include "global.h" static Color *halation_color(Color *out_clr, float phase) { if(phase < 0.5) { diff --git a/src/stages/stage1/spells/spells.h b/src/stages/stage1/spells/spells.h index f1ba8dd64f..e46ebf0408 100644 --- a/src/stages/stage1/spells/spells.h +++ b/src/stages/stage1/spells/spells.h @@ -10,8 +10,10 @@ #include "taisei.h" #include "../stage1.h" -#include "boss.h" -#include "stage.h" + +#include "stages/common_imports.h" // IWYU pragma: export +#include "../cirno.h" // IWYU pragma: export +#include "../misc.h" // IWYU pragma: export DECLARE_EXTERN_TASK_WITH_INTERFACE(stage1_spell_perfect_freeze, BossAttack); DECLARE_EXTERN_TASK_WITH_INTERFACE(stage1_spell_crystal_rain, BossAttack); diff --git a/src/stages/stage1/stage1.c b/src/stages/stage1/stage1.c index f01e4203d9..ba2ccb0ebb 100644 --- a/src/stages/stage1/stage1.c +++ b/src/stages/stage1/stage1.c @@ -7,11 +7,12 @@ */ #include "stage1.h" -#include "draw.h" + #include "background_anim.h" #include "cirno.h" -#include "spells/spells.h" -#include "timeline.h" +#include "draw.h" +#include "timeline.h" // IWYU pragma: keep +#include "spells/spells.h" // IWYU pragma: keep #include "global.h" #include "portrait.h" diff --git a/src/stages/stage1/timeline.c b/src/stages/stage1/timeline.c index 446e7d4dca..da57969c75 100644 --- a/src/stages/stage1/timeline.c +++ b/src/stages/stage1/timeline.c @@ -6,17 +6,15 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "timeline.h" -#include "stage1.h" -#include "cirno.h" -#include "spells/spells.h" -#include "nonspells/nonspells.h" +#include "timeline.h" // IWYU pragma: keep + #include "background_anim.h" +#include "cirno.h" +#include "nonspells/nonspells.h" // IWYU pragma: keep +#include "spells/spells.h" // IWYU pragma: keep +#include "stage1.h" -#include "global.h" -#include "stagetext.h" -#include "common_tasks.h" -#include "enemy_classes.h" +#include "stages/common_imports.h" TASK(burst_fairy, { BoxedEnemy e; cmplx target_pos; cmplx exit_dir; }) { Enemy *e = TASK_BIND(ARGS.e); diff --git a/src/stages/stage1/timeline.h b/src/stages/stage1/timeline.h index f63a3f9d29..937f5948c1 100644 --- a/src/stages/stage1/timeline.h +++ b/src/stages/stage1/timeline.h @@ -9,6 +9,6 @@ #pragma once #include "taisei.h" -#include "coroutine.h" +#include "coroutine/taskdsl.h" DECLARE_EXTERN_TASK(stage1_timeline); diff --git a/src/stages/stage2/background_anim.c b/src/stages/stage2/background_anim.c index 39586eae4e..dd7f60204c 100644 --- a/src/stages/stage2/background_anim.c +++ b/src/stages/stage2/background_anim.c @@ -10,7 +10,6 @@ #include "draw.h" #include "stageutils.h" -#include "coroutine.h" #include "common_tasks.h" #include "util/glm.h" @@ -44,8 +43,6 @@ void stage2_bg_enable_hina_lights(void) { ); } -#include "camcontrol.h" - TASK(animate_bg_fullstage) { Camera3D *cam = &stage_3d_context.cam; diff --git a/src/stages/stage2/draw.c b/src/stages/stage2/draw.c index 8e0db898bc..9a4b00aa24 100644 --- a/src/stages/stage2/draw.c +++ b/src/stages/stage2/draw.c @@ -10,9 +10,9 @@ #include "global.h" #include "renderer/api.h" -#include "resource/model.h" #include "stageutils.h" #include "util/glm.h" +#include "util/graphics.h" static Stage2DrawData *stage2_draw_data; diff --git a/src/stages/stage2/draw.h b/src/stages/stage2/draw.h index f891530f05..450f8a3dc3 100644 --- a/src/stages/stage2/draw.h +++ b/src/stages/stage2/draw.h @@ -9,7 +9,7 @@ #pragma once #include "taisei.h" -#include "stagedraw.h" +#include "stageinfo.h" #include "stageutils.h" typedef struct Stage2DrawData { diff --git a/src/stages/stage2/hina.c b/src/stages/stage2/hina.c index 8c64ec6a92..9219ec0b60 100644 --- a/src/stages/stage2/hina.c +++ b/src/stages/stage2/hina.c @@ -9,6 +9,7 @@ #include "hina.h" #include "global.h" +#include "renderer/api.h" void stage2_draw_hina_spellbg(Boss *h, int time) { SpriteParams sp = { 0 }; diff --git a/src/stages/stage2/hina.h b/src/stages/stage2/hina.h index b97800937f..a71f4c49f4 100644 --- a/src/stages/stage2/hina.h +++ b/src/stages/stage2/hina.h @@ -9,7 +9,7 @@ #pragma once #include "taisei.h" -#include "boss.h" +#include "boss.h" // IWYU pragma: keep Boss *stage2_spawn_hina(cmplx pos); void stage2_draw_hina_spellbg(Boss *h, int time); diff --git a/src/stages/stage2/nonspells/boss_nonspell_1.c b/src/stages/stage2/nonspells/boss_nonspell_1.c index b5fc40456b..8b8eff0293 100644 --- a/src/stages/stage2/nonspells/boss_nonspell_1.c +++ b/src/stages/stage2/nonspells/boss_nonspell_1.c @@ -8,9 +8,6 @@ #include "nonspells.h" -#include "global.h" -#include "common_tasks.h" - TASK(wander, { BoxedBoss boss; }) { Rect wander_bounds = viewport_bounds(80); wander_bounds.bottom = 130; diff --git a/src/stages/stage2/nonspells/boss_nonspell_2.c b/src/stages/stage2/nonspells/boss_nonspell_2.c index afc3f83cde..d2f36e0b4d 100644 --- a/src/stages/stage2/nonspells/boss_nonspell_2.c +++ b/src/stages/stage2/nonspells/boss_nonspell_2.c @@ -8,9 +8,6 @@ #include "nonspells.h" -#include "global.h" -#include "common_tasks.h" - TASK(speen, { BoxedBoss boss; }) { Boss *boss = TASK_BIND(ARGS.boss); aniplayer_queue(&boss->ani, "guruguru", 0); diff --git a/src/stages/stage2/nonspells/boss_nonspell_3.c b/src/stages/stage2/nonspells/boss_nonspell_3.c index 8775a453fb..fc2280d390 100644 --- a/src/stages/stage2/nonspells/boss_nonspell_3.c +++ b/src/stages/stage2/nonspells/boss_nonspell_3.c @@ -7,10 +7,6 @@ */ #include "nonspells.h" -#include "../hina.h" - -#include "common_tasks.h" -#include "global.h" // Pattern contributed by raz, originally written for danmakufu // The port is almost direct, and a bit rough diff --git a/src/stages/stage2/nonspells/midboss_nonspell_1.c b/src/stages/stage2/nonspells/midboss_nonspell_1.c index fcd48bc699..00f817f373 100644 --- a/src/stages/stage2/nonspells/midboss_nonspell_1.c +++ b/src/stages/stage2/nonspells/midboss_nonspell_1.c @@ -8,9 +8,6 @@ #include "nonspells.h" -#include "global.h" -#include "common_tasks.h" - TASK(spawn_bugs, { BoxedBoss boss; BoxedProjectileArray *bugs; }) { Boss *boss = TASK_BIND(ARGS.boss); diff --git a/src/stages/stage2/nonspells/nonspells.h b/src/stages/stage2/nonspells/nonspells.h index a97f8b7ab0..590fb49f35 100644 --- a/src/stages/stage2/nonspells/nonspells.h +++ b/src/stages/stage2/nonspells/nonspells.h @@ -9,11 +9,8 @@ #pragma once #include "taisei.h" -#include "boss.h" -#include "stage.h" - -void hina_cards1(Boss *h, int time); -void hina_cards2(Boss *h, int time); +#include "stages/common_imports.h" // IWYU pragma: export +#include "../hina.h" // IWYU pragma: export DECLARE_EXTERN_TASK_WITH_INTERFACE(stage2_midboss_nonspell_1, BossAttack); DECLARE_EXTERN_TASK_WITH_INTERFACE(stage2_boss_nonspell_1, BossAttack); diff --git a/src/stages/stage2/spells/amulet_of_harm.c b/src/stages/stage2/spells/amulet_of_harm.c index cb508c9575..f32da46485 100644 --- a/src/stages/stage2/spells/amulet_of_harm.c +++ b/src/stages/stage2/spells/amulet_of_harm.c @@ -8,9 +8,6 @@ #include "spells.h" -#include "global.h" -#include "common_tasks.h" - TASK(spinner_bullet_redirect, { BoxedProjectile p; MoveParams move; }) { Projectile *p = TASK_BIND(ARGS.p); cmplx ov = p->move.velocity; diff --git a/src/stages/stage2/spells/bad_pick.c b/src/stages/stage2/spells/bad_pick.c index ee05145d80..1f73cd26cc 100644 --- a/src/stages/stage2/spells/bad_pick.c +++ b/src/stages/stage2/spells/bad_pick.c @@ -8,9 +8,6 @@ #include "spells.h" -#include "global.h" -#include "common_tasks.h" - #define SLOTS 5 static int slot_of_position(cmplx pos) { diff --git a/src/stages/stage2/spells/monty_hall_danmaku.c b/src/stages/stage2/spells/monty_hall_danmaku.c index 8f8c52fbbe..0e8bad2577 100644 --- a/src/stages/stage2/spells/monty_hall_danmaku.c +++ b/src/stages/stage2/spells/monty_hall_danmaku.c @@ -8,9 +8,6 @@ #include "spells.h" -#include "global.h" -#include "common_tasks.h" - #define NUM_SLOTS 3 #define SLOT_WIDTH (VIEWPORT_W / (real)NUM_SLOTS) diff --git a/src/stages/stage2/spells/spells.h b/src/stages/stage2/spells/spells.h index 163374f994..83d65fe01d 100644 --- a/src/stages/stage2/spells/spells.h +++ b/src/stages/stage2/spells/spells.h @@ -9,7 +9,8 @@ #pragma once #include "taisei.h" -#include "boss.h" +#include "stages/common_imports.h" // IWYU pragma: export +#include "../hina.h" // IWYU pragma: export DECLARE_EXTERN_TASK_WITH_INTERFACE(stage2_spell_amulet_of_harm, BossAttack); DECLARE_EXTERN_TASK_WITH_INTERFACE(stage2_spell_wheel_of_fortune, BossAttack); diff --git a/src/stages/stage2/spells/wheel_of_fortune.c b/src/stages/stage2/spells/wheel_of_fortune.c index b4ace20d0b..2c5ef1a824 100644 --- a/src/stages/stage2/spells/wheel_of_fortune.c +++ b/src/stages/stage2/spells/wheel_of_fortune.c @@ -8,9 +8,6 @@ #include "spells.h" -#include "global.h" -#include "common_tasks.h" - TASK(change_velocity, { BoxedProjectile p; cmplx v; }) { Projectile *p = TASK_BIND(ARGS.p); p->move = move_asymptotic_halflife(p->move.velocity, ARGS.v, 20); diff --git a/src/stages/stage2/stage2.c b/src/stages/stage2/stage2.c index bd6c03d74a..1eae4ac213 100644 --- a/src/stages/stage2/stage2.c +++ b/src/stages/stage2/stage2.c @@ -7,11 +7,13 @@ */ #include "stage2.h" -#include "spells/spells.h" -#include "hina.h" -#include "draw.h" + #include "background_anim.h" -#include "timeline.h" +#include "draw.h" +#include "hina.h" +#include "spells/spells.h" +#include "stage.h" +#include "timeline.h" // IWYU pragma: keep #include "global.h" #include "portrait.h" diff --git a/src/stages/stage2/timeline.c b/src/stages/stage2/timeline.c index 9ce35c9cfb..684b6bab34 100644 --- a/src/stages/stage2/timeline.c +++ b/src/stages/stage2/timeline.c @@ -6,17 +6,15 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "timeline.h" -#include "wriggle.h" +#include "timeline.h" // IWYU pragma: keep + +#include "background_anim.h" #include "hina.h" -#include "nonspells/nonspells.h" +#include "nonspells/nonspells.h" // IWYU pragma: keep #include "stage2.h" -#include "background_anim.h" +#include "wriggle.h" -#include "stage.h" -#include "global.h" -#include "common_tasks.h" -#include "enemy_classes.h" +#include "stages/common_imports.h" TASK(spinshot_fairy_attack_spawn_projs, { BoxedEnemy e; diff --git a/src/stages/stage2/timeline.h b/src/stages/stage2/timeline.h index 35b05ab92e..bddccc5fac 100644 --- a/src/stages/stage2/timeline.h +++ b/src/stages/stage2/timeline.h @@ -9,6 +9,6 @@ #pragma once #include "taisei.h" -#include "coroutine.h" +#include "coroutine/taskdsl.h" DECLARE_EXTERN_TASK(stage2_timeline); diff --git a/src/stages/stage2/wriggle.c b/src/stages/stage2/wriggle.c index a50f156675..4c437b6a28 100644 --- a/src/stages/stage2/wriggle.c +++ b/src/stages/stage2/wriggle.c @@ -8,8 +8,10 @@ #include "wriggle.h" +#include "boss.h" + Boss *stage2_spawn_wriggle(cmplx pos) { - Boss* wriggle = create_boss("Wriggle", "wriggle", pos); + Boss *wriggle = create_boss("Wriggle", "wriggle", pos); wriggle->glowcolor = *RGB(0.2, 0.4, 0.5); wriggle->shadowcolor = *RGBA_MUL_ALPHA(0.4, 0.2, 0.6, 0.5); return wriggle; diff --git a/src/stages/stage2/wriggle.h b/src/stages/stage2/wriggle.h index 51230e28ab..893347e810 100644 --- a/src/stages/stage2/wriggle.h +++ b/src/stages/stage2/wriggle.h @@ -9,6 +9,6 @@ #pragma once #include "taisei.h" -#include "boss.h" +#include "entity.h" Boss *stage2_spawn_wriggle(cmplx pos); diff --git a/src/stages/stage3/draw.c b/src/stages/stage3/draw.c index 04c934da38..6a0cce70f6 100644 --- a/src/stages/stage3/draw.c +++ b/src/stages/stage3/draw.c @@ -8,10 +8,10 @@ #include "draw.h" -#include "stagedraw.h" #include "stageutils.h" #include "global.h" #include "util/glm.h" +#include "util/graphics.h" static Stage3DrawData *stage3_draw_data; diff --git a/src/stages/stage3/draw.h b/src/stages/stage3/draw.h index c89d90a0d1..9f5e645cfc 100644 --- a/src/stages/stage3/draw.h +++ b/src/stages/stage3/draw.h @@ -9,8 +9,7 @@ #pragma once #include "taisei.h" -#include "util/fbpair.h" -#include "stagedraw.h" +#include "stageinfo.h" #include "stageutils.h" typedef struct Stage3DrawData { diff --git a/src/stages/stage3/nonspells/boss_nonspells.c b/src/stages/stage3/nonspells/boss_nonspells.c index ee3772ece7..03e23dd450 100644 --- a/src/stages/stage3/nonspells/boss_nonspells.c +++ b/src/stages/stage3/nonspells/boss_nonspells.c @@ -7,10 +7,6 @@ */ #include "nonspells.h" -#include "../wriggle.h" - -#include "global.h" -#include "common_tasks.h" TASK(slave, { BoxedBoss boss; real rot_speed; real rot_initial; int level; }) { Boss *boss = TASK_BIND(ARGS.boss); diff --git a/src/stages/stage3/nonspells/midboss_nonspell_1.c b/src/stages/stage3/nonspells/midboss_nonspell_1.c index 037f61f3a3..0541a3ef4e 100644 --- a/src/stages/stage3/nonspells/midboss_nonspell_1.c +++ b/src/stages/stage3/nonspells/midboss_nonspell_1.c @@ -7,10 +7,6 @@ */ #include "nonspells.h" -#include "../scuttle.h" - -#include "common_tasks.h" -#include "global.h" TASK(bite_bullet, { cmplx pos; cmplx vel; }) { Color phase_colors[] = { diff --git a/src/stages/stage3/nonspells/nonspells.h b/src/stages/stage3/nonspells/nonspells.h index 03a1090657..9b7185c772 100644 --- a/src/stages/stage3/nonspells/nonspells.h +++ b/src/stages/stage3/nonspells/nonspells.h @@ -9,8 +9,9 @@ #pragma once #include "taisei.h" -#include "boss.h" -#include "stage.h" +#include "stages/common_imports.h" // IWYU pragma: export +#include "../scuttle.h" // IWYU pragma: export +#include "../wriggle.h" // IWYU pragma: export DECLARE_EXTERN_TASK_WITH_INTERFACE(stage3_midboss_nonspell_1, BossAttack); DECLARE_EXTERN_TASK_WITH_INTERFACE(stage3_boss_nonspell_1, BossAttack); diff --git a/src/stages/stage3/scuttle.h b/src/stages/stage3/scuttle.h index 0885688a14..abc039aeef 100644 --- a/src/stages/stage3/scuttle.h +++ b/src/stages/stage3/scuttle.h @@ -9,7 +9,7 @@ #pragma once #include "taisei.h" -#include "boss.h" +#include "entity.h" Boss *stage3_spawn_scuttle(cmplx pos); void stage3_draw_scuttle_spellbg(Boss *boss, int time); diff --git a/src/stages/stage3/spells/firefly_storm.c b/src/stages/stage3/spells/firefly_storm.c index 9ebb87d79b..66024ba2b5 100644 --- a/src/stages/stage3/spells/firefly_storm.c +++ b/src/stages/stage3/spells/firefly_storm.c @@ -7,10 +7,6 @@ */ #include "spells.h" -#include "../wriggle.h" - -#include "common_tasks.h" -#include "global.h" static void wriggle_fstorm_proj_draw(Projectile *p, int time, ProjDrawRuleArgs args) { SpriteParamsBuffer spbuf; diff --git a/src/stages/stage3/spells/light_singularity.c b/src/stages/stage3/spells/light_singularity.c index d3e86b20b0..c8d1708c0c 100644 --- a/src/stages/stage3/spells/light_singularity.c +++ b/src/stages/stage3/spells/light_singularity.c @@ -7,10 +7,6 @@ */ #include "spells.h" -#include "../wriggle.h" - -#include "common_tasks.h" -#include "global.h" TASK(singularity_laser, { cmplx pos; cmplx vel; real amp; real freq; }) { Laser *l = TASK_BIND(create_laser( diff --git a/src/stages/stage3/spells/logic_bomb.c b/src/stages/stage3/spells/logic_bomb.c index 2d29888525..678c2c86f6 100644 --- a/src/stages/stage3/spells/logic_bomb.c +++ b/src/stages/stage3/spells/logic_bomb.c @@ -7,10 +7,6 @@ */ #include "spells.h" -#include "../scuttle.h" - -#include "common_tasks.h" -#include "global.h" #define SHOT_OFS1 CMPLX(20, 8) #define SHOT_OFS2 CMPLX(-14, -42) diff --git a/src/stages/stage3/spells/moonlight_rocket.c b/src/stages/stage3/spells/moonlight_rocket.c index dff6efb989..ddb0086253 100644 --- a/src/stages/stage3/spells/moonlight_rocket.c +++ b/src/stages/stage3/spells/moonlight_rocket.c @@ -7,10 +7,6 @@ */ #include "spells.h" -#include "../wriggle.h" - -#include "common_tasks.h" -#include "global.h" TASK(aimcircle, { int lifetime; int focustime; }) { auto p = TASK_BIND(PARTICLE( diff --git a/src/stages/stage3/spells/moths_to_a_flame.c b/src/stages/stage3/spells/moths_to_a_flame.c index d7c1128383..b98135510c 100644 --- a/src/stages/stage3/spells/moths_to_a_flame.c +++ b/src/stages/stage3/spells/moths_to_a_flame.c @@ -7,10 +7,6 @@ */ #include "spells.h" -#include "../wriggle.h" - -#include "common_tasks.h" -#include "global.h" typedef struct SunContext { int bullets_absorbed; diff --git a/src/stages/stage3/spells/spells.h b/src/stages/stage3/spells/spells.h index 9dae222cd8..e468a9312b 100644 --- a/src/stages/stage3/spells/spells.h +++ b/src/stages/stage3/spells/spells.h @@ -9,7 +9,9 @@ #pragma once #include "taisei.h" -#include "boss.h" +#include "stages/common_imports.h" // IWYU pragma: export +#include "../scuttle.h" // IWYU pragma: export +#include "../wriggle.h" // IWYU pragma: export DECLARE_EXTERN_TASK_WITH_INTERFACE(stage3_spell_firefly_storm, BossAttack); DECLARE_EXTERN_TASK_WITH_INTERFACE(stage3_spell_light_singularity, BossAttack); diff --git a/src/stages/stage3/stage3.c b/src/stages/stage3/stage3.c index 49373725a5..ff612d2113 100644 --- a/src/stages/stage3/stage3.c +++ b/src/stages/stage3/stage3.c @@ -7,16 +7,18 @@ */ #include "stage3.h" -#include "draw.h" + #include "background_anim.h" -#include "wriggle.h" +#include "draw.h" #include "scuttle.h" #include "spells/spells.h" -#include "timeline.h" +#include "timeline.h" // IWYU pragma: keep +#include "wriggle.h" +#include "common_tasks.h" #include "global.h" #include "portrait.h" -#include "common_tasks.h" +#include "stage.h" /* * See the definition of AttackInfo in boss.h for information on how to set up the idmaps. diff --git a/src/stages/stage3/timeline.c b/src/stages/stage3/timeline.c index ea59cc5b36..1c70403e76 100644 --- a/src/stages/stage3/timeline.c +++ b/src/stages/stage3/timeline.c @@ -6,19 +6,16 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "timeline.h" -#include "stage3.h" -#include "wriggle.h" +#include "timeline.h" // IWYU pragma: keep + +#include "draw.h" +#include "nonspells/nonspells.h" #include "scuttle.h" #include "spells/spells.h" -#include "nonspells/nonspells.h" -#include "background_anim.h" -#include "draw.h" +#include "stage3.h" +#include "wriggle.h" -#include "global.h" -#include "stagetext.h" -#include "common_tasks.h" -#include "enemy_classes.h" +#include "stages/common_imports.h" static void stage3_dialog_post_boss(void) { PlayerMode *pm = global.plr.mode; diff --git a/src/stages/stage3/timeline.h b/src/stages/stage3/timeline.h index ba9045ad4d..8e13bed54d 100644 --- a/src/stages/stage3/timeline.h +++ b/src/stages/stage3/timeline.h @@ -9,6 +9,6 @@ #pragma once #include "taisei.h" -#include "coroutine.h" +#include "coroutine/taskdsl.h" DECLARE_EXTERN_TASK(stage3_timeline); diff --git a/src/stages/stage3/wriggle.h b/src/stages/stage3/wriggle.h index 8a305b0a36..c02d2a3426 100644 --- a/src/stages/stage3/wriggle.h +++ b/src/stages/stage3/wriggle.h @@ -9,7 +9,9 @@ #pragma once #include "taisei.h" -#include "boss.h" +#include "coroutine/taskdsl.h" +#include "entity.h" +#include "renderer/api.h" DEFINE_ENTITY_TYPE(WriggleSlave, { struct { diff --git a/src/stages/stage4/draw.c b/src/stages/stage4/draw.c index 92b8452132..dcbdf81a7d 100644 --- a/src/stages/stage4/draw.c +++ b/src/stages/stage4/draw.c @@ -7,9 +7,11 @@ */ #include "draw.h" -#include "stageutils.h" + #include "global.h" +#include "stageutils.h" #include "util/glm.h" +#include "util/graphics.h" #define LIGHT_OFS { 2.7f, 4.86f, 0.3f } #define CORRIDOR_POS { 0.0f, 25.0f, 3.0f } diff --git a/src/stages/stage4/draw.h b/src/stages/stage4/draw.h index 74f26199bb..ae168247a8 100644 --- a/src/stages/stage4/draw.h +++ b/src/stages/stage4/draw.h @@ -9,8 +9,8 @@ #pragma once #include "taisei.h" -#include "stagedraw.h" #include "color.h" +#include "stageinfo.h" #include "stageutils.h" typedef struct Stage4DrawData { diff --git a/src/stages/stage4/kurumi.c b/src/stages/stage4/kurumi.c index d61ac4040f..49d3718841 100644 --- a/src/stages/stage4/kurumi.c +++ b/src/stages/stage4/kurumi.c @@ -8,6 +8,7 @@ #include "kurumi.h" +#include "audio/audio.h" #include "global.h" DEFINE_EXTERN_TASK(stage4_boss_nonspell_burst) { diff --git a/src/stages/stage4/kurumi.h b/src/stages/stage4/kurumi.h index bd78914d39..e066e4d048 100644 --- a/src/stages/stage4/kurumi.h +++ b/src/stages/stage4/kurumi.h @@ -9,7 +9,7 @@ #pragma once #include "taisei.h" -#include "boss.h" +#include "boss.h" // IWYU pragma: keep DECLARE_EXTERN_TASK(stage4_boss_nonspell_burst, { BoxedBoss boss; int duration; int count; }); DECLARE_EXTERN_TASK(stage4_boss_nonspell_redirect, { BoxedProjectile proj; MoveParams new_move; }); diff --git a/src/stages/stage4/nonspells/boss_nonspell_1.c b/src/stages/stage4/nonspells/boss_nonspell_1.c index 787d0fe313..c6e514a089 100644 --- a/src/stages/stage4/nonspells/boss_nonspell_1.c +++ b/src/stages/stage4/nonspells/boss_nonspell_1.c @@ -7,9 +7,6 @@ */ #include "nonspells.h" -#include "../kurumi.h" - -#include "global.h" DEFINE_EXTERN_TASK(stage4_boss_nonspell_1) { STAGE_BOOKMARK(boss-non1); diff --git a/src/stages/stage4/nonspells/boss_nonspell_2.c b/src/stages/stage4/nonspells/boss_nonspell_2.c index df67eac70a..952d139f4d 100644 --- a/src/stages/stage4/nonspells/boss_nonspell_2.c +++ b/src/stages/stage4/nonspells/boss_nonspell_2.c @@ -7,9 +7,6 @@ */ #include "nonspells.h" -#include "../kurumi.h" - -#include "global.h" DEFINE_EXTERN_TASK(stage4_boss_nonspell_2) { STAGE_BOOKMARK(boss-non2); diff --git a/src/stages/stage4/nonspells/nonspells.h b/src/stages/stage4/nonspells/nonspells.h index 994d730e40..dc100bb7d6 100644 --- a/src/stages/stage4/nonspells/nonspells.h +++ b/src/stages/stage4/nonspells/nonspells.h @@ -9,8 +9,8 @@ #pragma once #include "taisei.h" -#include "boss.h" -#include "stage.h" +#include "stages/common_imports.h" // IWYU pragma: export +#include "../kurumi.h" // IWYU pragma: export DECLARE_EXTERN_TASK_WITH_INTERFACE(stage4_boss_nonspell_1, BossAttack); DECLARE_EXTERN_TASK_WITH_INTERFACE(stage4_boss_nonspell_2, BossAttack); diff --git a/src/stages/stage4/spells/animate_wall.c b/src/stages/stage4/spells/animate_wall.c index 0c2267c930..10ddee9d13 100644 --- a/src/stages/stage4/spells/animate_wall.c +++ b/src/stages/stage4/spells/animate_wall.c @@ -7,10 +7,6 @@ */ #include "spells.h" -#include "common_tasks.h" -#include "../kurumi.h" - -#include "global.h" typedef struct { cmplx pos; diff --git a/src/stages/stage4/spells/blow_the_walls.c b/src/stages/stage4/spells/blow_the_walls.c index 8597caf7f9..149856a22d 100644 --- a/src/stages/stage4/spells/blow_the_walls.c +++ b/src/stages/stage4/spells/blow_the_walls.c @@ -7,9 +7,6 @@ */ #include "spells.h" -#include "common_tasks.h" - -#include "global.h" TASK(kurumi_blowwall_exploder, { cmplx pos; cmplx acceleration; }) { diff --git a/src/stages/stage4/spells/gate_of_walachia.c b/src/stages/stage4/spells/gate_of_walachia.c index ca8ad1fedf..998d6e97fc 100644 --- a/src/stages/stage4/spells/gate_of_walachia.c +++ b/src/stages/stage4/spells/gate_of_walachia.c @@ -6,11 +6,7 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "common_tasks.h" #include "spells.h" -#include "../kurumi.h" - -#include "global.h" TASK(kurumi_walachia_slave_move_turn, { cmplx *vel; int duration; cmplx offset; }) { for(int i = 0; i < ARGS.duration; i++, YIELD) { @@ -21,12 +17,12 @@ TASK(kurumi_walachia_slave_move_turn, { cmplx *vel; int duration; cmplx offset; TASK(kurumi_walachia_slave_move, { cmplx *pos; cmplx *vel; cmplx direction; }) { INVOKE_SUBTASK_DELAYED(40, kurumi_walachia_slave_move_turn, ARGS.vel, 60, ARGS.direction); - + for(int i = 0;; i++, YIELD) { *ARGS.pos += 2 * *ARGS.vel * (sin(i / 10.0) + 1.5); } -} +} TASK(kurumi_walachia_slave, { cmplx pos; cmplx direction; int lifetime; }) { cmplx pos = ARGS.pos; diff --git a/src/stages/stage4/spells/red_spike.c b/src/stages/stage4/spells/red_spike.c index 1c9f2878af..d18d85ea08 100644 --- a/src/stages/stage4/spells/red_spike.c +++ b/src/stages/stage4/spells/red_spike.c @@ -7,10 +7,6 @@ */ #include "spells.h" -#include "common_tasks.h" -#include "../kurumi.h" - -#include "global.h" TASK(kurumi_redspike_slave, { cmplx pos; int direction; }) { cmplx pos = ARGS.pos; diff --git a/src/stages/stage4/spells/spells.h b/src/stages/stage4/spells/spells.h index dd79253d5f..58a17d789c 100644 --- a/src/stages/stage4/spells/spells.h +++ b/src/stages/stage4/spells/spells.h @@ -9,7 +9,8 @@ #pragma once #include "taisei.h" -#include "boss.h" +#include "stages/common_imports.h" // IWYU pragma: export +#include "../kurumi.h" // IWYU pragma: export DECLARE_EXTERN_TASK_WITH_INTERFACE(kurumi_walachia, BossAttack); DECLARE_EXTERN_TASK_WITH_INTERFACE(kurumi_dryfountain, BossAttack); diff --git a/src/stages/stage4/spells/vampiric_vapour.c b/src/stages/stage4/spells/vampiric_vapour.c index 91eaa4e019..2203b63ba1 100644 --- a/src/stages/stage4/spells/vampiric_vapour.c +++ b/src/stages/stage4/spells/vampiric_vapour.c @@ -7,10 +7,6 @@ */ #include "spells.h" -#include "common_tasks.h" -#include "../kurumi.h" - -#include "global.h" static Projectile *vapor_particle(cmplx pos, const Color *clr) { return PARTICLE( diff --git a/src/stages/stage4/spells/vlads_army.c b/src/stages/stage4/spells/vlads_army.c index cc3a6969cf..0f9a7bd55e 100644 --- a/src/stages/stage4/spells/vlads_army.c +++ b/src/stages/stage4/spells/vlads_army.c @@ -7,10 +7,6 @@ */ #include "spells.h" -#include "../kurumi.h" -#include "enemy_classes.h" - -#include "global.h" // TODO SUPER REDESIGN THIS, IT'S A MESS! diff --git a/src/stages/stage4/stage4.c b/src/stages/stage4/stage4.c index a6737c4caf..3b927716d5 100644 --- a/src/stages/stage4/stage4.c +++ b/src/stages/stage4/stage4.c @@ -7,15 +7,16 @@ */ #include "stage4.h" -#include "draw.h" + #include "background_anim.h" -#include "timeline.h" -#include "spells/spells.h" +#include "draw.h" #include "kurumi.h" +#include "spells/spells.h" +#include "timeline.h" // IWYU pragma: keep -#include "portrait.h" -#include "stageutils.h" #include "global.h" +#include "portrait.h" +#include "stage.h" /* * See the definition of AttackInfo in boss.h for information on how to set up the idmaps. diff --git a/src/stages/stage4/timeline.c b/src/stages/stage4/timeline.c index e3adef888c..9088a1b98b 100644 --- a/src/stages/stage4/timeline.c +++ b/src/stages/stage4/timeline.c @@ -6,19 +6,14 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "stage4.h" #include "timeline.h" -#include "draw.h" + #include "background_anim.h" -#include "nonspells/nonspells.h" #include "kurumi.h" +#include "nonspells/nonspells.h" +#include "stage4.h" -#include "global.h" -#include "stage.h" -#include "enemy.h" -#include "enemy_classes.h" -#include "laser.h" -#include "common_tasks.h" +#include "stages/common_imports.h" #include "../stage6/elly.h" static void stage4_dialog_pre_boss(void) { diff --git a/src/stages/stage4/timeline.h b/src/stages/stage4/timeline.h index 7f63941c0a..88db580dbc 100644 --- a/src/stages/stage4/timeline.h +++ b/src/stages/stage4/timeline.h @@ -9,7 +9,7 @@ #pragma once #include "taisei.h" -#include "boss.h" +#include "coroutine/taskdsl.h" DECLARE_EXTERN_TASK(stage4_timeline); diff --git a/src/stages/stage5/background_anim.c b/src/stages/stage5/background_anim.c index 6ea33b3e6a..01f022d943 100644 --- a/src/stages/stage5/background_anim.c +++ b/src/stages/stage5/background_anim.c @@ -9,9 +9,8 @@ #include "background_anim.h" #include "draw.h" -#include "global.h" -#include "stageutils.h" #include "common_tasks.h" +#include "stageutils.h" TASK(stage5_bg_update) { Stage5DrawData *stage5_draw_data = stage5_get_draw_data(); diff --git a/src/stages/stage5/background_anim.h b/src/stages/stage5/background_anim.h index 03be1c0ed0..5969511176 100644 --- a/src/stages/stage5/background_anim.h +++ b/src/stages/stage5/background_anim.h @@ -9,8 +9,6 @@ #pragma once #include "taisei.h" -#include "coroutine.h" - void stage5_bg_raise_lightning(void); void stage5_bg_lower_camera(void); diff --git a/src/stages/stage5/draw.c b/src/stages/stage5/draw.c index d789e986f2..9558243461 100644 --- a/src/stages/stage5/draw.c +++ b/src/stages/stage5/draw.c @@ -11,7 +11,7 @@ #include "global.h" #include "stageutils.h" #include "util/glm.h" -#include "resource/model.h" +#include "util/graphics.h" static Stage5DrawData *stage5_draw_data; diff --git a/src/stages/stage5/draw.h b/src/stages/stage5/draw.h index 6fc2d9eb3b..8e96678684 100644 --- a/src/stages/stage5/draw.h +++ b/src/stages/stage5/draw.h @@ -9,7 +9,7 @@ #pragma once #include "taisei.h" -#include "stagedraw.h" +#include "stageinfo.h" #include "stageutils.h" typedef struct Stage5DrawData { diff --git a/src/stages/stage5/iku.c b/src/stages/stage5/iku.c index 327a0e97ad..079a683c04 100644 --- a/src/stages/stage5/iku.c +++ b/src/stages/stage5/iku.c @@ -8,8 +8,6 @@ #include "iku.h" -#include "stage5.h" - #include "common_tasks.h" static void iku_slave_draw(EntityInterface *e) { diff --git a/src/stages/stage5/iku.h b/src/stages/stage5/iku.h index a90ea6383f..c6a0482f2b 100644 --- a/src/stages/stage5/iku.h +++ b/src/stages/stage5/iku.h @@ -9,7 +9,9 @@ #pragma once #include "taisei.h" -#include "boss.h" +#include "coroutine/taskdsl.h" +#include "renderer/api.h" +#include "move.h" DEFINE_ENTITY_TYPE(IkuSlave, { struct { diff --git a/src/stages/stage5/nonspells/nonspells.h b/src/stages/stage5/nonspells/nonspells.h index ffd85ae055..373f4fec19 100644 --- a/src/stages/stage5/nonspells/nonspells.h +++ b/src/stages/stage5/nonspells/nonspells.h @@ -9,10 +9,8 @@ #pragma once #include "taisei.h" -#include "common_tasks.h" -#include "stage.h" - -#include "stages/stage5/iku.h" +#include "stages/common_imports.h" // IWYU pragma: export +#include "../iku.h" // IWYU pragma: export DECLARE_EXTERN_TASK_WITH_INTERFACE(stage5_boss_nonspell_1, BossAttack); DECLARE_EXTERN_TASK_WITH_INTERFACE(stage5_boss_nonspell_2, BossAttack); diff --git a/src/stages/stage5/spells/spells.h b/src/stages/stage5/spells/spells.h index b8ebd92662..a96cbbfad9 100644 --- a/src/stages/stage5/spells/spells.h +++ b/src/stages/stage5/spells/spells.h @@ -9,10 +9,8 @@ #pragma once #include "taisei.h" -#include "common_tasks.h" -#include "stage.h" - -#include "stages/stage5/iku.h" +#include "stages/common_imports.h" // IWYU pragma: export +#include "../iku.h" // IWYU pragma: export DECLARE_EXTERN_TASK_WITH_INTERFACE(stage5_midboss_static_bomb, BossAttack); DECLARE_EXTERN_TASK_WITH_INTERFACE(stage5_spell_atmospheric_discharge, BossAttack); diff --git a/src/stages/stage5/stage5.c b/src/stages/stage5/stage5.c index c58e984ae5..b43a54830c 100644 --- a/src/stages/stage5/stage5.c +++ b/src/stages/stage5/stage5.c @@ -7,15 +7,16 @@ */ #include "stage5.h" -#include "draw.h" + #include "background_anim.h" +#include "draw.h" #include "iku.h" #include "spells/spells.h" #include "timeline.h" +#include "common_tasks.h" #include "global.h" #include "portrait.h" -#include "common_tasks.h" struct stage5_spells_s stage5_spells = { .mid = { diff --git a/src/stages/stage5/timeline.c b/src/stages/stage5/timeline.c index c8e57c6595..5daea54249 100644 --- a/src/stages/stage5/timeline.c +++ b/src/stages/stage5/timeline.c @@ -7,13 +7,10 @@ */ #include "timeline.h" -#include "stage5.h" + #include "background_anim.h" #include "nonspells/nonspells.h" -#include "spells/spells.h" - -#include "coroutine.h" -#include "enemy_classes.h" +#include "stage5.h" static void stage5_dialog_post_boss(void) { PlayerMode *pm = global.plr.mode; diff --git a/src/stages/stage5/timeline.h b/src/stages/stage5/timeline.h index 6e83efd851..41a5d3eb88 100644 --- a/src/stages/stage5/timeline.h +++ b/src/stages/stage5/timeline.h @@ -9,9 +9,9 @@ #pragma once #include "taisei.h" -#include "boss.h" +#include "boss.h" // IWYU pragma: keep void stage5_events(void); -Boss* stage5_spawn_iku(cmplx); +Boss *stage5_spawn_iku(cmplx); DECLARE_EXTERN_TASK(stage5_timeline); diff --git a/src/stages/stage6/background_anim.c b/src/stages/stage6/background_anim.c index d3db7a5122..83513ec116 100644 --- a/src/stages/stage6/background_anim.c +++ b/src/stages/stage6/background_anim.c @@ -9,7 +9,6 @@ #include "background_anim.h" #include "draw.h" -#include "global.h" #include "stageutils.h" #include "common_tasks.h" @@ -59,7 +58,7 @@ void stage6_bg_stop_boss_rotation(void) { cam->pos[0] = -6; cam->pos[1] = 0; } - + static float ease_final(float t, float from, float to, float outfrac) { float slope = 2/(1 + outfrac); diff --git a/src/stages/stage6/background_anim.h b/src/stages/stage6/background_anim.h index dcf4b62e71..bfd6a0c571 100644 --- a/src/stages/stage6/background_anim.h +++ b/src/stages/stage6/background_anim.h @@ -9,8 +9,6 @@ #pragma once #include "taisei.h" -#include "coroutine.h" - void stage6_bg_start_fall_over(void); void stage6_bg_start_boss_rotation(void); diff --git a/src/stages/stage6/draw.c b/src/stages/stage6/draw.c index 0ffdcd7633..120a0b1fcc 100644 --- a/src/stages/stage6/draw.c +++ b/src/stages/stage6/draw.c @@ -9,8 +9,10 @@ #include "draw.h" #include "global.h" -#include "util/glm.h" #include "resource/model.h" +#include "stagedraw.h" +#include "util/glm.h" +#include "util/graphics.h" static Stage6DrawData *stage6_draw_data; diff --git a/src/stages/stage6/draw.h b/src/stages/stage6/draw.h index 9cce1255d2..fbcee54857 100644 --- a/src/stages/stage6/draw.h +++ b/src/stages/stage6/draw.h @@ -9,9 +9,9 @@ #pragma once #include "taisei.h" -#include "util/fbpair.h" -#include "stagedraw.h" +#include "stageinfo.h" #include "stageutils.h" +#include "util/fbpair.h" enum { NUM_STARS = 400 diff --git a/src/stages/stage6/elly.c b/src/stages/stage6/elly.c index dc3d864fbe..b6a58e5712 100644 --- a/src/stages/stage6/elly.c +++ b/src/stages/stage6/elly.c @@ -6,12 +6,15 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "global.h" #include "elly.h" + #include "draw.h" -#include "util/glm.h" #include "spells/spells.h" +#include "stagedraw.h" +#include "util/glm.h" +#include "util/graphics.h" + TASK(elly_animate_colors, { BoxedBoss boss; }) { auto boss = TASK_BIND(ARGS.boss); diff --git a/src/stages/stage6/elly.h b/src/stages/stage6/elly.h index 4ba5b07081..5b517abc2a 100644 --- a/src/stages/stage6/elly.h +++ b/src/stages/stage6/elly.h @@ -9,7 +9,6 @@ #pragma once #include "taisei.h" -#include "enemy.h" #include "boss.h" #define FERMIONTIME 1000 diff --git a/src/stages/stage6/nonspells/nonspells.h b/src/stages/stage6/nonspells/nonspells.h index fe91a73edd..c7e08ab4ff 100644 --- a/src/stages/stage6/nonspells/nonspells.h +++ b/src/stages/stage6/nonspells/nonspells.h @@ -9,11 +9,8 @@ #pragma once #include "taisei.h" -#include "global.h" -#include "boss.h" -#include "stage.h" - -#include "stages/stage6/elly.h" +#include "stages/common_imports.h" // IWYU pragma: export +#include "../elly.h" // IWYU pragma: export DECLARE_EXTERN_TASK(stage6_boss_nonspell_scythe_common, { BoxedEllyScythe scythe; }); DECLARE_EXTERN_TASK(stage6_boss_nonspell_baryons_common, { BoxedEllyBaryons baryons; }); diff --git a/src/stages/stage6/spells/broglie.c b/src/stages/stage6/spells/broglie.c index 4706fa4ddb..618382abfb 100644 --- a/src/stages/stage6/spells/broglie.c +++ b/src/stages/stage6/spells/broglie.c @@ -8,8 +8,6 @@ #include "spells.h" -#include "common_tasks.h" - TASK(broglie_particle, { BoxedLaser laser; real laser_offset; Color color; bool fast; real angle_freq; }) { Laser *l = TASK_BIND(ARGS.laser); diff --git a/src/stages/stage6/spells/eigenstate.c b/src/stages/stage6/spells/eigenstate.c index cfeda9a3b2..88d65411cb 100644 --- a/src/stages/stage6/spells/eigenstate.c +++ b/src/stages/stage6/spells/eigenstate.c @@ -8,8 +8,6 @@ #include "spells.h" -#include "common_tasks.h" - TASK(eigenstate_baryons, { BoxedBoss boss; BoxedEllyBaryons baryons; }) { EllyBaryons *baryons = TASK_BIND(ARGS.baryons); @@ -24,7 +22,7 @@ TASK(eigenstate_baryons, { BoxedBoss boss; BoxedEllyBaryons baryons; }) { } YIELD; } -} +} TASK(eigenstate_bullet, { cmplx pos; cmplx v0; cmplx v1; Color color; }) { Projectile *p = TASK_BIND(PROJECTILE( @@ -42,7 +40,7 @@ TASK(eigenstate_bullet, { cmplx pos; cmplx v0; cmplx v1; Color color; }) { TASK(eigenstate_spawn_bullets, { BoxedEllyBaryons baryons; int baryon_idx; }) { EllyBaryons *baryons = TASK_BIND(ARGS.baryons); - + int interval = difficulty_value(138, 126, 114, 102); real deflection = difficulty_value(0.3, 0.2, 0.1, 0); @@ -55,7 +53,7 @@ TASK(eigenstate_spawn_bullets, { BoxedEllyBaryons baryons; int baryon_idx; }) { for(int j = 0; j < 3; j++) { cmplx v1 = v0 * (1 + 0.6 * I * (j-1) * cdir(deflection)); - + INVOKE_TASK(eigenstate_bullet, .pos = baryons->poss[ARGS.baryon_idx] + 60 * cdir(M_TAU/count*i), .v0 = v0, diff --git a/src/stages/stage6/spells/forgotten.c b/src/stages/stage6/spells/forgotten.c index 3d8ae8863f..0696cc9d18 100644 --- a/src/stages/stage6/spells/forgotten.c +++ b/src/stages/stage6/spells/forgotten.c @@ -8,8 +8,6 @@ #include "spells.h" -#include "common_tasks.h" - TASK(forgotten_baryons_movement, { BoxedEllyBaryons baryons; BoxedBoss boss; }) { EllyBaryons *baryons = TASK_BIND(ARGS.baryons); diff --git a/src/stages/stage6/spells/kepler.c b/src/stages/stage6/spells/kepler.c index ac7f7cf4d5..bd984f3310 100644 --- a/src/stages/stage6/spells/kepler.c +++ b/src/stages/stage6/spells/kepler.c @@ -8,8 +8,6 @@ #include "spells.h" -#include "common_tasks.h" - static ProjPrototype *kepler_pick_bullet(int tier) { switch(tier) { case 0: return pp_soul; diff --git a/src/stages/stage6/spells/lhc.c b/src/stages/stage6/spells/lhc.c index 271c5471cd..e25453aae0 100644 --- a/src/stages/stage6/spells/lhc.c +++ b/src/stages/stage6/spells/lhc.c @@ -8,8 +8,6 @@ #include "spells.h" -#include "common_tasks.h" - #define LHC_PERIOD 400 static real lhc_target_height(int turn) { diff --git a/src/stages/stage6/spells/maxwell.c b/src/stages/stage6/spells/maxwell.c index 77d984c1bb..2f55460237 100644 --- a/src/stages/stage6/spells/maxwell.c +++ b/src/stages/stage6/spells/maxwell.c @@ -8,8 +8,6 @@ #include "spells.h" -#include "common_tasks.h" - typedef struct LaserRuleMaxwellData { cmplx dir; real amplitude; diff --git a/src/stages/stage6/spells/newton.c b/src/stages/stage6/spells/newton.c index f710b509bc..ddad5937c8 100644 --- a/src/stages/stage6/spells/newton.c +++ b/src/stages/stage6/spells/newton.c @@ -8,8 +8,6 @@ #include "spells.h" -#include "common_tasks.h" - TASK(spawn_square, { BoxedProjectileArray *projectiles; cmplx pos; diff --git a/src/stages/stage6/spells/ricci.c b/src/stages/stage6/spells/ricci.c index 3ff7528d00..b07c7f57c5 100644 --- a/src/stages/stage6/spells/ricci.c +++ b/src/stages/stage6/spells/ricci.c @@ -8,8 +8,6 @@ #include "spells.h" -#include "common_tasks.h" - /* !!! You are entering Akari danmaku code !!! (rejuvenated by lao) */ // FIXME: This awful timing system is an relic of a shameful coroutine-less past; rewrite this. #define SAFE_RADIUS_DELAY 300 diff --git a/src/stages/stage6/spells/spells.h b/src/stages/stage6/spells/spells.h index 80d7c57faf..92b8da4d6c 100644 --- a/src/stages/stage6/spells/spells.h +++ b/src/stages/stage6/spells/spells.h @@ -9,10 +9,8 @@ #pragma once #include "taisei.h" -#include "boss.h" - -#include "stages/stage6/draw.h" -#include "stages/stage6/elly.h" +#include "stages/common_imports.h" // IWYU pragma: export +#include "../elly.h" // IWYU pragma: export #define ELLY_TOE_TARGET_POS (VIEWPORT_W/2+VIEWPORT_H/2*I) diff --git a/src/stages/stage6/spells/toe.c b/src/stages/stage6/spells/toe.c index cb29c4e26d..887503a857 100644 --- a/src/stages/stage6/spells/toe.c +++ b/src/stages/stage6/spells/toe.c @@ -7,8 +7,8 @@ */ #include "spells.h" -#include "stagetext.h" -#include "common_tasks.h" + +#include "../draw.h" #define LASER_LENGTH 60 diff --git a/src/stages/stage6/stage6.c b/src/stages/stage6/stage6.c index 07ae0351f3..b0721b8764 100644 --- a/src/stages/stage6/stage6.c +++ b/src/stages/stage6/stage6.c @@ -8,14 +8,14 @@ #include "stage6.h" -#include "draw.h" #include "background_anim.h" +#include "draw.h" #include "elly.h" #include "spells/spells.h" #include "timeline.h" -#include "portrait.h" #include "common_tasks.h" +#include "portrait.h" /* * See the definition of AttackInfo in boss.h for information on how to set up the idmaps. diff --git a/src/stages/stage6/timeline.c b/src/stages/stage6/timeline.c index d4024cfa99..6c70916363 100644 --- a/src/stages/stage6/timeline.c +++ b/src/stages/stage6/timeline.c @@ -7,16 +7,12 @@ */ #include "timeline.h" -#include "stage6.h" -#include "draw.h" -#include "background_anim.h" -#include "enemy_classes.h" +#include "background_anim.h" #include "elly.h" -#include "spells/spells.h" #include "nonspells/nonspells.h" - -#include "common_tasks.h" +#include "spells/spells.h" +#include "stage6.h" TASK(hacker_fairy, { cmplx pos; MoveParams exit_move; }) { Enemy *e = TASK_BIND(espawn_super_fairy(ARGS.pos, ITEMS( diff --git a/src/stages/stage6/timeline.h b/src/stages/stage6/timeline.h index ebea50213c..44649f27c5 100644 --- a/src/stages/stage6/timeline.h +++ b/src/stages/stage6/timeline.h @@ -9,7 +9,7 @@ #pragma once #include "taisei.h" -#include "boss.h" +#include "boss.h" // IWYU pragma: keep -Boss* stage6_spawn_elly(cmplx); +Boss *stage6_spawn_elly(cmplx); DECLARE_EXTERN_TASK(stage6_timeline); diff --git a/src/stages/stages.h b/src/stages/stages.h index c60efd7373..651355821b 100644 --- a/src/stages/stages.h +++ b/src/stages/stages.h @@ -9,7 +9,7 @@ #pragma once #include "taisei.h" -#include "stage.h" +#include "stageinfo.h" typedef struct StagesExports { struct { diff --git a/src/stagetext.c b/src/stagetext.c index 7c36444c99..6046a02693 100644 --- a/src/stagetext.c +++ b/src/stagetext.c @@ -7,8 +7,10 @@ */ #include "stagetext.h" -#include "list.h" + #include "global.h" +#include "objectpool.h" +#include "stageobjects.h" static StageText *textlist = NULL; diff --git a/src/stagetext.h b/src/stagetext.h index 4bac223536..226d394fea 100644 --- a/src/stagetext.h +++ b/src/stagetext.h @@ -9,9 +9,7 @@ #pragma once #include "taisei.h" -#include "util.h" #include "color.h" -#include "objectpool.h" #include "resource/font.h" typedef struct StageText StageText; diff --git a/src/stageutils.c b/src/stageutils.c index 58bc20b68f..f8a3a8610b 100644 --- a/src/stageutils.c +++ b/src/stageutils.c @@ -7,11 +7,11 @@ */ #include "stageutils.h" + #include "global.h" -#include "util/glm.h" -#include "video.h" -#include "resource/model.h" #include "resource/material.h" +#include "resource/model.h" +#include "util/glm.h" Stage3D stage_3d_context; diff --git a/src/stageutils.h b/src/stageutils.h index f20ca2f6e1..8c85b47178 100644 --- a/src/stageutils.h +++ b/src/stageutils.h @@ -9,9 +9,8 @@ #pragma once #include "taisei.h" -#include "util.h" +#include "renderer/api.h" #include "resource/material.h" -#include "global.h" // remove when STAGE3D_DEFAULT_ASPECT aspect is removed typedef struct Stage3D Stage3D; diff --git a/src/stats.c b/src/stats.c index 08e1095154..5e5bf0677c 100644 --- a/src/stats.c +++ b/src/stats.c @@ -8,7 +8,6 @@ #include "stats.h" -#include "global.h" #include "log.h" void stats_init(Stats *stats) { diff --git a/src/taisei.h b/src/taisei.h index d2eaaae5f9..8bbc394ee6 100644 --- a/src/taisei.h +++ b/src/taisei.h @@ -9,10 +9,13 @@ #pragma once #include "taisei.h" -#include "build_config.h" -#include "util/compat.h" -#include "util/consideredharmful.h" -#include "memory/memory.h" +// IWYU pragma: always_keep + +#include "build_config.h" // IWYU pragma: export +#include "util/compat.h" // IWYU pragma: export +#include "util/assert.h" // IWYU pragma: export +#include "util/consideredharmful.h" // IWYU pragma: export +#include "memory/memory.h" // IWYU pragma: export #ifdef TAISEI_BUILDCONF_DEVELOPER // TODO: maybe rename this diff --git a/src/taskmanager.c b/src/taskmanager.c index d70dad74d9..ff45c5cbba 100644 --- a/src/taskmanager.c +++ b/src/taskmanager.c @@ -7,8 +7,14 @@ */ #include "taskmanager.h" + #include "list.h" -#include "util.h" +#include "log.h" +#include "util/env.h" + +#include +#include +#include typedef enum TaskManagerState { TMGR_STATE_SHUTDOWN, diff --git a/src/thread.c b/src/thread.c index 7caeb2eb9d..dfe84e5fee 100644 --- a/src/thread.c +++ b/src/thread.c @@ -7,8 +7,9 @@ */ #include "thread.h" -#include "log.h" + #include "hashtable.h" +#include "log.h" #include diff --git a/src/transition.c b/src/transition.c index 9ee213bc83..c52d87d69a 100644 --- a/src/transition.c +++ b/src/transition.c @@ -7,8 +7,8 @@ */ #include "transition.h" -#include "menu/ingamemenu.h" -#include "global.h" + +#include "renderer/api.h" #include "util/graphics.h" Transition transition; diff --git a/src/util.h b/src/util.h index adf4a0e1e7..7e7ca5b130 100644 --- a/src/util.h +++ b/src/util.h @@ -9,22 +9,6 @@ #pragma once #include "taisei.h" -#include "util/assert.h" -#include "util/crap.h" -#include "util/debug.h" -#include "util/env.h" -#include "util/geometry.h" -// #include "util/glm.h" -// #include "util/graphics.h" -#include "util/io.h" -#include "util/kvparser.h" -#include "util/miscmath.h" -// #include "util/pngcruft.h" -#include "util/stringops.h" -#include "util/callchain.h" - -// FIXME: might not be the best place for these -#include "log.h" -#include "vfs/public.h" -#include "util/consideredharmful.h" -#include "dynarray.h" +#include "util/assert.h" // IWYU pragma: export +#include "util/crap.h" // IWYU pragma: export +#include "util/debug.h" // IWYU pragma: export diff --git a/src/util/assert.c b/src/util/assert.c index c64c598790..d4446bb554 100644 --- a/src/util/assert.c +++ b/src/util/assert.c @@ -7,8 +7,10 @@ */ #include "assert.h" + #include "util.h" #include "log.h" +#include "util/io.h" void _ts_assert_fail( const char *cond, const char *msg, const char *func, const char *file, int line, bool use_log diff --git a/src/util/compat.h b/src/util/compat.h index ee7aadd26a..df27c0280c 100644 --- a/src/util/compat.h +++ b/src/util/compat.h @@ -10,19 +10,19 @@ #include "taisei.h" // Common standard library headers -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export // clang defines this too #ifndef __GNUC__ @@ -35,7 +35,7 @@ #define _TAISEI_SRC_FILE __FILE__ #endif -#include "util/assert.h" +#include "util/assert.h" // IWYU pragma: export #ifdef __FAST_MATH__ #error -ffast-math is prohibited @@ -182,7 +182,7 @@ typedef _Complex double cmplx; #endif // polyfill CMPLX macros -#include "compat_cmplx.h" +#include "compat_cmplx.h" // IWYU pragma: export /* * Abstract away the nasty GNU attribute syntax. diff --git a/src/util/crap.h b/src/util/crap.h index bc6651d92f..25ee4e8284 100644 --- a/src/util/crap.h +++ b/src/util/crap.h @@ -11,6 +11,8 @@ #include +// IWYU pragma: private, include "util.h" + void inherit_missing_pointers(uint num, void *dest[num], void *const base[num]) attr_nonnull(2, 3); typedef union FloatBits { diff --git a/src/util/env.c b/src/util/env.c index 9a2e93a55a..3c9409360e 100644 --- a/src/util/env.c +++ b/src/util/env.c @@ -7,7 +7,8 @@ */ #include "env.h" -#include "util.h" + +#include "log.h" const char *env_get_string(const char *var, const char *fallback) { const char *val = SDL_getenv(var); diff --git a/src/util/fbmgr.c b/src/util/fbmgr.c index 8c15e8be2b..2a700ebf27 100644 --- a/src/util/fbmgr.c +++ b/src/util/fbmgr.c @@ -7,9 +7,11 @@ */ #include "fbmgr.h" -#include "list.h" -#include "events.h" + #include "config.h" +#include "events.h" +#include "list.h" +#include "util.h" #include "video.h" typedef struct ManagedFramebufferData ManagedFramebufferData; diff --git a/src/util/fbmgr.h b/src/util/fbmgr.h index 74a53d4fbf..178fc57ef2 100644 --- a/src/util/fbmgr.h +++ b/src/util/fbmgr.h @@ -9,10 +9,10 @@ #pragma once #include "taisei.h" -#include "renderer/api.h" #include "fbpair.h" #include "geometry.h" #include "list.h" +#include "renderer/api.h" typedef struct FramebufferResizeStrategy { void (*resize_func)(void *userdata, IntExtent *out_dimensions, FloatRect *out_viewport); diff --git a/src/util/fbpair.c b/src/util/fbpair.c index df9287e99d..f0c7ad0b4a 100644 --- a/src/util/fbpair.c +++ b/src/util/fbpair.c @@ -7,8 +7,6 @@ */ #include "fbpair.h" -#include "global.h" -#include "util.h" static void fbpair_destroy_fb(Framebuffer *fb) { fbutil_destroy_attachments(fb); diff --git a/src/util/gamemode.c b/src/util/gamemode.c index 13dae08cbd..884d330c38 100644 --- a/src/util/gamemode.c +++ b/src/util/gamemode.c @@ -7,8 +7,10 @@ */ #include "gamemode.h" -#include "util.h" + +#include "log.h" #include "taskmanager.h" +#include "util/env.h" #include diff --git a/src/util/gamemode_stub.c b/src/util/gamemode_stub.c index 62fd6320c9..581be7eef7 100644 --- a/src/util/gamemode_stub.c +++ b/src/util/gamemode_stub.c @@ -7,7 +7,7 @@ */ #include "gamemode.h" -#include "util.h" +#include "log.h" void gamemode_init(void) { log_info("Compiled without GameMode integration"); diff --git a/src/util/glm.h b/src/util/glm.h index f10039d40f..394d4a5f6d 100644 --- a/src/util/glm.h +++ b/src/util/glm.h @@ -13,11 +13,11 @@ // Please include this in any C file where access to the glm_* functions is needed. // You don't need to include this if you just want the types. -#include "util.h" +// IWYU pragma: always_keep DIAGNOSTIC(push) DIAGNOSTIC(ignored "-Wdeprecated-declarations") -#include +#include // IWYU pragma: export DIAGNOSTIC(pop) typedef float (*glm_ease_t)(float); diff --git a/src/util/graphics.c b/src/util/graphics.c index 1b95c3a1ab..83988b659c 100644 --- a/src/util/graphics.c +++ b/src/util/graphics.c @@ -7,9 +7,7 @@ */ #include "graphics.h" -#include "global.h" #include "video.h" -#include "pixmap/pixmap.h" void set_ortho(float w, float h) { r_mat_proj_ortho(0, w, h, 0, -100, 100); diff --git a/src/util/graphics.h b/src/util/graphics.h index 8540be1589..f541e27618 100644 --- a/src/util/graphics.h +++ b/src/util/graphics.h @@ -9,7 +9,6 @@ #pragma once #include "taisei.h" -#include "fbpair.h" #include "resource/font.h" void set_ortho(float w, float h); diff --git a/src/util/io.c b/src/util/io.c index ab8e30ae07..d77d9899c7 100644 --- a/src/util/io.c +++ b/src/util/io.c @@ -7,12 +7,12 @@ */ #include "io.h" -#include "log.h" -#include "vfs/public.h" + #include "assert.h" -#include "stringops.h" +#include "log.h" #include "rwops/rwops_autobuf.h" -#include "util/crap.h" +#include "stringops.h" +#include "vfs/public.h" #ifdef TAISEI_BUILDCONF_HAVE_POSIX #include diff --git a/src/util/kvparser.c b/src/util/kvparser.c index cefd313102..58aaaa10f3 100644 --- a/src/util/kvparser.c +++ b/src/util/kvparser.c @@ -7,9 +7,10 @@ */ #include "kvparser.h" + +#include "io.h" #include "log.h" #include "stringops.h" -#include "io.h" #include "vfs/public.h" bool parse_keyvalue_stream_cb(SDL_RWops *strm, KVCallback callback, void *data) { diff --git a/src/util/miscmath.c b/src/util/miscmath.c index 69fa417092..40a284fabb 100644 --- a/src/util/miscmath.c +++ b/src/util/miscmath.c @@ -7,7 +7,6 @@ */ #include "miscmath.h" -#include "assert.h" double lerp(double v0, double v1, double f) { return f * (v1 - v0) + v0; diff --git a/src/util/platform_posix.c b/src/util/platform_posix.c index f690025e50..39b9a471e8 100644 --- a/src/util/platform_posix.c +++ b/src/util/platform_posix.c @@ -6,10 +6,10 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include - #include "systime.h" +#include + void get_system_time(SystemTime *systime) { #if defined(TAISEI_BUILDCONF_HAVE_TIMESPEC) #if defined(TAISEI_BUILDCONF_HAVE_BUILTIN_AVAILABLE) diff --git a/src/util/sha256_openssl.c b/src/util/sha256_openssl.c index 8bc3620ac8..74e63b60c2 100644 --- a/src/util/sha256_openssl.c +++ b/src/util/sha256_openssl.c @@ -7,7 +7,7 @@ */ #include "sha256.h" -#include "util.h" +#include "util/stringops.h" #include diff --git a/src/util/stringops.c b/src/util/stringops.c index b17aee889d..ebca5a12c6 100644 --- a/src/util/stringops.c +++ b/src/util/stringops.c @@ -8,7 +8,6 @@ #include "stringops.h" #include "miscmath.h" -#include "assert.h" bool strendswith(const char *s, const char *e) { int ls = strlen(s); diff --git a/src/util/stringops.h b/src/util/stringops.h index a501ce4828..d1a661e975 100644 --- a/src/util/stringops.h +++ b/src/util/stringops.h @@ -13,7 +13,6 @@ #include #include "systime.h" -#include "memory.h" #define UNICODE_UNKNOWN 0xFFFD #define UNICODE_BOM_NATIVE 0xFEFF diff --git a/src/version.h b/src/version.h index 0b62a5481b..1acc297909 100644 --- a/src/version.h +++ b/src/version.h @@ -9,9 +9,10 @@ #pragma once #include "taisei.h" -#include "util.h" #include "util/strbuf.h" +#include + #ifdef TAISEI_BUILDCONF_DEBUG #define TAISEI_VERSION_BUILD_TYPE_0 "debug" #else diff --git a/src/vfs/decompress_wrapper.c b/src/vfs/decompress_wrapper.c index 9f3451a231..e2017f6f66 100644 --- a/src/vfs/decompress_wrapper.c +++ b/src/vfs/decompress_wrapper.c @@ -7,9 +7,13 @@ */ #include "decompress_wrapper.h" +#include "decompress_wrapper_public.h" + +#include "hashtable.h" #include "rwops/rwops_ro.h" #include "rwops/rwops_zstd.h" #include "util/strbuf.h" +#include "util/stringops.h" // NOTE: Largely based on readonly_wrapper. Sorry for the copypasta. // This is currently hardcoded to only support transparent decompression of .zst files. diff --git a/src/vfs/decompress_wrapper.h b/src/vfs/decompress_wrapper.h index bbeb2fea90..82f433af6d 100644 --- a/src/vfs/decompress_wrapper.h +++ b/src/vfs/decompress_wrapper.h @@ -9,7 +9,6 @@ #pragma once #include "taisei.h" -#include "decompress_wrapper_public.h" #include "private.h" VFSNode *vfs_decomp_wrap(VFSNode *base); diff --git a/src/vfs/emscripten_fetch.c b/src/vfs/emscripten_fetch.c index 9a5060dcd1..1a71ce2e6a 100644 --- a/src/vfs/emscripten_fetch.c +++ b/src/vfs/emscripten_fetch.c @@ -8,9 +8,9 @@ #include "emscripten_fetch.h" #include "emscripten_fetch_public.h" + #include "resindex.h" #include "rwops/rwops_dummy.h" -#include "util.h" #include #include diff --git a/src/vfs/error.h b/src/vfs/error.h index 993bc3df84..0750894489 100644 --- a/src/vfs/error.h +++ b/src/vfs/error.h @@ -9,14 +9,13 @@ #pragma once #include "taisei.h" -#include "log.h" - // #define VFS_LOG_ERRORS void vfs_set_error(char *fmt, ...) attr_printf(1, 2); void vfs_set_error_from_sdl(void); #ifdef VFS_LOG_ERRORS +#include "log.h" #define vfs_set_error(fmt, ...) ({ \ log_debug("vfs_set_error: " fmt, ##__VA_ARGS__); \ vfs_set_error(fmt, ##__VA_ARGS__); \ diff --git a/src/vfs/loadpacks.c b/src/vfs/loadpacks.c index 236c846eed..43cd713c45 100644 --- a/src/vfs/loadpacks.c +++ b/src/vfs/loadpacks.c @@ -7,10 +7,12 @@ */ #include "loadpacks.h" + #include "public.h" -#include "setup.h" #include "error.h" -#include "util.h" + +#include "log.h" +#include "util/stringops.h" static bool vfs_mount_pkgdir(const char *dst, const char *src) { VFSInfo stat = vfs_query(src); diff --git a/src/vfs/nodeapi.c b/src/vfs/nodeapi.c index 6892a37bcd..aeeba5b8bb 100644 --- a/src/vfs/nodeapi.c +++ b/src/vfs/nodeapi.c @@ -8,6 +8,7 @@ #include "private.h" #include "rwops/rwops_ro.h" +#include "util/strbuf.h" VFSInfo vfs_node_query(VFSNode *node) { assert(node->funcs != NULL); diff --git a/src/vfs/pathutil.c b/src/vfs/pathutil.c index 6858cd5aab..a55c4e5ec4 100644 --- a/src/vfs/pathutil.c +++ b/src/vfs/pathutil.c @@ -6,8 +6,9 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "private.h" -#include "syspath.h" +#include "pathutil.h" + +#include "public.h" char *vfs_path_normalize(const char *path, char *out) { const char *p = path; diff --git a/src/vfs/platform_paths/cache_apple.m b/src/vfs/platform_paths/cache_apple.m index f139158cd1..f4bd0500fa 100644 --- a/src/vfs/platform_paths/cache_apple.m +++ b/src/vfs/platform_paths/cache_apple.m @@ -6,8 +6,6 @@ * Copyright (c) 2012-2019, Andrei Alexeyev . */ -#include "taisei.h" - #include "platform_paths.h" #include "util.h" #include "../syspath_public.h" diff --git a/src/vfs/platform_paths/cache_win32.c b/src/vfs/platform_paths/cache_win32.c index 5427c50da8..ae2ccc4465 100644 --- a/src/vfs/platform_paths/cache_win32.c +++ b/src/vfs/platform_paths/cache_win32.c @@ -7,7 +7,7 @@ */ #include "platform_paths.h" -#include "util.h" +#include "../public.h" typedef struct tagLOGFONTW LOGFONTW; /* broken piece of shit garbage windows headers */ diff --git a/src/vfs/platform_paths/cache_xdg.c b/src/vfs/platform_paths/cache_xdg.c index 2f99ac579f..845a8b60f9 100644 --- a/src/vfs/platform_paths/cache_xdg.c +++ b/src/vfs/platform_paths/cache_xdg.c @@ -7,8 +7,8 @@ */ #include "platform_paths.h" -#include "util.h" #include "../syspath_public.h" +#include "util/env.h" const char *vfs_platformpath_cache(void) { static char *cached; diff --git a/src/vfs/platform_paths/resroot_sdl.c b/src/vfs/platform_paths/resroot_sdl.c index 4000f069bb..c1489a09af 100644 --- a/src/vfs/platform_paths/resroot_sdl.c +++ b/src/vfs/platform_paths/resroot_sdl.c @@ -7,8 +7,9 @@ */ #include "platform_paths.h" -#include "util.h" + #include "../syspath_public.h" +#include "log.h" #include diff --git a/src/vfs/platform_paths/storage_sdl.c b/src/vfs/platform_paths/storage_sdl.c index 6d32ccf85f..4c12ad0b56 100644 --- a/src/vfs/platform_paths/storage_sdl.c +++ b/src/vfs/platform_paths/storage_sdl.c @@ -7,7 +7,8 @@ */ #include "platform_paths.h" -#include "util.h" + +#include "log.h" #include diff --git a/src/vfs/private.c b/src/vfs/private.c index 344cf3da38..633eb6025c 100644 --- a/src/vfs/private.c +++ b/src/vfs/private.c @@ -9,6 +9,11 @@ #include "private.h" #include "vdir.h" +#include "list.h" +#include "log.h" +#include "util/io.h" +#include "util/stringops.h" + VFSNode *vfs_root = NULL; typedef struct vfs_tls_s { diff --git a/src/vfs/private.h b/src/vfs/private.h index d777d20837..42efe27ecd 100644 --- a/src/vfs/private.h +++ b/src/vfs/private.h @@ -13,11 +13,11 @@ * This file should not be included by code outside of the vfs/ directory */ -#include "util.h" +#include "public.h" // IWYU pragma: export +#include "pathutil.h" // IWYU pragma: export +#include "error.h" // IWYU pragma: export -#include "public.h" -#include "pathutil.h" -#include "error.h" +#include "util.h" typedef struct VFSNode VFSNode; typedef struct VFSNodeFuncs VFSNodeFuncs; diff --git a/src/vfs/public.c b/src/vfs/public.c index be077f03d9..f710bbf106 100644 --- a/src/vfs/public.c +++ b/src/vfs/public.c @@ -8,6 +8,9 @@ #include "private.h" +#include "dynarray.h" +#include "log.h" + typedef struct VFSDir { VFSNode *node; void *opaque; diff --git a/src/vfs/public.h b/src/vfs/public.h index 92048c67c8..028e57bc5e 100644 --- a/src/vfs/public.h +++ b/src/vfs/public.h @@ -9,14 +9,15 @@ #pragma once #include "taisei.h" -#include +#include "syspath_public.h" // IWYU pragma: export +#include "union_public.h" // IWYU pragma: export +#include "zipfile_public.h" // IWYU pragma: export +#include "readonly_wrapper_public.h" // IWYU pragma: export -#include "syspath_public.h" -#include "union_public.h" -#include "zipfile_public.h" -#include "readonly_wrapper_public.h" #include "util/callchain.h" +#include + typedef struct VFSInfo { uchar error : 1; uchar exists : 1; diff --git a/src/vfs/readonly_wrapper.c b/src/vfs/readonly_wrapper.c index df13244c82..5ba5041a72 100644 --- a/src/vfs/readonly_wrapper.c +++ b/src/vfs/readonly_wrapper.c @@ -8,7 +8,10 @@ #include "readonly_wrapper.h" #include "private.h" + +#include "log.h" #include "rwops/rwops_ro.h" +#include "util/stringops.h" VFS_NODE_TYPE(VFSReadOnlyNode, { VFSNode *wrapped; diff --git a/src/vfs/readonly_wrapper.h b/src/vfs/readonly_wrapper.h index c7b904b30d..9ad7b772b6 100644 --- a/src/vfs/readonly_wrapper.h +++ b/src/vfs/readonly_wrapper.h @@ -9,7 +9,6 @@ #pragma once #include "taisei.h" -#include "readonly_wrapper_public.h" #include "private.h" -VFSNode* vfs_ro_wrap(VFSNode *base); +VFSNode *vfs_ro_wrap(VFSNode *base); diff --git a/src/vfs/resindex_layered_public.h b/src/vfs/resindex_layered_public.h index 693cb52309..2861e1c530 100644 --- a/src/vfs/resindex_layered_public.h +++ b/src/vfs/resindex_layered_public.h @@ -9,7 +9,5 @@ #pragma once #include "taisei.h" -#include "public.h" - bool vfs_mount_resindex_layered(const char *mountpoint, const char *backend_vfspath) attr_nonnull(1, 2) attr_nodiscard; diff --git a/src/vfs/setup_generic.c b/src/vfs/setup_generic.c index 7cc84d1052..99ef1ee82a 100644 --- a/src/vfs/setup_generic.c +++ b/src/vfs/setup_generic.c @@ -6,12 +6,12 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "public.h" #include "setup.h" -#include "error.h" -#include "util.h" + #include "loadpacks.h" #include "platform_paths/platform_paths.h" +#include "public.h" +#include "util/env.h" // NOTE: For simplicity, we will assume that vfs_sync is not needed in this backend. diff --git a/src/vfs/setup_switch.c b/src/vfs/setup_switch.c index 3a6f95d8a5..e7956ad5b0 100644 --- a/src/vfs/setup_switch.c +++ b/src/vfs/setup_switch.c @@ -7,9 +7,9 @@ * Copyright (c) 2019, p-sam . */ -#include "public.h" #include "setup.h" -#include "util.h" + +#include "util/stringops.h" static void vfs_setup_onsync(CallChainResult ccr) { const char *program_dir = nxGetProgramDir(); diff --git a/src/vfs/sync_emscripten.c b/src/vfs/sync_emscripten.c index 5d439e8d81..1055c47738 100644 --- a/src/vfs/sync_emscripten.c +++ b/src/vfs/sync_emscripten.c @@ -7,7 +7,8 @@ */ #include "public.h" -#include "util.h" + +#include "log.h" #include diff --git a/src/vfs/syspath.h b/src/vfs/syspath.h index d2d31a1bd2..40df0b1179 100644 --- a/src/vfs/syspath.h +++ b/src/vfs/syspath.h @@ -10,7 +10,6 @@ #include "taisei.h" #include "private.h" -#include "syspath_public.h" extern char *vfs_syspath_separators; VFSNode *vfs_syspath_create(const char *path); diff --git a/src/vfs/syspath_posix.c b/src/vfs/syspath_posix.c index f79292190e..6f99854ac0 100644 --- a/src/vfs/syspath_posix.c +++ b/src/vfs/syspath_posix.c @@ -6,13 +6,15 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include -#include -#include +#include "syspath.h" + +#include "util/stringops.h" + #include #include - -#include "syspath.h" +#include +#include +#include VFS_NODE_TYPE(VFSSysPathNode, { char *path; diff --git a/src/vfs/syspath_win32.c b/src/vfs/syspath_win32.c index c45f6cf2e2..bf5e91b69e 100644 --- a/src/vfs/syspath_win32.c +++ b/src/vfs/syspath_win32.c @@ -6,12 +6,13 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ +#include "syspath.h" +#include "util/stringops.h" + #include #include #include -#include "syspath.h" - VFS_NODE_TYPE(VFSSysPathNode, { char *path; wchar_t *wpath; diff --git a/src/vfs/union.c b/src/vfs/union.c index 72ac92914a..73879835f0 100644 --- a/src/vfs/union.c +++ b/src/vfs/union.c @@ -8,6 +8,9 @@ #include "union.h" +#include "dynarray.h" +#include "hashtable.h" + VFS_NODE_TYPE(VFSUnionNode, { DYNAMIC_ARRAY(VFSNode*) members; }); diff --git a/src/vfs/union.h b/src/vfs/union.h index 01d16172b2..78461183e5 100644 --- a/src/vfs/union.h +++ b/src/vfs/union.h @@ -10,6 +10,5 @@ #include "taisei.h" #include "private.h" -#include "union_public.h" VFSNode *vfs_union_create(void); diff --git a/src/vfs/vdir.c b/src/vfs/vdir.c index 894549c653..0cc2d81f23 100644 --- a/src/vfs/vdir.c +++ b/src/vfs/vdir.c @@ -8,6 +8,8 @@ #include "vdir.h" +#include "hashtable.h" + VFS_NODE_TYPE(VFSVDirNode, { ht_str2ptr_t table; }); diff --git a/src/vfs/zipfile_impl.h b/src/vfs/zipfile_impl.h index 9daf175aea..d5f3c70f49 100644 --- a/src/vfs/zipfile_impl.h +++ b/src/vfs/zipfile_impl.h @@ -16,7 +16,7 @@ DIAGNOSTIC_CLANG(ignored "-Wnullability-completeness") #include DIAGNOSTIC_CLANG(pop) -#include "util/libzip_compat.h" +#include "util/libzip_compat.h" // IWYU pragma: export #include "private.h" #include "hashtable.h" diff --git a/src/vfs/zippath.c b/src/vfs/zippath.c index 2b6bde6017..7c8f231188 100644 --- a/src/vfs/zippath.c +++ b/src/vfs/zippath.c @@ -6,10 +6,8 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "zipfile.h" #include "zipfile_impl.h" #include "syspath.h" -#include "rwops/all.h" #define ZTLS(zpnode) vfs_zipfile_get_tls((zpnode)->zipnode, true) diff --git a/src/vfs/zippath_rwops.c b/src/vfs/zippath_rwops.c index c3ac30edcf..c4e5d76001 100644 --- a/src/vfs/zippath_rwops.c +++ b/src/vfs/zippath_rwops.c @@ -11,8 +11,6 @@ #include "rwops/rwops_util.h" #include "rwops/rwops_zstd.h" -#include "util.h" - #define FORCE_MANUAL_DECOMPRESSION (0) #if FORCE_MANUAL_DECOMPRESSION diff --git a/src/video.c b/src/video.c index 9b5f3cadda..d946535794 100644 --- a/src/video.c +++ b/src/video.c @@ -6,17 +6,21 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "global.h" #include "video.h" + +#include "dynarray.h" +#include "events.h" +#include "global.h" #include "renderer/api.h" -#include "util/pngcruft.h" +#include "rwops/rwops_autobuf.h" +#include "stagedraw.h" +#include "taskmanager.h" +#include "util/env.h" #include "util/fbmgr.h" #include "util/graphics.h" -#include "taskmanager.h" -#include "video_postprocess.h" -#include "dynarray.h" +#include "util/io.h" #include "version.h" -#include "stagedraw.h" +#include "video_postprocess.h" typedef DYNAMIC_ARRAY(VideoMode) VideoModeArray; diff --git a/src/video_postprocess.c b/src/video_postprocess.c index 60c3ba0c30..3b9c16d081 100644 --- a/src/video_postprocess.c +++ b/src/video_postprocess.c @@ -6,12 +6,12 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include "log.h" +#include "video_postprocess.h" + #include "resource/postprocess.h" +#include "util/fbmgr.h" #include "util/graphics.h" #include "video.h" -#include "video_postprocess.h" -#include "util/fbmgr.h" struct VideoPostProcess { ManagedFramebufferGroup *mfb_group; diff --git a/src/watchdog.c b/src/watchdog.c index 29710f3dd6..615fa48cd5 100644 --- a/src/watchdog.c +++ b/src/watchdog.c @@ -6,9 +6,10 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ +#include "watchdog.h" + #include "events.h" #include "log.h" -#include "watchdog.h" static struct { int countdown;