Index: source/graphics/Color.h =================================================================== --- source/graphics/Color.h +++ source/graphics/Color.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 Wildfire Games. +/* Copyright (C) 2021 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/SColor.h" #include "maths/Vector3D.h" #include "maths/Vector4D.h" +#include "ps/CStrForward.h" // Simple defines for 3 and 4 component floating point colors - just map to // corresponding vector types. @@ -36,8 +37,6 @@ * Detects CPU caps and activates the best possible codepath. */ extern void ColorActivateFastImpl(); - -class CStr8; struct CColor { Index: source/graphics/Terrain.h =================================================================== --- source/graphics/Terrain.h +++ source/graphics/Terrain.h @@ -26,11 +26,11 @@ #include "graphics/SColor.h" #include "maths/Fixed.h" #include "maths/Vector3D.h" +#include "ps/CStr.h" class CPatch; class CMiniPatch; class CFixedVector3D; -class CStr8; class CBoundingBoxAligned; /////////////////////////////////////////////////////////////////////////////// Index: source/graphics/UnitManager.h =================================================================== --- source/graphics/UnitManager.h +++ source/graphics/UnitManager.h @@ -22,12 +22,13 @@ #ifndef INCLUDED_UNITMANAGER #define INCLUDED_UNITMANAGER +#include "ps/CStrForward.h" + #include #include class CUnit; class CObjectManager; -class CStrW; /////////////////////////////////////////////////////////////////////////////// // CUnitManager: simple container class holding all units within the world Index: source/gui/GUIRenderer.h =================================================================== --- source/gui/GUIRenderer.h +++ source/gui/GUIRenderer.h @@ -23,6 +23,7 @@ #include "graphics/Texture.h" #include "lib/res/handle.h" #include "maths/Rect.h" +#include "ps/CStrForward.h" #include "ps/CStrIntern.h" #include @@ -31,7 +32,6 @@ class CCanvas2D; class CGUI; class CGUISprite; -class CStr8; struct CGUIColor; struct SGUIImage; Index: source/gui/ObjectBases/IGUIScrollBarOwner.h =================================================================== --- source/gui/ObjectBases/IGUIScrollBarOwner.h +++ source/gui/ObjectBases/IGUIScrollBarOwner.h @@ -18,11 +18,12 @@ #ifndef INCLUDED_IGUISCROLLBAROWNER #define INCLUDED_IGUISCROLLBAROWNER +#include "ps/CStrForward.h" + #include #include class CCanvas2D; -class CStr8; struct SGUIMessage; struct SGUIScrollBarStyle; class IGUIScrollBar; Index: source/gui/ObjectBases/IGUITextOwner.h =================================================================== --- source/gui/ObjectBases/IGUITextOwner.h +++ source/gui/ObjectBases/IGUITextOwner.h @@ -33,6 +33,7 @@ #include "gui/CGUISetting.h" #include "gui/SettingTypes/EAlign.h" #include "maths/Rect.h" +#include "ps/CStrForward.h" #include @@ -43,7 +44,6 @@ class CGUIString; class IGUIObject; -class CStrW; class CVector2D; /** Index: source/gui/SettingTypes/CGUIColor.h =================================================================== --- source/gui/SettingTypes/CGUIColor.h +++ source/gui/SettingTypes/CGUIColor.h @@ -19,9 +19,9 @@ #define INCLUDED_GUICOLOR #include "graphics/Color.h" +#include "ps/CStrForward.h" class CGUI; -class CStr8; /** * Same as the CColor class, but this one can also parse colors predefined in the GUI page (such as "yellow"). Index: source/gui/SettingTypes/CGUISize.h =================================================================== --- source/gui/SettingTypes/CGUISize.h +++ source/gui/SettingTypes/CGUISize.h @@ -19,9 +19,8 @@ #define INCLUDED_CGUISIZE #include "maths/Rect.h" +#include "ps/CStrForward.h" #include "scriptinterface/ScriptForward.h" - -class CStr8; /** * This class represents a rectangle relative to a parent rectangle Index: source/maths/Fixed.h =================================================================== --- source/maths/Fixed.h +++ source/maths/Fixed.h @@ -20,9 +20,7 @@ #include "lib/types.h" #include "maths/Sqrt.h" - -class CStr8; -class CStrW; +#include "ps/CStrForward.h" #ifndef NDEBUG #define USE_FIXED_OVERFLOW_CHECKS Index: source/network/StunClient.h =================================================================== --- source/network/StunClient.h +++ source/network/StunClient.h @@ -19,10 +19,11 @@ #ifndef STUNCLIENT_H #define STUNCLIENT_H +#include "ps/CStrForward.h" + #include typedef struct _ENetHost ENetHost; -class CStr8; namespace StunClient { Index: source/ps/CStr.h =================================================================== --- source/ps/CStr.h +++ source/ps/CStr.h @@ -50,11 +50,10 @@ #define CSTR_H_A #endif -#include #include "ps/utf16string.h" +#include "ps/CStrForward.h" -class CStr8; -class CStrW; +#include /** * The base class of all strings @@ -351,4 +350,4 @@ }; } -#endif +#endif // INCLUDED_CSTR Index: source/ps/CStrForward.h =================================================================== --- source/ps/CStrForward.h +++ source/ps/CStrForward.h @@ -0,0 +1,24 @@ +/* Copyright (C) 2021 Wildfire Games. + * This file is part of 0 A.D. + * + * 0 A.D. is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * 0 A.D. is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 0 A.D. If not, see . + */ + +#ifndef INCLUDED_CSTR_FORWARD +#define INCLUDED_CSTR_FORWARD + +class CStr8; +class CStrW; + +#endif // INCLUDED_CSTR_FORWARD Index: source/ps/FileIo.h =================================================================== --- source/ps/FileIo.h +++ source/ps/FileIo.h @@ -31,11 +31,9 @@ #define INCLUDED_FILEPACKER #include "lib/file/vfs/vfs_path.h" -#include "ps/Filesystem.h" // WriteBuffer - +#include "ps/CStrForward.h" #include "ps/Errors.h" - -class CStr8; +#include "ps/Filesystem.h" // WriteBuffer ERROR_GROUP(File); ERROR_TYPE(File, OpenFailed); Index: source/ps/Filesystem.h =================================================================== --- source/ps/Filesystem.h +++ source/ps/Filesystem.h @@ -21,10 +21,8 @@ #include "lib/file/file.h" #include "lib/file/io/write_buffer.h" #include "lib/file/vfs/vfs_util.h" - +#include "ps/CStrForward.h" #include "ps/Errors.h" - -class CStr8; extern PIVFS g_VFS; Index: source/ps/GUID.h =================================================================== --- source/ps/GUID.h +++ source/ps/GUID.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2013 Wildfire Games. +/* Copyright (C) 2021 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -18,7 +18,7 @@ #ifndef INCLUDED_GUID #define INCLUDED_GUID -class CStr8; +#include "ps/CStr.h" CStr8 ps_generate_guid(void); Index: source/ps/Hashing.h =================================================================== --- source/ps/Hashing.h +++ source/ps/Hashing.h @@ -18,7 +18,7 @@ #ifndef INCLUDED_HASHING #define INCLUDED_HASHING -class CStr8; +#include "ps/CStr.h" /** * Hash a string in a cryptographically secure manner. Index: source/ps/KeyName.h =================================================================== --- source/ps/KeyName.h +++ source/ps/KeyName.h @@ -20,8 +20,7 @@ // Need SDLK_* enum values. #include "lib/external_libraries/libsdl.h" - -class CStr8; +#include "ps/CStr.h" extern SDL_Scancode FindScancode(const CStr8& keyname); // Map a scancode to a locale-independent scancode name. Index: source/ps/VisualReplay.h =================================================================== --- source/ps/VisualReplay.h +++ source/ps/VisualReplay.h @@ -19,9 +19,8 @@ #define INCLUDED_VISUAL_REPLAY #include "lib/os_path.h" +#include "ps/CStrForward.h" #include "scriptinterface/ScriptTypes.h" - -class CStrW; class ScriptInterface; Index: source/ps/World.h =================================================================== --- source/ps/World.h +++ source/ps/World.h @@ -24,6 +24,7 @@ #ifndef INCLUDED_WORLD #define INCLUDED_WORLD +#include "ps/CStrForward.h" #include "ps/Errors.h" #ifndef ERROR_GROUP_GAME_DEFINED @@ -36,7 +37,6 @@ class CGame; class CUnitManager; class CTerrain; -class CStrW; class CMapReader; class ScriptContext; Index: source/renderer/RenderingOptions.h =================================================================== --- source/renderer/RenderingOptions.h +++ source/renderer/RenderingOptions.h @@ -27,10 +27,12 @@ #ifndef INCLUDED_RENDERINGOPTIONS #define INCLUDED_RENDERINGOPTIONS -class CStr8; +#include "ps/CStr.h" + class CRenderer; -enum RenderPath { +enum RenderPath +{ // If no rendering path is configured explicitly, the renderer // will choose the path when Open() is called. DEFAULT, Index: source/soundmanager/ISoundManager.h =================================================================== --- source/soundmanager/ISoundManager.h +++ source/soundmanager/ISoundManager.h @@ -20,9 +20,9 @@ #include "lib/config2.h" #include "lib/file/vfs/vfs_path.h" +#include "ps/CStr.h" #include "simulation2/system/Entity.h" -class CStr8; class CVector3D; class ISoundManager Index: source/soundmanager/SoundManager.h =================================================================== --- source/soundmanager/SoundManager.h +++ source/soundmanager/SoundManager.h @@ -29,14 +29,13 @@ #include "lib/external_libraries/openal.h" #include "lib/file/vfs/vfs_path.h" +#include "ps/CStr.h" #include "ps/Profiler2.h" #include "simulation2/system/Entity.h" #include #include #include - -class CStr8; #define AL_CHECK CSoundManager::al_check(__func__, __LINE__) Index: source/tools/atlas/GameInterface/ActorViewer.h =================================================================== --- source/tools/atlas/GameInterface/ActorViewer.h +++ source/tools/atlas/GameInterface/ActorViewer.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 Wildfire Games. +/* Copyright (C) 2021 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -18,14 +18,13 @@ #ifndef INCLUDED_ACTORVIEWER #define INCLUDED_ACTORVIEWER +#include "ps/CStrForward.h" #include "simulation2/helpers/Player.h" #include "simulation2/system/Entity.h" struct ActorViewerImpl; struct SColor4ub; class CSimulation2; -class CStr8; -class CStrW; class ActorViewer {