Merge pull request #2852 from TheCycoONE/includes

Include what you use
This commit is contained in:
Stephen E. Baker
2025-05-07 22:02:44 -04:00
committed by GitHub
57 changed files with 270 additions and 105 deletions

View File

@@ -22,8 +22,6 @@ SOFTWARE.
#include "app.h" #include "app.h"
#include "config.h"
#include "frmMain.h" #include "frmMain.h"
#include "frmSprites.h" #include "frmSprites.h"

View File

@@ -23,7 +23,6 @@ SOFTWARE.
#ifndef ANIMVIEW_APP_H_ #ifndef ANIMVIEW_APP_H_
#define ANIMVIEW_APP_H_ #define ANIMVIEW_APP_H_
#include "config.h"
// For compilers that support precompilation, includes "wx/wx.h". // For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h" #include "wx/wxprec.h"

View File

@@ -24,8 +24,8 @@ SOFTWARE.
#define CORSIX_AV_CONFIG_H_ #define CORSIX_AV_CONFIG_H_
/** Standard includes **/ /** Standard includes **/
#include <cstddef> #include <cstddef> // IWYU pragma: export
#include <cstdint> #include <cstdint> // IWYU pragma: export
// We bring in the most common stddef and stdint types to avoid typing // We bring in the most common stddef and stdint types to avoid typing
using std::size_t; using std::size_t;

View File

@@ -24,21 +24,36 @@ SOFTWARE.
#include "config.h" #include "config.h"
#include <wx/anybutton.h>
#include <wx/bitmap.h> #include <wx/bitmap.h>
#include <wx/button.h>
#include <wx/chartype.h>
#include <wx/checkbox.h>
#include <wx/dcclient.h> #include <wx/dcclient.h>
#include <wx/dcmemory.h> #include <wx/dcmemory.h>
#include <wx/defs.h> #include <wx/defs.h>
#include <wx/dir.h> #include <wx/dir.h>
#include <wx/dirdlg.h> #include <wx/dirdlg.h>
#include <wx/filename.h> #include <wx/filename.h>
#include <wx/gdicmn.h>
#include <wx/image.h> #include <wx/image.h>
#include <wx/listbox.h>
#include <wx/msgdlg.h> #include <wx/msgdlg.h>
#include <wx/numdlg.h> #include <wx/numdlg.h>
#include <wx/object.h>
#include <wx/panel.h>
#include <wx/radiobut.h> #include <wx/radiobut.h>
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/spinbutt.h>
#include <wx/spinctrl.h>
#include <wx/stattext.h> #include <wx/stattext.h>
#include <wx/stringimpl.h>
#include <wx/textctrl.h>
#include <wx/tokenzr.h> #include <wx/tokenzr.h>
#include <wx/wfstream.h> #include <wx/unichar.h>
#include <wx/utils.h>
#include <cstring>
#include "backdrop.h" #include "backdrop.h"

View File

