Index: ps/trunk/source/graphics/HeightMipmap.h =================================================================== --- ps/trunk/source/graphics/HeightMipmap.h +++ ps/trunk/source/graphics/HeightMipmap.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2012 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -24,6 +24,8 @@ #ifndef INCLUDED_HEIGHTMIPMAP #define INCLUDED_HEIGHTMIPMAP +#include + class Path; using VfsPath = Path; Index: ps/trunk/source/graphics/MiniPatch.h =================================================================== --- ps/trunk/source/graphics/MiniPatch.h +++ ps/trunk/source/graphics/MiniPatch.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -24,7 +24,7 @@ #include "lib/res/handle.h" -#include "graphics/TerrainTextureEntry.h" +class CTerrainTextureEntry; /////////////////////////////////////////////////////////////////////////////// // CMiniPatch: definition of a single terrain tile Index: ps/trunk/source/graphics/Overlay.h =================================================================== --- ps/trunk/source/graphics/Overlay.h +++ ps/trunk/source/graphics/Overlay.h @@ -25,6 +25,8 @@ #include "maths/FixedVector3D.h" #include "ps/CStrIntern.h" +#include + class CFrustum; class CTerrain; class CSimContext; Index: ps/trunk/source/graphics/ShaderDefines.h =================================================================== --- ps/trunk/source/graphics/ShaderDefines.h +++ ps/trunk/source/graphics/ShaderDefines.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -24,6 +24,7 @@ #include #include +#include class CVector4D; Index: ps/trunk/source/graphics/ShaderProgram.cpp =================================================================== --- ps/trunk/source/graphics/ShaderProgram.cpp +++ ps/trunk/source/graphics/ShaderProgram.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -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: ps/trunk/source/graphics/ShaderTechnique.h =================================================================== --- ps/trunk/source/graphics/ShaderTechnique.h +++ ps/trunk/source/graphics/ShaderTechnique.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2012 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -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: ps/trunk/source/graphics/TerrainTextureEntry.cpp =================================================================== --- ps/trunk/source/graphics/TerrainTextureEntry.cpp +++ ps/trunk/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: ps/trunk/source/graphics/TextRenderer.h =================================================================== --- ps/trunk/source/graphics/TextRenderer.h +++ ps/trunk/source/graphics/TextRenderer.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -24,6 +24,8 @@ #include "ps/CStrIntern.h" #include "ps/Shapes.h" +#include + class CFont; class CTextRenderer Index: ps/trunk/source/graphics/TextRenderer.cpp =================================================================== --- ps/trunk/source/graphics/TextRenderer.cpp +++ ps/trunk/source/graphics/TextRenderer.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -27,6 +27,8 @@ #include "ps/GameSetup/Config.h" #include "renderer/Renderer.h" +#include + CTextRenderer::CTextRenderer(const CShaderProgramPtr& shader) : m_Shader(shader) { Index: ps/trunk/source/graphics/TextureManager.cpp =================================================================== --- ps/trunk/source/graphics/TextureManager.cpp +++ ps/trunk/source/graphics/TextureManager.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -32,6 +32,8 @@ #include "ps/Filesystem.h" #include "ps/Profile.h" +#include + #include #include #include Index: ps/trunk/source/graphics/UnitAnimation.h =================================================================== --- ps/trunk/source/graphics/UnitAnimation.h +++ ps/trunk/source/graphics/UnitAnimation.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -22,6 +22,8 @@ #include "simulation2/system/Entity.h" +#include + class CUnit; class CModel; class CSkeletonAnim; Index: ps/trunk/source/graphics/tests/test_Color.h =================================================================== --- ps/trunk/source/graphics/tests/test_Color.h +++ ps/trunk/source/graphics/tests/test_Color.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2009 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -19,6 +19,8 @@ #include "graphics/Color.h" +#include + class TestColor : public CxxTest::TestSuite { public: Index: ps/trunk/source/gui/CGUI.h =================================================================== --- ps/trunk/source/gui/CGUI.h +++ ps/trunk/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. */ @@ -152,7 +153,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 @@ -576,7 +577,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: ps/trunk/source/gui/CGUI.cpp =================================================================== --- ps/trunk/source/gui/CGUI.cpp +++ ps/trunk/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; } @@ -500,10 +506,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); } @@ -527,7 +533,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); } } @@ -1265,7 +1271,7 @@ object->SetSettingFromString(attr_name, attr_value.FromUTF8(), true); } - if (!AddObject(m_BaseObject, *object)) + if (!AddObject(*m_BaseObject, *object)) delete object; } Index: ps/trunk/source/gui/GUIObjectTypes.cpp =================================================================== --- ps/trunk/source/gui/GUIObjectTypes.cpp +++ ps/trunk/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: ps/trunk/source/gui/IGUIScrollBar.cpp =================================================================== --- ps/trunk/source/gui/IGUIScrollBar.cpp +++ ps/trunk/source/gui/IGUIScrollBar.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -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: ps/trunk/source/gui/ObjectBases/IGUIObject.h =================================================================== --- ps/trunk/source/gui/ObjectBases/IGUIObject.h +++ ps/trunk/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: ps/trunk/source/gui/ObjectBases/IGUIObject.cpp =================================================================== --- ps/trunk/source/gui/ObjectBases/IGUIObject.cpp +++ ps/trunk/source/gui/ObjectBases/IGUIObject.cpp @@ -554,12 +554,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: ps/trunk/source/gui/ObjectBases/IGUIScrollBarOwner.h =================================================================== --- ps/trunk/source/gui/ObjectBases/IGUIScrollBarOwner.h +++ ps/trunk/source/gui/ObjectBases/IGUIScrollBarOwner.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -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: ps/trunk/source/gui/ObjectBases/IGUIScrollBarOwner.cpp =================================================================== --- ps/trunk/source/gui/ObjectBases/IGUIScrollBarOwner.cpp +++ ps/trunk/source/gui/ObjectBases/IGUIScrollBarOwner.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -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: ps/trunk/source/gui/ObjectBases/IGUITextOwner.h =================================================================== --- ps/trunk/source/gui/ObjectBases/IGUITextOwner.h +++ ps/trunk/source/gui/ObjectBases/IGUITextOwner.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -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: ps/trunk/source/gui/ObjectBases/IGUITextOwner.cpp =================================================================== --- ps/trunk/source/gui/ObjectBases/IGUITextOwner.cpp +++ ps/trunk/source/gui/ObjectBases/IGUITextOwner.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -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: ps/trunk/source/gui/ObjectTypes/CChart.h =================================================================== --- ps/trunk/source/gui/ObjectTypes/CChart.h +++ ps/trunk/source/gui/ObjectTypes/CChart.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -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: ps/trunk/source/gui/ObjectTypes/CCheckBox.h =================================================================== --- ps/trunk/source/gui/ObjectTypes/CCheckBox.h +++ ps/trunk/source/gui/ObjectTypes/CCheckBox.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -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: ps/trunk/source/gui/ObjectTypes/CDropDown.h =================================================================== --- ps/trunk/source/gui/ObjectTypes/CDropDown.h +++ ps/trunk/source/gui/ObjectTypes/CDropDown.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -29,6 +29,7 @@ #define INCLUDED_CDROPDOWN #include "gui/CGUISprite.h" +#include "gui/ObjectBases/IGUIObject.h" #include "gui/ObjectTypes/CList.h" #include Index: ps/trunk/source/gui/ObjectTypes/CHotkeyPicker.h =================================================================== --- ps/trunk/source/gui/ObjectTypes/CHotkeyPicker.h +++ ps/trunk/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: ps/trunk/source/gui/ObjectTypes/CInput.h =================================================================== --- ps/trunk/source/gui/ObjectTypes/CInput.h +++ ps/trunk/source/gui/ObjectTypes/CInput.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -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: ps/trunk/source/gui/ObjectTypes/CList.h =================================================================== --- ps/trunk/source/gui/ObjectTypes/CList.h +++ ps/trunk/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: ps/trunk/source/gui/ObjectTypes/CText.h =================================================================== --- ps/trunk/source/gui/ObjectTypes/CText.h +++ ps/trunk/source/gui/ObjectTypes/CText.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -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: ps/trunk/source/gui/ObjectTypes/CTooltip.h =================================================================== --- ps/trunk/source/gui/ObjectTypes/CTooltip.h +++ ps/trunk/source/gui/ObjectTypes/CTooltip.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -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: ps/trunk/source/gui/SettingTypes/CGUIString.cpp =================================================================== --- ps/trunk/source/gui/SettingTypes/CGUIString.cpp +++ ps/trunk/source/gui/SettingTypes/CGUIString.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -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: ps/trunk/source/lib/allocators/allocator_policies.h =================================================================== --- ps/trunk/source/lib/allocators/allocator_policies.h +++ ps/trunk/source/lib/allocators/allocator_policies.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -31,6 +31,7 @@ #include "lib/allocators/allocator_adapters.h" #include "lib/allocators/freelist.h" +#include namespace Allocators { Index: ps/trunk/source/lib/allocators/dynarray.cpp =================================================================== --- ps/trunk/source/lib/allocators/dynarray.cpp +++ ps/trunk/source/lib/allocators/dynarray.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -30,6 +30,8 @@ #include "lib/alignment.h" #include "lib/sysdep/vm.h" +#include +#include static Status validate_da(DynArray* da) { Index: ps/trunk/source/lib/allocators/freelist.h =================================================================== --- ps/trunk/source/lib/allocators/freelist.h +++ ps/trunk/source/lib/allocators/freelist.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2011 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -23,6 +23,8 @@ #ifndef INCLUDED_ALLOCATORS_FREELIST #define INCLUDED_ALLOCATORS_FREELIST +#include + // "freelist" is a pointer to the first unused element or a sentinel. // their memory holds a pointer to the previous element in the freelist // (or its own address in the case of sentinels to avoid branches) Index: ps/trunk/source/lib/bits.cpp =================================================================== --- ps/trunk/source/lib/bits.cpp +++ ps/trunk/source/lib/bits.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -27,6 +27,8 @@ #include "precompiled.h" #include "lib/bits.h" +#include + static inline u32 get_float_bits(const float x) { u32 ret; Index: ps/trunk/source/lib/byte_order.cpp =================================================================== --- ps/trunk/source/lib/byte_order.cpp +++ ps/trunk/source/lib/byte_order.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -29,6 +29,8 @@ #include "lib/bits.h" +#include + #ifndef swap16 u16 swap16(const u16 x) { Index: ps/trunk/source/lib/debug_stl.cpp =================================================================== --- ps/trunk/source/lib/debug_stl.cpp +++ ps/trunk/source/lib/debug_stl.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -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: ps/trunk/source/lib/file/archive/codec_zlib.cpp =================================================================== --- ps/trunk/source/lib/file/archive/codec_zlib.cpp +++ ps/trunk/source/lib/file/archive/codec_zlib.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -29,6 +29,7 @@ #include "lib/sysdep/cpu.h" +#include class Codec_ZLib : public ICodec { Index: ps/trunk/source/lib/file/file_system.h =================================================================== --- ps/trunk/source/lib/file/file_system.h +++ ps/trunk/source/lib/file/file_system.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -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: ps/trunk/source/lib/file/file_system.cpp =================================================================== --- ps/trunk/source/lib/file/file_system.cpp +++ ps/trunk/source/lib/file/file_system.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -33,6 +33,7 @@ #include "lib/sysdep/filesystem.h" +#include bool DirectoryExists(const OsPath& path) { Index: ps/trunk/source/lib/file/vfs/vfs_path.h =================================================================== --- ps/trunk/source/lib/file/vfs/vfs_path.h +++ ps/trunk/source/lib/file/vfs/vfs_path.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -25,6 +25,8 @@ #include "lib/path.h" +#include + /** * VFS path of the form "(dir/)*file?" * Index: ps/trunk/source/lib/file/vfs/vfs_populate.cpp =================================================================== --- ps/trunk/source/lib/file/vfs/vfs_populate.cpp +++ ps/trunk/source/lib/file/vfs/vfs_populate.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2016 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -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: ps/trunk/source/lib/file/vfs/vfs_tree.cpp =================================================================== --- ps/trunk/source/lib/file/vfs/vfs_tree.cpp +++ ps/trunk/source/lib/file/vfs/vfs_tree.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2016 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -28,6 +28,7 @@ #include "lib/file/vfs/vfs_tree.h" #include +#include #include "lib/file/common/file_stats.h" #include "lib/sysdep/cpu.h" Index: ps/trunk/source/lib/input.cpp =================================================================== --- ps/trunk/source/lib/input.cpp +++ ps/trunk/source/lib/input.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2017 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -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: ps/trunk/source/lib/path.h =================================================================== --- ps/trunk/source/lib/path.h +++ ps/trunk/source/lib/path.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -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: ps/trunk/source/lib/pch/pch_boost.h =================================================================== --- ps/trunk/source/lib/pch/pch_boost.h +++ ps/trunk/source/lib/pch/pch_boost.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -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: ps/trunk/source/lib/pch/pch_stdlib.h =================================================================== --- ps/trunk/source/lib/pch/pch_stdlib.h +++ ps/trunk/source/lib/pch/pch_stdlib.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -45,25 +45,26 @@ #include #endif // !MINIMAL_PCH -#if MINIMAL_PCH < 2 +#if MINIMAL_PCH < 3 // common C++98 STL headers #include +#include +#include +#include +#include +#include +#include +#include #include #endif -#if MINIMAL_PCH < 3 +#if MINIMAL_PCH < 2 // all other C++98 STL headers #include #include -#include -#include -#include -#include #include #include -#include #include -#include #endif #if !MINIMAL_PCH @@ -84,7 +85,6 @@ #include #include #include -#include #include #include #include Index: ps/trunk/source/lib/regex.cpp =================================================================== --- ps/trunk/source/lib/regex.cpp +++ ps/trunk/source/lib/regex.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -24,6 +24,7 @@ #include "precompiled.h" +#include int match_wildcard(const wchar_t* s, const wchar_t* w) { Index: ps/trunk/source/lib/res/graphics/tests/test_tex.h =================================================================== --- ps/trunk/source/lib/res/graphics/tests/test_tex.h +++ ps/trunk/source/lib/res/graphics/tests/test_tex.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -26,6 +26,8 @@ #include "lib/tex/tex_codec.h" #include "lib/allocators/shared_ptr.h" +#include + class TestTex : public CxxTest::TestSuite { public: Index: ps/trunk/source/lib/secure_crt.cpp =================================================================== --- ps/trunk/source/lib/secure_crt.cpp +++ ps/trunk/source/lib/secure_crt.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -26,9 +26,10 @@ #include "precompiled.h" -#include -#include -#include +#include +#include +#include +#include #include "lib/secure_crt.h" Index: ps/trunk/source/lib/snd.cpp =================================================================== --- ps/trunk/source/lib/snd.cpp +++ ps/trunk/source/lib/snd.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -27,8 +27,9 @@ #include "precompiled.h" #include "lib/snd.h" -#include -#include +#include +#include +#include #include "lib/external_libraries/openal.h" Index: ps/trunk/source/lib/sysdep/acpi.h =================================================================== --- ps/trunk/source/lib/sysdep/acpi.h +++ ps/trunk/source/lib/sysdep/acpi.h @@ -1,111 +0,0 @@ -/* Copyright (C) 2010 Wildfire Games. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * minimal subset of ACPI - */ - -#ifndef INCLUDED_ACPI -#define INCLUDED_ACPI - -#pragma pack(push, 1) - -// common header for all ACPI tables -struct AcpiTable -{ - char signature[4]; - u32 size; // table size [bytes], including header - u8 revision; - u8 checksum; // to make sum of entire table == 0 - char oemId[6]; - char oemTableId[8]; - u32 oemRevision; - char creatorId[4]; - u32 creatorRevision; -}; - -enum AcpiAddressSpace -{ - // (these are not generally powers-of-two - some values have been omitted.) - ACPI_AS_MEMORY = 0, - ACPI_AS_IO = 1, - ACPI_AS_PCI_CONFIG = 2, - ACPI_AS_SMBUS = 4 -}; - -// address of a struct or register -struct AcpiGenericAddress -{ - u8 addressSpaceId; - u8 registerBitWidth; - u8 registerBitOffset; - u8 accessSize; - u64 address; -}; - -struct FADT // signature is FACP! -{ - AcpiTable header; - u8 unused1[40]; - u32 pmTimerPortAddress; - u8 unused2[16]; - u16 c2Latency; // [us] - u16 c3Latency; // [us] - u8 unused3[5]; - u8 dutyWidth; - u8 unused4[6]; - u32 flags; - // (ACPI4 defines additional fields after this) - - bool IsDutyCycleSupported() const - { - return dutyWidth != 0; - } - - bool IsC2Supported() const - { - return c2Latency <= 100; // magic value specified by ACPI - } - - bool IsC3Supported() const - { - return c3Latency <= 1000; // see above - } -}; - -#pragma pack(pop) - -/** - * @param signature e.g. "RSDT" - * @return pointer to internal storage (valid until acpi_Shutdown()) - * - * note: the first call may be slow, e.g. if a kernel-mode driver is - * loaded. subsequent requests will be faster since tables are cached. - **/ -LIB_API const AcpiTable* acpi_GetTable(const char* signature); - -/** - * invalidates all pointers returned by acpi_GetTable. - **/ -LIB_API void acpi_Shutdown(); - -#endif // #ifndef INCLUDED_ACPI Index: ps/trunk/source/lib/sysdep/acpi.cpp =================================================================== --- ps/trunk/source/lib/sysdep/acpi.cpp +++ ps/trunk/source/lib/sysdep/acpi.cpp @@ -1,170 +0,0 @@ -/* Copyright (C) 2020 Wildfire Games. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -#include "precompiled.h" -#include "lib/sysdep/acpi.h" - -#include "lib/byte_order.h" -#include "lib/sysdep/cpu.h" -#include "lib/module_init.h" - -# include "lib/sysdep/os/win/wfirmware.h" - -#pragma pack(1) - -typedef const volatile u8* PCV_u8; -typedef const volatile AcpiTable* PCV_AcpiTable; - - -//----------------------------------------------------------------------------- -// table - -static AcpiTable* AllocateTable(size_t size) -{ - ENSURE(size >= sizeof(AcpiTable)); - return (AcpiTable*)malloc(size); -} - - -template -static void DeallocateTable(const T* table) -{ - free((void*)table); -} - - -// return 8-bit checksum of a buffer (should be 0) -static u8 ComputeChecksum(PCV_u8 buf, size_t numBytes) -{ - // (can't use std::accumulate - we need 8-bit wraparound) - u8 sum = 0; - for(PCV_u8 p = buf; p < buf+numBytes; p++) - sum = u8((sum + *p) & 0xFF); - return sum; -} - - -static bool ValidateTable(const AcpiTable* table, const char* signature = 0) -{ - if(!table) - return false; - - // caller knowns the signature; make sure it matches - if(signature) - { - if(memcmp(table->signature, signature, 4) != 0) - return false; - } - // no specific signature is called for, just validate the characters. - else - { - for(size_t i = 0; i < 4; i++) - { - const char c = table->signature[i]; - // "ASF!" and "____" have been encountered - if(!isalpha(c) && c != '_' && c != '!') - return false; - } - } - - // must be at least as large as the common header - if(table->size < sizeof(AcpiTable)) - return false; - - // checksum of table must be 0 - // .. AMIBIOS OEMB table has an incorrect checksum (off-by-one), - // so don't complain about any OEM tables (ignored anyway). - const bool isOemTable = (memcmp(table->signature, "OEM", 3) == 0); - if(!isOemTable) - { - if(ComputeChecksum((PCV_u8)table, table->size) != 0) - return false; - } - - return true; -} - -static void AllocateAndCopyTables(const AcpiTable**& tables, size_t& numTables) -{ - const wfirmware::Provider provider = FOURCC_BE('A','C','P','I'); - const wfirmware::TableIds tableIDs = wfirmware::GetTableIDs(provider); - - numTables = tableIDs.size(); - tables = new const AcpiTable*[numTables]; - - for(size_t i = 0; i < numTables; i++) - { - wfirmware::Table table = wfirmware::GetTable(provider, tableIDs[i]); - ENSURE(!table.empty()); - tables[i] = AllocateTable(table.size()); - memcpy((void*)tables[i], &table[0], table.size()); - } - - // to prevent callers from choking on invalid tables, we - // zero out the corresponding tables[] entries. - for(size_t i = 0; i < numTables; i++) - { - if(!ValidateTable(tables[i])) - { - DeallocateTable(tables[i]); - tables[i] = 0; - } - } -} - - -//----------------------------------------------------------------------------- - -// note: avoid global std::map etc. because we may be called before _cinit -static const AcpiTable** tables; // tables == 0 <=> not initialized -static const AcpiTable* invalidTables; // tables == &invalidTables => init failed -static size_t numTables; - -void acpi_Shutdown() -{ - if(tables) - { - for(size_t i = 0; i < numTables; i++) - DeallocateTable(tables[i]); - SAFE_ARRAY_DELETE(tables); - numTables = 0; - } -} - - -const AcpiTable* acpi_GetTable(const char* signature) -{ - if(cpu_CAS(&tables, (const AcpiTable**)0, &invalidTables)) - AllocateAndCopyTables(tables, numTables); - - // (typically only a few tables, linear search is OK) - for(size_t i = 0; i < numTables; i++) - { - const AcpiTable* table = tables[i]; - if(!table) - continue; // skip invalid tables, e.g. OEM (see above) - if(strncmp(table->signature, signature, 4) == 0) - return table; - } - - return 0; // no matching AND valid table found -} Index: ps/trunk/source/lib/sysdep/arch/x86_x64/apic.cpp =================================================================== --- ps/trunk/source/lib/sysdep/arch/x86_x64/apic.cpp +++ ps/trunk/source/lib/sysdep/arch/x86_x64/apic.cpp @@ -29,6 +29,7 @@ #include "lib/sysdep/os_cpu.h" #include "lib/sysdep/arch/x86_x64/x86_x64.h" +#include ApicId GetApicId() { Index: ps/trunk/source/lib/sysdep/arch/x86_x64/cache.cpp =================================================================== --- ps/trunk/source/lib/sysdep/arch/x86_x64/cache.cpp +++ ps/trunk/source/lib/sysdep/arch/x86_x64/cache.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -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: ps/trunk/source/lib/sysdep/arch/x86_x64/topology.cpp =================================================================== --- ps/trunk/source/lib/sysdep/arch/x86_x64/topology.cpp +++ ps/trunk/source/lib/sysdep/arch/x86_x64/topology.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -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: ps/trunk/source/lib/sysdep/dir_watch.h =================================================================== --- ps/trunk/source/lib/sysdep/dir_watch.h +++ ps/trunk/source/lib/sysdep/dir_watch.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -29,8 +29,11 @@ #include "lib/os_path.h" +#include +#include + struct DirWatch; -typedef shared_ptr PDirWatch; +typedef std::shared_ptr PDirWatch; /** * start watching a single directory for changes. Index: ps/trunk/source/lib/sysdep/gfx.cpp =================================================================== --- ps/trunk/source/lib/sysdep/gfx.cpp +++ ps/trunk/source/lib/sysdep/gfx.cpp @@ -34,6 +34,7 @@ # include "lib/sysdep/os/win/wgfx.h" #endif +#include namespace gfx { Index: ps/trunk/source/lib/sysdep/os/osx/dir_watch.cpp =================================================================== --- ps/trunk/source/lib/sysdep/os/osx/dir_watch.cpp +++ ps/trunk/source/lib/sysdep/os/osx/dir_watch.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2014 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -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: ps/trunk/source/lib/sysdep/os/win/acpi.h =================================================================== --- ps/trunk/source/lib/sysdep/os/win/acpi.h +++ ps/trunk/source/lib/sysdep/os/win/acpi.h @@ -0,0 +1,111 @@ +/* Copyright (C) 2010 Wildfire Games. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * minimal subset of ACPI + */ + +#ifndef INCLUDED_ACPI +#define INCLUDED_ACPI + +#pragma pack(push, 1) + +// common header for all ACPI tables +struct AcpiTable +{ + char signature[4]; + u32 size; // table size [bytes], including header + u8 revision; + u8 checksum; // to make sum of entire table == 0 + char oemId[6]; + char oemTableId[8]; + u32 oemRevision; + char creatorId[4]; + u32 creatorRevision; +}; + +enum AcpiAddressSpace +{ + // (these are not generally powers-of-two - some values have been omitted.) + ACPI_AS_MEMORY = 0, + ACPI_AS_IO = 1, + ACPI_AS_PCI_CONFIG = 2, + ACPI_AS_SMBUS = 4 +}; + +// address of a struct or register +struct AcpiGenericAddress +{ + u8 addressSpaceId; + u8 registerBitWidth; + u8 registerBitOffset; + u8 accessSize; + u64 address; +}; + +struct FADT // signature is FACP! +{ + AcpiTable header; + u8 unused1[40]; + u32 pmTimerPortAddress; + u8 unused2[16]; + u16 c2Latency; // [us] + u16 c3Latency; // [us] + u8 unused3[5]; + u8 dutyWidth; + u8 unused4[6]; + u32 flags; + // (ACPI4 defines additional fields after this) + + bool IsDutyCycleSupported() const + { + return dutyWidth != 0; + } + + bool IsC2Supported() const + { + return c2Latency <= 100; // magic value specified by ACPI + } + + bool IsC3Supported() const + { + return c3Latency <= 1000; // see above + } +}; + +#pragma pack(pop) + +/** + * @param signature e.g. "RSDT" + * @return pointer to internal storage (valid until acpi_Shutdown()) + * + * note: the first call may be slow, e.g. if a kernel-mode driver is + * loaded. subsequent requests will be faster since tables are cached. + **/ +LIB_API const AcpiTable* acpi_GetTable(const char* signature); + +/** + * invalidates all pointers returned by acpi_GetTable. + **/ +LIB_API void acpi_Shutdown(); + +#endif // #ifndef INCLUDED_ACPI Index: ps/trunk/source/lib/sysdep/os/win/acpi.cpp =================================================================== --- ps/trunk/source/lib/sysdep/os/win/acpi.cpp +++ ps/trunk/source/lib/sysdep/os/win/acpi.cpp @@ -0,0 +1,170 @@ +/* Copyright (C) 2020 Wildfire Games. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include "precompiled.h" +#include "lib/sysdep/os/win/acpi.h" + +#include "lib/byte_order.h" +#include "lib/sysdep/cpu.h" +#include "lib/module_init.h" + +#include "lib/sysdep/os/win/wfirmware.h" + +#pragma pack(1) + +typedef const volatile u8* PCV_u8; +typedef const volatile AcpiTable* PCV_AcpiTable; + + +//----------------------------------------------------------------------------- +// table + +static AcpiTable* AllocateTable(size_t size) +{ + ENSURE(size >= sizeof(AcpiTable)); + return (AcpiTable*)malloc(size); +} + + +template +static void DeallocateTable(const T* table) +{ + free((void*)table); +} + + +// return 8-bit checksum of a buffer (should be 0) +static u8 ComputeChecksum(PCV_u8 buf, size_t numBytes) +{ + // (can't use std::accumulate - we need 8-bit wraparound) + u8 sum = 0; + for(PCV_u8 p = buf; p < buf+numBytes; p++) + sum = u8((sum + *p) & 0xFF); + return sum; +} + + +static bool ValidateTable(const AcpiTable* table, const char* signature = 0) +{ + if(!table) + return false; + + // caller knowns the signature; make sure it matches + if(signature) + { + if(memcmp(table->signature, signature, 4) != 0) + return false; + } + // no specific signature is called for, just validate the characters. + else + { + for(size_t i = 0; i < 4; i++) + { + const char c = table->signature[i]; + // "ASF!" and "____" have been encountered + if(!isalpha(c) && c != '_' && c != '!') + return false; + } + } + + // must be at least as large as the common header + if(table->size < sizeof(AcpiTable)) + return false; + + // checksum of table must be 0 + // .. AMIBIOS OEMB table has an incorrect checksum (off-by-one), + // so don't complain about any OEM tables (ignored anyway). + const bool isOemTable = (memcmp(table->signature, "OEM", 3) == 0); + if(!isOemTable) + { + if(ComputeChecksum((PCV_u8)table, table->size) != 0) + return false; + } + + return true; +} + +static void AllocateAndCopyTables(const AcpiTable**& tables, size_t& numTables) +{ + const wfirmware::Provider provider = FOURCC_BE('A','C','P','I'); + const wfirmware::TableIds tableIDs = wfirmware::GetTableIDs(provider); + + numTables = tableIDs.size(); + tables = new const AcpiTable*[numTables]; + + for(size_t i = 0; i < numTables; i++) + { + wfirmware::Table table = wfirmware::GetTable(provider, tableIDs[i]); + ENSURE(!table.empty()); + tables[i] = AllocateTable(table.size()); + memcpy((void*)tables[i], &table[0], table.size()); + } + + // to prevent callers from choking on invalid tables, we + // zero out the corresponding tables[] entries. + for(size_t i = 0; i < numTables; i++) + { + if(!ValidateTable(tables[i])) + { + DeallocateTable(tables[i]); + tables[i] = 0; + } + } +} + + +//----------------------------------------------------------------------------- + +// note: avoid global std::map etc. because we may be called before _cinit +static const AcpiTable** tables; // tables == 0 <=> not initialized +static const AcpiTable* invalidTables; // tables == &invalidTables => init failed +static size_t numTables; + +void acpi_Shutdown() +{ + if(tables) + { + for(size_t i = 0; i < numTables; i++) + DeallocateTable(tables[i]); + SAFE_ARRAY_DELETE(tables); + numTables = 0; + } +} + + +const AcpiTable* acpi_GetTable(const char* signature) +{ + if(cpu_CAS(&tables, (const AcpiTable**)0, &invalidTables)) + AllocateAndCopyTables(tables, numTables); + + // (typically only a few tables, linear search is OK) + for(size_t i = 0; i < numTables; i++) + { + const AcpiTable* table = tables[i]; + if(!table) + continue; // skip invalid tables, e.g. OEM (see above) + if(strncmp(table->signature, signature, 4) == 0) + return table; + } + + return 0; // no matching AND valid table found +} Index: ps/trunk/source/lib/sysdep/os/win/wfirmware.h =================================================================== --- ps/trunk/source/lib/sysdep/os/win/wfirmware.h +++ ps/trunk/source/lib/sysdep/os/win/wfirmware.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -23,6 +23,8 @@ #ifndef INCLUDED_WFIRMWARE #define INCLUDED_WFIRMWARE +#include + namespace wfirmware { typedef u32 Provider; Index: ps/trunk/source/lib/sysdep/os/win/wnuma.cpp =================================================================== --- ps/trunk/source/lib/sysdep/os/win/wnuma.cpp +++ ps/trunk/source/lib/sysdep/os/win/wnuma.cpp @@ -29,8 +29,8 @@ #include "lib/timer.h" #include "lib/module_init.h" #include "lib/sysdep/vm.h" -#include "lib/sysdep/acpi.h" #include "lib/sysdep/os_cpu.h" +#include "lib/sysdep/os/win/acpi.h" #include "lib/sysdep/os/win/win.h" #include "lib/sysdep/os/win/wutil.h" #include "lib/sysdep/os/win/wcpu.h" Index: ps/trunk/source/lib/sysdep/os/win/wposix/waio.cpp =================================================================== --- ps/trunk/source/lib/sysdep/os/win/wposix/waio.cpp +++ ps/trunk/source/lib/sysdep/os/win/wposix/waio.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -42,6 +42,8 @@ #include "lib/sysdep/os/win/winit.h" #include "lib/sysdep/os/win/wposix/crt_posix.h" // _get_osfhandle +#include + WINIT_REGISTER_MAIN_SHUTDOWN(waio_Shutdown); // (dynamic linking preserves compatibility with previous Windows versions) Index: ps/trunk/source/lib/sysdep/os/win/wposix/wtime.cpp =================================================================== --- ps/trunk/source/lib/sysdep/os/win/wposix/wtime.cpp +++ ps/trunk/source/lib/sysdep/os/win/wposix/wtime.cpp @@ -30,6 +30,8 @@ #include "lib/sysdep/os/win/wposix/wposix_internal.h" +#include + WINIT_REGISTER_MAIN_INIT(wtime_Init); // whrt -> wtime // NT system time and FILETIME are hectonanoseconds since Jan. 1, 1601 UTC. Index: ps/trunk/source/lib/sysdep/smbios.cpp =================================================================== --- ps/trunk/source/lib/sysdep/smbios.cpp +++ ps/trunk/source/lib/sysdep/smbios.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -37,7 +37,9 @@ # include "lib/sysdep/os/win/wfirmware.h" #endif +#include #include +#include namespace SMBIOS { Index: ps/trunk/source/lib/tests/test_byte_order.h =================================================================== --- ps/trunk/source/lib/tests/test_byte_order.h +++ ps/trunk/source/lib/tests/test_byte_order.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -24,6 +24,8 @@ #include "lib/byte_order.h" +#include + class TestByteOrder : public CxxTest::TestSuite { public: Index: ps/trunk/source/lib/tests/test_secure_crt.h =================================================================== --- ps/trunk/source/lib/tests/test_secure_crt.h +++ ps/trunk/source/lib/tests/test_secure_crt.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2016 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -24,6 +24,8 @@ #include "lib/secure_crt.h" +#include + // note: we only test the char version. this avoids having to // expose secure_crt.cpp's tchar / tcpy etc. macros in the header and/or // writing a copy of this test for the unicode version. Index: ps/trunk/source/lib/timer.h =================================================================== --- ps/trunk/source/lib/timer.h +++ ps/trunk/source/lib/timer.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -36,6 +36,8 @@ #include "lib/utf8.h" +#include + /** * timer_Time will subsequently return values relative to the current time. **/ Index: ps/trunk/source/lib/utf8.h =================================================================== --- ps/trunk/source/lib/utf8.h +++ ps/trunk/source/lib/utf8.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -23,6 +23,8 @@ #ifndef INCLUDED_UTF8 #define INCLUDED_UTF8 +#include + // note: error codes are returned via optional output parameter. namespace ERR { Index: ps/trunk/source/lobby/StanzaExtensions.h =================================================================== --- ps/trunk/source/lobby/StanzaExtensions.h +++ ps/trunk/source/lobby/StanzaExtensions.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -19,6 +19,8 @@ #include "glooxwrapper/glooxwrapper.h" +#include + /// Global Gamelist Extension #define EXTGAMELISTQUERY 1403 #define XMLNS_GAMELIST "jabber:iq:gamelist" Index: ps/trunk/source/lobby/XmppClient.h =================================================================== --- ps/trunk/source/lobby/XmppClient.h +++ ps/trunk/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: ps/trunk/source/lobby/XmppClient.cpp =================================================================== --- ps/trunk/source/lobby/XmppClient.cpp +++ ps/trunk/source/lobby/XmppClient.cpp @@ -37,6 +37,8 @@ #include +#include + //debug #if 1 #define DbgXMPP(x) Index: ps/trunk/source/main.cpp =================================================================== --- ps/trunk/source/main.cpp +++ ps/trunk/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: ps/trunk/source/maths/Brush.h =================================================================== --- ps/trunk/source/maths/Brush.h +++ ps/trunk/source/maths/Brush.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2012 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -26,6 +26,8 @@ #include "graphics/ShaderProgramPtr.h" +#include + class CBoundingBoxAligned; class CFrustum; class CPlane; Index: ps/trunk/source/maths/NUSpline.h =================================================================== --- ps/trunk/source/maths/NUSpline.h +++ ps/trunk/source/maths/NUSpline.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2016 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -29,6 +29,8 @@ #include "FixedVector3D.h" #include "Vector3D.h" +#include + /** * Describes a node of the spline */ Index: ps/trunk/source/maths/Vector3D.cpp =================================================================== --- ps/trunk/source/maths/Vector3D.cpp +++ ps/trunk/source/maths/Vector3D.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -28,6 +28,7 @@ #include "FixedVector3D.h" #include +#include #include CVector3D::CVector3D(const CFixedVector3D& v) : Index: ps/trunk/source/network/NetClient.h =================================================================== --- ps/trunk/source/network/NetClient.h +++ ps/trunk/source/network/NetClient.h @@ -25,6 +25,7 @@ #include "ps/CStr.h" +#include #include class CGame; Index: ps/trunk/source/network/NetFileTransfer.h =================================================================== --- ps/trunk/source/network/NetFileTransfer.h +++ ps/trunk/source/network/NetFileTransfer.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -19,6 +19,7 @@ #define NETFILETRANSFER_H #include +#include class CNetMessage; class CFileTransferResponseMessage; Index: ps/trunk/source/network/NetServer.h =================================================================== --- ps/trunk/source/network/NetServer.h +++ ps/trunk/source/network/NetServer.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -24,6 +24,7 @@ #include "lib/types.h" #include "scriptinterface/ScriptTypes.h" +#include #include #include #include Index: ps/trunk/source/network/NetStats.h =================================================================== --- ps/trunk/source/network/NetStats.h +++ ps/trunk/source/network/NetStats.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -21,6 +21,7 @@ #include "ps/ProfileViewer.h" #include +#include typedef struct _ENetPeer ENetPeer; typedef struct _ENetHost ENetHost; Index: ps/trunk/source/pch/engine/precompiled.h =================================================================== --- ps/trunk/source/pch/engine/precompiled.h +++ ps/trunk/source/pch/engine/precompiled.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -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: ps/trunk/source/pch/graphics/precompiled.h =================================================================== --- ps/trunk/source/pch/graphics/precompiled.h +++ ps/trunk/source/pch/graphics/precompiled.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2009 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -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: ps/trunk/source/pch/gui/precompiled.h =================================================================== --- ps/trunk/source/pch/gui/precompiled.h +++ ps/trunk/source/pch/gui/precompiled.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -23,7 +23,6 @@ #endif #if CONFIG_ENABLE_PCH - #include "gui/CGUI.h" #include "gui/ObjectBases/IGUIObject.h" #include "ps/CStr.h" Index: ps/trunk/source/pch/network/precompiled.h =================================================================== --- ps/trunk/source/pch/network/precompiled.h +++ ps/trunk/source/pch/network/precompiled.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -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: ps/trunk/source/pch/simulation2/precompiled.h =================================================================== --- ps/trunk/source/pch/simulation2/precompiled.h +++ ps/trunk/source/pch/simulation2/precompiled.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -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: ps/trunk/source/ps/Compress.h =================================================================== --- ps/trunk/source/ps/Compress.h +++ ps/trunk/source/ps/Compress.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2012 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -18,6 +18,8 @@ #ifndef INCLUDED_COMPRESS #define INCLUDED_COMPRESS +#include + /** * @file * Simple (non-streaming) compression functions. Index: ps/trunk/source/ps/Filesystem.h =================================================================== --- ps/trunk/source/ps/Filesystem.h +++ ps/trunk/source/ps/Filesystem.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -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: ps/trunk/source/ps/Filesystem.cpp =================================================================== --- ps/trunk/source/ps/Filesystem.cpp +++ ps/trunk/source/ps/Filesystem.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -26,6 +26,7 @@ #include "lib/sysdep/dir_watch.h" #include "lib/utf8.h" +#include PIVFS g_VFS; Index: ps/trunk/source/ps/GameSetup/CmdLineArgs.h =================================================================== --- ps/trunk/source/ps/GameSetup/CmdLineArgs.h +++ ps/trunk/source/ps/GameSetup/CmdLineArgs.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -21,6 +21,8 @@ #include "ps/CStr.h" #include "lib/os_path.h" +#include + class CmdLineArgs { public: Index: ps/trunk/source/ps/Hotkey.h =================================================================== --- ps/trunk/source/ps/Hotkey.h +++ ps/trunk/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: ps/trunk/source/ps/KeyName.cpp =================================================================== --- ps/trunk/source/ps/KeyName.cpp +++ ps/trunk/source/ps/KeyName.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -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: ps/trunk/source/ps/Profile.h =================================================================== --- ps/trunk/source/ps/Profile.h +++ ps/trunk/source/ps/Profile.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -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: ps/trunk/source/ps/ProfileViewer.h =================================================================== --- ps/trunk/source/ps/ProfileViewer.h +++ ps/trunk/source/ps/ProfileViewer.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -26,6 +26,8 @@ #include "ps/CStr.h" #include "ps/Singleton.h" +#include + class ScriptInterface; /** Index: ps/trunk/source/ps/Profiler2.h =================================================================== --- ps/trunk/source/ps/Profiler2.h +++ ps/trunk/source/ps/Profiler2.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -78,13 +78,14 @@ #ifndef INCLUDED_PROFILER2 #define INCLUDED_PROFILER2 -#include -#include - #include "lib/timer.h" #include "ps/ThreadUtil.h" +#include +#include #include +#include +#include struct mg_context; Index: ps/trunk/source/ps/Pyrogenesis.h =================================================================== --- ps/trunk/source/ps/Pyrogenesis.h +++ ps/trunk/source/ps/Pyrogenesis.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -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: ps/trunk/source/ps/SavedGame.cpp =================================================================== --- ps/trunk/source/ps/SavedGame.cpp +++ ps/trunk/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: ps/trunk/source/ps/VisualReplay.cpp =================================================================== --- ps/trunk/source/ps/VisualReplay.cpp +++ ps/trunk/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: ps/trunk/source/ps/scripting/JSInterface_Debug.cpp =================================================================== --- ps/trunk/source/ps/scripting/JSInterface_Debug.cpp +++ ps/trunk/source/ps/scripting/JSInterface_Debug.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -24,6 +24,7 @@ #include "lib/debug.h" #include "scriptinterface/ScriptInterface.h" +#include #include /** Index: ps/trunk/source/ps/utf16string.h =================================================================== --- ps/trunk/source/ps/utf16string.h +++ ps/trunk/source/ps/utf16string.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2009 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -25,9 +25,11 @@ // On Linux, wchar_t is 32-bit, so define a new version of it. // We now use this code on Windows as well, because wchar_t is a // native type and distinct from utf16_t. -#include -#include #include +#include +#include +#include + typedef uint16_t utf16_t; Index: ps/trunk/source/renderer/DecalRData.h =================================================================== --- ps/trunk/source/renderer/DecalRData.h +++ ps/trunk/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: ps/trunk/source/renderer/PatchRData.cpp =================================================================== --- ps/trunk/source/renderer/PatchRData.cpp +++ ps/trunk/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: ps/trunk/source/rlinterface/RLInterface.h =================================================================== --- ps/trunk/source/rlinterface/RLInterface.h +++ ps/trunk/source/rlinterface/RLInterface.h @@ -21,6 +21,7 @@ #include #include +#include #include struct ScenarioConfig { Index: ps/trunk/source/rlinterface/RLInterface.cpp =================================================================== --- ps/trunk/source/rlinterface/RLInterface.cpp +++ ps/trunk/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: ps/trunk/source/scriptinterface/ScriptContext.h =================================================================== --- ps/trunk/source/scriptinterface/ScriptContext.h +++ ps/trunk/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: ps/trunk/source/scriptinterface/ScriptInterface.h =================================================================== --- ps/trunk/source/scriptinterface/ScriptInterface.h +++ ps/trunk/source/scriptinterface/ScriptInterface.h @@ -24,7 +24,6 @@ #include "scriptinterface/ScriptExceptions.h" #include "scriptinterface/ScriptTypes.h" -#include #include ERROR_GROUP(Scripting); @@ -59,6 +58,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: @@ -140,7 +141,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)". @@ -449,7 +450,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: ps/trunk/source/scriptinterface/ScriptStats.h =================================================================== --- ps/trunk/source/scriptinterface/ScriptStats.h +++ ps/trunk/source/scriptinterface/ScriptStats.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -20,6 +20,8 @@ #include "ps/ProfileViewer.h" +#include + class ScriptInterface; class CScriptStatsTable : public AbstractProfileTable Index: ps/trunk/source/simulation2/components/ICmpAIManager.cpp =================================================================== --- ps/trunk/source/simulation2/components/ICmpAIManager.cpp +++ ps/trunk/source/simulation2/components/ICmpAIManager.cpp @@ -25,6 +25,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: ps/trunk/source/simulation2/components/ICmpAttack.h =================================================================== --- ps/trunk/source/simulation2/components/ICmpAttack.h +++ ps/trunk/source/simulation2/components/ICmpAttack.h @@ -21,6 +21,8 @@ #include "ps/CStr.h" #include "simulation2/system/Interface.h" +#include + class ICmpAttack : public IComponent { public: Index: ps/trunk/source/simulation2/components/ICmpCommandQueue.h =================================================================== --- ps/trunk/source/simulation2/components/ICmpCommandQueue.h +++ ps/trunk/source/simulation2/components/ICmpCommandQueue.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -22,6 +22,8 @@ #include "simulation2/helpers/SimulationCommand.h" +#include + /** * Command queue, for sending orders to entities. * Each command is associated with a player ID (who triggered the command, in some sense) Index: ps/trunk/source/simulation2/components/ICmpObstructionManager.h =================================================================== --- ps/trunk/source/simulation2/components/ICmpObstructionManager.h +++ ps/trunk/source/simulation2/components/ICmpObstructionManager.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -23,6 +23,8 @@ #include "maths/FixedVector2D.h" #include "simulation2/helpers/Position.h" +#include + class IObstructionTestFilter; template class Grid; Index: ps/trunk/source/simulation2/components/ICmpTerritoryManager.h =================================================================== --- ps/trunk/source/simulation2/components/ICmpTerritoryManager.h +++ ps/trunk/source/simulation2/components/ICmpTerritoryManager.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -23,6 +23,8 @@ #include "simulation2/helpers/Player.h" #include "simulation2/components/ICmpPosition.h" +#include + template class Grid; Index: ps/trunk/source/simulation2/components/ICmpUnitRenderer.h =================================================================== --- ps/trunk/source/simulation2/components/ICmpUnitRenderer.h +++ ps/trunk/source/simulation2/components/ICmpUnitRenderer.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2017 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -20,6 +20,8 @@ #include "simulation2/system/Interface.h" +#include + class CUnit; class CBoundingSphere; class CVector3D; Index: ps/trunk/source/simulation2/helpers/Grid.h =================================================================== --- ps/trunk/source/simulation2/helpers/Grid.h +++ ps/trunk/source/simulation2/helpers/Grid.h @@ -18,11 +18,10 @@ #ifndef INCLUDED_GRID #define INCLUDED_GRID -#include - #include "simulation2/serialization/IDeserializer.h" #include "simulation2/serialization/ISerializer.h" +#include #ifdef NDEBUG #define GRID_BOUNDS_DEBUG 0 Index: ps/trunk/source/simulation2/helpers/HierarchicalPathfinder.h =================================================================== --- ps/trunk/source/simulation2/helpers/HierarchicalPathfinder.h +++ ps/trunk/source/simulation2/helpers/HierarchicalPathfinder.h @@ -25,6 +25,8 @@ #include "Render.h" #include "graphics/SColor.h" +#include + /** * Hierarchical pathfinder. * Index: ps/trunk/source/simulation2/helpers/LongPathfinder.h =================================================================== --- ps/trunk/source/simulation2/helpers/LongPathfinder.h +++ ps/trunk/source/simulation2/helpers/LongPathfinder.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2017 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -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: ps/trunk/source/simulation2/helpers/Render.h =================================================================== --- ps/trunk/source/simulation2/helpers/Render.h +++ ps/trunk/source/simulation2/helpers/Render.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2017 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -18,6 +18,8 @@ #ifndef INCLUDED_HELPER_RENDER #define INCLUDED_HELPER_RENDER +#include + class CSimContext; class CVector2D; class CVector3D; Index: ps/trunk/source/simulation2/helpers/VertexPathfinder.h =================================================================== --- ps/trunk/source/simulation2/helpers/VertexPathfinder.h +++ ps/trunk/source/simulation2/helpers/VertexPathfinder.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -22,6 +22,9 @@ #include "simulation2/helpers/Pathfinding.h" #include "simulation2/system/CmpPtr.h" +#include +#include + // A vertex around the corners of an obstruction // (paths will be sequences of these vertexes) struct Vertex Index: ps/trunk/source/simulation2/serialization/BinarySerializer.h =================================================================== --- ps/trunk/source/simulation2/serialization/BinarySerializer.h +++ ps/trunk/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: ps/trunk/source/simulation2/serialization/StdDeserializer.h =================================================================== --- ps/trunk/source/simulation2/serialization/StdDeserializer.h +++ ps/trunk/source/simulation2/serialization/StdDeserializer.h @@ -23,6 +23,7 @@ #include "ps/utf16string.h" #include +#include class CStdDeserializer : public IDeserializer { Index: ps/trunk/source/simulation2/system/ComponentManagerSerialization.cpp =================================================================== --- ps/trunk/source/simulation2/system/ComponentManagerSerialization.cpp +++ ps/trunk/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: ps/trunk/source/simulation2/system/DynamicSubscription.h =================================================================== --- ps/trunk/source/simulation2/system/DynamicSubscription.h +++ ps/trunk/source/simulation2/system/DynamicSubscription.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2017 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -21,6 +21,7 @@ #include "IComponent.h" #include +#include /** * A list of components that are dynamically subscribed to a particular Index: ps/trunk/source/simulation2/system/IComponent.cpp =================================================================== --- ps/trunk/source/simulation2/system/IComponent.cpp +++ ps/trunk/source/simulation2/system/IComponent.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2017 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -19,6 +19,8 @@ #include "IComponent.h" +#include + IComponent::~IComponent() { } Index: ps/trunk/source/third_party/encryption/pkcs5_pbkdf2.cpp =================================================================== --- ps/trunk/source/third_party/encryption/pkcs5_pbkdf2.cpp +++ ps/trunk/source/third_party/encryption/pkcs5_pbkdf2.cpp @@ -19,6 +19,8 @@ #include "pkcs5_pbkdf2.h" +#include + // This does not match libsodium crypto_auth_hmacsha256, which has a constant key_len. static void hmac_sha256(unsigned char (&digest)[crypto_hash_sha256_BYTES], const unsigned char* text, size_t text_len, Index: ps/trunk/source/tools/atlas/GameInterface/Brushes.h =================================================================== --- ps/trunk/source/tools/atlas/GameInterface/Brushes.h +++ ps/trunk/source/tools/atlas/GameInterface/Brushes.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2009 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -20,6 +20,8 @@ #include "maths/Vector3D.h" +#include + class TerrainOverlay; namespace AtlasMessage { Index: ps/trunk/source/tools/atlas/GameInterface/Shareable.h =================================================================== --- ps/trunk/source/tools/atlas/GameInterface/Shareable.h +++ ps/trunk/source/tools/atlas/GameInterface/Shareable.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 Wildfire Games. +/* Copyright (C) 2020 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -59,6 +59,7 @@ #include "SharedMemory.h" +#include #include #include