diff --git a/src/aniplayer.c b/src/aniplayer.c index b5c6ee82..84249769 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 513e77a1..a8e1d323 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 023d1cf6..70a9a3d0 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 af81e651..a71c098e 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 8c4f6736..a7f60012 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 "resource/bgm.h" -#include "resource/sfx.h" +#include "events.h" #include "global.h" +#include "resource/bgm.h" +#include "resource/resource.h" +#include "resource/sfx.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 f2ac7442..2ad7ef38 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 da80ea17..9b00dc5d 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 13e8edc3..dd8b90a1 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 6e2018c8..b168b659 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 f0e2f82b..0cbe904d 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 eab1cb52..47d60eda 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 44df9293..b23bc995 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 1fd3f1c6..1dc16a8d 100644 --- a/src/boss.c +++ b/src/boss.c @@ -7,16 +7,20 @@ */ #include "boss.h" -#include "global.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 "audio/audio.h" #include "dynstage.h" +#include "entity.h" +#include "global.h" +#include "portrait.h" +#include "stage.h" +#include "stagedraw.h" +#include "stageobjects.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 2eb4d46c..ba6f5daf 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 1079704a..2f095779 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 1e274156..3b2adcbe 100644 --- a/src/cli.c +++ b/src/cli.c @@ -6,17 +6,20 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include - #include "cli.h" -#include "difficulty.h" -#include "util.h" -#include "log.h" -#include "stage.h" -#include "plrmodes.h" -#include "version.h" + #include "cutscenes/cutscene.h" #include "cutscenes/scenes.h" +#include "difficulty.h" +#include "log.h" +#include "plrmodes.h" +#include "stageinfo.h" +#include "util.h" +#include "util/env.h" +#include "util/io.h" +#include "version.h" + +#include struct TsOption { struct option opt; const char *help; const char *argname; }; diff --git a/src/color.c b/src/color.c index 06f04502..15d3f019 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 baceaf43..9c2c12e3 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 261e59bb..c21c2aad 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 73013a5e..2b5a94cc 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 8c98173c..9b801f97 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 8923a74c..00000000 --- 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 986a697e..e9a3b050 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 58842621..f5e01837 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 d21e45cf..4b4c278a 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 56754b26..2e04007c 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 6447c07b..c4013841 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 efc69cc9..d5d48d4d 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 c2776b1f..f6865ebc 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 60859d04..ead6ec64 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 33173c8f..00000000 --- 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 d4309727..59025a6a 100644 --- a/src/credits.c +++ b/src/credits.c @@ -7,16 +7,22 @@ */ #include "credits.h" -#include "global.h" -#include "stages/stage6/draw.h" -#include "video.h" -#include "resource/model.h" -#include "renderer/api.h" -#include "util/fbmgr.h" -#include "util/glm.h" + +#include "audio/audio.h" #include "dynarray.h" #include "eventloop/eventloop.h" +#include "events.h" +#include "global.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 "util/graphics.h" +#include "video.h" typedef struct CreditsEntry { char **data; diff --git a/src/cutscenes/cutscene.c b/src/cutscenes/cutscene.c index 6b77a346..7ef800a9 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 85d813d1..6a999546 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 e6db95c3..f3b6da77 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 bae64b45..9161a133 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 1cdb0925..35184bf3 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 5f49ee59..5674080e 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 f2ee7214..07acc282 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 e3817839..d3f698ac 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 f01a771c..6819fc37 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 88b60aeb..4c1ec138 100644 --- a/src/dynstage.c +++ b/src/dynstage.c @@ -6,14 +6,15 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ +#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 "dynstage.h" -#include "events.h" -#include "filewatch/filewatch.h" - #include #include #include diff --git a/src/enemy.c b/src/enemy.c index 7ae4d045..c1bd4fa9 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 35d6a4ed..dfe852dc 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 943b0d0c..37c1fb6a 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 c8c4dd4c..83c5e850 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 223f25c7..442a8d0c 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 675827fc..33cdc7ca 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 24c51664..50ec8f02 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 b6893b2a..30bb7338 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 10b40b4b..aa0c1c82 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 8e3b885a..cae4dfc5 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 bffb9404..2b8c3912 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 b42787dd..35ad4105 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 99a88ce4..99180da8 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 bf1affde..b628527e 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 905ed7d3..82347227 100644 --- a/src/global.h +++ b/src/global.h @@ -9,43 +9,21 @@ #pragma once #include "taisei.h" +#include "cli.h" +#include "config.h" +#include "dialog.h" +#include "enemy.h" +#include "framerate.h" +#include "item.h" +#include "lasers/laser.h" +#include "projectile.h" +#include "random.h" +#include "replay/state.h" +#include "stageinfo.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 "enemy.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 "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 "stageinfo.h" - enum { // defaults RESX = 800, diff --git a/src/hashtable.c b/src/hashtable.c index 87a61838..a7432e65 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 172c0029..60b29886 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 fd0ed6e6..1bfb86ed 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 6f01a756..c5893065 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 48a7f44c..92556336 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 42ac79cc..00000000 --- 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 ba2e98dd..99b2810a 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 3cec7acf..bccf950f 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 ba7b9f40..17303097 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 b8d573bd..a64c7fb2 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 3594bf22..89c173ec 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 1bd3b5cc..f81ecde2 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 3cacc6b6..99abb009 100644 --- a/src/log.c +++ b/src/log.c @@ -6,17 +6,21 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ +#include "log.h" + +#include "coroutine/cotask.h" +#include "list.h" +#include "random.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 -#include "log.h" -#include "util.h" -#include "list.h" -#include "util/strbuf.h" -#include "thread.h" -#include "random.h" -#include "coroutine/cotask.h" - typedef struct Logger { LIST_INTERFACE(struct Logger); diff --git a/src/log.h b/src/log.h index bd3d1a70..45923c5f 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 870a066a..21b268af 100644 --- a/src/main.c +++ b/src/main.c @@ -6,35 +6,38 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ +#include "audio/audio.h" +#include "cli.h" +#include "coroutine/coroutine.h" +#include "credits.h" +#include "cutscenes/cutscene.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 -#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 "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 "replay/demoplayer.h" -#include "replay/tsrtool.h" -#include "watchdog.h" - 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 4b6edf9a..731f5e80 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 58ebdb41..ac3340b9 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 4a1127f7..29615323 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 517ce2e2..1f09f3aa 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 221865cc..a8ea7982 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 343920e4..8c758baa 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 1ecc2754..0f5d9fb1 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 e9f79451..ccaae7dc 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 cf14b06f..9fb20f89 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 86a01470..42a7d042 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 "ingamemenu.h" -#include "stats.h" + #include "global.h" +#include "ingamemenu.h" +#include "menu.h" +#include "stats.h" typedef struct GameoverMenuContext { IngameMenuContext base; diff --git a/src/menu/ingamemenu.c b/src/menu/ingamemenu.c index c2eee913..f72c2e4a 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 "stagedraw.h" -#include "video.h" -#include "options.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" 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 46f5fb2f..b6956e4b 100644 --- a/src/menu/mainmenu.c +++ b/src/menu/mainmenu.c @@ -7,21 +7,19 @@ */ #include "mainmenu.h" + +#include "charselect.h" +#include "common.h" #include "menu.h" #include "submenus.h" -#include "common.h" - -#include "savereplay.h" -#include "stagepractice.h" -#include "difficultyselect.h" -#include "charselect.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 18591cdf..c3a77640 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 1fd6ec1e..c0122321 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 d019ce4f..ef4c88b6 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 6049f8b2..023c11c9 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 aa3b46bc..3df46e9e 100644 --- a/src/menu/options.c +++ b/src/menu/options.c @@ -6,15 +6,18 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ -#include - -#include "menu.h" -#include "common.h" #include "options.h" + +#include "common.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 14f80884..e1597fa7 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 8ced6052..1dbcabdd 100644 --- a/src/menu/savereplay.c +++ b/src/menu/savereplay.c @@ -7,13 +7,18 @@ */ #include "savereplay.h" -#include "mainmenu.h" -#include "global.h" -#include "replay/struct.h" -#include "plrmodes.h" + #include "common.h" -#include "video.h" +#include "mainmenu.h" + +#include "config.h" +#include "difficulty.h" +#include "events.h" +#include "plrmodes.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 6a08745a..5171a098 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 50d1a8b6..460c04e1 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 84c1d0e5..92653e02 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 ea12d663..45564e28 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 a986a5d8..016c7d72 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 "stageselect.h" + +#include "common.h" #include "menu.h" #include "options.h" -#include "stage.h" -#include "stageselect.h" -#include "common.h" + #include "video.h" #include "stageinfo.h" diff --git a/src/menu/submenus.c b/src/menu/submenus.c index b6c27a36..13d69adb 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 012cc8b9..1b0fe896 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 e6596946..2b594bf8 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 3b9a5b22..6795c820 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 e9b37e97..2f5b9ab3 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 46b0b064..6f7d1457 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 c49b3d84..f4a9042a 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 d486cd40..5cf09d2d 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 83d3081e..d14dd15d 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 db635aca..27561ab0 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 95959586..35a679b5 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 "stage.h" -#include "stagetext.h" -#include "stagedraw.h" -#include "stats.h" -#include "entity.h" -#include "util/glm.h" +#include "projectile.h" #include "replay/stage.h" #include "replay/struct.h" +#include "stage.h" +#include "stagedraw.h" +#include "stagetext.h" +#include "stats.h" +#include "util/glm.h" +#include "util/graphics.h" DEFINE_ENTITY_TYPE(PlayerIndicators, { Player *plr; diff --git a/src/player.h b/src/player.h index f4e56910..a616e8aa 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 bf19d69f..819a198f 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 dff56efe..0dee4608 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 bffb0b67..67bf1702 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 e3acef98..e3f7c17a 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 96b78bba..92cdd21c 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 97261574..00000000 --- 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 f347c933..46864a76 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 c6864a2a..00000000 --- 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 2177d9e4..78f1a5f1 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 73652e09..ccce924b 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 4c445682..3db5a0a7 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 4c4edcd7..4d801166 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 a3eb38c4..e1517821 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 e385bea9..6fbfa844 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 fb987486..7a962f59 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 4d2cc707..00000000 --- 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 9ccb4308..d87d405e 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 fafacb28..00000000 --- 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 40fb7cad..74fd38e0 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 85baaf1e..33c0d0ac 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 9f63d183..4868bc9f 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 dd83d4b3..33ea5301 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 c1d230ad..f60b02e1 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 edbea6a7..c7565b8e 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 fbb6e644..e1ad4c83 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 e9780b10..5d80fe8f 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 0c6dc937..c938728a 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 50bb9838..9eb63fbc 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 9864789d..ea572b7f 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 ba1773f5..c86620a5 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 030453fc..74d1e39d 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 fc7941bf..b650f16d 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 0fa7430c..fab2ca54 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 57d8d939..a18b4502 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 315f6122..8e8db2e2 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 8dc2bd2c..7c7b98f4 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 668411c5..092e8b08 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 b284da24..05693842 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 abca8531..bcadfd3f 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 c3e17279..a027612f 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 da1ce77a..4d9c05ce 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 4ae9fa6b..a0fa150d 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 78b2edcb..0e25dc0b 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 544ef1db..60c6c19d 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 37b6966d..402002ab 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 4adc6901..2508f58e 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 d50b3ba9..f13b3e85 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 43cfbe0e..d581b22e 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 d21014d1..a6866295 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 d91af398..af474afe 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 c5e324e6..780d8c66 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 f3ffc4f5..d80ef5c8 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 d3d1d239..f18cfe67 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 e969f218..4e516eae 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 068fe338..f1917aa4 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 0abd84c5..6fac78fa 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 cba9248d..c62ebf95 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 5075ecf8..859157be 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 66f37534..383eae7c 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 5b248e62..1af9aaa1 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 61a86470..e1e2c28a 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 b5f0ec28..70ca7309 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 14caa456..07e24e62 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 35b5d608..7edd9179 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 2a35079f..0686e7e0 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 6f7733d6..6f606dcc 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 0cbedf2b..f9a39b2f 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 1d46921b..699de5f1 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 bf91aa1f..032c810d 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 39388e53..376bac5a 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 5b89dfda..7606966e 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 d75eb818..27eeb5d5 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 a033d701..cdff757d 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 c8cdd173..8ef49455 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 f0abd23f..9c20c974 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 "replay.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 effc08b6..5549cd19 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 009b1354..663b3bda 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 a5dfae60..e2a7eba6 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 92805695..95217be4 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 2b08b8c0..d358b361 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 b91d9b5d..cf7f97d4 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 a1c6a75b..4757abf0 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 4bdcd4ad..e1be19e5 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 4d07b286..37a54f47 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 1e0161aa..23353354 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 620b7ab8..ac7a6a21 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 e38554b6..c88188e1 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 1a4301cb..530ee0b4 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 16f03509..1c89e40b 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 534ff844..b82dd585 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 8ae7580d..dc9acc7b 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 ff3abdfe..8c210178 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 d94f332c..99bc246a 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 0cc0a0a6..7a9ef7e1 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 4c4a1182..8d26f480 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 c7a2de7a..1958d8d0 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 a6625a3f..6d21c85e 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 dfd778ac..ebf443d5 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 bd2a4124..22947c0e 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 e447237f..70e84c8d 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 559a0270..d187d102 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 1ea70ac6..13a34cbb 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 fb6ba2f7..d6aab5e1 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 3224c176..1bbc6274 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 80054a66..d700e2e6 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 e0b326d7..48405828 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 51342c2b..87439a43 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 a209a9c4..3c3ed728 100644 --- a/src/rwops/rwops_zlib.c +++ b/src/rwops/rwops_zlib.c @@ -6,13 +6,15 @@ * Copyright (c) 2012-2024, Andrei Alexeyev . */ +#include "rwops_zlib.h" + +#include "log.h" +#include "rwops_util.h" +#include "util/miscmath.h" + #include #include -#include "rwops_zlib.h" -#include "rwops_util.h" -#include "util.h" - #define MIN_CHUNK_SIZE 1024 #define ZDATA(rw) ((ZData*)((rw)->hidden.unknown.data1)) diff --git a/src/rwops/rwops_zstd.c b/src/rwops/rwops_zstd.c index f15d4b77..1bce9a75 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 6946fd78..f826c61a 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 576da34e..57c08bf9 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 0ed4ab0c..48d14c53 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 09f0bea7..e3c55c2f 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 26c19e2b..d6b23ec1 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 e5dad73e..a4e503a5 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 6b5dfe6c..b6a56b42 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 00000000..08d21331 --- /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 55c6fefa..b0a4991d 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 5d3780f8..e518ae06 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 660f5c71..bf1357c9 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 d4b6c1f5..b3468956 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 d66c1a28..7d9e8c51 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 5ac03dd3..7a4f4207 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 dc7f9c4a..d83e2f0e 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 ddc0acc0..66c68017 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 fca3469e..690c1fad 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 f0a241ba..cd14c53e 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 2dcec0c1..03658cb3 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 be0ab530..b8205c7d 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 2f0ffcd9..3ef1a9bb 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 70875bc2..790af985 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 340682d6..2cffdc37 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 9ed9eb80..8680fcf8 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 ce69bcf8..bb755d02 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 f1ba8dd6..e46ebf04 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 f01e4203..ba2ccb0e 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 446e7d4d..da57969c 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 "background_anim.h" +#include "timeline.h" // IWYU pragma: keep -#include "global.h" -#include "stagetext.h" -#include "common_tasks.h" -#include "enemy_classes.h" +#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 "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 f63a3f9d..937f5948 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 39586eae..dd7f6020 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 8e0db898..9a4b00aa 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 f891530f..450f8a3d 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 8c64ec6a..9219ec0b 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 b9780093..a71f4c49 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 b5fc4045..8b8eff02 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 afc3f83c..d2f36e0b 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 8775a453..fc2280d3 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 fcd48bc6..00f817f3 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 a97f8b7a..590fb49f 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 cb508c95..f32da464 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 ee05145d..1f73cd26 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 8f8c52fb..0e8bad25 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 163374f9..83d65fe0 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 b4ace20d..2c5ef1a8 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 bd6c03d7..1eae4ac2 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 9ce35c9c..684b6bab 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 "hina.h" -#include "nonspells/nonspells.h" -#include "stage2.h" -#include "background_anim.h" +#include "timeline.h" // IWYU pragma: keep -#include "stage.h" -#include "global.h" -#include "common_tasks.h" -#include "enemy_classes.h" +#include "background_anim.h" +#include "hina.h" +#include "nonspells/nonspells.h" // IWYU pragma: keep +#include "stage2.h" +#include "wriggle.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 35b05ab9..bddccc5f 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 a50f1566..4c437b6a 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 51230e28..893347e8 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 04c934da..6a0cce70 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 c89d90a0..9f5e645c 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 ee3772ec..03e23dd4 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 037f61f3..0541a3ef 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 03a10906..9b7185c7 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 0885688a..abc039ae 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 9ebb87d7..66024ba2 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 d3e86b20..c8d1708c 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 2d298885..678c2c86 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 dff6efb9..ddb00862 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 d7c11283..b9813551 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 9dae222c..e468a931 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 49373725..ff612d21 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 ea59cc5b..1c70403e 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 ba9045ad..8e13bed5 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 8a305b0a..c02d2a34 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 92b84521..dcbdf81a 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 74f26199..ae168247 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 d61ac404..49d37188 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 bd78914d..e066e4d0 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 787d0fe3..c6e514a0 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 df67eac7..952d139f 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 994d730e..dc100bb7 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 0c2267c9..10ddee9d 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 8597caf7..149856a2 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 ca8ad1fe..998d6e97 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 1c9f2878..d18d85ea 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 dd79253d..58a17d78 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 91eaa4e0..2203b63b 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 cc3a6969..0f9a7bd5 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 a6737c4c..3b927716 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 "kurumi.h" -#include "portrait.h" -#include "stageutils.h" +#include "background_anim.h" +#include "draw.h" +#include "kurumi.h" +#include "spells/spells.h" +#include "timeline.h" // IWYU pragma: keep + #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 e3adef88..9088a1b9 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 "global.h" -#include "stage.h" -#include "enemy.h" -#include "enemy_classes.h" -#include "laser.h" -#include "common_tasks.h" +#include "background_anim.h" +#include "kurumi.h" +#include "nonspells/nonspells.h" +#include "stage4.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 7f63941c..88db580d 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 6ea33b3e..01f022d9 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 03be1c0e..59695111 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 d789e986..95582434 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 6fc2d9eb..8e966786 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 327a0e97..079a683c 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 a90ea638..c6a0482f 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 ffd85ae0..373f4fec 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 b8ebd926..a96cbbfa 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 c58e984a..b43a5483 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 c8e57c65..5daea542 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 6e83efd8..41a5d3eb 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 d3db7a51..83513ec1 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 dcf4b62e..bfd6a0c5 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 0ffdcd76..120a0b1f 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 9cce1255..fbcee548 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 dc3d864f..b6a58e57 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 4ba5b070..5b517abc 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 fe91a73e..c7e08ab4 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 4706fa4d..618382ab 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 cfeda9a3..88d65411 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 3d8ae886..0696cc9d 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 ac7f7cf4..bd984f33 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 271c5471..e25453aa 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 77d984c1..2f554602 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 f710b509..ddad5937 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 3ff7528d..b07c7f57 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 80d7c57f..92b8da4d 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 cb29c4e2..887503a8 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 07ae0351..b0721b87 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 d4024cfa..6c709163 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 "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 ebea5021..44649f27 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 c60efd73..65135582 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 7c36444c..6046a026 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 4bac2235..226d394f 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 58bc20b6..f8a3a861 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 f20ca2f6..8c85b471 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 08e10951..5e5bf067 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 d2eaaae5..8bbc394e 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 d70dad74..ff45c5cb 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 7caeb2eb..dfe84e5f 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 9ee213bc..c52d87d6 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 adf4a0e1..7e7ca5b1 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 c64c5987..d4446bb5 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 ee7aadd2..df27c028 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 bc6651d9..25ee4e82 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 9a2e93a5..3c940936 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 8c15e8be..2a700ebf 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 74a53d4f..178fc57e 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 df9287e9..f0c7ad0b 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 13dae08c..884d330c 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 62fd6320..581be7ee 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 f10039d4..394d4a5f 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 1b95c3a1..83988b65 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 8540be15..f541e276 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 ab8e30ae..d77d9899 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 cefd3131..58aaaa10 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 69fa4170..40a284fa 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 f690025e..39b9a471 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 8bc3620a..74e63b60 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 b17aee88..ebca5a12 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 a501ce48..d1a661e9 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 0b62a548..1acc2979 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 9f3451a2..e2017f6f 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 bbeb2fea..82f433af 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 9a5060dc..1a71ce2e 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 993bc3df..07508944 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 236c846e..43cd713c 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 6892a37b..aeeba5b8 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 6858cd5a..a55c4e5e 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 f139158c..f4bd0500 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 5427c50d..ae2ccc44 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 2f99ac57..845a8b60 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 4000f069..c1489a09 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 6d32ccf8..4c12ad0b 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 344cf3da..633eb602 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 d777d208..42efe27e 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 be077f03..f710bbf1 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 92048c67..028e57bc 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 df13244c..5ba5041a 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 c7b904b3..9ad7b772 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 693cb523..2861e1c5 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 7cc84d10..99ef1ee8 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 3a6f95d8..e7956ad5 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 5d439e8d..1055c477 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 d2d31a1b..40df0b11 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 f7929219..6f99854a 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 c45f6cf2..bf5e91b6 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 72ac9291..73879835 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 01d16172..78461183 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 894549c6..0cc2d81f 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 9daf175a..d5f3c70f 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 2b6bde60..7c8f2311 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 c3ac30ed..c4e5d760 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 9b5f3cad..d9465357 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 60c3ba0c..3b9c16d0 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 29710f3d..615fa48c 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;