diff --git a/src/action/actions.cpp b/src/action/actions.cpp index 74ed143557..c33705bea6 100644 --- a/src/action/actions.cpp +++ b/src/action/actions.cpp @@ -33,11 +33,6 @@ -- Includes ----------------------------------------------------------------------------*/ -#include - -#include "stratagus.h" -#include "version.h" - #include "actions.h" #include "action/action_attack.h" @@ -58,7 +53,6 @@ #include "action/action_train.h" #include "action/action_unload.h" #include "action/action_upgradeto.h" - #include "animation/animation_die.h" #include "commands.h" #include "game.h" @@ -71,19 +65,23 @@ #include "player.h" #include "script.h" #include "spells.h" +#include "stratagus.h" #include "unit.h" #include "unit_find.h" #include "unit_manager.h" #include "unittype.h" +#include "version.h" #ifdef USE_STACKTRACE -#include -#include -#include +# include +# include +# include #else -#include "st_backtrace.h" +# include "st_backtrace.h" #endif +#include + /*---------------------------------------------------------------------------- -- Variables ----------------------------------------------------------------------------*/ diff --git a/src/animation/animation_die.cpp b/src/animation/animation_die.cpp index 53e843ee74..dc6b34f2c3 100644 --- a/src/animation/animation_die.cpp +++ b/src/animation/animation_die.cpp @@ -33,13 +33,12 @@ -- Includes ----------------------------------------------------------------------------*/ -#include "stratagus.h" - #include "animation/animation_die.h" +#include "stratagus.h" #include "unit.h" -#include +#include void CAnimation_Die::Action(CUnit &unit, int & /*move*/, int /*scale*/) const /* override */ { diff --git a/src/animation/animation_setplayervar.cpp b/src/animation/animation_setplayervar.cpp index 97c240ce7d..5a5382afd5 100644 --- a/src/animation/animation_setplayervar.cpp +++ b/src/animation/animation_setplayervar.cpp @@ -33,15 +33,14 @@ -- Includes ----------------------------------------------------------------------------*/ -#include "stratagus.h" - #include "animation/animation_setplayervar.h" #include "animation.h" +#include "stratagus.h" #include "unit.h" +#include #include -#include /** ** Gets the player data. diff --git a/src/animation/animation_setvar.cpp b/src/animation/animation_setvar.cpp index d6340ad019..92a7da9d6a 100644 --- a/src/animation/animation_setvar.cpp +++ b/src/animation/animation_setvar.cpp @@ -33,16 +33,14 @@ -- Includes ----------------------------------------------------------------------------*/ -#include "stratagus.h" - #include "animation/animation_setvar.h" #include "actions.h" +#include "map.h" #include "unit.h" #include "unit_manager.h" -#include "map.h" -#include +#include #include void CAnimation_SetVar::Action(CUnit &unit, int & /*move*/, int /*scale*/) const /* override */ diff --git a/src/game/replay.cpp b/src/game/replay.cpp index 0a9921a2aa..32a4f993d1 100644 --- a/src/game/replay.cpp +++ b/src/game/replay.cpp @@ -32,8 +32,6 @@ // Includes //---------------------------------------------------------------------------- -#include "stratagus.h" - #include "replay.h" #include "actions.h" @@ -56,8 +54,8 @@ #include "unittype.h" #include "version.h" +#include #include -#include extern fs::path ExpandPath(const std::string &path); extern void StartMap(const std::string &filename, bool clean); diff --git a/src/game/savegame.cpp b/src/game/savegame.cpp index ec1ffa9947..db0bb0a741 100644 --- a/src/game/savegame.cpp +++ b/src/game/savegame.cpp @@ -54,7 +54,7 @@ #include "upgrade.h" #include "version.h" -#include +#include extern void StartMap(const std::string &filename, bool clean); diff --git a/src/include/interface.h b/src/include/interface.h index ac6cfa94b3..d2049c723e 100644 --- a/src/include/interface.h +++ b/src/include/interface.h @@ -39,8 +39,10 @@ #include "icons.h" #endif +#include "stratagus.h" #include "unitsound.h" #include "vec2i.h" + #include #include diff --git a/src/include/iolib.h b/src/include/iolib.h index 8b1e5bbe1e..16ca55fff1 100644 --- a/src/include/iolib.h +++ b/src/include/iolib.h @@ -37,6 +37,7 @@ ----------------------------------------------------------------------------*/ #include "filesystem.h" +#include "stratagus.h" #include #include diff --git a/src/include/luacallback.h b/src/include/luacallback.h index 4c8951cfbe..5ad80307be 100644 --- a/src/include/luacallback.h +++ b/src/include/luacallback.h @@ -30,6 +30,7 @@ #define LUA_CALLBACK_HEADER_FILE #include +#include #include #include #include diff --git a/src/include/sdl2_helper.h b/src/include/sdl2_helper.h index 0632e4e79a..ee8a3a0c76 100644 --- a/src/include/sdl2_helper.h +++ b/src/include/sdl2_helper.h @@ -29,6 +29,7 @@ #include #include +#include //@{ diff --git a/src/include/unitptr.h b/src/include/unitptr.h index 565309815f..f3bf836605 100644 --- a/src/include/unitptr.h +++ b/src/include/unitptr.h @@ -32,6 +32,8 @@ //@{ +#include + class CUnit; diff --git a/src/include/upgrade_structs.h b/src/include/upgrade_structs.h index 7a579b5087..020d0be34f 100644 --- a/src/include/upgrade_structs.h +++ b/src/include/upgrade_structs.h @@ -37,6 +37,9 @@ -- Includes ----------------------------------------------------------------------------*/ +#include "settings.h" + +#include #include #include diff --git a/src/include/util.h b/src/include/util.h index 2b0ea321ce..13f05e94da 100644 --- a/src/include/util.h +++ b/src/include/util.h @@ -82,7 +82,7 @@ extern uint32_t fletcher32(const std::string &content); -- Strings ----------------------------------------------------------------------------*/ -#include +#include #ifndef _TRUNCATE #define _TRUNCATE ((size_t)-1) diff --git a/src/map/fow.cpp b/src/map/fow.cpp index f1a9d769f2..8a809f9380 100644 --- a/src/map/fow.cpp +++ b/src/map/fow.cpp @@ -34,18 +34,17 @@ -- Includes ----------------------------------------------------------------------------*/ -#include -#include - -#include "stratagus.h" - #include "fow.h" + +#include "../video/intern_video.h" #include "map.h" #include "player.h" +#include "stratagus.h" #include "tile.h" #include "ui.h" #include "viewport.h" -#include "../video/intern_video.h" + +#include /*---------------------------------------------------------------------------- -- Defines diff --git a/src/map/fow_utils.cpp b/src/map/fow_utils.cpp index 01fe7b1665..3ddbf90813 100644 --- a/src/map/fow_utils.cpp +++ b/src/map/fow_utils.cpp @@ -33,12 +33,12 @@ -- Includes ----------------------------------------------------------------------------*/ -#include -#include +#include "fow_utils.h" #include "stratagus.h" -#include "fow_utils.h" +#include +#include /*---------------------------------------------------------------------------- -- Defines diff --git a/src/map/map_wall.cpp b/src/map/map_wall.cpp index 1ea7a4ebc3..f71ed14bb5 100644 --- a/src/map/map_wall.cpp +++ b/src/map/map_wall.cpp @@ -33,16 +33,16 @@ -- Includes ----------------------------------------------------------------------------*/ -#include - -#include "stratagus.h" -#include "map.h" #include "fov.h" +#include "map.h" +#include "player.h" +#include "stratagus.h" #include "tileset.h" #include "ui.h" -#include "player.h" #include "unittype.h" +#include + /*---------------------------------------------------------------------------- -- Functions ----------------------------------------------------------------------------*/ diff --git a/src/map/script_tileset.cpp b/src/map/script_tileset.cpp index 7eca3eb27c..4790a7997c 100644 --- a/src/map/script_tileset.cpp +++ b/src/map/script_tileset.cpp @@ -42,8 +42,8 @@ #include "video.h" #include +#include #include -#include #include /*---------------------------------------------------------------------------- diff --git a/src/map/tileset.cpp b/src/map/tileset.cpp index 32bd271af4..d6b4c166f8 100644 --- a/src/map/tileset.cpp +++ b/src/map/tileset.cpp @@ -185,7 +185,7 @@ #include "tileset.h" -#include +#include /*---------------------------------------------------------------------------- -- Variables diff --git a/src/missile/missile.cpp b/src/missile/missile.cpp index 4432a2509a..33a8cb7457 100644 --- a/src/missile/missile.cpp +++ b/src/missile/missile.cpp @@ -33,10 +33,6 @@ -- Includes ----------------------------------------------------------------------------*/ -#include - -#include "stratagus.h" - #include "missile.h" #include "action/action_spellcast.h" @@ -57,6 +53,8 @@ #include "unittype.h" #include "video.h" +#include + /*---------------------------------------------------------------------------- -- Declarations ----------------------------------------------------------------------------*/ diff --git a/src/missile/missile_parabolic.cpp b/src/missile/missile_parabolic.cpp index aac0b696e2..908e173d96 100644 --- a/src/missile/missile_parabolic.cpp +++ b/src/missile/missile_parabolic.cpp @@ -33,16 +33,14 @@ -- Includes ----------------------------------------------------------------------------*/ -#include - -#include "stratagus.h" - -#include "missile.h" - #include "luacallback.h" #include "map.h" +#include "missile.h" +#include "stratagus.h" #include "unit_find.h" +#include + /** ** Calculate parabolic trajectories. ** diff --git a/src/missile/missile_tracer.cpp b/src/missile/missile_tracer.cpp index 61a065eb0e..661b64b979 100644 --- a/src/missile/missile_tracer.cpp +++ b/src/missile/missile_tracer.cpp @@ -33,17 +33,14 @@ -- Includes ----------------------------------------------------------------------------*/ -#include - -#include "stratagus.h" - -#include "missile.h" - #include "luacallback.h" #include "map.h" +#include "missile.h" #include "unit.h" #include "unit_find.h" +#include + /** ** Handle tracer missile. ** diff --git a/src/network/net_lowlevel.cpp b/src/network/net_lowlevel.cpp index 750938382a..06a5936aac 100644 --- a/src/network/net_lowlevel.cpp +++ b/src/network/net_lowlevel.cpp @@ -37,9 +37,9 @@ #include "net_lowlevel.h" -#include +#include +#include #include -#include //---------------------------------------------------------------------------- // Declarations diff --git a/src/network/netsockets.cpp b/src/network/netsockets.cpp index 9f2ef37fb0..8566b1ec2e 100644 --- a/src/network/netsockets.cpp +++ b/src/network/netsockets.cpp @@ -38,7 +38,7 @@ #include "network/netsockets.h" #include "net_lowlevel.h" -#include +#include // // CHost diff --git a/src/network/network.cpp b/src/network/network.cpp index 0cbcd0a41f..98e5607a14 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -222,9 +222,6 @@ #include "online_service.h" #include "stratagus.h" -#include -#include - #include "network.h" #include "actions.h" @@ -244,7 +241,9 @@ #include "unittype.h" #include "video.h" +#include #include +#include //---------------------------------------------------------------------------- // Declaration diff --git a/src/particle/chunkparticle.cpp b/src/particle/chunkparticle.cpp index 6e13880490..045a183c8a 100644 --- a/src/particle/chunkparticle.cpp +++ b/src/particle/chunkparticle.cpp @@ -29,12 +29,11 @@ //@{ -#include - -#include "stratagus.h" #include "particle.h" +#include "stratagus.h" #include "video.h" +#include static const int gravity = 32 * 12; diff --git a/src/particle/radialparticle.cpp b/src/particle/radialparticle.cpp index f0c0628752..948991b020 100644 --- a/src/particle/radialparticle.cpp +++ b/src/particle/radialparticle.cpp @@ -29,10 +29,10 @@ //@{ -#include - -#include "stratagus.h" #include "particle.h" +#include "stratagus.h" + +#include CRadialParticle::CRadialParticle(CPosition position, GraphicAnimation *animation, int maxSpeed, int drawlevel) : CParticle(position, drawlevel) diff --git a/src/pathfinder/astar.cpp b/src/pathfinder/astar.cpp index 4c9f410d78..701caee3e0 100644 --- a/src/pathfinder/astar.cpp +++ b/src/pathfinder/astar.cpp @@ -60,7 +60,7 @@ # include "viewport.h" #endif -#include +#include /*---------------------------------------------------------------------------- -- Declarations diff --git a/src/stratagus/iolib.cpp b/src/stratagus/iolib.cpp index a4b4c54014..c3a04b3608 100644 --- a/src/stratagus/iolib.cpp +++ b/src/stratagus/iolib.cpp @@ -45,10 +45,10 @@ #include +#include +#include #include #include -#include -#include #ifdef USE_ZLIB #include diff --git a/src/stratagus/parameters.cpp b/src/stratagus/parameters.cpp index 267f493cf6..503e50a7da 100644 --- a/src/stratagus/parameters.cpp +++ b/src/stratagus/parameters.cpp @@ -34,7 +34,7 @@ #include "filesystem.h" #include "parameters.h" -#include +#include #ifdef USE_WIN32 #include diff --git a/src/stratagus/stratagus.cpp b/src/stratagus/stratagus.cpp index 6f3b78e23e..89a6ab2afc 100644 --- a/src/stratagus/stratagus.cpp +++ b/src/stratagus/stratagus.cpp @@ -164,7 +164,7 @@ #pragma comment(lib, "Imm32.lib") #endif -#include +#include #ifdef USE_BEOS #include @@ -221,8 +221,8 @@ extern void beos_init(int argc, char **argv); #include "st_backtrace.h" #endif -#include -#include +#include +#include #ifdef USE_WIN32 # include diff --git a/src/stratagus/util.cpp b/src/stratagus/util.cpp index 09f3a0fe8c..5b8dbebdf1 100644 --- a/src/stratagus/util.cpp +++ b/src/stratagus/util.cpp @@ -27,24 +27,18 @@ // 02111-1307, USA. // -#if __has_include() -#include // from_chars -#endif - -#include -#include +#include "util.h" #include "stratagus.h" -#include "util.h" - #include - -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #ifndef __APPLE__ #include #endif @@ -61,6 +55,10 @@ #include "st_backtrace.h" #endif +#if __has_include() +#include // from_chars +#endif + /*---------------------------------------------------------------------------- -- Random ----------------------------------------------------------------------------*/ @@ -342,7 +340,7 @@ int to_number(std::string_view s, int base) ** an 'argument required' error. */ -#include +#include int opterr = 1; int optind = 1; diff --git a/src/ui/botpanel.cpp b/src/ui/botpanel.cpp index 08e9e49fc9..44e44632f8 100644 --- a/src/ui/botpanel.cpp +++ b/src/ui/botpanel.cpp @@ -56,7 +56,7 @@ #include "upgrade.h" #include "video.h" -#include +#include #include #include #include diff --git a/src/ui/button_checks.cpp b/src/ui/button_checks.cpp index 3701a73581..ca8a7c4960 100644 --- a/src/ui/button_checks.cpp +++ b/src/ui/button_checks.cpp @@ -45,7 +45,8 @@ #include "unittype.h" #include "upgrade.h" -#include +#include + /*---------------------------------------------------------------------------- -- Functions ----------------------------------------------------------------------------*/ diff --git a/src/ui/mouse.cpp b/src/ui/mouse.cpp index b47cbe5937..3f7b4c86a5 100644 --- a/src/ui/mouse.cpp +++ b/src/ui/mouse.cpp @@ -36,12 +36,6 @@ -- Includes ----------------------------------------------------------------------------*/ -#include -#include - -#include "stratagus.h" -#include "ui.h" - #include "action/action_build.h" #include "action/action_train.h" #include "actions.h" @@ -57,7 +51,10 @@ #include "player.h" #include "sound.h" #include "spells.h" +#include "stratagus.h" +#include "tileset.h" #include "translate.h" +#include "ui.h" #include "unit.h" #include "unit_find.h" #include "unitsound.h" @@ -65,9 +62,9 @@ #include "video.h" #include "widgets.h" -#include "tileset.h" - +#include #include +#include /*---------------------------------------------------------------------------- -- Variables diff --git a/src/ui/ui.cpp b/src/ui/ui.cpp index f792caf948..902c109f85 100644 --- a/src/ui/ui.cpp +++ b/src/ui/ui.cpp @@ -49,7 +49,7 @@ #include "unit.h" #include "video.h" -#include +#include /*---------------------------------------------------------------------------- -- Variables diff --git a/src/unit/unit.cpp b/src/unit/unit.cpp index 950b9da2b8..4baccae999 100644 --- a/src/unit/unit.cpp +++ b/src/unit/unit.cpp @@ -66,8 +66,7 @@ #include "upgrade.h" #include "video.h" -#include - +#include /*---------------------------------------------------------------------------- -- Documentation diff --git a/src/unit/unit_find.cpp b/src/unit/unit_find.cpp index b67bed2aa5..7d32590f9a 100644 --- a/src/unit/unit_find.cpp +++ b/src/unit/unit_find.cpp @@ -33,10 +33,6 @@ -- Includes ----------------------------------------------------------------------------*/ -#include - -#include "stratagus.h" - #include "unit_find.h" #include "actions.h" @@ -50,6 +46,8 @@ #include "unit_manager.h" #include "unittype.h" +#include + /*---------------------------------------------------------------------------- -- Finding units ----------------------------------------------------------------------------*/ diff --git a/src/unit/unit_save.cpp b/src/unit/unit_save.cpp index ae0a09ff77..e4b82c698f 100644 --- a/src/unit/unit_save.cpp +++ b/src/unit/unit_save.cpp @@ -49,7 +49,7 @@ #include "spells.h" #include "unittype.h" -#include +#include /*---------------------------------------------------------------------------- -- Functions diff --git a/src/unit/unittype.cpp b/src/unit/unittype.cpp index 0b925c861a..94fdbac11e 100644 --- a/src/unit/unittype.cpp +++ b/src/unit/unittype.cpp @@ -33,8 +33,6 @@ -- Includes ----------------------------------------------------------------------------*/ -#include "stratagus.h" - #include "unittype.h" #include "animation.h" @@ -56,11 +54,10 @@ #include "util.h" #include "video.h" +#include #include -#include - -#include #include +#include /*---------------------------------------------------------------------------- -- Documentation diff --git a/src/video/movie.cpp b/src/video/movie.cpp index e1080c159e..ec5e6e5eef 100644 --- a/src/video/movie.cpp +++ b/src/video/movie.cpp @@ -509,12 +509,12 @@ SDL_Surface *Movie::getSurface() const /* override */ #else -#include -#include -#include - #include "stratagus.h" +#include +#include +#include + /** ** Play a video file. ** diff --git a/src/video/renderer.h b/src/video/renderer.h index 1a2f47d794..052b93598c 100644 --- a/src/video/renderer.h +++ b/src/video/renderer.h @@ -1,7 +1,8 @@ #ifndef __RENDERER_H__ #define __RENDERER_H__ -#include +#include +#include struct CPrimitives { virtual void DrawPixel(Uint32 color, int x, int y) = 0; diff --git a/src/win32/SetupConsole_win32.cpp b/src/win32/SetupConsole_win32.cpp index 66e5c8b78d..3bda7c6458 100644 --- a/src/win32/SetupConsole_win32.cpp +++ b/src/win32/SetupConsole_win32.cpp @@ -16,18 +16,23 @@ */ +#include "SetupConsole_win32.h" + #include -#include +#include +#include #include -#include #include #ifdef __cplusplus -#include +# include +# include +# include +#else +# include +# include #endif -#include "SetupConsole_win32.h" - /* * Microsoft systems were and always are one big mess where even standard output does not work :-( * There are at least 4 different I/O API levels and each WINAPI function initilize correctly just one... diff --git a/tests/network/test_net_lowlevel.cpp b/tests/network/test_net_lowlevel.cpp index 16bd34092b..d286d1cd83 100644 --- a/tests/network/test_net_lowlevel.cpp +++ b/tests/network/test_net_lowlevel.cpp @@ -31,7 +31,8 @@ #include "stratagus.h" #include "net_lowlevel.h" -#include + +#include #include class AutoNetwork