Index: source/graphics/HeightMipmap.h =================================================================== --- source/graphics/HeightMipmap.h +++ source/graphics/HeightMipmap.h @@ -24,6 +24,8 @@ #ifndef INCLUDED_HEIGHTMIPMAP #define INCLUDED_HEIGHTMIPMAP +#include + class Path; using VfsPath = Path; Index: source/graphics/MiniPatch.h =================================================================== --- source/graphics/MiniPatch.h +++ source/graphics/MiniPatch.h @@ -24,7 +24,7 @@ #include "lib/res/handle.h" -#include "graphics/TerrainTextureEntry.h" +class CTerrainTextureEntry; /////////////////////////////////////////////////////////////////////////////// // CMiniPatch: definition of a single terrain tile Index: source/graphics/Overlay.h =================================================================== --- source/graphics/Overlay.h +++ source/graphics/Overlay.h @@ -25,6 +25,8 @@ #include "maths/FixedVector3D.h" #include "ps/CStrIntern.h" +#include + class CFrustum; class CTerrain; class CSimContext; Index: source/graphics/ShaderDefines.h =================================================================== --- source/graphics/ShaderDefines.h +++ source/graphics/ShaderDefines.h @@ -24,6 +24,7 @@ #include #include +#include class CVector4D; Index: source/graphics/ShaderProgram.cpp =================================================================== --- source/graphics/ShaderProgram.cpp +++ source/graphics/ShaderProgram.cpp @@ -23,6 +23,7 @@ #include "graphics/PreprocessorWrapper.h" #include "graphics/ShaderManager.h" #include "graphics/TextureManager.h" +#include "lib/timer.h" #include "lib/res/graphics/ogl_tex.h" #include "maths/Matrix3D.h" #include "maths/Vector3D.h" Index: source/graphics/ShaderTechnique.h =================================================================== --- source/graphics/ShaderTechnique.h +++ source/graphics/ShaderTechnique.h @@ -22,6 +22,8 @@ #include "graphics/ShaderTechniquePtr.h" #include "lib/ogl.h" +#include + /** * Implements a render pass consisting of various GL state changes and a shader, * used by CShaderTechnique. Index: source/graphics/SkeletonAnimDef.cpp =================================================================== --- source/graphics/SkeletonAnimDef.cpp +++ source/graphics/SkeletonAnimDef.cpp @@ -24,6 +24,7 @@ #include "SkeletonAnimDef.h" #include "maths/MathUtil.h" #include "maths/Matrix3D.h" +#include "ps/CStr.h" #include "ps/FileIo.h" Index: source/graphics/TerrainTextureEntry.cpp =================================================================== --- source/graphics/TerrainTextureEntry.cpp +++ source/graphics/TerrainTextureEntry.cpp @@ -22,6 +22,7 @@ #include "lib/utf8.h" #include "lib/ogl.h" #include "lib/allocators/shared_ptr.h" +#include "lib/file/io/io.h" #include "lib/res/graphics/ogl_tex.h" #include "ps/CLogger.h" Index: source/graphics/TextRenderer.h =================================================================== --- source/graphics/TextRenderer.h +++ source/graphics/TextRenderer.h @@ -24,6 +24,8 @@ #include "ps/CStrIntern.h" #include "ps/Shapes.h" +#include + class CFont; class CTextRenderer Index: source/graphics/TextRenderer.cpp =================================================================== --- source/graphics/TextRenderer.cpp +++ source/graphics/TextRenderer.cpp @@ -27,6 +27,8 @@ #include "ps/GameSetup/Config.h" #include "renderer/Renderer.h" +#include + CTextRenderer::CTextRenderer(const CShaderProgramPtr& shader) : m_Shader(shader) { Index: source/graphics/TextureManager.cpp =================================================================== --- source/graphics/TextureManager.cpp +++ source/graphics/TextureManager.cpp @@ -32,6 +32,8 @@ #include "ps/Filesystem.h" #include "ps/Profile.h" +#include + #include #include #include Index: source/graphics/UnitAnimation.h =================================================================== --- source/graphics/UnitAnimation.h +++ source/graphics/UnitAnimation.h @@ -22,6 +22,8 @@ #include "simulation2/system/Entity.h" +#include + class CUnit; class CModel; class CSkeletonAnim; Index: source/gui/CGUI.h =================================================================== --- source/gui/CGUI.h +++ source/gui/CGUI.h @@ -24,7 +24,6 @@ #define INCLUDED_CGUI #include "gui/GUITooltip.h" -#include "gui/ObjectTypes/CGUIDummyObject.h" #include "gui/SettingTypes/CGUIColor.h" #include "gui/SGUIIcon.h" #include "gui/SGUIStyle.h" @@ -49,6 +48,8 @@ namespace js { class BaseProxyHandler; } +using map_pObjects = std::map; + /** * The main object that represents a whole GUI page. */ @@ -146,7 +147,7 @@ /** * Return the object which is an ancestor of every other GUI object. */ - CGUIDummyObject& GetBaseObject() { return m_BaseObject; }; + IGUIObject* GetBaseObject(); /** * Checks if object exists and return true or false accordingly @@ -570,7 +571,7 @@ * Base Object, all its children are considered parentless * because this is not a real object per se. */ - CGUIDummyObject m_BaseObject; + std::unique_ptr m_BaseObject; /** * Focused object! Index: source/gui/CGUI.cpp =================================================================== --- source/gui/CGUI.cpp +++ source/gui/CGUI.cpp @@ -20,6 +20,7 @@ #include "CGUI.h" #include "gui/IGUIScrollBar.h" +#include "gui/ObjectTypes/CGUIDummyObject.h" #include "gui/ObjectTypes/CTooltip.h" #include "gui/Scripting/ScriptFunctions.h" #include "i18n/L10n.h" @@ -63,7 +64,7 @@ const CStr CGUI::EventNameMouseRightRelease = "MouseRightRelease"; CGUI::CGUI(const shared_ptr& context) - : m_BaseObject(*this), + : m_BaseObject(new CGUIDummyObject(*this)), m_FocusedObject(nullptr), m_InternalNameNumber(0), m_MouseButtons(0) @@ -126,7 +127,7 @@ m_MousePos = CPos((float)ev->ev.motion.x / g_GuiScale, (float)ev->ev.motion.y / g_GuiScale); SGUIMessage msg(GUIM_MOUSE_MOTION); - m_BaseObject.RecurseObject(&IGUIObject::IsHiddenOrGhost, &IGUIObject::HandleMessage, msg); + m_BaseObject->RecurseObject(&IGUIObject::IsHiddenOrGhost, &IGUIObject::HandleMessage, msg); } // Update m_MouseButtons. (BUTTONUP is handled later.) @@ -164,7 +165,7 @@ // Now we'll call UpdateMouseOver on *all* objects, // we'll input the one hovered, and they will each // update their own data and send messages accordingly - m_BaseObject.RecurseObject(&IGUIObject::IsHiddenOrGhost, &IGUIObject::UpdateMouseOver, static_cast(pNearest)); + m_BaseObject->RecurseObject(&IGUIObject::IsHiddenOrGhost, &IGUIObject::UpdateMouseOver, static_cast(pNearest)); if (ev->ev.type == SDL_MOUSEBUTTONDOWN) { @@ -223,10 +224,10 @@ } // Reset all states on all visible objects - m_BaseObject.RecurseObject(&IGUIObject::IsHidden, &IGUIObject::ResetStates); + m_BaseObject->RecurseObject(&IGUIObject::IsHidden, &IGUIObject::ResetStates); // Since the hover state will have been reset, we reload it. - m_BaseObject.RecurseObject(&IGUIObject::IsHiddenOrGhost, &IGUIObject::UpdateMouseOver, static_cast(pNearest)); + m_BaseObject->RecurseObject(&IGUIObject::IsHiddenOrGhost, &IGUIObject::UpdateMouseOver, static_cast(pNearest)); } } @@ -266,7 +267,7 @@ void CGUI::TickObjects() { - m_BaseObject.RecurseObject(&IGUIObject::IsHiddenOrGhost, &IGUIObject::Tick); + m_BaseObject->RecurseObject(&IGUIObject::IsHiddenOrGhost, &IGUIObject::Tick); SendEventToAll(EventNameTick); m_Tooltip.Update(FindObjectUnderMouse(), m_MousePos, *this); } @@ -299,7 +300,7 @@ // drawn on top of everything else glClear(GL_DEPTH_BUFFER_BIT); - m_BaseObject.RecurseObject(&IGUIObject::IsHidden, &IGUIObject::Draw); + m_BaseObject->RecurseObject(&IGUIObject::IsHidden, &IGUIObject::Draw); } void CGUI::DrawSprite(const CGUISpriteInstance& Sprite, int CellID, const float& Z, const CRect& Rect, const CRect& UNUSED(Clipping)) @@ -315,7 +316,7 @@ void CGUI::UpdateResolution() { - m_BaseObject.RecurseObject(nullptr, &IGUIObject::UpdateCachedSize); + m_BaseObject->RecurseObject(nullptr, &IGUIObject::UpdateCachedSize); } IGUIObject* CGUI::ConstructObject(const CStr& str) @@ -347,6 +348,11 @@ return true; } +IGUIObject* CGUI::GetBaseObject() +{ + return m_BaseObject.get(); +}; + bool CGUI::ObjectExists(const CStr& Name) const { return m_pAllObjects.find(Name) != m_pAllObjects.end(); @@ -365,7 +371,7 @@ IGUIObject* CGUI::FindObjectUnderMouse() { IGUIObject* pNearest = nullptr; - m_BaseObject.RecurseObject(&IGUIObject::IsHiddenOrGhost, &IGUIObject::ChooseMouseOverAndClosest, pNearest); + m_BaseObject->RecurseObject(&IGUIObject::IsHiddenOrGhost, &IGUIObject::ChooseMouseOverAndClosest, pNearest); return pNearest; } @@ -487,10 +493,10 @@ void CGUI::LoadedXmlFiles() { - m_BaseObject.RecurseObject(nullptr, &IGUIObject::UpdateCachedSize); + m_BaseObject->RecurseObject(nullptr, &IGUIObject::UpdateCachedSize); SGUIMessage msg(GUIM_LOAD); - m_BaseObject.RecurseObject(nullptr, &IGUIObject::HandleMessage, msg); + m_BaseObject->RecurseObject(nullptr, &IGUIObject::HandleMessage, msg); SendEventToAll(EventNameLoad); } @@ -514,7 +520,7 @@ Xeromyces_ReadScript(child, pFile, Paths); else // Read in this whole object into the GUI - Xeromyces_ReadObject(child, pFile, &m_BaseObject, subst, Paths, 0); + Xeromyces_ReadObject(child, pFile, m_BaseObject.get(), subst, Paths, 0); } } @@ -1259,7 +1265,7 @@ object->SetSettingFromString(attr_name, attr_value.FromUTF8(), true); } - if (!AddObject(m_BaseObject, *object)) + if (!AddObject(*m_BaseObject, *object)) delete object; } Index: source/gui/GUIObjectTypes.cpp =================================================================== --- source/gui/GUIObjectTypes.cpp +++ source/gui/GUIObjectTypes.cpp @@ -21,6 +21,7 @@ #include "gui/ObjectTypes/CChart.h" #include "gui/ObjectTypes/CCheckBox.h" #include "gui/ObjectTypes/CDropDown.h" +#include "gui/ObjectTypes/CGUIDummyObject.h" #include "gui/ObjectTypes/CHotkeyPicker.h" #include "gui/ObjectTypes/CImage.h" #include "gui/ObjectTypes/CInput.h" Index: source/gui/IGUIScrollBar.cpp =================================================================== --- source/gui/IGUIScrollBar.cpp +++ source/gui/IGUIScrollBar.cpp @@ -20,6 +20,7 @@ #include "IGUIScrollBar.h" #include "gui/CGUI.h" +#include "gui/SGUIMessage.h" #include "gui/ObjectBases/IGUIScrollBarOwner.h" #include "maths/MathUtil.h" Index: source/gui/ObjectBases/IGUIObject.h =================================================================== --- source/gui/ObjectBases/IGUIObject.h +++ source/gui/ObjectBases/IGUIObject.h @@ -42,8 +42,6 @@ template class JSI_GUIProxy; -using map_pObjects = std::map; - #define GUI_OBJECT(obj) \ public: \ static IGUIObject* ConstructObject(CGUI& pGUI) \ Index: source/gui/ObjectBases/IGUIObject.cpp =================================================================== --- source/gui/ObjectBases/IGUIObject.cpp +++ source/gui/ObjectBases/IGUIObject.cpp @@ -542,12 +542,12 @@ bool IGUIObject::IsBaseObject() const { - return this == &m_pGUI.GetBaseObject(); + return this == m_pGUI.GetBaseObject(); } bool IGUIObject::IsRootObject() const { - return m_pParent == &m_pGUI.GetBaseObject(); + return m_pParent == m_pGUI.GetBaseObject(); } void IGUIObject::TraceMember(JSTracer* trc) Index: source/gui/ObjectBases/IGUIScrollBarOwner.h =================================================================== --- source/gui/ObjectBases/IGUIScrollBarOwner.h +++ source/gui/ObjectBases/IGUIScrollBarOwner.h @@ -18,12 +18,13 @@ #ifndef INCLUDED_IGUISCROLLBAROWNER #define INCLUDED_IGUISCROLLBAROWNER -#include "gui/ObjectBases/IGUIObject.h" - #include +class CStr8; +struct SGUIMessage; struct SGUIScrollBarStyle; class IGUIScrollBar; +class IGUIObject; /** * Base-class this if you want an object to contain @@ -54,7 +55,7 @@ /** * Interface for the m_ScrollBar to use. */ - virtual const SGUIScrollBarStyle* GetScrollBarStyle(const CStr& style) const; + virtual const SGUIScrollBarStyle* GetScrollBarStyle(const CStr8& style) const; /** * Add a scroll-bar Index: source/gui/ObjectBases/IGUIScrollBarOwner.cpp =================================================================== --- source/gui/ObjectBases/IGUIScrollBarOwner.cpp +++ source/gui/ObjectBases/IGUIScrollBarOwner.cpp @@ -21,6 +21,7 @@ #include "gui/CGUI.h" #include "gui/IGUIScrollBar.h" +#include "gui/ObjectBases/IGUIObject.h" IGUIScrollBarOwner::IGUIScrollBarOwner(IGUIObject& pObject) : m_pObject(pObject) Index: source/gui/ObjectBases/IGUITextOwner.h =================================================================== --- source/gui/ObjectBases/IGUITextOwner.h +++ source/gui/ObjectBases/IGUITextOwner.h @@ -30,13 +30,16 @@ #ifndef INCLUDED_IGUITEXTOWNER #define INCLUDED_IGUITEXTOWNER -#include "gui/ObjectBases/IGUIObject.h" +#include "ps/Shapes.h" #include +class CStrW; struct CGUIColor; +struct SGUIMessage; class CGUIText; class CGUIString; +class IGUIObject; /** * Framework for handling Output text. Index: source/gui/ObjectBases/IGUITextOwner.cpp =================================================================== --- source/gui/ObjectBases/IGUITextOwner.cpp +++ source/gui/ObjectBases/IGUITextOwner.cpp @@ -20,6 +20,8 @@ #include "IGUITextOwner.h" #include "gui/CGUI.h" +#include "gui/SGUIMessage.h" +#include "gui/ObjectBases/IGUIObject.h" #include "gui/SettingTypes/CGUIString.h" #include Index: source/gui/ObjectTypes/CChart.h =================================================================== --- source/gui/ObjectTypes/CChart.h +++ source/gui/ObjectTypes/CChart.h @@ -19,6 +19,7 @@ #define INCLUDED_CCHART #include "graphics/ShaderProgramPtr.h" +#include "gui/ObjectBases/IGUIObject.h" #include "gui/ObjectBases/IGUITextOwner.h" #include "gui/SettingTypes/CGUIColor.h" #include "gui/SettingTypes/CGUIList.h" Index: source/gui/ObjectTypes/CCheckBox.h =================================================================== --- source/gui/ObjectTypes/CCheckBox.h +++ source/gui/ObjectTypes/CCheckBox.h @@ -19,6 +19,7 @@ #define INCLUDED_CCHECKBOX #include "gui/CGUISprite.h" +#include "gui/ObjectBases/IGUIObject.h" #include "gui/ObjectBases/IGUIButtonBehavior.h" class CCheckBox : public IGUIObject, public IGUIButtonBehavior Index: source/gui/ObjectTypes/CDropDown.h =================================================================== --- source/gui/ObjectTypes/CDropDown.h +++ source/gui/ObjectTypes/CDropDown.h @@ -29,6 +29,7 @@ #define INCLUDED_CDROPDOWN #include "gui/CGUISprite.h" +#include "gui/ObjectBases/IGUIObject.h" #include "gui/ObjectTypes/CList.h" #include Index: source/gui/ObjectTypes/CHotkeyPicker.h =================================================================== --- source/gui/ObjectTypes/CHotkeyPicker.h +++ source/gui/ObjectTypes/CHotkeyPicker.h @@ -19,6 +19,7 @@ #define INCLUDED_CHOTKEYPICKER #include "gui/CGUI.h" +#include "gui/ObjectBases/IGUIObject.h" #include "lib/external_libraries/libsdl.h" #include "ps/CStr.h" Index: source/gui/ObjectTypes/CInput.h =================================================================== --- source/gui/ObjectTypes/CInput.h +++ source/gui/ObjectTypes/CInput.h @@ -19,9 +19,11 @@ #define INCLUDED_CINPUT #include "gui/CGUISprite.h" +#include "gui/ObjectBases/IGUIObject.h" #include "gui/ObjectBases/IGUIScrollBarOwner.h" #include "lib/external_libraries/libsdl.h" +#include #include /** Index: source/gui/ObjectTypes/CList.h =================================================================== --- source/gui/ObjectTypes/CList.h +++ source/gui/ObjectTypes/CList.h @@ -19,6 +19,7 @@ #define INCLUDED_CLIST #include "gui/CGUISprite.h" +#include "gui/ObjectBases/IGUIObject.h" #include "gui/ObjectBases/IGUIScrollBarOwner.h" #include "gui/ObjectBases/IGUITextOwner.h" #include "gui/SettingTypes/CGUIList.h" Index: source/gui/ObjectTypes/CText.h =================================================================== --- source/gui/ObjectTypes/CText.h +++ source/gui/ObjectTypes/CText.h @@ -19,6 +19,7 @@ #define INCLUDED_CTEXT #include "gui/CGUISprite.h" +#include "gui/ObjectBases/IGUIObject.h" #include "gui/ObjectBases/IGUIScrollBarOwner.h" #include "gui/ObjectBases/IGUITextOwner.h" #include "gui/SettingTypes/CGUIString.h" Index: source/gui/ObjectTypes/CTooltip.h =================================================================== --- source/gui/ObjectTypes/CTooltip.h +++ source/gui/ObjectTypes/CTooltip.h @@ -18,8 +18,9 @@ #ifndef INCLUDED_CTOOLTIP #define INCLUDED_CTOOLTIP -#include "gui/ObjectBases/IGUITextOwner.h" #include "gui/CGUISprite.h" +#include "gui/ObjectBases/IGUIObject.h" +#include "gui/ObjectBases/IGUITextOwner.h" #include "gui/SettingTypes/CGUIString.h" /** Index: source/gui/SettingTypes/CGUIString.cpp =================================================================== --- source/gui/SettingTypes/CGUIString.cpp +++ source/gui/SettingTypes/CGUIString.cpp @@ -21,6 +21,7 @@ #include "graphics/FontMetrics.h" #include "gui/CGUI.h" +#include "gui/ObjectBases/IGUIObject.h" #include "lib/utf8.h" #include "ps/CLogger.h" Index: source/lib/debug_stl.cpp =================================================================== --- source/lib/debug_stl.cpp +++ source/lib/debug_stl.cpp @@ -27,13 +27,14 @@ #include "precompiled.h" #include "lib/debug_stl.h" +#include "lib/regex.h" + +#include #include +#include #include #include -#include -#include - -#include "lib/regex.h" +#include static const StatusDefinition debugStlStatusDefinitions[] = { { ERR::STL_CNT_UNKNOWN, L"Unknown STL container type_name" }, Index: source/lib/file/file_system.h =================================================================== --- source/lib/file/file_system.h +++ source/lib/file/file_system.h @@ -30,6 +30,7 @@ #include "lib/os_path.h" #include "lib/posix/posix_filesystem.h" // mode_t +#include LIB_API bool DirectoryExists(const OsPath& path); LIB_API bool FileExists(const OsPath& pathname); Index: source/lib/file/file_system.cpp =================================================================== --- source/lib/file/file_system.cpp +++ source/lib/file/file_system.cpp @@ -33,6 +33,7 @@ #include "lib/sysdep/filesystem.h" +#include bool DirectoryExists(const OsPath& path) { Index: source/lib/file/vfs/vfs_path.h =================================================================== --- source/lib/file/vfs/vfs_path.h +++ source/lib/file/vfs/vfs_path.h @@ -25,6 +25,8 @@ #include "lib/path.h" +#include + /** * VFS path of the form "(dir/)*file?" * Index: source/lib/file/vfs/vfs_populate.cpp =================================================================== --- source/lib/file/vfs/vfs_populate.cpp +++ source/lib/file/vfs/vfs_populate.cpp @@ -32,7 +32,6 @@ #include "lib/file/vfs/vfs_lookup.h" #include "lib/file/vfs/vfs.h" // error codes - struct CompareFileInfoByName { bool operator()(const CFileInfo& a, const CFileInfo& b) Index: source/lib/input.cpp =================================================================== --- source/lib/input.cpp +++ source/lib/input.cpp @@ -27,11 +27,12 @@ #include "precompiled.h" #include "input.h" +#include "lib/external_libraries/libsdl.h" + +#include #include #include -#include "lib/external_libraries/libsdl.h" - const size_t MAX_HANDLERS = 9; static InHandler handler_stack[MAX_HANDLERS]; static size_t handler_stack_top = 0; Index: source/lib/path.h =================================================================== --- source/lib/path.h +++ source/lib/path.h @@ -39,6 +39,7 @@ #include "lib/utf8.h" +#include #include #include @@ -247,7 +248,7 @@ // Convert the separator to allow for string comparison if(other.separator != ret.separator) - replace(other.path.begin(), other.path.end(), other.separator, ret.separator); + std::replace(other.path.begin(), other.path.end(), other.separator, ret.separator); const size_t idx = ret.path.rfind(other.path); if(idx == String::npos) Index: source/lib/pch/pch_boost.h =================================================================== --- source/lib/pch/pch_boost.h +++ source/lib/pch/pch_boost.h @@ -54,7 +54,13 @@ #else # define BOOST_FILESYSTEM_VERSION 2 #endif -#include + +namespace boost{ + namespace filesystem { + class path; + typedef path wpath; + }; +} namespace fs = boost::filesystem; #endif // #ifndef INCLUDED_PCH_BOOST Index: source/lib/pch/pch_stdlib.h =================================================================== --- source/lib/pch/pch_stdlib.h +++ source/lib/pch/pch_stdlib.h @@ -45,25 +45,26 @@ #include #endif // !MINIMAL_PCH -#if MINIMAL_PCH < 2 +#if MINIMAL_PCH < 3 // common C++98 STL headers #include -#include -#endif - -#if MINIMAL_PCH < 3 -// all other C++98 STL headers -#include -#include #include #include #include #include +#include +#include +#include +#include +#endif + +#if MINIMAL_PCH < 2 +// all other C++98 STL headers +#include +#include #include #include -#include #include -#include #endif #if !MINIMAL_PCH @@ -84,7 +85,6 @@ #include #include #include -#include #include #include #include Index: source/lib/sysdep/acpi.cpp =================================================================== --- source/lib/sysdep/acpi.cpp +++ source/lib/sysdep/acpi.cpp @@ -29,6 +29,8 @@ # include "lib/sysdep/os/win/wfirmware.h" +#include + #pragma pack(1) typedef const volatile u8* PCV_u8; Index: source/lib/sysdep/arch/x86_x64/cache.cpp =================================================================== --- source/lib/sysdep/arch/x86_x64/cache.cpp +++ source/lib/sysdep/arch/x86_x64/cache.cpp @@ -29,6 +29,8 @@ #include "lib/sysdep/os_cpu.h" #include "lib/sysdep/arch/x86_x64/x86_x64.h" +#include + namespace x86_x64 { static const size_t maxTLBs = 2*2*4; // (level0, level1) x (D,I) x (4K, 2M, 4M, 1G) Index: source/lib/sysdep/arch/x86_x64/topology.cpp =================================================================== --- source/lib/sysdep/arch/x86_x64/topology.cpp +++ source/lib/sysdep/arch/x86_x64/topology.cpp @@ -27,8 +27,6 @@ #include "precompiled.h" #include "lib/sysdep/arch/x86_x64/topology.h" -#include - #include "lib/bits.h" #include "lib/module_init.h" #include "lib/sysdep/cpu.h" // ERR::CPU_FEATURE_MISSING @@ -38,6 +36,9 @@ #include "lib/sysdep/arch/x86_x64/cache.h" #include "lib/sysdep/arch/x86_x64/apic.h" +#include +#include + namespace topology { //--------------------------------------------------------------------------------------------------------------------- Index: source/lib/sysdep/dir_watch.h =================================================================== --- source/lib/sysdep/dir_watch.h +++ source/lib/sysdep/dir_watch.h @@ -29,8 +29,16 @@ #include "lib/os_path.h" +namespace std { + template + class vector; + + template + class shared_ptr; +} + struct DirWatch; -typedef shared_ptr PDirWatch; +typedef std::shared_ptr PDirWatch; /** * start watching a single directory for changes. Index: source/lib/sysdep/gfx.cpp =================================================================== --- source/lib/sysdep/gfx.cpp +++ source/lib/sysdep/gfx.cpp @@ -34,6 +34,7 @@ # include "lib/sysdep/os/win/wgfx.h" #endif +#include namespace gfx { Index: source/lib/sysdep/os/osx/dir_watch.cpp =================================================================== --- source/lib/sysdep/os/osx/dir_watch.cpp +++ source/lib/sysdep/os/osx/dir_watch.cpp @@ -30,12 +30,13 @@ #include "lib/file/file.h" #include "lib/posix/posix_filesystem.h" // mode_t +#include "ps/CLogger.h" + #include // MAC_OS_X_VERSION_MIN_REQUIRED #include #include - -#include "ps/CLogger.h" +#include static FSEventStreamRef g_Stream = NULL; Index: source/lib/sysdep/smbios.cpp =================================================================== --- source/lib/sysdep/smbios.cpp +++ source/lib/sysdep/smbios.cpp @@ -38,6 +38,7 @@ #endif #include +#include namespace SMBIOS { Index: source/lib/utf8.h =================================================================== --- source/lib/utf8.h +++ source/lib/utf8.h @@ -23,6 +23,8 @@ #ifndef INCLUDED_UTF8 #define INCLUDED_UTF8 +#include + // note: error codes are returned via optional output parameter. namespace ERR { Index: source/lobby/StanzaExtensions.h =================================================================== --- source/lobby/StanzaExtensions.h +++ source/lobby/StanzaExtensions.h @@ -19,6 +19,8 @@ #include "glooxwrapper/glooxwrapper.h" +#include + /// Global Gamelist Extension #define EXTGAMELISTQUERY 1403 #define XMLNS_GAMELIST "jabber:iq:gamelist" Index: source/lobby/XmppClient.h =================================================================== --- source/lobby/XmppClient.h +++ source/lobby/XmppClient.h @@ -20,10 +20,13 @@ #include "IXmppClient.h" -#include - #include "glooxwrapper/glooxwrapper.h" +#include +#include +#include +#include + class ScriptInterface; namespace glooxwrapper Index: source/lobby/XmppClient.cpp =================================================================== --- source/lobby/XmppClient.cpp +++ source/lobby/XmppClient.cpp @@ -36,6 +36,8 @@ #include +#include + //debug #if 1 #define DbgXMPP(x) Index: source/main.cpp =================================================================== --- source/main.cpp +++ source/main.cpp @@ -31,8 +31,6 @@ #define MINIMAL_PCH 2 #include "lib/precompiled.h" -#include - #include "lib/debug.h" #include "lib/status.h" #include "lib/secure_crt.h" @@ -95,6 +93,9 @@ #define getpid _getpid // Use the non-deprecated function name #endif +#include +#include + extern CmdLineArgs g_args; extern CStrW g_UniqueLogPostfix; Index: source/maths/Brush.h =================================================================== --- source/maths/Brush.h +++ source/maths/Brush.h @@ -26,6 +26,8 @@ #include "graphics/ShaderProgramPtr.h" +#include + class CBoundingBoxAligned; class CFrustum; class CPlane; Index: source/maths/NUSpline.h =================================================================== --- source/maths/NUSpline.h +++ source/maths/NUSpline.h @@ -29,6 +29,8 @@ #include "FixedVector3D.h" #include "Vector3D.h" +#include + /** * Describes a node of the spline */ Index: source/network/NetClient.h =================================================================== --- source/network/NetClient.h +++ source/network/NetClient.h @@ -25,6 +25,7 @@ #include "ps/CStr.h" +#include #include class CGame; Index: source/network/NetFileTransfer.h =================================================================== --- source/network/NetFileTransfer.h +++ source/network/NetFileTransfer.h @@ -19,6 +19,7 @@ #define NETFILETRANSFER_H #include +#include class CNetMessage; class CFileTransferResponseMessage; Index: source/network/NetServer.h =================================================================== --- source/network/NetServer.h +++ source/network/NetServer.h @@ -24,6 +24,7 @@ #include "lib/types.h" #include "scriptinterface/ScriptTypes.h" +#include #include #include #include Index: source/network/NetStats.h =================================================================== --- source/network/NetStats.h +++ source/network/NetStats.h @@ -21,6 +21,7 @@ #include "ps/ProfileViewer.h" #include +#include typedef struct _ENetPeer ENetPeer; typedef struct _ENetHost ENetHost; Index: source/pch/engine/precompiled.h =================================================================== --- source/pch/engine/precompiled.h +++ source/pch/engine/precompiled.h @@ -19,11 +19,10 @@ // "engine"-specific PCH: -#include "ps/Pyrogenesis.h" // old error system - #if CONFIG_ENABLE_PCH - -#include "SDL.h" -#include "SDL_endian.h" - +#include "ps/CStr.h" +#include "ps/Errors.h" +#include "lib/file/vfs/vfs_path.h" +#include "lib/file/vfs/vfs_util.h" +#include "scriptinterface/ScriptTypes.h" #endif // CONFIG_ENABLE_PCH Index: source/pch/graphics/precompiled.h =================================================================== --- source/pch/graphics/precompiled.h +++ source/pch/graphics/precompiled.h @@ -18,3 +18,8 @@ #include "lib/precompiled.h" // common precompiled header // "graphics"-specific PCH: +#include "scriptinterface/ScriptTypes.h" +#include "lib/ogl.h" +#include "ps/CStr.h" +#include "ps/CStrIntern.h" +#include "maths/Matrix3D.h" Index: source/pch/gui/precompiled.h =================================================================== --- source/pch/gui/precompiled.h +++ source/pch/gui/precompiled.h @@ -23,7 +23,6 @@ #endif #if CONFIG_ENABLE_PCH - #include "gui/CGUI.h" #include "gui/ObjectBases/IGUIObject.h" #include "ps/CStr.h" Index: source/pch/network/precompiled.h =================================================================== --- source/pch/network/precompiled.h +++ source/pch/network/precompiled.h @@ -23,5 +23,6 @@ // These headers are included by almost all compilation units. #include "ps/CStr.h" #include "ps/ThreadUtil.h" - +#include "network/NetMessage.h" +#include "scriptinterface/ScriptInterface.h" #endif // CONFIG_ENABLE_PCH Index: source/pch/simulation2/precompiled.h =================================================================== --- source/pch/simulation2/precompiled.h +++ source/pch/simulation2/precompiled.h @@ -15,12 +15,9 @@ * along with 0 A.D. If not, see . */ -#define MINIMAL_PCH 1 +#define MINIMAL_PCH 2 #include "lib/precompiled.h" // common precompiled header -// Minimal is a bit *too* minimal to let things compile, so include a few more headers -#include "lib/debug.h" - #if CONFIG_ENABLE_PCH // The simulation has many header files (component interfaces) which are quick to compile on their own @@ -29,5 +26,7 @@ #include "simulation2/system/Component.h" #include "simulation2/system/Interface.h" #include "simulation2/system/InterfaceScripted.h" +#include "maths/FixedVector2D.h" +#include "maths/FixedVector3D.h" #endif // CONFIG_ENABLE_PCH Index: source/ps/Compress.h =================================================================== --- source/ps/Compress.h +++ source/ps/Compress.h @@ -18,6 +18,8 @@ #ifndef INCLUDED_COMPRESS #define INCLUDED_COMPRESS +#include + /** * @file * Simple (non-streaming) compression functions. Index: source/ps/Filesystem.h =================================================================== --- source/ps/Filesystem.h +++ source/ps/Filesystem.h @@ -19,7 +19,6 @@ #define INCLUDED_PS_FILESYSTEM #include "lib/file/file.h" -#include "lib/file/io/io.h" #include "lib/file/io/write_buffer.h" #include "lib/file/vfs/vfs_util.h" Index: source/ps/Filesystem.cpp =================================================================== --- source/ps/Filesystem.cpp +++ source/ps/Filesystem.cpp @@ -25,6 +25,7 @@ #include "lib/sysdep/dir_watch.h" #include "lib/utf8.h" +#include PIVFS g_VFS; Index: source/ps/GameSetup/CmdLineArgs.h =================================================================== --- source/ps/GameSetup/CmdLineArgs.h +++ source/ps/GameSetup/CmdLineArgs.h @@ -21,6 +21,8 @@ #include "ps/CStr.h" #include "lib/os_path.h" +#include + class CmdLineArgs { public: Index: source/ps/Hotkey.h =================================================================== --- source/ps/Hotkey.h +++ source/ps/Hotkey.h @@ -35,6 +35,7 @@ #include "lib/input.h" #include +#include // SDL_Scancode is an enum, we'll use an explicit int to avoid including SDL in this header. using SDL_Scancode_ = int; Index: source/ps/KeyName.cpp =================================================================== --- source/ps/KeyName.cpp +++ source/ps/KeyName.cpp @@ -25,6 +25,7 @@ #include "ps/CStr.h" #include +#include // Some scancodes <-> names that SDL doesn't recognise. // Those are tested first so they override SDL defaults (useful for UNIFIED keys). Index: source/ps/Profile.h =================================================================== --- source/ps/Profile.h +++ source/ps/Profile.h @@ -29,10 +29,6 @@ #include "ps/Profiler2.h" #include "ps/Singleton.h" -#include -#include -#include -#include #define PROFILE_AMORTIZE_FRAMES 30 #define PROFILE_AMORTIZE_TURNS 1 @@ -49,15 +45,6 @@ // // TODO: Check again how much the overhead for getting filename and line really is and if // it has increased with the new approach after the SpiderMonkey 31 upgrade. -// -// Flyweight types (with no_locking because the call hooks are only used in the -// main thread, and no_tracking because we mustn't delete values the profiler is -// using and it's not going to waste much memory) -typedef boost::flyweight< - std::string, - boost::flyweights::no_tracking, - boost::flyweights::no_locking -> StringFlyweight; class CProfileNode { Index: source/ps/Profiler2.h =================================================================== --- source/ps/Profiler2.h +++ source/ps/Profiler2.h @@ -78,13 +78,13 @@ #ifndef INCLUDED_PROFILER2 #define INCLUDED_PROFILER2 -#include -#include - #include "lib/timer.h" #include "ps/ThreadUtil.h" +#include #include +#include +#include struct mg_context; Index: source/ps/Pyrogenesis.h =================================================================== --- source/ps/Pyrogenesis.h +++ source/ps/Pyrogenesis.h @@ -24,7 +24,8 @@ #ifndef INCLUDED_PYROGENESIS #define INCLUDED_PYROGENESIS -#include "lib/os_path.h" +class Path; +using OsPath = Path; extern const char* engine_version; Index: source/ps/SavedGame.cpp =================================================================== --- source/ps/SavedGame.cpp +++ source/ps/SavedGame.cpp @@ -23,6 +23,7 @@ #include "i18n/L10n.h" #include "lib/allocators/shared_ptr.h" #include "lib/file/archive/archive_zip.h" +#include "lib/file/io/io.h" #include "lib/utf8.h" #include "maths/Vector3D.h" #include "ps/CLogger.h" Index: source/ps/VisualReplay.cpp =================================================================== --- source/ps/VisualReplay.cpp +++ source/ps/VisualReplay.cpp @@ -19,9 +19,10 @@ #include "VisualReplay.h" #include "graphics/GameView.h" +#include "lib/timer.h" +#include "lib/utf8.h" #include "lib/allocators/shared_ptr.h" #include "lib/external_libraries/libsdl.h" -#include "lib/utf8.h" #include "network/NetClient.h" #include "network/NetServer.h" #include "ps/CLogger.h" Index: source/ps/XML/XMLWriter.h =================================================================== --- source/ps/XML/XMLWriter.h +++ source/ps/XML/XMLWriter.h @@ -62,8 +62,8 @@ */ #include "lib/file/vfs/vfs.h" +#include "ps/CStr.h" -class CStr8; class XMBElement; class XMBFile; class XMLWriter_Element; @@ -98,7 +98,7 @@ bool m_PrettyPrint; - CStr8 m_Data; + CStr m_Data; int m_Indent; XMLWriter_Element* m_LastElement; }; @@ -119,7 +119,7 @@ friend class XMLWriter_File; XMLWriter_File* m_File; - CStr8 m_Name; + CStr m_Name; int m_Type; }; Index: source/renderer/DecalRData.h =================================================================== --- source/renderer/DecalRData.h +++ source/renderer/DecalRData.h @@ -18,7 +18,6 @@ #ifndef INCLUDED_DECALRDATA #define INCLUDED_DECALRDATA -#include "graphics/Camera.h" #include "graphics/RenderableObject.h" #include "graphics/ShaderProgramPtr.h" #include "renderer/VertexArray.h" Index: source/renderer/PatchRData.cpp =================================================================== --- source/renderer/PatchRData.cpp +++ source/renderer/PatchRData.cpp @@ -25,6 +25,7 @@ #include "graphics/Patch.h" #include "graphics/ShaderManager.h" #include "graphics/Terrain.h" +#include "graphics/TerrainTextureEntry.h" #include "graphics/TextRenderer.h" #include "lib/alignment.h" #include "lib/allocators/arena.h" Index: source/rlinterface/RLInterface.h =================================================================== --- source/rlinterface/RLInterface.h +++ source/rlinterface/RLInterface.h @@ -21,6 +21,7 @@ #include #include +#include #include struct ScenarioConfig { Index: source/rlinterface/RLInterface.cpp =================================================================== --- source/rlinterface/RLInterface.cpp +++ source/rlinterface/RLInterface.cpp @@ -23,7 +23,6 @@ #include "gui/GUIManager.h" #include "ps/Game.h" -#include "ps/GameSetup/GameSetup.h" #include "ps/Loader.h" #include "ps/CLogger.h" #include "simulation2/components/ICmpAIInterface.h" @@ -32,8 +31,6 @@ #include "simulation2/system/LocalTurnManager.h" #include "third_party/mongoose/mongoose.h" -#include -#include #include // Globally accessible pointer to the RL Interface. Index: source/scriptinterface/ScriptContext.h =================================================================== --- source/scriptinterface/ScriptContext.h +++ source/scriptinterface/ScriptContext.h @@ -21,6 +21,7 @@ #include "ScriptTypes.h" #include "ScriptExtraHeaders.h" +#include #include // Those are minimal defaults. The runtime for the main game is larger and GCs upon a larger growth. Index: source/scriptinterface/ScriptInterface.h =================================================================== --- source/scriptinterface/ScriptInterface.h +++ source/scriptinterface/ScriptInterface.h @@ -24,7 +24,6 @@ #include "scriptinterface/ScriptExceptions.h" #include "scriptinterface/ScriptTypes.h" -#include #include ERROR_GROUP(Scripting); @@ -57,6 +56,8 @@ // use their own threads and also their own contexts. extern thread_local shared_ptr g_ScriptContext; +namespace boost { namespace random { class rand48; } } + /** * RAII structure which encapsulates an access to the context and compartment of a ScriptInterface. * This struct provides: @@ -138,7 +139,7 @@ /** * Replace the default JS random number geenrator with a seeded, network-sync'd one. */ - bool ReplaceNondeterministicRNG(boost::rand48& rng); + bool ReplaceNondeterministicRNG(boost::random::rand48& rng); /** * Call a constructor function, equivalent to JS "new ctor(arg)". @@ -446,7 +447,7 @@ // members have to be called before the custom destructor of ScriptInterface_impl. std::unique_ptr m; - boost::rand48* m_rng; + boost::random::rand48* m_rng; std::map m_CustomObjectTypes; // The nasty macro/template bits are split into a separate file so you don't have to look at them Index: source/scriptinterface/ScriptStats.h =================================================================== --- source/scriptinterface/ScriptStats.h +++ source/scriptinterface/ScriptStats.h @@ -20,6 +20,8 @@ #include "ps/ProfileViewer.h" +#include + class ScriptInterface; class CScriptStatsTable : public AbstractProfileTable Index: source/simulation2/components/ICmpAIManager.cpp =================================================================== --- source/simulation2/components/ICmpAIManager.cpp +++ source/simulation2/components/ICmpAIManager.cpp @@ -24,6 +24,8 @@ #include "lib/file/vfs/vfs_util.h" #include "ps/Filesystem.h" +#include + BEGIN_INTERFACE_WRAPPER(AIManager) DEFINE_INTERFACE_METHOD_4("AddPlayer", void, ICmpAIManager, AddPlayer, std::wstring, player_id_t, uint8_t, std::wstring) DEFINE_INTERFACE_METHOD_0("TryLoadSharedComponent", void, ICmpAIManager, TryLoadSharedComponent) Index: source/simulation2/helpers/HierarchicalPathfinder.h =================================================================== --- source/simulation2/helpers/HierarchicalPathfinder.h +++ source/simulation2/helpers/HierarchicalPathfinder.h @@ -25,6 +25,8 @@ #include "Render.h" #include "graphics/SColor.h" +#include + /** * Hierarchical pathfinder. * Index: source/simulation2/helpers/LongPathfinder.h =================================================================== --- source/simulation2/helpers/LongPathfinder.h +++ source/simulation2/helpers/LongPathfinder.h @@ -26,6 +26,8 @@ #include "simulation2/helpers/Grid.h" #include "simulation2/helpers/PriorityQueue.h" +#include + /** * Represents the 2D coordinates of a tile. * The i/j components are packed into a single u32, since we usually use these Index: source/simulation2/helpers/Render.h =================================================================== --- source/simulation2/helpers/Render.h +++ source/simulation2/helpers/Render.h @@ -18,6 +18,8 @@ #ifndef INCLUDED_HELPER_RENDER #define INCLUDED_HELPER_RENDER +#include + class CSimContext; class CVector2D; class CVector3D; Index: source/simulation2/helpers/VertexPathfinder.h =================================================================== --- source/simulation2/helpers/VertexPathfinder.h +++ source/simulation2/helpers/VertexPathfinder.h @@ -22,6 +22,8 @@ #include "simulation2/helpers/Pathfinding.h" #include "simulation2/system/CmpPtr.h" +#include + // A vertex around the corners of an obstruction // (paths will be sequences of these vertexes) struct Vertex Index: source/simulation2/serialization/BinarySerializer.h =================================================================== --- source/simulation2/serialization/BinarySerializer.h +++ source/simulation2/serialization/BinarySerializer.h @@ -23,7 +23,9 @@ #include "lib/byte_order.h" #include "lib/allocators/arena.h" +#include #include +#include /** * Wrapper for redirecting ostream writes to CBinarySerializer's impl Index: source/simulation2/serialization/StdDeserializer.h =================================================================== --- source/simulation2/serialization/StdDeserializer.h +++ source/simulation2/serialization/StdDeserializer.h @@ -23,6 +23,7 @@ #include "ps/utf16string.h" #include +#include class CStdDeserializer : public IDeserializer { Index: source/simulation2/system/ComponentManagerSerialization.cpp =================================================================== --- source/simulation2/system/ComponentManagerSerialization.cpp +++ source/simulation2/system/ComponentManagerSerialization.cpp @@ -32,14 +32,14 @@ #include "ps/CLogger.h" -std::string SerializeRNG(const boost::rand48& rng) +std::string SerializeRNG(const boost::random::rand48& rng) { std::stringstream s; s << rng; return s.str(); } -void DeserializeRNG(const std::string& str, boost::rand48& rng) +void DeserializeRNG(const std::string& str, boost::random::rand48& rng) { std::stringstream s; s << str; Index: source/simulation2/system/DynamicSubscription.h =================================================================== --- source/simulation2/system/DynamicSubscription.h +++ source/simulation2/system/DynamicSubscription.h @@ -21,6 +21,7 @@ #include "IComponent.h" #include +#include /** * A list of components that are dynamically subscribed to a particular Index: source/simulation2/system/IComponent.cpp =================================================================== --- source/simulation2/system/IComponent.cpp +++ source/simulation2/system/IComponent.cpp @@ -19,6 +19,8 @@ #include "IComponent.h" +#include + IComponent::~IComponent() { } Index: source/tools/atlas/GameInterface/Brushes.h =================================================================== --- source/tools/atlas/GameInterface/Brushes.h +++ source/tools/atlas/GameInterface/Brushes.h @@ -20,6 +20,8 @@ #include "maths/Vector3D.h" +#include + class TerrainOverlay; namespace AtlasMessage {