diff --git a/src/actions.cc b/src/actions.cc index 7a88bbc..1ca3f52 100644 --- a/src/actions.cc +++ b/src/actions.cc @@ -1,5 +1,8 @@ #include "actions.h" +#include +#include + #include "animation.h" #include "art.h" #include "color.h" @@ -32,9 +35,6 @@ #include "tile.h" #include "trait.h" -#include -#include - #define MAX_KNOCKDOWN_DISTANCE 20 typedef enum ScienceRepairTargetType { diff --git a/src/animation.cc b/src/animation.cc index 426ad43..5af3bb0 100644 --- a/src/animation.cc +++ b/src/animation.cc @@ -1,5 +1,8 @@ #include "animation.h" +#include +#include + #include "art.h" #include "color.h" #include "combat.h" @@ -28,9 +31,6 @@ #include "tile.h" #include "trait.h" -#include -#include - #define ANIMATION_SEQUENCE_LIST_CAPACITY 32 #define ANIMATION_DESCRIPTION_LIST_CAPACITY 55 #define ANIMATION_SAD_LIST_CAPACITY 24 diff --git a/src/art.cc b/src/art.cc index b81422b..2920bd7 100644 --- a/src/art.cc +++ b/src/art.cc @@ -1,5 +1,9 @@ #include "art.h" +#include +#include +#include + #include "animation.h" #include "debug.h" #include "draw.h" @@ -10,10 +14,6 @@ #include "proto.h" #include "sfall_config.h" -#include -#include -#include - typedef struct ArtListDescription { int flags; char name[16]; diff --git a/src/audio.cc b/src/audio.cc index 596e3fc..6b008d1 100644 --- a/src/audio.cc +++ b/src/audio.cc @@ -1,15 +1,15 @@ #include "audio.h" +#include +#include +#include + #include "db.h" #include "debug.h" #include "memory_manager.h" #include "pointer_registry.h" #include "sound.h" -#include -#include -#include - static bool _defaultCompressionFunc(char* filePath); static int audioSoundDecoderReadHandler(int fileHandle, void* buf, unsigned int size); diff --git a/src/audio_file.cc b/src/audio_file.cc index 044c8ce..04f3488 100644 --- a/src/audio_file.cc +++ b/src/audio_file.cc @@ -1,15 +1,15 @@ #include "audio_file.h" +#include +#include +#include + #include "debug.h" #include "memory_manager.h" #include "platform_compat.h" #include "pointer_registry.h" #include "sound.h" -#include -#include -#include - static bool _defaultCompressionFunc__(char* filePath); static int audioFileSoundDecoderReadHandler(int fileHandle, void* buffer, unsigned int size); diff --git a/src/automap.cc b/src/automap.cc index 0a2313c..bbe5178 100644 --- a/src/automap.cc +++ b/src/automap.cc @@ -1,5 +1,10 @@ #include "automap.h" +#include +#include + +#include + #include "art.h" #include "color.h" #include "config.h" @@ -20,11 +25,6 @@ #include "text_font.h" #include "window_manager.h" -#include -#include - -#include - #define AUTOMAP_OFFSET_COUNT (AUTOMAP_MAP_COUNT * ELEVATION_COUNT) #define AUTOMAP_WINDOW_WIDTH (519) diff --git a/src/cache.cc b/src/cache.cc index 959e624..c550810 100644 --- a/src/cache.cc +++ b/src/cache.cc @@ -1,14 +1,14 @@ #include "cache.h" -#include "debug.h" -#include "memory.h" -#include "sound.h" - #include #include #include #include +#include "debug.h" +#include "memory.h" +#include "sound.h" + // The initial number of cache entries in new cache. #define CACHE_ENTRIES_INITIAL_CAPACITY (100) diff --git a/src/character_editor.cc b/src/character_editor.cc index c56e33c..25e72b6 100644 --- a/src/character_editor.cc +++ b/src/character_editor.cc @@ -1,5 +1,12 @@ #include "character_editor.h" +#include +#include +#include +#include + +#include + #include "art.h" #include "color.h" #include "combat.h" @@ -35,13 +42,6 @@ #include "word_wrap.h" #include "worldmap.h" -#include -#include -#include -#include - -#include - #define RENDER_ALL_STATS 7 #define EDITOR_WINDOW_WIDTH 640 diff --git a/src/character_selector.cc b/src/character_selector.cc index 8628b8f..8efc783 100644 --- a/src/character_selector.cc +++ b/src/character_selector.cc @@ -1,5 +1,11 @@ #include "character_selector.h" +#include +#include + +#include +#include + #include "art.h" #include "character_editor.h" #include "color.h" @@ -25,12 +31,6 @@ #include "trait.h" #include "window_manager.h" -#include -#include - -#include -#include - #define CS_WINDOW_WIDTH (640) #define CS_WINDOW_HEIGHT (480) diff --git a/src/color.cc b/src/color.cc index 614cee1..b09351d 100644 --- a/src/color.cc +++ b/src/color.cc @@ -1,12 +1,12 @@ #include "color.h" -#include "core.h" - #include #include #include +#include "core.h" + #define COLOR_PALETTE_STACK_CAPACITY 16 typedef struct ColorPaletteStackEntry { diff --git a/src/combat.cc b/src/combat.cc index 8de1521..336aef6 100644 --- a/src/combat.cc +++ b/src/combat.cc @@ -1,5 +1,9 @@ #include "combat.h" +#include +#include +#include + #include "actions.h" #include "animation.h" #include "art.h" @@ -39,10 +43,6 @@ #include "trait.h" #include "window_manager.h" -#include -#include -#include - #define CALLED_SHOT_WINDOW_Y (20) #define CALLED_SHOT_WINDOW_WIDTH (504) #define CALLED_SHOT_WINDOW_HEIGHT (309) diff --git a/src/combat_ai.cc b/src/combat_ai.cc index ab6892a..86d9d12 100644 --- a/src/combat_ai.cc +++ b/src/combat_ai.cc @@ -1,5 +1,9 @@ #include "combat_ai.h" +#include +#include +#include + #include "actions.h" #include "animation.h" #include "art.h" @@ -30,10 +34,6 @@ #include "text_object.h" #include "tile.h" -#include -#include -#include - #define AI_PACKET_CHEM_PRIMARY_DESIRE_COUNT (3) typedef struct AiMessageRange { diff --git a/src/config.cc b/src/config.cc index 96b23a7..2c8ff67 100644 --- a/src/config.cc +++ b/src/config.cc @@ -1,9 +1,5 @@ #include "config.h" -#include "db.h" -#include "memory.h" -#include "platform_compat.h" - #include #include #include @@ -11,6 +7,10 @@ #include #include +#include "db.h" +#include "memory.h" +#include "platform_compat.h" + #define CONFIG_FILE_MAX_LINE_LENGTH (256) // The initial number of sections (or key-value) pairs in the config. diff --git a/src/core.cc b/src/core.cc index cc5990e..14849bb 100644 --- a/src/core.cc +++ b/src/core.cc @@ -1,5 +1,10 @@ #include "core.h" +#include +#include + +#include + #include "audio_engine.h" #include "color.h" #include "config.h" @@ -13,10 +18,6 @@ #include "window_manager.h" #include "window_manager_private.h" -#include -#include -#include - static void idleImpl(); // 0x51E234 diff --git a/src/core.h b/src/core.h index 9210f52..80bd68d 100644 --- a/src/core.h +++ b/src/core.h @@ -1,13 +1,13 @@ #ifndef CORE_H #define CORE_H +#include + #include "db.h" #include "dinput.h" #include "geometry.h" #include "window.h" -#include - #define MOUSE_DEFAULT_CURSOR_WIDTH 8 #define MOUSE_DEFAULT_CURSOR_HEIGHT 8 #define MOUSE_DEFAULT_CURSOR_SIZE (MOUSE_DEFAULT_CURSOR_WIDTH * MOUSE_DEFAULT_CURSOR_HEIGHT) diff --git a/src/credits.cc b/src/credits.cc index ef40abe..3b6e8eb 100644 --- a/src/credits.cc +++ b/src/credits.cc @@ -1,5 +1,7 @@ #include "credits.h" +#include + #include "art.h" #include "color.h" #include "core.h" @@ -16,8 +18,6 @@ #include "text_font.h" #include "window_manager.h" -#include - #define CREDITS_WINDOW_WIDTH (640) #define CREDITS_WINDOW_HEIGHT (480) #define CREDITS_WINDOW_SCROLLING_DELAY (38) diff --git a/src/critter.cc b/src/critter.cc index 48ff332..c78e223 100644 --- a/src/critter.cc +++ b/src/critter.cc @@ -1,5 +1,8 @@ #include "critter.h" +#include +#include + #include "animation.h" #include "art.h" #include "character_editor.h" @@ -28,9 +31,6 @@ #include "trait.h" #include "worldmap.h" -#include -#include - // Maximum length of dude's name length. #define DUDE_NAME_MAX_LENGTH (32) diff --git a/src/db.cc b/src/db.cc index 696ff0d..b667ec1 100644 --- a/src/db.cc +++ b/src/db.cc @@ -1,12 +1,12 @@ #include "db.h" -#include "platform_compat.h" -#include "xfile.h" - #include #include #include +#include "platform_compat.h" +#include "xfile.h" + typedef struct FileList { XList xlist; struct FileList* next; diff --git a/src/db.h b/src/db.h index 986feb2..dd0305d 100644 --- a/src/db.h +++ b/src/db.h @@ -1,11 +1,11 @@ #ifndef DB_H #define DB_H +#include + #include "memory_defs.h" #include "xfile.h" -#include - typedef XFile File; typedef void FileReadProgressHandler(); typedef char* StrdupProc(const char* string); diff --git a/src/dbox.cc b/src/dbox.cc index 9e2abca..ac4b8bf 100644 --- a/src/dbox.cc +++ b/src/dbox.cc @@ -1,5 +1,10 @@ #include "dbox.h" +#include +#include + +#include + #include "art.h" #include "character_editor.h" #include "color.h" @@ -14,11 +19,6 @@ #include "window_manager.h" #include "word_wrap.h" -#include -#include - -#include - #define FILE_DIALOG_LINE_COUNT 12 #define FILE_DIALOG_DOUBLE_CLICK_DELAY 32 diff --git a/src/debug.cc b/src/debug.cc index e6b5aa6..8ffebae 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -1,9 +1,5 @@ #include "debug.h" -#include "memory.h" -#include "platform_compat.h" -#include "window_manager_private.h" - #include #include #include @@ -14,6 +10,10 @@ #include #endif +#include "memory.h" +#include "platform_compat.h" +#include "window_manager_private.h" + static int _debug_puts(char* string); static void _debug_clear(); static int _debug_mono(char* string); diff --git a/src/dfile.cc b/src/dfile.cc index 39024b6..74da663 100644 --- a/src/dfile.cc +++ b/src/dfile.cc @@ -1,14 +1,14 @@ #include "dfile.h" -#include "platform_compat.h" - -#include - #include #include #include #include +#include + +#include "platform_compat.h" + // The size of decompression buffer for reading compressed [DFile]s. #define DFILE_DECOMPRESSION_BUFFER_SIZE (0x400) diff --git a/src/dfile.h b/src/dfile.h index 11244ff..fe652c4 100644 --- a/src/dfile.h +++ b/src/dfile.h @@ -1,11 +1,12 @@ #ifndef DFILE_H #define DFILE_H -#include "platform_compat.h" - #include + #include +#include "platform_compat.h" + typedef struct DBase DBase; typedef struct DBaseEntry DBaseEntry; typedef struct DFile DFile; diff --git a/src/dialog.cc b/src/dialog.cc index 85a5eff..3d7d548 100644 --- a/src/dialog.cc +++ b/src/dialog.cc @@ -1,5 +1,7 @@ #include "dialog.h" +#include + #include "core.h" #include "memory_manager.h" #include "movie.h" @@ -7,8 +9,6 @@ #include "text_font.h" #include "window_manager.h" -#include - // 0x501623 const float flt_501623 = 31.0; diff --git a/src/dictionary.cc b/src/dictionary.cc index 4801289..599d5a1 100644 --- a/src/dictionary.cc +++ b/src/dictionary.cc @@ -1,11 +1,11 @@ #include "dictionary.h" -#include "platform_compat.h" - #include #include #include +#include "platform_compat.h" + // NOTE: I guess this marker is used as a type discriminator for implementing // nested dictionaries. That's why every dictionary-related function starts // with a check for this value. diff --git a/src/dictionary.h b/src/dictionary.h index 5e093d4..4cbdb93 100644 --- a/src/dictionary.h +++ b/src/dictionary.h @@ -1,10 +1,10 @@ #ifndef DICTIONARY_H #define DICTIONARY_H -#include "memory_defs.h" - #include +#include "memory_defs.h" + typedef int(DictionaryReadProc)(FILE* stream, void* buffer, unsigned int size, int a4); typedef int(DictionaryWriteProc)(FILE* stream, void* buffer, unsigned int size, int a4); diff --git a/src/display_monitor.cc b/src/display_monitor.cc index fcac2c0..57fd585 100644 --- a/src/display_monitor.cc +++ b/src/display_monitor.cc @@ -1,5 +1,9 @@ #include "display_monitor.h" +#include + +#include + #include "art.h" #include "color.h" #include "combat.h" @@ -14,10 +18,6 @@ #include "text_font.h" #include "window_manager.h" -#include - -#include - // The maximum number of lines display monitor can hold. Once this value // is reached earlier messages are thrown away. #define DISPLAY_MONITOR_LINES_CAPACITY (100) diff --git a/src/draw.cc b/src/draw.cc index fb856d8..32b52ef 100644 --- a/src/draw.cc +++ b/src/draw.cc @@ -1,11 +1,11 @@ #include "draw.h" +#include + #include "color.h" #include "core.h" #include "mmx.h" -#include - // 0x4D2FC0 void bufferDrawLine(unsigned char* buf, int pitch, int x1, int y1, int x2, int y2, int color) { diff --git a/src/electronic_registration.cc b/src/electronic_registration.cc index fa8c926..2eb0b34 100644 --- a/src/electronic_registration.cc +++ b/src/electronic_registration.cc @@ -1,13 +1,13 @@ #include "electronic_registration.h" -#include "game_config.h" -#include "platform_compat.h" - #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #include #endif +#include "game_config.h" +#include "platform_compat.h" + // 0x440DD0 void runElectronicRegistration() { diff --git a/src/elevator.cc b/src/elevator.cc index 770f772..df47652 100644 --- a/src/elevator.cc +++ b/src/elevator.cc @@ -1,5 +1,10 @@ #include "elevator.h" +#include +#include + +#include + #include "art.h" #include "core.h" #include "cycle.h" @@ -15,11 +20,6 @@ #include "sfall_config.h" #include "window_manager.h" -#include -#include - -#include - // The maximum number of elevator levels. #define ELEVATOR_LEVEL_MAX (4) diff --git a/src/endgame.cc b/src/endgame.cc index 8b6961a..475ca34 100644 --- a/src/endgame.cc +++ b/src/endgame.cc @@ -1,5 +1,11 @@ #include "endgame.h" +#include +#include +#include +#include +#include + #include "art.h" #include "color.h" #include "core.h" @@ -27,12 +33,6 @@ #include "word_wrap.h" #include "worldmap.h" -#include -#include -#include -#include -#include - // The maximum number of subtitle lines per slide. #define ENDGAME_ENDING_MAX_SUBTITLES (50) diff --git a/src/export.cc b/src/export.cc index 4a12c7a..bc345c4 100644 --- a/src/export.cc +++ b/src/export.cc @@ -1,12 +1,12 @@ #include "export.h" +#include +#include + #include "interpreter_lib.h" #include "memory_manager.h" #include "platform_compat.h" -#include -#include - typedef struct ExternalVariable { char name[32]; char* programName; diff --git a/src/file_find.cc b/src/file_find.cc index 8ac3497..85e7bf3 100644 --- a/src/file_find.cc +++ b/src/file_find.cc @@ -1,10 +1,10 @@ #include "file_find.h" -#include - #include #include +#include + // 0x4E6380 bool fileFindFirst(const char* path, DirectoryFileFindData* findData) { diff --git a/src/file_find.h b/src/file_find.h index be58bba..0205757 100644 --- a/src/file_find.h +++ b/src/file_find.h @@ -1,8 +1,6 @@ #ifndef FILE_FIND_H #define FILE_FIND_H -#include "platform_compat.h" - #if defined(_WIN32) #define WIN32_LEAN_AND_MEAN #define NOMINMAX @@ -11,6 +9,8 @@ #include #endif +#include "platform_compat.h" + // NOTE: This structure is significantly different from what was in the // original code. Watcom provides opendir/readdir/closedir implementations, // that use Win32 FindFirstFile/FindNextFile under the hood, which in turn diff --git a/src/file_utils.cc b/src/file_utils.cc index dc25dba..c121535 100644 --- a/src/file_utils.cc +++ b/src/file_utils.cc @@ -2,7 +2,6 @@ // of regular __usercall. #include "file_utils.h" -#include "platform_compat.h" #include #include @@ -10,6 +9,8 @@ #include +#include "platform_compat.h" + static void fileCopy(const char* existingFilePath, const char* newFilePath); // 0x452740 diff --git a/src/font_manager.cc b/src/font_manager.cc index 76ca905..c9cfa8b 100644 --- a/src/font_manager.cc +++ b/src/font_manager.cc @@ -1,12 +1,12 @@ #include "font_manager.h" +#include +#include + #include "color.h" #include "db.h" #include "memory_manager.h" -#include -#include - // The maximum number of interface fonts. #define INTERFACE_FONT_MAX (16) diff --git a/src/game.cc b/src/game.cc index 422ee2d..c0f1870 100644 --- a/src/game.cc +++ b/src/game.cc @@ -1,5 +1,14 @@ #include "game.h" +#include +#include + +#ifdef _WIN32 +#include +#else +#include // access +#endif + #include "actions.h" #include "animation.h" #include "art.h" @@ -57,15 +66,6 @@ #include "window_manager.h" #include "worldmap.h" -#ifdef _WIN32 -#include -#else -#include // access -#endif - -#include -#include - #define HELP_SCREEN_WIDTH (640) #define HELP_SCREEN_HEIGHT (480) diff --git a/src/game_config.cc b/src/game_config.cc index b671b4e..5403fff 100644 --- a/src/game_config.cc +++ b/src/game_config.cc @@ -1,11 +1,11 @@ #include "game_config.h" -#include "main.h" -#include "platform_compat.h" - #include #include +#include "main.h" +#include "platform_compat.h" + // A flag indicating if [gGameConfig] was initialized. // // 0x5186D0 diff --git a/src/game_dialog.cc b/src/game_dialog.cc index c6d7333..88562d2 100644 --- a/src/game_dialog.cc +++ b/src/game_dialog.cc @@ -1,5 +1,9 @@ #include "game_dialog.h" +#include +#include +#include + #include "actions.h" #include "animation.h" #include "art.h" @@ -34,10 +38,6 @@ #include "tile.h" #include "window_manager.h" -#include -#include -#include - #define DIALOG_REVIEW_ENTRIES_CAPACITY 80 #define DIALOG_OPTION_ENTRIES_CAPACITY 30 diff --git a/src/game_mouse.cc b/src/game_mouse.cc index c95e953..001f774 100644 --- a/src/game_mouse.cc +++ b/src/game_mouse.cc @@ -1,5 +1,9 @@ #include "game_mouse.h" +#include +#include +#include + #include "actions.h" #include "animation.h" #include "art.h" @@ -23,10 +27,6 @@ #include "tile.h" #include "window_manager.h" -#include -#include -#include - typedef enum ScrollableDirections { SCROLLABLE_W = 0x01, SCROLLABLE_E = 0x02, diff --git a/src/game_movie.cc b/src/game_movie.cc index a2ea826..31dc904 100644 --- a/src/game_movie.cc +++ b/src/game_movie.cc @@ -1,5 +1,8 @@ #include "game_movie.h" +#include +#include + #include "color.h" #include "core.h" #include "cycle.h" @@ -15,9 +18,6 @@ #include "text_font.h" #include "window_manager.h" -#include -#include - #define GAME_MOVIE_WINDOW_WIDTH 640 #define GAME_MOVIE_WINDOW_HEIGHT 480 diff --git a/src/game_sound.cc b/src/game_sound.cc index 43e2315..8a499ad 100644 --- a/src/game_sound.cc +++ b/src/game_sound.cc @@ -1,5 +1,8 @@ #include "game_sound.h" +#include +#include + #include "animation.h" #include "art.h" #include "audio.h" @@ -21,9 +24,6 @@ #include "window_manager.h" #include "worldmap.h" -#include -#include - typedef enum SoundEffectActionType { SOUND_EFFECT_ACTION_TYPE_ACTIVE, SOUND_EFFECT_ACTION_TYPE_PASSIVE, diff --git a/src/geometry.cc b/src/geometry.cc index 52d8053..22d6c92 100644 --- a/src/geometry.cc +++ b/src/geometry.cc @@ -1,9 +1,10 @@ #include "geometry.h" -#include "memory.h" +#include #include -#include + +#include "memory.h" // 0x51DEF4 static RectListNode* _rectList = NULL; diff --git a/src/graph_lib.cc b/src/graph_lib.cc index 5ef0deb..e9f58cc 100644 --- a/src/graph_lib.cc +++ b/src/graph_lib.cc @@ -1,10 +1,10 @@ #include "graph_lib.h" +#include + #include "debug.h" #include "memory.h" -#include - static void _InitTree(); static void _InsertNode(int a1); static void _DeleteNode(int a1); diff --git a/src/grayscale.cc b/src/grayscale.cc index 93fc682..5c52f6a 100644 --- a/src/grayscale.cc +++ b/src/grayscale.cc @@ -1,9 +1,9 @@ #include "grayscale.h" -#include "color.h" - #include +#include "color.h" + // 0x596D90 static unsigned char _GreyTable[256]; diff --git a/src/heap.cc b/src/heap.cc index 890ea5a..7831b2c 100644 --- a/src/heap.cc +++ b/src/heap.cc @@ -1,12 +1,12 @@ #include "heap.h" -#include "debug.h" -#include "memory.h" - #include #include #include +#include "debug.h" +#include "memory.h" + #define HEAP_BLOCK_HEADER_GUARD (0xDEADC0DE) #define HEAP_BLOCK_FOOTER_GUARD (0xACDCACDC) diff --git a/src/interface.cc b/src/interface.cc index 04a7e77..58a0bfa 100644 --- a/src/interface.cc +++ b/src/interface.cc @@ -1,5 +1,8 @@ #include "interface.h" +#include +#include + #include "animation.h" #include "art.h" #include "color.h" @@ -30,9 +33,6 @@ #include "tile.h" #include "window_manager.h" -#include -#include - // The width of connectors in the indicator box. // // There are male connectors on the left, and female connectors on the right. diff --git a/src/interpreter.cc b/src/interpreter.cc index ef2a7a8..1b5ab9a 100644 --- a/src/interpreter.cc +++ b/src/interpreter.cc @@ -1,5 +1,12 @@ #include "interpreter.h" +#include +#include +#include +#include +#include +#include + #include "core.h" #include "db.h" #include "debug.h" @@ -8,13 +15,6 @@ #include "memory_manager.h" #include "platform_compat.h" -#include -#include -#include -#include -#include -#include - typedef struct ProgramListNode { Program* program; struct ProgramListNode* next; // next diff --git a/src/interpreter_extra.cc b/src/interpreter_extra.cc index 9cae6c1..c23bcd7 100644 --- a/src/interpreter_extra.cc +++ b/src/interpreter_extra.cc @@ -1,5 +1,9 @@ #include "interpreter_extra.h" +#include +#include +#include + #include "actions.h" #include "animation.h" #include "art.h" @@ -40,10 +44,6 @@ #include "trait.h" #include "worldmap.h" -#include -#include -#include - typedef enum ScriptError { SCRIPT_ERROR_NOT_IMPLEMENTED, SCRIPT_ERROR_OBJECT_IS_NULL, diff --git a/src/inventory.cc b/src/inventory.cc index f002a9b..61d2a4a 100644 --- a/src/inventory.cc +++ b/src/inventory.cc @@ -1,5 +1,11 @@ #include "inventory.h" +#include +#include +#include + +#include + #include "actions.h" #include "animation.h" #include "art.h" @@ -37,12 +43,6 @@ #include "tile.h" #include "window_manager.h" -#include -#include -#include - -#include - #define INVENTORY_WINDOW_X 80 #define INVENTORY_WINDOW_Y 0 diff --git a/src/item.cc b/src/item.cc index 0553bab..c4bbf19 100644 --- a/src/item.cc +++ b/src/item.cc @@ -1,5 +1,10 @@ #include "item.h" +#include + +#include +#include + #include "animation.h" #include "art.h" #include "automap.h" @@ -28,11 +33,6 @@ #include "tile.h" #include "trait.h" -#include - -#include -#include - #define ADDICTION_COUNT (9) // Max number of books that can be loaded from books.ini. This limit is imposed diff --git a/src/light.cc b/src/light.cc index df65b69..844b5a1 100644 --- a/src/light.cc +++ b/src/light.cc @@ -1,12 +1,12 @@ #include "light.h" +#include + #include "map_defs.h" #include "object.h" #include "perk.h" #include "tile.h" -#include - // 20% of max light per "Night Vision" rank #define LIGHT_LEVEL_NIGHT_VISION_BONUS (65536 / 5) diff --git a/src/lips.cc b/src/lips.cc index aea21f5..de2e9b7 100644 --- a/src/lips.cc +++ b/src/lips.cc @@ -1,5 +1,8 @@ #include "lips.h" +#include +#include + #include "audio.h" #include "core.h" #include "db.h" @@ -9,9 +12,6 @@ #include "platform_compat.h" #include "sound.h" -#include -#include - static char* _lips_fix_string(const char* fileName, size_t length); static int lipsReadV1(LipsData* a1, File* stream); static int _lips_make_speech(); diff --git a/src/lips.h b/src/lips.h index 0773cc7..f2a2f0d 100644 --- a/src/lips.h +++ b/src/lips.h @@ -1,10 +1,10 @@ #ifndef LIPS_H #define LIPS_H -#include "sound.h" - #include +#include "sound.h" + #define PHONEME_COUNT (42) typedef enum LipsFlags { diff --git a/src/loadsave.cc b/src/loadsave.cc index 64bcb72..fa947db 100644 --- a/src/loadsave.cc +++ b/src/loadsave.cc @@ -1,5 +1,12 @@ #include "loadsave.h" +#include +#include +#include +#include + +#include + #include "art.h" #include "automap.h" #include "character_editor.h" @@ -46,13 +53,6 @@ #include "word_wrap.h" #include "worldmap.h" -#include -#include -#include -#include - -#include - #define LS_WINDOW_WIDTH 640 #define LS_WINDOW_HEIGHT 480 diff --git a/src/main.cc b/src/main.cc index f841448..c2ec317 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,5 +1,9 @@ #include "main.h" +#include +#include +#include + #include "art.h" #include "autorun.h" #include "character_selector.h" @@ -36,10 +40,6 @@ #include "word_wrap.h" #include "worldmap.h" -#include -#include -#include - #define MAIN_MENU_WINDOW_WIDTH 640 #define MAIN_MENU_WINDOW_HEIGHT 480 diff --git a/src/map.cc b/src/map.cc index aa404c7..71f0cb4 100644 --- a/src/map.cc +++ b/src/map.cc @@ -1,5 +1,8 @@ #include "map.h" +#include +#include + #include "animation.h" #include "art.h" #include "automap.h" @@ -37,9 +40,6 @@ #include "window_manager_private.h" #include "worldmap.h" -#include -#include - static char* mapBuildPath(char* name); static int mapLoad(File* stream); static int _map_age_dead_critters(); diff --git a/src/memory.cc b/src/memory.cc index b91ffd0..0ca4ccf 100644 --- a/src/memory.cc +++ b/src/memory.cc @@ -1,11 +1,11 @@ #include "memory.h" -#include "debug.h" - #include #include #include +#include "debug.h" + // A special value that denotes a beginning of a memory block data. #define MEMORY_BLOCK_HEADER_GUARD (0xFEEDFACE) diff --git a/src/message.cc b/src/message.cc index dadfd8a..ddd7725 100644 --- a/src/message.cc +++ b/src/message.cc @@ -1,5 +1,10 @@ #include "message.h" +#include +#include +#include +#include + #include "debug.h" #include "game_config.h" #include "memory.h" @@ -8,11 +13,6 @@ #include "random.h" #include "sfall_config.h" -#include -#include -#include -#include - #define BADWORD_LENGTH_MAX 80 static bool _message_find(MessageList* msg, int num, int* out_index); diff --git a/src/mmx.cc b/src/mmx.cc index fdf467c..ce328ac 100644 --- a/src/mmx.cc +++ b/src/mmx.cc @@ -1,9 +1,9 @@ #include "mmx.h" -#include "core.h" - #include +#include "core.h" + // Return `true` if CPU supports MMX. // // 0x4E08A0 diff --git a/src/mouse_manager.cc b/src/mouse_manager.cc index 1586e5b..472f250 100644 --- a/src/mouse_manager.cc +++ b/src/mouse_manager.cc @@ -1,5 +1,7 @@ #include "mouse_manager.h" +#include + #include "core.h" #include "datafile.h" #include "db.h" @@ -7,8 +9,6 @@ #include "memory_manager.h" #include "platform_compat.h" -#include - // 0x5195A8 MouseManagerNameMangler* gMouseManagerNameMangler = mouseManagerNameManglerDefaultImpl; diff --git a/src/movie.cc b/src/movie.cc index af153c2..4676e72 100644 --- a/src/movie.cc +++ b/src/movie.cc @@ -1,5 +1,9 @@ #include "movie.h" +#include + +#include + #include "color.h" #include "core.h" #include "db.h" @@ -17,10 +21,6 @@ #include "window.h" #include "window_manager.h" -#include - -#include - typedef struct MovieSubtitleListNode { int num; char* text; diff --git a/src/movie_effect.cc b/src/movie_effect.cc index 9b783a7..799f3ef 100644 --- a/src/movie_effect.cc +++ b/src/movie_effect.cc @@ -1,5 +1,9 @@ #include "movie_effect.h" +#include +#include +#include + #include "config.h" #include "debug.h" #include "memory.h" @@ -7,10 +11,6 @@ #include "palette.h" #include "platform_compat.h" -#include -#include -#include - typedef enum MovieEffectType { MOVIE_EFFECT_TYPE_NONE = 0, MOVIE_EFFECT_TYPE_FADE_IN = 1, diff --git a/src/movie_lib.cc b/src/movie_lib.cc index e31a5ac..e31eec3 100644 --- a/src/movie_lib.cc +++ b/src/movie_lib.cc @@ -4,13 +4,13 @@ #include "movie_lib.h" -#include "audio_engine.h" -#include "platform_compat.h" - #include #include #include +#include "audio_engine.h" +#include "platform_compat.h" + typedef struct STRUCT_6B3690 { void* field_0; unsigned int field_4; diff --git a/src/movie_lib.h b/src/movie_lib.h index 9fe8b64..6997299 100644 --- a/src/movie_lib.h +++ b/src/movie_lib.h @@ -1,10 +1,10 @@ #ifndef MOVIE_LIB_H #define MOVIE_LIB_H -#include "memory_defs.h" - #include +#include "memory_defs.h" + typedef bool MovieReadProc(int fileHandle, void* buffer, int count); typedef void(MovieShowFrameProc)(SDL_Surface*, int, int, int, int, int, int, int, int); diff --git a/src/nevs.cc b/src/nevs.cc index 916378f..1857bb1 100644 --- a/src/nevs.cc +++ b/src/nevs.cc @@ -1,13 +1,13 @@ #include "nevs.h" +#include +#include + #include "debug.h" #include "interpreter_lib.h" #include "memory_manager.h" #include "platform_compat.h" -#include -#include - #define NEVS_COUNT 40 typedef struct Nevs { diff --git a/src/object.cc b/src/object.cc index 3e547bf..018a9b6 100644 --- a/src/object.cc +++ b/src/object.cc @@ -1,5 +1,8 @@ #include "object.h" +#include +#include + #include "animation.h" #include "art.h" #include "color.h" @@ -23,9 +26,6 @@ #include "tile.h" #include "worldmap.h" -#include -#include - static int objectLoadAllInternal(File* stream); static void _obj_fix_combat_cid_for_dude(); static void _object_fix_weapon_ammo(Object* obj); diff --git a/src/options.cc b/src/options.cc index c6fdf9d..4bf97af 100644 --- a/src/options.cc +++ b/src/options.cc @@ -1,5 +1,11 @@ #include "options.h" +#include +#include +#include + +#include + #include "art.h" #include "color.h" #include "combat.h" @@ -24,12 +30,6 @@ #include "tile.h" #include "window_manager.h" -#include -#include -#include - -#include - #define PREFERENCES_WINDOW_WIDTH 640 #define PREFERENCES_WINDOW_HEIGHT 480 diff --git a/src/palette.cc b/src/palette.cc index 8db862a..b3edb18 100644 --- a/src/palette.cc +++ b/src/palette.cc @@ -1,13 +1,13 @@ #include "palette.h" +#include + #include "color.h" #include "core.h" #include "cycle.h" #include "debug.h" #include "game_sound.h" -#include - static void _palette_reset_(); // 0x6639D0 diff --git a/src/party_member.cc b/src/party_member.cc index 80e0014..bb3b5f1 100644 --- a/src/party_member.cc +++ b/src/party_member.cc @@ -1,5 +1,9 @@ #include "party_member.h" +#include +#include +#include + #include "animation.h" #include "color.h" #include "combat_ai.h" @@ -28,10 +32,6 @@ #include "tile.h" #include "window_manager.h" -#include -#include -#include - typedef struct PartyMemberDescription { bool areaAttackMode[AREA_ATTACK_MODE_COUNT]; bool runAwayMode[RUN_AWAY_MODE_COUNT]; diff --git a/src/perk.cc b/src/perk.cc index 9c60dd5..982db7e 100644 --- a/src/perk.cc +++ b/src/perk.cc @@ -1,5 +1,7 @@ #include "perk.h" +#include + #include "debug.h" #include "game.h" #include "game_config.h" @@ -11,8 +13,6 @@ #include "skill.h" #include "stat.h" -#include - typedef struct PerkDescription { char* name; char* description; diff --git a/src/pipboy.cc b/src/pipboy.cc index e6be2fb..78c4530 100644 --- a/src/pipboy.cc +++ b/src/pipboy.cc @@ -1,5 +1,9 @@ #include "pipboy.h" +#include +#include +#include + #include "art.h" #include "automap.h" #include "color.h" @@ -33,10 +37,6 @@ #include "word_wrap.h" #include "worldmap.h" -#include -#include -#include - #define PIPBOY_WINDOW_WIDTH (640) #define PIPBOY_WINDOW_HEIGHT (480) diff --git a/src/platform_compat.cc b/src/platform_compat.cc index 5ead0cf..571af2c 100644 --- a/src/platform_compat.cc +++ b/src/platform_compat.cc @@ -1,6 +1,5 @@ #include "platform_compat.h" -#include #include #ifdef _WIN32 @@ -25,6 +24,8 @@ #include #endif +#include + int compat_stricmp(const char* string1, const char* string2) { return SDL_strcasecmp(string1, string2); diff --git a/src/proto.cc b/src/proto.cc index eb12a09..3b13a1d 100644 --- a/src/proto.cc +++ b/src/proto.cc @@ -1,5 +1,8 @@ #include "proto.h" +#include +#include + #include "art.h" #include "character_editor.h" #include "combat.h" @@ -19,9 +22,6 @@ #include "stat.h" #include "trait.h" -#include -#include - static int _proto_critter_init(Proto* a1, int a2); static int objectCritterCombatDataRead(CritterCombatData* data, File* stream); static int objectCritterCombatDataWrite(CritterCombatData* data, File* stream); diff --git a/src/proto_instance.cc b/src/proto_instance.cc index 98a8319..25d0ecf 100644 --- a/src/proto_instance.cc +++ b/src/proto_instance.cc @@ -1,5 +1,10 @@ #include "proto_instance.h" +#include +#include +#include +#include + #include "animation.h" #include "art.h" #include "color.h" @@ -27,11 +32,6 @@ #include "tile.h" #include "worldmap.h" -#include -#include -#include -#include - static int _obj_remove_from_inven(Object* critter, Object* item); static int _obj_use_book(Object* item_obj); static int _obj_use_flare(Object* critter_obj, Object* item_obj); diff --git a/src/random.cc b/src/random.cc index eeb2029..25cb662 100644 --- a/src/random.cc +++ b/src/random.cc @@ -1,13 +1,13 @@ #include "random.h" +#include +#include + #include "debug.h" #include "platform_compat.h" #include "scripts.h" #include "sfall_config.h" -#include -#include - static int _roll_reset_(); static int randomTranslateRoll(int delta, int criticalSuccessModifier); static int getRandom(int max); diff --git a/src/region.cc b/src/region.cc index 0c59c94..131e869 100644 --- a/src/region.cc +++ b/src/region.cc @@ -1,11 +1,11 @@ #include "region.h" -#include "debug.h" -#include "memory_manager.h" - #include #include +#include "debug.h" +#include "memory_manager.h" + // 0x50D394 static char _aNull[] = ""; diff --git a/src/scripts.cc b/src/scripts.cc index 33f3d21..b365e8a 100644 --- a/src/scripts.cc +++ b/src/scripts.cc @@ -1,5 +1,10 @@ #include "scripts.h" +#include +#include +#include +#include + #include "actions.h" #include "animation.h" #include "art.h" @@ -30,11 +35,6 @@ #include "window_manager_private.h" #include "worldmap.h" -#include -#include -#include -#include - #define SCRIPT_LIST_EXTENT_SIZE 16 // SFALL: Increase number of message lists for scripted dialogs. diff --git a/src/select_file_list.cc b/src/select_file_list.cc index 1fac1ef..6dd455f 100644 --- a/src/select_file_list.cc +++ b/src/select_file_list.cc @@ -1,10 +1,10 @@ #include "select_file_list.h" -#include "db.h" - #include #include +#include "db.h" + // 0x4AA250 int _compare(const void* a1, const void* a2) { diff --git a/src/selfrun.cc b/src/selfrun.cc index 2e19973..eeb2cd0 100644 --- a/src/selfrun.cc +++ b/src/selfrun.cc @@ -1,13 +1,13 @@ #include "selfrun.h" +#include + #include "core.h" #include "db.h" #include "game.h" #include "game_config.h" #include "platform_compat.h" -#include - // 0x51C8D8 int gSelfrunState = SELFRUN_STATE_TURNED_OFF; diff --git a/src/sfall_config.cc b/src/sfall_config.cc index cfad082..1cf9f09 100644 --- a/src/sfall_config.cc +++ b/src/sfall_config.cc @@ -1,10 +1,10 @@ #include "sfall_config.h" -#include "platform_compat.h" - #include #include +#include "platform_compat.h" + #define SFALL_CONFIG_FILE_NAME "ddraw.ini" bool gSfallConfigInitialized = false; diff --git a/src/skill.cc b/src/skill.cc index 8158b9a..75b7037 100644 --- a/src/skill.cc +++ b/src/skill.cc @@ -1,5 +1,9 @@ #include "skill.h" +#include +#include +#include + #include "actions.h" #include "color.h" #include "combat.h" @@ -23,10 +27,6 @@ #include "stat.h" #include "trait.h" -#include -#include -#include - #define SKILLS_MAX_USES_PER_DAY (3) #define REPAIRABLE_DAMAGE_FLAGS_LENGTH (5) diff --git a/src/skilldex.cc b/src/skilldex.cc index 0e186d9..69eabba 100644 --- a/src/skilldex.cc +++ b/src/skilldex.cc @@ -1,5 +1,8 @@ #include "skilldex.h" +#include +#include + #include "art.h" #include "color.h" #include "core.h" @@ -20,9 +23,6 @@ #include "text_font.h" #include "window_manager.h" -#include -#include - #define SKILLDEX_WINDOW_RIGHT_MARGIN 4 #define SKILLDEX_WINDOW_BOTTOM_MARGIN 6 diff --git a/src/sound.cc b/src/sound.cc index ad9d82d..10b650b 100644 --- a/src/sound.cc +++ b/src/sound.cc @@ -1,8 +1,9 @@ #include "sound.h" -#include "audio_engine.h" -#include "debug.h" -#include "platform_compat.h" +#include +#include +#include +#include #ifdef _WIN32 #include @@ -10,15 +11,15 @@ #include #include #endif -#include -#include -#include -#include #include #include +#include "audio_engine.h" +#include "debug.h" +#include "platform_compat.h" + #define SOUND_FLAG_SOUND_IS_DONE (0x01) #define SOUND_FLAG_SOUND_IS_PLAYING (0x02) #define SOUND_FLAG_SOUND_IS_FADING (0x04) diff --git a/src/sound_effects_cache.cc b/src/sound_effects_cache.cc index 80d8f25..608723f 100644 --- a/src/sound_effects_cache.cc +++ b/src/sound_effects_cache.cc @@ -1,5 +1,11 @@ #include "sound_effects_cache.h" +#include +#include +#include +#include +#include + #include "cache.h" #include "db.h" #include "game_config.h" @@ -7,12 +13,6 @@ #include "sound_decoder.h" #include "sound_effects_list.h" -#include -#include -#include -#include -#include - #define SOUND_EFFECTS_CACHE_MIN_SIZE (0x40000) typedef struct SoundEffect { diff --git a/src/sound_effects_list.cc b/src/sound_effects_list.cc index 60a0ba4..4a9be42 100644 --- a/src/sound_effects_list.cc +++ b/src/sound_effects_list.cc @@ -1,5 +1,10 @@ #include "sound_effects_list.h" +#include +#include +#include +#include + #include "db.h" #include "debug.h" #include "memory.h" @@ -7,11 +12,6 @@ #include "pointer_registry.h" #include "sound_decoder.h" -#include -#include -#include -#include - typedef struct SoundEffectsListEntry { char* name; int dataSize; diff --git a/src/stat.cc b/src/stat.cc index 9f33b44..03308e0 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -1,5 +1,9 @@ #include "stat.h" +#include + +#include + #include "art.h" #include "combat.h" #include "core.h" @@ -22,10 +26,6 @@ #include "tile.h" #include "trait.h" -#include - -#include - // Provides metadata about stats. typedef struct StatDescription { char* name; diff --git a/src/string_parsers.cc b/src/string_parsers.cc index 445f09c..1ea7d57 100644 --- a/src/string_parsers.cc +++ b/src/string_parsers.cc @@ -1,11 +1,11 @@ #include "string_parsers.h" -#include "debug.h" -#include "platform_compat.h" - #include #include +#include "debug.h" +#include "platform_compat.h" + // strParseInt // 0x4AFD10 int strParseInt(char** stringPtr, int* valuePtr) diff --git a/src/text_font.cc b/src/text_font.cc index 024f9de..ba5bc83 100644 --- a/src/text_font.cc +++ b/src/text_font.cc @@ -1,13 +1,13 @@ #include "text_font.h" +#include +#include + #include "color.h" #include "db.h" #include "memory.h" #include "platform_compat.h" -#include -#include - // The maximum number of text fonts. #define TEXT_FONT_MAX (10) diff --git a/src/text_object.cc b/src/text_object.cc index 3748833..4a87dbd 100644 --- a/src/text_object.cc +++ b/src/text_object.cc @@ -1,5 +1,7 @@ #include "text_object.h" +#include + #include "core.h" #include "debug.h" #include "draw.h" @@ -10,8 +12,6 @@ #include "tile.h" #include "word_wrap.h" -#include - // The maximum number of text objects that can exist at the same time. #define TEXT_OBJECTS_MAX_COUNT (20) diff --git a/src/tile.cc b/src/tile.cc index 4fecbf8..f301a70 100644 --- a/src/tile.cc +++ b/src/tile.cc @@ -1,5 +1,9 @@ #include "tile.h" +#include +#include +#include + #include "art.h" #include "color.h" #include "config.h" @@ -13,10 +17,6 @@ #include "object.h" #include "platform_compat.h" -#include -#include -#include - typedef struct STRUCT_51D99C { int field_0; int field_4; diff --git a/src/trait.cc b/src/trait.cc index c9bbf06..c1dab3e 100644 --- a/src/trait.cc +++ b/src/trait.cc @@ -1,5 +1,7 @@ #include "trait.h" +#include + #include "game.h" #include "message.h" #include "object.h" @@ -7,8 +9,6 @@ #include "skill.h" #include "stat.h" -#include - // Provides metadata about traits. typedef struct TraitDescription { // The name of trait. diff --git a/src/win32.cc b/src/win32.cc index 8b4ab30..1fb4c81 100644 --- a/src/win32.cc +++ b/src/win32.cc @@ -1,12 +1,13 @@ #include "win32.h" +#include + +#include + #include "core.h" #include "main.h" #include "window_manager.h" -#include -#include - #ifdef _WIN32 // 0x51E444 bool gProgramIsActive = false; diff --git a/src/window.cc b/src/window.cc index b7c2c64..193fd23 100644 --- a/src/window.cc +++ b/src/window.cc @@ -1,5 +1,9 @@ #include "window.h" +#include +#include +#include + #include "color.h" #include "core.h" #include "datafile.h" @@ -14,10 +18,6 @@ #include "widget.h" #include "window_manager.h" -#include -#include -#include - #define MANAGED_WINDOW_COUNT (16) typedef struct ManagedButton { diff --git a/src/window_manager.cc b/src/window_manager.cc index 0b7adfd..fef9e6d 100644 --- a/src/window_manager.cc +++ b/src/window_manager.cc @@ -1,5 +1,11 @@ #include "window_manager.h" +#include + +#include + +#include + #include "color.h" #include "core.h" #include "debug.h" @@ -11,11 +17,6 @@ #include "win32.h" #include "window_manager_private.h" -#include -#include - -#include - #define MAX_WINDOW_COUNT (50) // The maximum number of radio groups. diff --git a/src/window_manager.h b/src/window_manager.h index cd712e6..7e368d3 100644 --- a/src/window_manager.h +++ b/src/window_manager.h @@ -1,8 +1,6 @@ #ifndef WINDOW_MANAGER_H #define WINDOW_MANAGER_H -#include "geometry.h" - #include #ifdef _WIN32 @@ -11,6 +9,8 @@ #include #endif +#include "geometry.h" + // The maximum number of buttons in one radio group. #define RADIO_GROUP_BUTTON_LIST_CAPACITY (64) diff --git a/src/window_manager_private.cc b/src/window_manager_private.cc index ee2fdf2..f3d487a 100644 --- a/src/window_manager_private.cc +++ b/src/window_manager_private.cc @@ -1,5 +1,10 @@ #include "window_manager_private.h" +#include +#include + +#include + #include "color.h" #include "core.h" #include "draw.h" @@ -7,11 +12,6 @@ #include "text_font.h" #include "window_manager.h" -#include -#include - -#include - typedef struct STRUCT_6B2340 { int field_0; int field_4; diff --git a/src/word_wrap.cc b/src/word_wrap.cc index 59471c6..5456d59 100644 --- a/src/word_wrap.cc +++ b/src/word_wrap.cc @@ -1,11 +1,11 @@ #include "word_wrap.h" -#include "text_font.h" - #include #include #include +#include "text_font.h" + // 0x4BC6F0 int wordWrap(const char* string, int width, short* breakpoints, short* breakpointsLengthPtr) { diff --git a/src/worldmap.cc b/src/worldmap.cc index 5af0105..38aff3b 100644 --- a/src/worldmap.cc +++ b/src/worldmap.cc @@ -1,5 +1,11 @@ #include "worldmap.h" +#include +#include +#include +#include +#include + #include "animation.h" #include "art.h" #include "automap.h" @@ -37,12 +43,6 @@ #include "tile.h" #include "window_manager.h" -#include -#include -#include -#include -#include - #define CITY_NAME_SIZE (40) #define TILE_WALK_MASK_NAME_SIZE (40) #define ENTRANCE_LIST_CAPACITY (10) diff --git a/src/xfile.cc b/src/xfile.cc index 57cd82b..9c1a42a 100644 --- a/src/xfile.cc +++ b/src/xfile.cc @@ -1,16 +1,17 @@ #include "xfile.h" -#include "file_find.h" - #include +#include +#include +#include + #ifdef _WIN32 #include #else #include #endif -#include -#include -#include + +#include "file_find.h" typedef enum XFileEnumerationEntryType { XFILE_ENUMERATION_ENTRY_TYPE_FILE, diff --git a/src/xfile.h b/src/xfile.h index 25d45fe..ba10b66 100644 --- a/src/xfile.h +++ b/src/xfile.h @@ -1,13 +1,13 @@ #ifndef XFILE_H #define XFILE_H -#include "dfile.h" - -#include "platform_compat.h" - #include + #include +#include "dfile.h" +#include "platform_compat.h" + typedef enum XFileType { XFILE_TYPE_FILE, XFILE_TYPE_DFILE,