@@ -25,19 +25,22 @@ SOFTWARE.
#include "config.h" #include "config.h"
#include <wx/button.h> #include <wx/defs.h>
#include <wx/checkbox.h> #include <wx/event.h>
#include <wx/dcclient.h>
#include <wx/frame.h> #include <wx/frame.h>
#include <wx/listbox.h> #include <wx/image.h>
#include <wx/panel.h> #include <wx/string.h>
#include <wx/spinctrl.h>
#include <wx/textctrl.h>
#include <wx/timer.h> #include <wx/timer.h>
#include <wx/txtstrm.h>
#include "th.h" #include "th.h"
//#include <vector>
class wxButton;
class wxCheckBox;
class wxListBox;
class wxPaintDC;
class wxPanel;
class wxSpinEvent;
class wxTextCtrl;
class frmMain : public wxFrame { class frmMain : public wxFrame {
public: public:

View File

@@ -24,13 +24,19 @@ SOFTWARE.
#include "config.h" #include "config.h"
#include <wx/button.h>
#include <wx/chartype.h>
#include <wx/dcclient.h> #include <wx/dcclient.h>
#include <wx/dirdlg.h>
#include <wx/filedlg.h> #include <wx/filedlg.h>
#include <wx/filefn.h>
#include <wx/gdicmn.h>
#include <wx/image.h>
#include <wx/msgdlg.h> #include <wx/msgdlg.h>
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/stattext.h> #include <wx/stattext.h>
#include <wx/vscroll.h> #include <wx/textctrl.h>
#include <wx/unichar.h>
#include <wx/utils.h>
BEGIN_EVENT_TABLE(frmSprites, wxFrame) BEGIN_EVENT_TABLE(frmSprites, wxFrame)
EVT_BUTTON(ID_LOAD, frmSprites::_onLoad) EVT_BUTTON(ID_LOAD, frmSprites::_onLoad)

View File

@@ -26,19 +26,20 @@ SOFTWARE.
#include "config.h" #include "config.h"
#include <wx/bitmap.h> #include <wx/bitmap.h>
#include <wx/button.h> #include <wx/defs.h>
#include <wx/checkbox.h> #include <wx/event.h>
#include <wx/frame.h> #include <wx/frame.h>
#include <wx/listbox.h> #include <wx/string.h>
#include <wx/panel.h> #include <wx/types.h>
#include <wx/textctrl.h>
#include <wx/timer.h>
#include <wx/vscroll.h> #include <wx/vscroll.h>
#include <vector> #include <vector>
#include "th.h" #include "th.h"
class wxTextCtrl;
class wxWindow;
static const int ROW_COUNT = 1000; static const int ROW_COUNT = 1000;
// Derived class to add scrollbars to the window. // Derived class to add scrollbars to the window.

View File

@@ -24,9 +24,8 @@ SOFTWARE.
#include "config.h" #include "config.h"
#include <wx/app.h> #include <wx/gdicmn.h>
#include <wx/filename.h> #include <wx/image.h>
#include <wx/toplevel.h>
#include <algorithm> #include <algorithm>
#include <array> #include <array>

View File

@@ -39,15 +39,16 @@ SOFTWARE.
#include "config.h" #include "config.h"
#include <stdint.h>
#include <wx/file.h> #include <wx/file.h>
#include <wx/image.h>
#include <wx/string.h> #include <wx/string.h>
#include <wx/txtstrm.h>
#include <array> #include <array>
#include <cstring>
#include <vector> #include <vector>
class wxImage;
class wxSize;
#pragma pack(push) #pragma pack(push)
#pragma pack(1) #pragma pack(1)

View File

@@ -1,3 +1,4 @@
#include "../Src/lua.hpp"
#include "../Src/th_lua.h" #include "../Src/th_lua.h"
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_test_macros.hpp>

View File

@@ -1,7 +1,8 @@
#include <cstring> #include <string>
#include "../Src/th_strings.h" #include "../Src/th_strings.h"
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_test_macros.hpp>
#include <catch2/matchers/catch_matchers.hpp>
#include <catch2/matchers/catch_matchers_string.hpp> #include <catch2/matchers/catch_matchers_string.hpp>
TEST_CASE("skip whitespace", "[skip_utf8_whitespace]") { TEST_CASE("skip whitespace", "[skip_utf8_whitespace]") {

View File

@@ -79,8 +79,8 @@ SOFTWARE.
#endif #endif
/** Standard includes **/ /** Standard includes **/
#include <cstddef> #include <cstddef> // IWYU pragma: export
#include <cstdint> #include <cstdint> // IWYU pragma: export
// We bring in the most common stddef and stdint types to avoid typing // We bring in the most common stddef and stdint types to avoid typing
// clang-format off // clang-format off

View File

@@ -1,6 +1,8 @@
#ifndef CORSIX_TH_CP437_TO_UNICODE_TABLE_H #ifndef CORSIX_TH_CP437_TO_UNICODE_TABLE_H
#define CORSIX_TH_CP437_TO_UNICODE_TABLE_H #define CORSIX_TH_CP437_TO_UNICODE_TABLE_H
#include "config.h"
#include <array> #include <array>
// clang-format off // clang-format off

View File

@@ -1,6 +1,8 @@
#ifndef CORSIX_TH_CP936_TO_UNICODE_TABLE_H #ifndef CORSIX_TH_CP936_TO_UNICODE_TABLE_H
#define CORSIX_TH_CP936_TO_UNICODE_TABLE_H #define CORSIX_TH_CP936_TO_UNICODE_TABLE_H
#include "config.h"
#include <array> #include <array>
// Generated from the following document: // Generated from the following document:
// http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP936.TXT // http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP936.TXT

View File

@@ -23,14 +23,14 @@ SOFTWARE.
#include "iso_fs.h" #include "iso_fs.h"
#include <algorithm> #include <algorithm>
#include <array>
#include <cstdarg> #include <cstdarg>
#include <cstdio> #include <cstdio>
#include <cstdlib>
#include <cstring> #include <cstring>
#include <exception>
#include <iterator> #include <iterator>
#include <memory> #include <memory>
#include <stdexcept> #include <stdexcept>
#include <utility>
#include <vector> #include <vector>
#include "th.h" #include "th.h"

View File

@@ -27,8 +27,7 @@ SOFTWARE.
#include <cstdio> #include <cstdio>
#include <string> #include <string>
#include <vector>
#include "th_lua.h"
//! Layer for reading Theme Hospital files out of an .iso disk image //! Layer for reading Theme Hospital files out of an .iso disk image
/*! /*!

View File

@@ -24,9 +24,12 @@ SOFTWARE.
#define CORSIX_TH_LUA_HPP_ #define CORSIX_TH_LUA_HPP_
extern "C" { extern "C" {
#include <lauxlib.h> // IWYU pragma: begin_exports
#include <lua.h> #include <lua.h>
#include <luaconf.h>
#include <lualib.h> #include <lualib.h>
#include <lauxlib.h>
// IWYU pragma: end_exports
} }
#if LUA_VERSION_NUM >= 502 #if LUA_VERSION_NUM >= 502

View File

@@ -1,5 +1,7 @@
#include "lua_rnc.h" #include "lua_rnc.h"
#include "config.h"
#include <array> #include <array>
#include "rnc.h" #include "rnc.h"

View File

@@ -1,7 +1,7 @@
#ifndef CORSIX_TH_LUA_RNC #ifndef CORSIX_TH_LUA_RNC
#define CORSIX_TH_LUA_RNC #define CORSIX_TH_LUA_RNC
#include "th_lua.h" #include "lua.hpp"
int luaopen_rnc(lua_State* L); int luaopen_rnc(lua_State* L);

View File

@@ -22,13 +22,12 @@ SOFTWARE.
#include "config.h" #include "config.h"
#include <array>
#include <cstdio> #include <cstdio>
#include <cstdlib>
#include <cstring> #include <cstring>
#include <fstream> #include <fstream>
#include <string> #include <string>
#include "iso_fs.h"
#include "lua.hpp" #include "lua.hpp"
#include "lua_rnc.h" #include "lua_rnc.h"
#include "lua_sdl.h" #include "lua_sdl.h"

View File

@@ -22,15 +22,19 @@ SOFTWARE.
#include "persist_lua.h" #include "persist_lua.h"
#include "config.h"
#include <errno.h> #include <errno.h>
#include <array> #include <array>
#include <climits>
#include <cmath> #include <cmath>
#include <cstdio> #include <cstdio>
#include <cstdlib>
#include <cstring> #include <cstring>
#include <new>
#include <string> #include <string>
#include "lua.hpp"
#include "th_lua.h" #include "th_lua.h"
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning( \ #pragma warning( \

View File

@@ -24,10 +24,10 @@ SOFTWARE.
#define CORSIX_TH_PERSIST_LUA_H_ #define CORSIX_TH_PERSIST_LUA_H_
#include "config.h" #include "config.h"
#include <cstdlib> #include <type_traits>
#include <vector> #include <vector>
#include "th_lua.h" #include "lua.hpp"
template <class T> template <class T>
struct lua_persist_int {}; struct lua_persist_int {};

View File

@@ -43,6 +43,7 @@
#include <lauxlib.h> #include <lauxlib.h>
#include <lua.h> #include <lua.h>
#include <stddef.h>
#ifdef _MSC_VER #ifdef _MSC_VER
typedef unsigned __int16 uint16_t; typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t; typedef unsigned __int32 uint32_t;

View File

@@ -22,13 +22,18 @@ SOFTWARE.
#include "config.h" #include "config.h"
#include "lua.hpp"
#include "lua_sdl.h" #include "lua_sdl.h"
#include "th_lua.h" #include "th_lua.h"
#ifdef CORSIX_TH_USE_SDL_MIXER #ifdef CORSIX_TH_USE_SDL_MIXER
#include <SDL_events.h>
#include <SDL_mixer.h> #include <SDL_mixer.h>
#include <SDL_rwops.h>
#include <SDL_thread.h>
#include <array> #include <array>
#include <cmath> #include <cmath>
#include <cstdlib>
#include <cstring> #include <cstring>
#include "xmi2mid.h" #include "xmi2mid.h"

View File

@@ -20,12 +20,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
*/ */
#include "config.h" #include <SDL.h>
#include <array> #include <array>
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
#include "lua.hpp"
#include "lua_sdl.h" #include "lua_sdl.h"
#include "th_lua.h" #include "th_lua.h"

View File

@@ -20,9 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
*/ */
#include "config.h" #include "lua.hpp"
#include "lua_sdl.h"
#include "th_lua.h" #include "th_lua.h"
#ifdef CORSIX_TH_USE_WIN32_SDK #ifdef CORSIX_TH_USE_WIN32_SDK
#include <SDL_syswm.h> #include <SDL_syswm.h>
@@ -30,6 +28,8 @@ SOFTWARE.
#include "../resource.h" #include "../resource.h"
#endif #endif
#include <SDL_mouse.h>
#include <array> #include <array>
namespace { namespace {

View File

@@ -24,9 +24,12 @@ SOFTWARE.
#include "config.h" #include "config.h"
#include <cstring> #include <array>
#include <stdexcept> #include <stdexcept>
#include "cp437_table.h"
#include "cp936_table.h"
link_list::link_list() { link_list::link_list() {
prev = nullptr; prev = nullptr;
next = nullptr; next = nullptr;
@@ -45,9 +48,6 @@ void link_list::remove_from_list() {
prev = nullptr; prev = nullptr;
} }
#include "cp437_table.h"
#include "cp936_table.h"
namespace { namespace {
void utf8encode(uint8_t*& sOut, uint32_t iCodepoint) { void utf8encode(uint8_t*& sOut, uint32_t iCodepoint) {

View File

@@ -27,10 +27,14 @@ SOFTWARE.
#include <algorithm> #include <algorithm>
#include <cassert> #include <cassert>
#include <climits> #include <climits>
#include <cstdlib>
#include <cstring> #include <cstring>
#include <memory>
#include <new> #include <new>
#include "persist_lua.h" #include "persist_lua.h"
#include "th_gfx_sdl.h"
#include "th_lua.h"
#include "th_map.h" #include "th_map.h"
#include "th_sound.h" #include "th_sound.h"

View File

@@ -23,19 +23,26 @@ SOFTWARE.
#ifndef CORSIX_TH_TH_GFX_H_ #ifndef CORSIX_TH_TH_GFX_H_
#define CORSIX_TH_TH_GFX_H_ #define CORSIX_TH_TH_GFX_H_
#include "config.h"
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
#include <map> #include <map>
#include <string> #include <string>
#include <utility>
#include <vector> #include <vector>
#include "lua.hpp"
#include "th.h" #include "th.h"
#include "th_gfx_common.h" #include "th_gfx_common.h"
#include "th_gfx_sdl.h"
#include "th_lua.h"
class lua_persist_reader; class lua_persist_reader;
class lua_persist_writer; class lua_persist_writer;
class memory_reader;
class render_target;
class sprite_sheet;
struct clip_rect;
struct map_tile;
enum class scaled_items { none, sprite_sheets, bitmaps, all }; enum class scaled_items { none, sprite_sheets, bitmaps, all };
@@ -210,8 +217,6 @@ struct layers {
uint8_t layer_contents[max_number_of_layers]; uint8_t layer_contents[max_number_of_layers];
}; };
class memory_reader;
/** Key value for finding an animation. */ /** Key value for finding an animation. */
struct animation_key { struct animation_key {
std::string name; ///< Name of the animations. std::string name; ///< Name of the animations.
@@ -525,7 +530,6 @@ class animation_manager {
void fix_next_frame(uint32_t iFirst, size_t iLength); void fix_next_frame(uint32_t iFirst, size_t iLength);
}; };
struct map_tile;
class animation_base : public drawable { class animation_base : public drawable {
public: public:
animation_base(); animation_base();

View File

@@ -26,14 +26,18 @@ SOFTWARE.
#include "th_strings.h" #include "th_strings.h"
#ifdef CORSIX_TH_USE_FREETYPE2 #ifdef CORSIX_TH_USE_FREETYPE2
#include <ft2build.h> // IWYU pragma: keep
#include FT_FREETYPE_H
#include FT_ERRORS_H
#include FT_GLYPH_H #include FT_GLYPH_H
#include FT_IMAGE_H
#include FT_TYPES_H
#include <map> #include <map>
#include <vector> #include <vector>
#endif #endif
#include <algorithm> #include <algorithm>
#include <cstdio>
#include <cstring> #include <cstring>
#include <stdexcept> #include <utility>
bitmap_font::bitmap_font() { bitmap_font::bitmap_font() {
sheet = nullptr; sheet = nullptr;

View File

@@ -22,16 +22,20 @@ SOFTWARE.
#ifndef CORSIX_TH_TH_GFX_FONT_H_ #ifndef CORSIX_TH_TH_GFX_FONT_H_
#define CORSIX_TH_TH_GFX_FONT_H_ #define CORSIX_TH_TH_GFX_FONT_H_
#include "th_gfx.h" #include "config.h"
#include <SDL_render.h>
#include <climits>
#include "th_gfx_sdl.h"
#ifdef CORSIX_TH_USE_FREETYPE2 #ifdef CORSIX_TH_USE_FREETYPE2
#include <ft2build.h> #include <ft2build.h> // IWYU pragma: keep
#include FT_FREETYPE_H #include FT_FREETYPE_H
#include FT_IMAGE_H
#include FT_TYPES_H
#endif #endif
class render_target;
class sprite_sheet;
enum class text_alignment { enum class text_alignment {
left = 0, left = 0,
center = 1, center = 1,

View File

@@ -26,19 +26,23 @@ SOFTWARE.
#ifdef CORSIX_TH_USE_FREETYPE2 #ifdef CORSIX_TH_USE_FREETYPE2
#include "th_gfx_font.h" #include "th_gfx_font.h"
#endif #endif
#include <SDL.h>
#include <algorithm> #include <algorithm>
#include <cmath> #include <cmath>
#include <cstdio> #include <cstdio>
#include <cstdlib>
#include <cstring> #include <cstring>
#include <iostream> #include <iostream>
#include <limits> #include <limits>
#include <memory> #include <memory>
#include <new> #include <new>
#include <stack>
#include <stdexcept> #include <stdexcept>
#include <vector>
#include "th_map.h" #include "persist_lua.h"
#include "th_gfx_common.h"
#include "th_gfx_sdl.h"
#if SDL_VERSION_ATLEAST(2, 0, 10) #if SDL_VERSION_ATLEAST(2, 0, 10)

View File

@@ -32,11 +32,12 @@ SOFTWARE.
#include <stdexcept> #include <stdexcept>
#include <vector> #include <vector>
#include "persist_lua.h"
#include "th.h"
#include "th_gfx_common.h" #include "th_gfx_common.h"
class cursor; class cursor;
class line_sequence;
class lua_persist_reader;
class lua_persist_writer;
struct clip_rect : public SDL_Rect { struct clip_rect : public SDL_Rect {
typedef Sint16 x_y_type; typedef Sint16 x_y_type;

View File

@@ -32,7 +32,9 @@ SOFTWARE.
#endif #endif
#include "bootstrap.h" #include "bootstrap.h"
#include "lua.hpp"
#include "th.h" #include "th.h"
#include "th_lua.h"
#include "th_lua_internal.h" #include "th_lua_internal.h"
const char* update_check_url = const char* update_check_url =
@@ -237,7 +239,7 @@ int l_load_strings(lua_State* L) {
} }
int get_api_version() { int get_api_version() {
#include "../Lua/api_version.lua" #include "../Lua/api_version.lua" // IWYU pragma: keep
} }
int l_get_compile_options(lua_State* L) { int l_get_compile_options(lua_State* L) {

View File

@@ -25,9 +25,7 @@ SOFTWARE.
#include "config.h" #include "config.h"
#include <cassert> #include <cassert>
#include <cstdio>
#include <new> #include <new>
#include <vector>
#include "lua.hpp" #include "lua.hpp"

View File

@@ -20,10 +20,23 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
*/ */
#include "config.h"
#include <new>
#include <string>
#include "lua.hpp"
#include "persist_lua.h"
#include "th.h"
#include "th_gfx.h" #include "th_gfx.h"
#include "th_lua.h"
#include "th_lua_internal.h" #include "th_lua_internal.h"
#include "th_map.h" #include "th_map.h"
class render_target;
class sprite_sheet;
enum class animation_effect;
namespace { namespace {
/* this variable is used to determine the layer of the animation, it should be /* this variable is used to determine the layer of the animation, it should be

View File

@@ -20,15 +20,28 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
*/ */
#include <SDL.h> #include "config.h"
#include <SDL_stdinc.h>
#include <climits>
#include <cstring> #include <cstring>
#include <exception> #include <new>
#include "lua.hpp"
#include "persist_lua.h"
#include "th_gfx.h" #include "th_gfx.h"
#include "th_gfx_font.h" #include "th_gfx_font.h"
#include "th_gfx_sdl.h"
#include "th_lua.h"
#include "th_lua_internal.h" #include "th_lua_internal.h"
#ifdef CORSIX_TH_USE_FREETYPE2
#include <ft2build.h> // IWYU pragma: keep
#include FT_ERRORS_H
#include FT_TYPES_H
#endif
namespace { namespace {
int l_palette_new(lua_State* L) { int l_palette_new(lua_State* L) {

View File

@@ -20,9 +20,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
*/ */
#include <cstdio> #include "config.h"
#include "iso_fs.h" #include "iso_fs.h"
#include "lua.hpp"
#include "th_lua.h"
#include "th_lua_internal.h" #include "th_lua_internal.h"
namespace { namespace {

View File

@@ -21,8 +21,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
*/ */
#include "config.h" #include "lua.hpp"
#include "th_lua.h"
#include "th_lua_internal.h" #include "th_lua_internal.h"
#ifdef CORSIX_TH_USE_WIN32_SDK #ifdef CORSIX_TH_USE_WIN32_SDK
#include <windows.h> #include <windows.h>

View File

@@ -20,14 +20,28 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
*/ */
#include <cstring> #include "config.h"
#include <exception>
#include <string>
#include <cstring>
#include <list>
#include <map>
#include <stdexcept>
#include <string>
#include <utility>
#include <vector>
#include "lua.hpp"
#include "th_gfx.h"
#include "th_lua.h"
#include "th_lua_internal.h" #include "th_lua_internal.h"
#include "th_map.h" #include "th_map.h"
#include "th_pathfind.h" #include "th_pathfind.h"
class lua_persist_reader;
class lua_persist_writer;
class render_target;
class sprite_sheet;
namespace { namespace {
constexpr int player_max = 4; constexpr int player_max = 4;

View File

@@ -20,7 +20,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
*/ */
#include "th_gfx.h" #include <SDL_rect.h>
#include "lua.hpp"
#include "th_gfx_sdl.h"
#include "th_lua.h"
#include "th_lua_internal.h" #include "th_lua_internal.h"
#include "th_movie.h" #include "th_movie.h"

View File

@@ -20,11 +20,20 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
*/ */
#include "config.h"
#include <SDL_events.h>
#include <SDL_rwops.h>
#include <SDL_stdinc.h>
#include <SDL_timer.h>
#include <array> #include <array>
#include <cctype> #include <cctype>
#include <cstring> #include <cstdio>
#include <map> #include <map>
#include <utility>
#include "lua.hpp"
#include "lua_sdl.h" #include "lua_sdl.h"
#include "th_lua.h" #include "th_lua.h"
#include "th_lua_internal.h" #include "th_lua_internal.h"

View File

@@ -20,10 +20,14 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
*/ */
#include "config.h"
#include <cstring> #include <cstring>
#include <vector> #include <vector>
#include "lua.hpp"
#include "persist_lua.h" #include "persist_lua.h"
#include "th_lua.h"
#include "th_lua_internal.h" #include "th_lua_internal.h"
/* /*

View File

@@ -20,9 +20,14 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
*/ */
#include <algorithm> #include "config.h"
#include "th_gfx.h" #include <algorithm>
#include <list>
#include "lua.hpp"
#include "th_gfx_sdl.h"
#include "th_lua.h"
#include "th_lua_internal.h" #include "th_lua_internal.h"
#include "th_map.h" #include "th_map.h"

View File

@@ -24,19 +24,20 @@ SOFTWARE.
#include "config.h" #include "config.h"
#include <SDL.h>
#include <algorithm>
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
#include <exception>
#include <fstream> #include <fstream>
#include <new> #include <new>
#include <stdexcept>
#include <string> #include <string>
#include "lua.hpp"
#include "persist_lua.h"
#include "run_length_encoder.h" #include "run_length_encoder.h"
#include "th.h" #include "th.h"
#include "th_gfx.h" #include "th_gfx.h"
#include "th_gfx_sdl.h"
#include "th_lua.h"
#include "th_map_overlays.h" #include "th_map_overlays.h"
constexpr int max_player_count = 4; constexpr int max_player_count = 4;

View File

@@ -22,10 +22,21 @@ SOFTWARE.
#ifndef CORSIX_TH_TH_MAP_H_ #ifndef CORSIX_TH_TH_MAP_H_
#define CORSIX_TH_TH_MAP_H_ #define CORSIX_TH_TH_MAP_H_
#include "config.h"
#include <list> #include <list>
#include <string> #include <string>
#include <utility>
#include <vector>
#include "th_gfx.h" #include "th.h"
class lua_persist_reader;
class lua_persist_writer;
class map_overlay;
class render_target;
class sprite_sheet;
struct drawable;
/* /*
Object type enumeration uses same values as original TH does. Object type enumeration uses same values as original TH does.
@@ -212,8 +223,6 @@ struct map_tile {
std::list<object_type> objects; std::list<object_type> objects;
}; };
class sprite_sheet;
//! Prototype for object callbacks from THMap::loadFromTHFile //! Prototype for object callbacks from THMap::loadFromTHFile
/*! /*!
The callback function will receive 5 arguments: The callback function will receive 5 arguments:
@@ -226,8 +235,6 @@ class sprite_sheet;
typedef void (*map_load_object_callback_fn)(void*, int, int, object_type, typedef void (*map_load_object_callback_fn)(void*, int, int, object_type,
uint8_t); uint8_t);
class map_overlay;
class level_map { class level_map {
public: public:
level_map(); level_map();

View File

@@ -23,10 +23,11 @@ SOFTWARE.
#include "th_map_overlays.h" #include "th_map_overlays.h"
#include <array> #include <array>
#include <list>
#include <sstream> #include <sstream>
#include "th_gfx.h"
#include "th_gfx_font.h" #include "th_gfx_font.h"
#include "th_gfx_sdl.h"
#include "th_map.h" #include "th_map.h"
map_overlay_pair::map_overlay_pair() { map_overlay_pair::map_overlay_pair() {

View File

@@ -27,21 +27,31 @@ SOFTWARE.
#include "lua_sdl.h" #include "lua_sdl.h"
#if defined(CORSIX_TH_USE_FFMPEG) && defined(CORSIX_TH_USE_SDL_MIXER) #if defined(CORSIX_TH_USE_FFMPEG) && defined(CORSIX_TH_USE_SDL_MIXER)
#include "th_gfx.h"
extern "C" { extern "C" {
#include <libavcodec/avcodec.h> #include <libavcodec/avcodec.h>
#include <libavutil/avutil.h> #include <libavutil/avutil.h>
#include <libavutil/channel_layout.h> #include <libavutil/channel_layout.h>
#include <libavutil/error.h>
#include <libavutil/imgutils.h> #include <libavutil/imgutils.h>
#include <libavutil/mathematics.h> #include <libavutil/rational.h>
#include <libavutil/opt.h> #include <libavutil/samplefmt.h>
#include <libswresample/version.h>
#include <libswscale/swscale.h> #include <libswscale/swscale.h>
} }
#include <SDL_error.h>
#include <SDL_events.h>
#include <SDL_mixer.h> #include <SDL_mixer.h>
#include <SDL_pixels.h>
#include <SDL_rect.h>
#include <SDL_render.h>
#include <SDL_timer.h>
#include <cerrno>
#include <chrono> #include <chrono>
#include <cstring> #include <cstring>
#include <iostream> #include <iostream>
#include <stdexcept>
#include <utility>
namespace { namespace {

View File

@@ -25,11 +25,13 @@ SOFTWARE.
#include "config.h" #include "config.h"
#include <SDL.h> #include <SDL_rect.h>
#include <SDL_render.h>
#include <array> #include <array>
#include <atomic> #include <atomic>
#include <condition_variable> #include <condition_variable>
#include <memory>
#include <mutex> #include <mutex>
#include <queue> #include <queue>
#include <string> #include <string>
@@ -45,11 +47,12 @@ extern "C" {
#endif #endif
#include <libavcodec/avcodec.h> #include <libavcodec/avcodec.h>
#include <libavformat/avformat.h> #include <libavformat/avformat.h>
#include <libavutil/avutil.h> #include <libavutil/avutil.h> // IWYU pragma: keep
#include <libswresample/swresample.h> #include <libswresample/swresample.h>
#include <libswscale/swscale.h>
} }
struct SwsContext;
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59, 0, 100) #if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59, 0, 100)
using av_codec_ptr = AVCodec*; using av_codec_ptr = AVCodec*;
#else #else

View File

@@ -26,12 +26,15 @@ SOFTWARE.
#include <cmath> #include <cmath>
#include <cstdlib> #include <cstdlib>
#include <queue> #include <initializer_list>
#include <list>
#include <new>
#include <stdexcept> #include <stdexcept>
#include <vector> #include <vector>
#include "lua.hpp" #include "lua.hpp"
#include "persist_lua.h" #include "persist_lua.h"
#include "th_map.h"
abstract_pathfinder::abstract_pathfinder(pathfinder* pf) : parent(pf) {} abstract_pathfinder::abstract_pathfinder(pathfinder* pf) : parent(pf) {}

View File

@@ -22,11 +22,20 @@ SOFTWARE.
#ifndef CORSIX_TH_TH_PATHFIND_H_ #ifndef CORSIX_TH_TH_PATHFIND_H_
#define CORSIX_TH_TH_PATHFIND_H_ #define CORSIX_TH_TH_PATHFIND_H_
#include "th_map.h"
#include "config.h"
#include <cstdint>
#include <vector>
#include "lua.hpp"
class level_map;
class lua_persist_reader; class lua_persist_reader;
class lua_persist_writer; class lua_persist_writer;
class pathfinder; class pathfinder;
enum class object_type : uint8_t;
struct map_tile_flags;
/** Directions of movement. */ /** Directions of movement. */
enum class travel_direction { enum class travel_direction {

View File

@@ -24,11 +24,16 @@ SOFTWARE.
#include "config.h" #include "config.h"
#include <SDL_rwops.h>
#include <cmath> #include <cmath>
#include <cstring> #include <cstring>
#include <new> #include <new>
#include "th.h" #include "th.h"
#ifdef CORSIX_TH_USE_SDL_MIXER
#include <SDL_mixer.h>
#endif
sound_archive::sound_archive() { sound_archive::sound_archive() {
sound_files = nullptr; sound_files = nullptr;

View File

@@ -24,7 +24,7 @@ SOFTWARE.
#define CORSIX_TH_TH_SOUND_H_ #define CORSIX_TH_TH_SOUND_H_
#include "config.h" #include "config.h"
#include <SDL.h> #include <SDL_rwops.h>
#ifdef CORSIX_TH_USE_SDL_MIXER #ifdef CORSIX_TH_USE_SDL_MIXER
#include <SDL_mixer.h> #include <SDL_mixer.h>
#endif #endif

View File

@@ -24,7 +24,6 @@ SOFTWARE.
#ifdef CORSIX_TH_USE_SDL_MIXER #ifdef CORSIX_TH_USE_SDL_MIXER
#include <algorithm> #include <algorithm>
#include <cstring> #include <cstring>
#include <iterator>
#include <new> #include <new>
#include <vector> #include <vector>

View File

@@ -27,9 +27,9 @@ SOFTWARE.
#include <SDL.h> #include <SDL.h>
#include <cstdio> #include <cstdio>
#include <stack>
#include "../Src/bootstrap.h" #include "../Src/bootstrap.h"
#include "../Src/lua.hpp"
#ifdef CORSIX_TH_USE_SDL_MIXER #ifdef CORSIX_TH_USE_SDL_MIXER
#include <SDL_mixer.h> #include <SDL_mixer.h>
#endif #endif

View File

@@ -38,7 +38,6 @@ SOFTWARE.
#include <cstddef> #include <cstddef>
#include <cstdint> #include <cstdint>
#include <vector>
static const std::uint32_t rnc_signature = 0x524E4301; /*!< "RNC\001" */ static const std::uint32_t rnc_signature = 0x524E4301; /*!< "RNC\001" */

View File

@@ -20,6 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
*/ */
#include <cstdint>
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
#include <cstring> #include <cstring>