Index: ps/trunk/source/graphics/ShaderProgram.cpp =================================================================== --- ps/trunk/source/graphics/ShaderProgram.cpp +++ ps/trunk/source/graphics/ShaderProgram.cpp @@ -848,19 +848,19 @@ // These should all be overridden by CShaderProgramGLSL // (GLES doesn't support any other types of shader program): -void CShaderProgram::VertexPointer(GLint UNUSED(size), GLenum UNUSED(type), GLsizei UNUSED(stride), const void* UNUSED(pointer)) +void CShaderProgram::VertexPointer(const Renderer::Backend::Format UNUSED(format), GLsizei UNUSED(stride), const void* UNUSED(pointer)) { debug_warn("CShaderProgram::VertexPointer should be overridden"); } -void CShaderProgram::NormalPointer(GLenum UNUSED(type), GLsizei UNUSED(stride), const void* UNUSED(pointer)) +void CShaderProgram::NormalPointer(const Renderer::Backend::Format UNUSED(format), GLsizei UNUSED(stride), const void* UNUSED(pointer)) { debug_warn("CShaderProgram::NormalPointer should be overridden"); } -void CShaderProgram::ColorPointer(GLint UNUSED(size), GLenum UNUSED(type), GLsizei UNUSED(stride), const void* UNUSED(pointer)) +void CShaderProgram::ColorPointer(const Renderer::Backend::Format UNUSED(format), GLsizei UNUSED(stride), const void* UNUSED(pointer)) { debug_warn("CShaderProgram::ColorPointer should be overridden"); } -void CShaderProgram::TexCoordPointer(GLenum UNUSED(texture), GLint UNUSED(size), GLenum UNUSED(type), GLsizei UNUSED(stride), const void* UNUSED(pointer)) +void CShaderProgram::TexCoordPointer(GLenum UNUSED(texture), const Renderer::Backend::Format UNUSED(format), GLsizei UNUSED(stride), const void* UNUSED(pointer)) { debug_warn("CShaderProgram::TexCoordPointer should be overridden"); } Index: ps/trunk/source/simulation2/components/CCmpAIManager.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpAIManager.cpp +++ ps/trunk/source/simulation2/components/CCmpAIManager.cpp @@ -881,7 +881,7 @@ return ""; } - virtual void Init(const CParamNode& UNUSED(paramNode)) + void Init(const CParamNode& UNUSED(paramNode)) override { m_Worker.Init(GetSimContext().GetScriptInterface()); @@ -890,11 +890,11 @@ m_JustDeserialized = false; } - virtual void Deinit() + void Deinit() override { } - virtual void Serialize(ISerializer& serialize) + void Serialize(ISerializer& serialize) override { serialize.NumberU32_Unbounded("num ais", m_Worker.getPlayerSize()); @@ -906,7 +906,7 @@ m_Worker.Serialize(serialize.GetStream(), serialize.IsDebug()); } - virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) + void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override { Init(paramNode); @@ -920,7 +920,7 @@ m_JustDeserialized = true; } - virtual void AddPlayer(const std::wstring& id, player_id_t player, u8 difficulty, const std::wstring& behavior) + void AddPlayer(const std::wstring& id, player_id_t player, u8 difficulty, const std::wstring& behavior) override { LoadUsedEntityTemplates(); @@ -934,17 +934,17 @@ cmpRangeManager->SetLosRevealAll(player, true); } - virtual void SetRNGSeed(u32 seed) + void SetRNGSeed(u32 seed) override { m_Worker.SetRNGSeed(seed); } - virtual void TryLoadSharedComponent() + void TryLoadSharedComponent() override { m_Worker.TryLoadSharedComponent(); } - virtual void RunGamestateInit() + void RunGamestateInit() override { const ScriptInterface& scriptInterface = GetSimContext().GetScriptInterface(); ScriptRequest rq(scriptInterface); @@ -981,7 +981,7 @@ *passabilityMap, *territoryMap, nonPathfindingPassClassMasks, pathfindingPassClassMasks); } - virtual void StartComputation() + void StartComputation() override { PROFILE("AI setup"); @@ -1040,7 +1040,7 @@ m_JustDeserialized = false; } - virtual void PushCommands() + void PushCommands() override { std::vector commands; m_Worker.GetCommands(commands); Index: ps/trunk/source/simulation2/components/CCmpCinemaManager.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpCinemaManager.cpp +++ ps/trunk/source/simulation2/components/CCmpCinemaManager.cpp @@ -44,7 +44,7 @@ return ""; } - virtual void Init(const CParamNode& UNUSED(paramNode)) + void Init(const CParamNode& UNUSED(paramNode)) override { m_Enabled = false; m_MapRevealed = false; @@ -53,11 +53,11 @@ m_CurrentPathElapsedTime = fixed::Zero(); } - virtual void Deinit() + void Deinit() override { } - virtual void Serialize(ISerializer& serializer) + void Serialize(ISerializer& serializer) override { serializer.Bool("Enabled", m_Enabled); serializer.NumberFixed_Unbounded("ElapsedTime", m_ElapsedTime); @@ -73,7 +73,7 @@ serializer.String("PathName", path.GetName(), 1, 128); } - virtual void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserializer) + void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserializer) override { deserializer.Bool("Enabled", m_Enabled); deserializer.NumberFixed_Unbounded("ElapsedTime", m_ElapsedTime); @@ -107,7 +107,7 @@ SetEnabled(m_Enabled); } - virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)) + void HandleMessage(const CMessage& msg, bool UNUSED(global)) override { switch (msg.GetType()) { @@ -146,7 +146,7 @@ } } - virtual void AddPath(const CCinemaPath& path) + void AddPath(const CCinemaPath& path) override { if (m_Paths.find(path.GetName()) != m_Paths.end()) { @@ -156,7 +156,7 @@ m_Paths[path.GetName()] = path; } - virtual void AddCinemaPathToQueue(const CStrW& name) + void AddCinemaPathToQueue(const CStrW& name) override { if (!HasPath(name)) { @@ -170,27 +170,27 @@ m_TotalTime += m_Paths[name].GetDuration(); } - virtual void Play() + void Play() override { SetEnabled(true); } - virtual void Stop() + void Stop() override { SetEnabled(false); } - virtual bool HasPath(const CStrW& name) const + bool HasPath(const CStrW& name) const override { return m_Paths.find(name) != m_Paths.end(); } - virtual void ClearQueue() + void ClearQueue() override { m_PathQueue.clear(); } - virtual void DeletePath(const CStrW& name) + void DeletePath(const CStrW& name) override { if (!HasPath(name)) { @@ -201,27 +201,27 @@ m_Paths.erase(name); } - virtual const std::map& GetPaths() const + const std::map& GetPaths() const override { return m_Paths; } - virtual void SetPaths(const std::map& newPaths) + void SetPaths(const std::map& newPaths) override { m_Paths = newPaths; } - virtual const std::list& GetQueue() const + const std::list& GetQueue() const override { return m_PathQueue; } - virtual bool IsEnabled() const + bool IsEnabled() const override { return m_Enabled; } - virtual void SetEnabled(bool enabled) + void SetEnabled(bool enabled) override { if (m_PathQueue.empty() && enabled) enabled = false; @@ -246,7 +246,7 @@ m_Enabled = enabled; } - virtual void PlayQueue(const float deltaRealTime, CCamera* camera) + void PlayQueue(const float deltaRealTime, CCamera* camera) override { if (m_PathQueue.empty()) return; Index: ps/trunk/source/simulation2/components/CCmpCommandQueue.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpCommandQueue.cpp +++ ps/trunk/source/simulation2/components/CCmpCommandQueue.cpp @@ -43,15 +43,15 @@ return ""; } - virtual void Init(const CParamNode& UNUSED(paramNode)) + void Init(const CParamNode& UNUSED(paramNode)) override { } - virtual void Deinit() + void Deinit() override { } - virtual void Serialize(ISerializer& serialize) + void Serialize(ISerializer& serialize) override { ScriptRequest rq(GetSimContext().GetScriptInterface()); @@ -63,7 +63,7 @@ } } - virtual void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserialize) + void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserialize) override { ScriptRequest rq(GetSimContext().GetScriptInterface()); @@ -79,13 +79,13 @@ } } - virtual void PushLocalCommand(player_id_t player, JS::HandleValue cmd) + void PushLocalCommand(player_id_t player, JS::HandleValue cmd) override { ScriptRequest rq(GetSimContext().GetScriptInterface()); m_LocalQueue.emplace_back(SimulationCommand(player, rq.cx, cmd)); } - virtual void PostNetworkCommand(JS::HandleValue cmd1) + void PostNetworkCommand(JS::HandleValue cmd1) override { ScriptRequest rq(GetSimContext().GetScriptInterface()); @@ -100,7 +100,7 @@ g_Game->GetTurnManager()->PostCommand(cmd); } - virtual void FlushTurn(const std::vector& commands) + void FlushTurn(const std::vector& commands) override { const ScriptInterface& scriptInterface = GetSimContext().GetScriptInterface(); ScriptRequest rq(scriptInterface); Index: ps/trunk/source/simulation2/components/CCmpDecay.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpDecay.cpp +++ ps/trunk/source/simulation2/components/CCmpDecay.cpp @@ -89,7 +89,7 @@ ""; } - virtual void Init(const CParamNode& paramNode) + void Init(const CParamNode& paramNode) override { m_Active = paramNode.GetChild("Active").ToBool(); m_ShipSink = paramNode.GetChild("SinkingAnim").ToBool(); @@ -111,21 +111,21 @@ GetSimContext().GetComponentManager().DynamicSubscriptionNonsync(MT_Interpolate, this, true); } - virtual void Deinit() + void Deinit() override { } - virtual void Serialize(ISerializer& UNUSED(serialize)) + void Serialize(ISerializer& UNUSED(serialize)) override { // This component isn't network-synchronised, so don't serialize anything } - virtual void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) + void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override { Init(paramNode); } - virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)) + void HandleMessage(const CMessage& msg, bool UNUSED(global)) override { switch (msg.GetType()) { Index: ps/trunk/source/simulation2/components/CCmpFootprint.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpFootprint.cpp +++ ps/trunk/source/simulation2/components/CCmpFootprint.cpp @@ -92,7 +92,7 @@ ""; } - virtual void Init(const CParamNode& paramNode) + void Init(const CParamNode& paramNode) override { if (paramNode.GetChild("Square").IsOk()) { @@ -121,21 +121,21 @@ m_MaxSpawnDistance = entity_pos_t::FromInt(7); } - virtual void Deinit() + void Deinit() override { } - virtual void Serialize(ISerializer& UNUSED(serialize)) + void Serialize(ISerializer& UNUSED(serialize)) override { // No dynamic state to serialize } - virtual void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) + void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override { Init(paramNode); } - virtual void GetShape(EShape& shape, entity_pos_t& size0, entity_pos_t& size1, entity_pos_t& height) const + void GetShape(EShape& shape, entity_pos_t& size0, entity_pos_t& size1, entity_pos_t& height) const override { shape = m_Shape; size0 = m_Size0; @@ -143,7 +143,7 @@ height = m_Height; } - virtual CFixedVector3D PickSpawnPoint(entity_id_t spawned) const + CFixedVector3D PickSpawnPoint(entity_id_t spawned) const override { PROFILE3("PickSpawnPoint"); @@ -269,7 +269,7 @@ return error; } - virtual CFixedVector3D PickSpawnPointBothPass(entity_id_t spawned) const + CFixedVector3D PickSpawnPointBothPass(entity_id_t spawned) const override { PROFILE3("PickSpawnPointBothPass"); Index: ps/trunk/source/simulation2/components/CCmpMinimap.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpMinimap.cpp +++ ps/trunk/source/simulation2/components/CCmpMinimap.cpp @@ -99,7 +99,7 @@ ""; } - virtual void Init(const CParamNode& paramNode) + void Init(const CParamNode& paramNode) override { m_Active = true; m_IsPinging = false; @@ -136,7 +136,7 @@ } } - virtual void Deinit() + void Deinit() override { } @@ -152,19 +152,19 @@ } } - virtual void Serialize(ISerializer& serialize) + void Serialize(ISerializer& serialize) override { SerializeCommon(serialize); } - virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) + void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override { Init(paramNode); SerializeCommon(deserialize); } - virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)) + void HandleMessage(const CMessage& msg, bool UNUSED(global)) override { switch (msg.GetType()) { @@ -207,7 +207,7 @@ } } - virtual bool GetRenderData(u8& r, u8& g, u8& b, entity_pos_t& x, entity_pos_t& z) const + bool GetRenderData(u8& r, u8& g, u8& b, entity_pos_t& x, entity_pos_t& z) const override { if (!m_Active) return false; @@ -220,7 +220,7 @@ return true; } - virtual bool CheckPing(double currentTime, double pingDuration) + bool CheckPing(double currentTime, double pingDuration) override { if (!m_Active || !m_IsPinging) return false; @@ -237,7 +237,7 @@ return m_IsPinging; } - virtual void UpdateColor() + void UpdateColor() override { if (!m_UsePlayerColor) return; Index: ps/trunk/source/simulation2/components/CCmpMotionBall.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpMotionBall.cpp +++ ps/trunk/source/simulation2/components/CCmpMotionBall.cpp @@ -43,30 +43,30 @@ return ""; } - virtual void Init(const CParamNode& UNUSED(paramNode)) + void Init(const CParamNode& UNUSED(paramNode)) override { m_SpeedX = 0; m_SpeedZ = 0; } - virtual void Deinit() + void Deinit() override { } - virtual void Serialize(ISerializer& serialize) + void Serialize(ISerializer& serialize) override { serialize.NumberFloat_Unbounded("speed x", m_SpeedX); serialize.NumberFloat_Unbounded("speed z", m_SpeedZ); } - virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) + void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override { Init(paramNode); deserialize.NumberFloat_Unbounded("speed x", m_SpeedX); deserialize.NumberFloat_Unbounded("speed z", m_SpeedZ); } - virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)) + void HandleMessage(const CMessage& msg, bool UNUSED(global)) override { switch (msg.GetType()) { Index: ps/trunk/source/simulation2/components/CCmpObstruction.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpObstruction.cpp +++ ps/trunk/source/simulation2/components/CCmpObstruction.cpp @@ -196,7 +196,7 @@ ""; } - virtual void Init(const CParamNode& paramNode) + void Init(const CParamNode& paramNode) override { // The minimum obstruction size is the navcell size * sqrt(2) // This is enforced in the schema as a minimum of 1.5 @@ -273,7 +273,7 @@ m_ControlGroup2 = INVALID_ENTITY; } - virtual void Deinit() + void Deinit() override { } @@ -292,19 +292,19 @@ serialize.NumberFixed_Unbounded("clearance", m_Clearance); } - virtual void Serialize(ISerializer& serialize) + void Serialize(ISerializer& serialize) override { SerializeCommon(serialize); } - virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) + void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override { Init(paramNode); SerializeCommon(deserialize); } - virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)) + void HandleMessage(const CMessage& msg, bool UNUSED(global)) override { switch (msg.GetType()) { @@ -380,7 +380,7 @@ } } - virtual void SetActive(bool active) + void SetActive(bool active) override { if (active && !m_Active && !m_IsDestroyed) { @@ -446,7 +446,7 @@ // else we didn't change the active status } - virtual void SetDisableBlockMovementPathfinding(bool movementDisabled, bool pathfindingDisabled, int32_t shape) + void SetDisableBlockMovementPathfinding(bool movementDisabled, bool pathfindingDisabled, int32_t shape) override { flags_t *flags = NULL; if (shape == -1) @@ -476,27 +476,27 @@ } } - virtual bool GetBlockMovementFlag(bool templateOnly) const + bool GetBlockMovementFlag(bool templateOnly) const override { return m_Active && ((templateOnly ? m_TemplateFlags : m_Flags) & ICmpObstructionManager::FLAG_BLOCK_MOVEMENT) != 0; } - virtual EObstructionType GetObstructionType() const + EObstructionType GetObstructionType() const override { return m_Type; } - virtual ICmpObstructionManager::tag_t GetObstruction() const + ICmpObstructionManager::tag_t GetObstruction() const override { return m_Tag; } - virtual bool GetPreviousObstructionSquare(ICmpObstructionManager::ObstructionSquare& out) const + bool GetPreviousObstructionSquare(ICmpObstructionManager::ObstructionSquare& out) const override { return GetObstructionSquare(out, true); } - virtual bool GetObstructionSquare(ICmpObstructionManager::ObstructionSquare& out) const + bool GetObstructionSquare(ICmpObstructionManager::ObstructionSquare& out) const override { return GetObstructionSquare(out, false); } @@ -526,7 +526,7 @@ return true; } - virtual entity_pos_t GetSize() const + entity_pos_t GetSize() const override { if (m_Type == UNIT) return m_Clearance; @@ -534,12 +534,12 @@ return CFixedVector2D(m_Size0 / 2, m_Size1 / 2).Length(); } - virtual CFixedVector2D GetStaticSize() const + CFixedVector2D GetStaticSize() const override { return m_Type == STATIC ? CFixedVector2D(m_Size0, m_Size1) : CFixedVector2D(); } - virtual void SetUnitClearance(const entity_pos_t& clearance) + void SetUnitClearance(const entity_pos_t& clearance) override { // This doesn't send a MovementObstructionChanged message // because it's a just a workaround init order, and used in UnitMotion directly. @@ -547,12 +547,12 @@ m_Clearance = clearance; } - virtual bool IsControlPersistent() const + bool IsControlPersistent() const override { return m_ControlPersist; } - virtual bool CheckShorePlacement() const + bool CheckShorePlacement() const override { ICmpObstructionManager::ObstructionSquare s; if (!GetObstructionSquare(s)) @@ -571,12 +571,12 @@ cmpWaterManager->GetWaterLevel( back.X, back.Y) - cmpTerrain->GetGroundLevel( back.X, back.Y) < fixed::FromInt(2); } - virtual EFoundationCheck CheckFoundation(const std::string& className) const + EFoundationCheck CheckFoundation(const std::string& className) const override { return CheckFoundation(className, false); } - virtual EFoundationCheck CheckFoundation(const std::string& className, bool onlyCenterPoint) const + EFoundationCheck CheckFoundation(const std::string& className, bool onlyCenterPoint) const override { CmpPtr cmpPosition(GetEntityHandle()); if (!cmpPosition) @@ -613,7 +613,7 @@ return cmpPathfinder->CheckBuildingPlacement(filter, pos.X, pos.Y, cmpPosition->GetRotation().Y, m_Size0, m_Size1, GetEntityId(), passClass, onlyCenterPoint); } - virtual bool CheckDuplicateFoundation() const + bool CheckDuplicateFoundation() const override { CmpPtr cmpPosition(GetEntityHandle()); if (!cmpPosition) @@ -645,7 +645,7 @@ return !cmpObstructionManager->TestStaticShape(filter, pos.X, pos.Y, cmpPosition->GetRotation().Y, m_Size0, m_Size1, NULL ); } - virtual std::vector GetEntitiesByFlags(flags_t flags) const + std::vector GetEntitiesByFlags(flags_t flags) const override { std::vector ret; @@ -668,22 +668,22 @@ return ret; } - virtual std::vector GetEntitiesBlockingMovement() const + std::vector GetEntitiesBlockingMovement() const override { return GetEntitiesByFlags(ICmpObstructionManager::FLAG_BLOCK_MOVEMENT); } - virtual std::vector GetEntitiesBlockingConstruction() const + std::vector GetEntitiesBlockingConstruction() const override { return GetEntitiesByFlags(ICmpObstructionManager::FLAG_BLOCK_CONSTRUCTION); } - virtual std::vector GetEntitiesDeletedUponConstruction() const + std::vector GetEntitiesDeletedUponConstruction() const override { return GetEntitiesByFlags(ICmpObstructionManager::FLAG_DELETE_UPON_CONSTRUCTION); } - virtual void SetMovingFlag(bool enabled) + void SetMovingFlag(bool enabled) override { m_Moving = enabled; @@ -695,24 +695,24 @@ } } - virtual void SetControlGroup(entity_id_t group) + void SetControlGroup(entity_id_t group) override { m_ControlGroup = group; UpdateControlGroups(); } - virtual void SetControlGroup2(entity_id_t group2) + void SetControlGroup2(entity_id_t group2) override { m_ControlGroup2 = group2; UpdateControlGroups(); } - virtual entity_id_t GetControlGroup() const + entity_id_t GetControlGroup() const override { return m_ControlGroup; } - virtual entity_id_t GetControlGroup2() const + entity_id_t GetControlGroup2() const override { return m_ControlGroup2; } @@ -744,7 +744,7 @@ } } - void ResolveFoundationCollisions() const + void ResolveFoundationCollisions() const override { if (m_Type == UNIT) return; Index: ps/trunk/source/simulation2/components/CCmpObstructionManager.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpObstructionManager.cpp +++ ps/trunk/source/simulation2/components/CCmpObstructionManager.cpp @@ -160,7 +160,7 @@ return ""; } - virtual void Init(const CParamNode& UNUSED(paramNode)) + void Init(const CParamNode& UNUSED(paramNode)) override { m_DebugOverlayEnabled = false; m_DebugOverlayDirty = true; @@ -180,7 +180,7 @@ ResetSubdivisions(entity_pos_t::FromInt(1024), entity_pos_t::FromInt(1024)); } - virtual void Deinit() + void Deinit() override { } @@ -205,7 +205,7 @@ serialize.NumberFixed_Unbounded("world z1", m_WorldZ1); } - virtual void Serialize(ISerializer& serialize) + void Serialize(ISerializer& serialize) override { // TODO: this could perhaps be optimised by not storing all the obstructions, // and instead regenerating them from the other entities on Deserialize @@ -213,7 +213,7 @@ SerializeCommon(serialize); } - virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) + void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override { Init(paramNode); @@ -223,7 +223,7 @@ m_UpdateInformations.dirtinessGrid = Grid(size, size); } - virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)) + void HandleMessage(const CMessage& msg, bool UNUSED(global)) override { switch (msg.GetType()) { @@ -238,7 +238,7 @@ // NB: on deserialization, this function is not called after the component is reset. // So anything that happens here should be safely serialized. - virtual void SetBounds(entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1) + void SetBounds(entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1) override { m_WorldX0 = x0; m_WorldZ0 = z0; @@ -278,7 +278,7 @@ } } - virtual tag_t AddUnitShape(entity_id_t ent, entity_pos_t x, entity_pos_t z, entity_pos_t clearance, flags_t flags, entity_id_t group) + tag_t AddUnitShape(entity_id_t ent, entity_pos_t x, entity_pos_t z, entity_pos_t clearance, flags_t flags, entity_id_t group) override { UnitShape shape = { ent, x, z, clearance, flags, group }; u32 id = m_UnitShapeNext++; @@ -291,7 +291,7 @@ return UNIT_INDEX_TO_TAG(id); } - virtual tag_t AddStaticShape(entity_id_t ent, entity_pos_t x, entity_pos_t z, entity_angle_t a, entity_pos_t w, entity_pos_t h, flags_t flags, entity_id_t group, entity_id_t group2 /* = INVALID_ENTITY */) + tag_t AddStaticShape(entity_id_t ent, entity_pos_t x, entity_pos_t z, entity_angle_t a, entity_pos_t w, entity_pos_t h, flags_t flags, entity_id_t group, entity_id_t group2 /* = INVALID_ENTITY */) override { fixed s, c; sincos_approx(a, s, c); @@ -311,7 +311,7 @@ return STATIC_INDEX_TO_TAG(id); } - virtual ObstructionSquare GetUnitShapeObstruction(entity_pos_t x, entity_pos_t z, entity_pos_t clearance) const + ObstructionSquare GetUnitShapeObstruction(entity_pos_t x, entity_pos_t z, entity_pos_t clearance) const override { CFixedVector2D u(entity_pos_t::FromInt(1), entity_pos_t::Zero()); CFixedVector2D v(entity_pos_t::Zero(), entity_pos_t::FromInt(1)); @@ -319,7 +319,7 @@ return o; } - virtual ObstructionSquare GetStaticShapeObstruction(entity_pos_t x, entity_pos_t z, entity_angle_t a, entity_pos_t w, entity_pos_t h) const + ObstructionSquare GetStaticShapeObstruction(entity_pos_t x, entity_pos_t z, entity_angle_t a, entity_pos_t w, entity_pos_t h) const override { fixed s, c; sincos_approx(a, s, c); @@ -330,7 +330,7 @@ return o; } - virtual void MoveShape(tag_t tag, entity_pos_t x, entity_pos_t z, entity_angle_t a) + void MoveShape(tag_t tag, entity_pos_t x, entity_pos_t z, entity_angle_t a) override { ENSURE(TAG_IS_VALID(tag)); @@ -379,7 +379,7 @@ } } - virtual void SetUnitMovingFlag(tag_t tag, bool moving) + void SetUnitMovingFlag(tag_t tag, bool moving) override { ENSURE(TAG_IS_VALID(tag) && TAG_IS_UNIT(tag)); @@ -395,7 +395,7 @@ } } - virtual void SetUnitControlGroup(tag_t tag, entity_id_t group) + void SetUnitControlGroup(tag_t tag, entity_id_t group) override { ENSURE(TAG_IS_VALID(tag) && TAG_IS_UNIT(tag)); @@ -406,7 +406,7 @@ } } - virtual void SetStaticControlGroup(tag_t tag, entity_id_t group, entity_id_t group2) + void SetStaticControlGroup(tag_t tag, entity_id_t group, entity_id_t group2) override { ENSURE(TAG_IS_VALID(tag) && TAG_IS_STATIC(tag)); @@ -418,7 +418,7 @@ } } - virtual void RemoveShape(tag_t tag) + void RemoveShape(tag_t tag) override { ENSURE(TAG_IS_VALID(tag)); @@ -447,7 +447,7 @@ } } - virtual ObstructionSquare GetObstruction(tag_t tag) const + ObstructionSquare GetObstruction(tag_t tag) const override { ENSURE(TAG_IS_VALID(tag)); @@ -467,31 +467,31 @@ } } - virtual fixed DistanceToPoint(entity_id_t ent, entity_pos_t px, entity_pos_t pz) const; - virtual fixed MaxDistanceToPoint(entity_id_t ent, entity_pos_t px, entity_pos_t pz) const; - virtual fixed DistanceToTarget(entity_id_t ent, entity_id_t target) const; - virtual fixed MaxDistanceToTarget(entity_id_t ent, entity_id_t target) const; - virtual fixed DistanceBetweenShapes(const ObstructionSquare& source, const ObstructionSquare& target) const; - virtual fixed MaxDistanceBetweenShapes(const ObstructionSquare& source, const ObstructionSquare& target) const; - - virtual bool IsInPointRange(entity_id_t ent, entity_pos_t px, entity_pos_t pz, entity_pos_t minRange, entity_pos_t maxRange, bool opposite) const; - virtual bool IsInTargetRange(entity_id_t ent, entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange, bool opposite) const; - virtual bool IsInTargetParabolicRange(entity_id_t ent, entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange, entity_pos_t yOrigin, bool opposite) const; - virtual bool IsPointInPointRange(entity_pos_t x, entity_pos_t z, entity_pos_t px, entity_pos_t pz, entity_pos_t minRange, entity_pos_t maxRange) const; - virtual bool AreShapesInRange(const ObstructionSquare& source, const ObstructionSquare& target, entity_pos_t minRange, entity_pos_t maxRange, bool opposite) const; - - virtual bool TestLine(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, entity_pos_t r, bool relaxClearanceForUnits = false) const; - virtual bool TestStaticShape(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t a, entity_pos_t w, entity_pos_t h, std::vector* out) const; - virtual bool TestUnitShape(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t r, std::vector* out) const; - - virtual void Rasterize(Grid& grid, const std::vector& passClasses, bool fullUpdate); - virtual void GetObstructionsInRange(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, std::vector& squares) const; - virtual void GetUnitObstructionsInRange(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, std::vector& squares) const; - virtual void GetStaticObstructionsInRange(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, std::vector& squares) const; - virtual void GetUnitsOnObstruction(const ObstructionSquare& square, std::vector& out, const IObstructionTestFilter& filter, bool strict = false) const; - virtual void GetStaticObstructionsOnObstruction(const ObstructionSquare& square, std::vector& out, const IObstructionTestFilter& filter) const; + fixed DistanceToPoint(entity_id_t ent, entity_pos_t px, entity_pos_t pz) const override; + fixed MaxDistanceToPoint(entity_id_t ent, entity_pos_t px, entity_pos_t pz) const override; + fixed DistanceToTarget(entity_id_t ent, entity_id_t target) const override; + fixed MaxDistanceToTarget(entity_id_t ent, entity_id_t target) const override; + fixed DistanceBetweenShapes(const ObstructionSquare& source, const ObstructionSquare& target) const override; + fixed MaxDistanceBetweenShapes(const ObstructionSquare& source, const ObstructionSquare& target) const override; + + bool IsInPointRange(entity_id_t ent, entity_pos_t px, entity_pos_t pz, entity_pos_t minRange, entity_pos_t maxRange, bool opposite) const override; + bool IsInTargetRange(entity_id_t ent, entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange, bool opposite) const override; + bool IsInTargetParabolicRange(entity_id_t ent, entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange, entity_pos_t yOrigin, bool opposite) const override; + bool IsPointInPointRange(entity_pos_t x, entity_pos_t z, entity_pos_t px, entity_pos_t pz, entity_pos_t minRange, entity_pos_t maxRange) const override; + bool AreShapesInRange(const ObstructionSquare& source, const ObstructionSquare& target, entity_pos_t minRange, entity_pos_t maxRange, bool opposite) const override; + + bool TestLine(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, entity_pos_t r, bool relaxClearanceForUnits = false) const override; + bool TestStaticShape(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t a, entity_pos_t w, entity_pos_t h, std::vector* out) const override; + bool TestUnitShape(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t r, std::vector* out) const override; + + void Rasterize(Grid& grid, const std::vector& passClasses, bool fullUpdate) override; + void GetObstructionsInRange(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, std::vector& squares) const override; + void GetUnitObstructionsInRange(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, std::vector& squares) const override; + void GetStaticObstructionsInRange(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, std::vector& squares) const override; + void GetUnitsOnObstruction(const ObstructionSquare& square, std::vector& out, const IObstructionTestFilter& filter, bool strict = false) const override; + void GetStaticObstructionsOnObstruction(const ObstructionSquare& square, std::vector& out, const IObstructionTestFilter& filter) const override; - virtual void SetPassabilityCircular(bool enabled) + void SetPassabilityCircular(bool enabled) override { m_PassabilityCircular = enabled; MakeDirtyAll(); @@ -500,12 +500,12 @@ GetSimContext().GetComponentManager().BroadcastMessage(msg); } - virtual bool GetPassabilityCircular() const + bool GetPassabilityCircular() const override { return m_PassabilityCircular; } - virtual void SetDebugOverlay(bool enabled) + void SetDebugOverlay(bool enabled) override { m_DebugOverlayEnabled = enabled; m_DebugOverlayDirty = true; @@ -515,7 +515,7 @@ void RenderSubmit(SceneCollector& collector); - virtual void UpdateInformations(GridUpdateInformation& informations) + void UpdateInformations(GridUpdateInformation& informations) override { if (!m_UpdateInformations.dirtinessGrid.blank()) informations.MergeAndClear(m_UpdateInformations); Index: ps/trunk/source/simulation2/components/CCmpOverlayRenderer.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpOverlayRenderer.cpp +++ ps/trunk/source/simulation2/components/CCmpOverlayRenderer.cpp @@ -54,27 +54,27 @@ return ""; } - virtual void Init(const CParamNode& UNUSED(paramNode)) + void Init(const CParamNode& UNUSED(paramNode)) override { } - virtual void Deinit() + void Deinit() override { } - virtual void Serialize(ISerializer& UNUSED(serialize)) + void Serialize(ISerializer& UNUSED(serialize)) override { // TODO: should we do anything here? // or should we expect other components to reinitialise us // after deserialization? } - virtual void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) + void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override { Init(paramNode); } - virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)) + void HandleMessage(const CMessage& msg, bool UNUSED(global)) override { switch (msg.GetType()) { @@ -107,7 +107,7 @@ GetSimContext().GetComponentManager().DynamicSubscriptionNonsync(MT_RenderSubmit, this, needRender); } - virtual void Reset() + void Reset() override { m_Sprites.clear(); m_SpriteOffsets.clear(); @@ -115,7 +115,7 @@ UpdateMessageSubscriptions(); } - virtual void AddSprite(const VfsPath& textureName, const CFixedVector2D& corner0, const CFixedVector2D& corner1, const CFixedVector3D& position, const std::string& color) + void AddSprite(const VfsPath& textureName, const CFixedVector2D& corner0, const CFixedVector2D& corner1, const CFixedVector3D& position, const std::string& color) override { CColor colorObj(1.0f, 1.0f, 1.0f, 1.0f); if (!colorObj.ParseString(color, 1)) Index: ps/trunk/source/simulation2/components/CCmpOwnership.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpOwnership.cpp +++ ps/trunk/source/simulation2/components/CCmpOwnership.cpp @@ -45,26 +45,26 @@ ""; } - virtual void Init(const CParamNode& UNUSED(paramNode)) + void Init(const CParamNode& UNUSED(paramNode)) override { m_Owner = INVALID_PLAYER; } - virtual void Deinit() + void Deinit() override { } - virtual void Serialize(ISerializer& serialize) + void Serialize(ISerializer& serialize) override { serialize.NumberI32_Unbounded("owner", m_Owner); } - virtual void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserialize) + void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserialize) override { deserialize.NumberI32_Unbounded("owner", m_Owner); } - virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)) + void HandleMessage(const CMessage& msg, bool UNUSED(global)) override { switch (msg.GetType()) { @@ -77,12 +77,12 @@ } } - virtual player_id_t GetOwner() const + player_id_t GetOwner() const override { return m_Owner; } - virtual void SetOwner(player_id_t playerID) + void SetOwner(player_id_t playerID) override { if (playerID == m_Owner) return; @@ -94,7 +94,7 @@ GetSimContext().GetComponentManager().PostMessage(GetEntityId(), msg); } - virtual void SetOwnerQuiet(player_id_t playerID) + void SetOwnerQuiet(player_id_t playerID) override { if (playerID != m_Owner) m_Owner = playerID; Index: ps/trunk/source/simulation2/components/CCmpParticleManager.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpParticleManager.cpp +++ ps/trunk/source/simulation2/components/CCmpParticleManager.cpp @@ -42,25 +42,25 @@ return ""; } - virtual void Init(const CParamNode& UNUSED(paramNode)) + void Init(const CParamNode& UNUSED(paramNode)) override { useSimTime = true; } - virtual void Deinit() + void Deinit() override { } - virtual void Serialize(ISerializer& UNUSED(serialize)) + void Serialize(ISerializer& UNUSED(serialize)) override { } - virtual void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) + void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override { Init(paramNode); } - virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)) + void HandleMessage(const CMessage& msg, bool UNUSED(global)) override { switch (msg.GetType()) { @@ -77,7 +77,7 @@ } } - virtual void SetUseSimTime(bool flag) + void SetUseSimTime(bool flag) override { useSimTime = flag; } Index: ps/trunk/source/simulation2/components/CCmpPathfinder_Common.h =================================================================== --- ps/trunk/source/simulation2/components/CCmpPathfinder_Common.h +++ ps/trunk/source/simulation2/components/CCmpPathfinder_Common.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -149,29 +149,29 @@ return ""; } - virtual void Init(const CParamNode& paramNode); + void Init(const CParamNode& paramNode) override; - virtual void Deinit(); + void Deinit() override; template void SerializeCommon(S& serialize); - virtual void Serialize(ISerializer& serialize); + void Serialize(ISerializer& serialize) override; - virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize); + void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override; - virtual void HandleMessage(const CMessage& msg, bool global); + void HandleMessage(const CMessage& msg, bool global) override; - virtual pass_class_t GetPassabilityClass(const std::string& name) const; + pass_class_t GetPassabilityClass(const std::string& name) const override; - virtual void GetPassabilityClasses(std::map& passClasses) const; - virtual void GetPassabilityClasses( + void GetPassabilityClasses(std::map& passClasses) const override; + void GetPassabilityClasses( std::map& nonPathfindingPassClasses, - std::map& pathfindingPassClasses) const; + std::map& pathfindingPassClasses) const override; const PathfinderPassability* GetPassabilityFromMask(pass_class_t passClass) const; - virtual entity_pos_t GetClearance(pass_class_t passClass) const + entity_pos_t GetClearance(pass_class_t passClass) const override { const PathfinderPassability* passability = GetPassabilityFromMask(passClass); if (!passability) @@ -180,7 +180,7 @@ return passability->m_Clearance; } - virtual entity_pos_t GetMaximumClearance() const + entity_pos_t GetMaximumClearance() const override { entity_pos_t max = fixed::Zero(); @@ -191,51 +191,51 @@ return max + Pathfinding::CLEARANCE_EXTENSION_RADIUS; } - virtual const Grid& GetPassabilityGrid(); + const Grid& GetPassabilityGrid() override; - virtual const GridUpdateInformation& GetAIPathfinderDirtinessInformation() const + const GridUpdateInformation& GetAIPathfinderDirtinessInformation() const override { return m_AIPathfinderDirtinessInformation; } - virtual void FlushAIPathfinderDirtinessInformation() + void FlushAIPathfinderDirtinessInformation() override { m_AIPathfinderDirtinessInformation.Clean(); } - virtual Grid ComputeShoreGrid(bool expandOnWater = false); + Grid ComputeShoreGrid(bool expandOnWater = false) override; - virtual void ComputePathImmediate(entity_pos_t x0, entity_pos_t z0, const PathGoal& goal, pass_class_t passClass, WaypointPath& ret) const; + void ComputePathImmediate(entity_pos_t x0, entity_pos_t z0, const PathGoal& goal, pass_class_t passClass, WaypointPath& ret) const override; - virtual u32 ComputePathAsync(entity_pos_t x0, entity_pos_t z0, const PathGoal& goal, pass_class_t passClass, entity_id_t notify); + u32 ComputePathAsync(entity_pos_t x0, entity_pos_t z0, const PathGoal& goal, pass_class_t passClass, entity_id_t notify) override; - virtual WaypointPath ComputeShortPathImmediate(const ShortPathRequest& request) const; + WaypointPath ComputeShortPathImmediate(const ShortPathRequest& request) const override; - virtual u32 ComputeShortPathAsync(entity_pos_t x0, entity_pos_t z0, entity_pos_t clearance, entity_pos_t range, const PathGoal& goal, pass_class_t passClass, bool avoidMovingUnits, entity_id_t controller, entity_id_t notify); + u32 ComputeShortPathAsync(entity_pos_t x0, entity_pos_t z0, entity_pos_t clearance, entity_pos_t range, const PathGoal& goal, pass_class_t passClass, bool avoidMovingUnits, entity_id_t controller, entity_id_t notify) override; - virtual bool IsGoalReachable(entity_pos_t x0, entity_pos_t z0, const PathGoal& goal, pass_class_t passClass); + bool IsGoalReachable(entity_pos_t x0, entity_pos_t z0, const PathGoal& goal, pass_class_t passClass) override; - virtual void SetDebugPath(entity_pos_t x0, entity_pos_t z0, const PathGoal& goal, pass_class_t passClass); + void SetDebugPath(entity_pos_t x0, entity_pos_t z0, const PathGoal& goal, pass_class_t passClass) override; - virtual void SetDebugOverlay(bool enabled); + void SetDebugOverlay(bool enabled) override; - virtual void SetHierDebugOverlay(bool enabled); + void SetHierDebugOverlay(bool enabled) override; - virtual void GetDebugData(u32& steps, double& time, Grid& grid) const; + void GetDebugData(u32& steps, double& time, Grid& grid) const override; - virtual void SetAtlasOverlay(bool enable, pass_class_t passClass = 0); + void SetAtlasOverlay(bool enable, pass_class_t passClass = 0) override; - virtual bool CheckMovement(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, entity_pos_t r, pass_class_t passClass) const; + bool CheckMovement(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, entity_pos_t r, pass_class_t passClass) const override; - virtual ICmpObstruction::EFoundationCheck CheckUnitPlacement(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t r, pass_class_t passClass, bool onlyCenterPoint) const; + ICmpObstruction::EFoundationCheck CheckUnitPlacement(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t r, pass_class_t passClass, bool onlyCenterPoint) const override; - virtual ICmpObstruction::EFoundationCheck CheckBuildingPlacement(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t a, entity_pos_t w, entity_pos_t h, entity_id_t id, pass_class_t passClass) const; + ICmpObstruction::EFoundationCheck CheckBuildingPlacement(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t a, entity_pos_t w, entity_pos_t h, entity_id_t id, pass_class_t passClass) const override; - virtual ICmpObstruction::EFoundationCheck CheckBuildingPlacement(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t a, entity_pos_t w, entity_pos_t h, entity_id_t id, pass_class_t passClass, bool onlyCenterPoint) const; + ICmpObstruction::EFoundationCheck CheckBuildingPlacement(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t a, entity_pos_t w, entity_pos_t h, entity_id_t id, pass_class_t passClass, bool onlyCenterPoint) const override; - virtual void SendRequestedPaths(); + void SendRequestedPaths() override; - virtual void StartProcessingMoves(bool useMax); + void StartProcessingMoves(bool useMax) override; template std::vector GetMovesToProcess(std::vector& requests, bool useMax = false, size_t maxMoves = 0); @@ -246,7 +246,7 @@ /** * Regenerates the grid based on the current obstruction list, if necessary */ - virtual void UpdateGrid(); + void UpdateGrid() override; /** * Updates the terrain-only grid without updating the dirtiness informations. @@ -274,7 +274,7 @@ { } - virtual void BuildTextureRGBA(u8* data, size_t w, size_t h) + void BuildTextureRGBA(u8* data, size_t w, size_t h) override { // Render navcell passability, based on the terrain-only grid u8* p = data; Index: ps/trunk/source/simulation2/components/CCmpPosition.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpPosition.cpp +++ ps/trunk/source/simulation2/components/CCmpPosition.cpp @@ -136,7 +136,7 @@ ""; } - virtual void Init(const CParamNode& paramNode) + void Init(const CParamNode& paramNode) override { const std::string& anchor = paramNode.GetChild("Anchor").ToString(); if (anchor == "pitch") @@ -171,11 +171,11 @@ m_EnabledMessageInterpolate = false; } - virtual void Deinit() + void Deinit() override { } - virtual void Serialize(ISerializer& serialize) + void Serialize(ISerializer& serialize) override { serialize.Bool("in world", m_InWorld); if (m_InWorld) @@ -232,7 +232,7 @@ Serializer(serialize, "turrets", m_Turrets); } - virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) + void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override { Init(paramNode); @@ -280,7 +280,7 @@ AdvertiseInterpolatedPositionChanges(); } - virtual void UpdateTurretPosition() + void UpdateTurretPosition() override { if (m_TurretParent == INVALID_ENTITY) return; @@ -308,12 +308,12 @@ } } - virtual std::set* GetTurrets() + std::set* GetTurrets() override { return &m_Turrets; } - virtual void SetTurretParent(entity_id_t id, const CFixedVector3D& offset) + void SetTurretParent(entity_id_t id, const CFixedVector3D& offset) override { entity_angle_t angle = GetRotation().Y; if (m_TurretParent != INVALID_ENTITY) @@ -336,17 +336,17 @@ UpdateTurretPosition(); } - virtual entity_id_t GetTurretParent() const + entity_id_t GetTurretParent() const override { return m_TurretParent; } - virtual bool IsInWorld() const + bool IsInWorld() const override { return m_InWorld; } - virtual void MoveOutOfWorld() + void MoveOutOfWorld() override { m_InWorld = false; @@ -354,7 +354,7 @@ AdvertiseInterpolatedPositionChanges(); } - virtual void MoveTo(entity_pos_t x, entity_pos_t z) + void MoveTo(entity_pos_t x, entity_pos_t z) override { m_X = x; m_Z = z; @@ -371,7 +371,7 @@ AdvertiseInterpolatedPositionChanges(); } - virtual void MoveAndTurnTo(entity_pos_t x, entity_pos_t z, entity_angle_t ry) + void MoveAndTurnTo(entity_pos_t x, entity_pos_t z, entity_angle_t ry) override { m_X = x; m_Z = z; @@ -390,7 +390,7 @@ AdvertiseInterpolatedPositionChanges(); } - virtual void JumpTo(entity_pos_t x, entity_pos_t z) + void JumpTo(entity_pos_t x, entity_pos_t z) override { m_LastX = m_PrevX = m_X = x; m_LastZ = m_PrevZ = m_Z = z; @@ -405,7 +405,7 @@ AdvertiseInterpolatedPositionChanges(); } - virtual void SetHeightOffset(entity_pos_t dy) + void SetHeightOffset(entity_pos_t dy) override { // subtract the offset and replace with a new offset m_LastYDifference = dy - GetHeightOffset(); @@ -413,7 +413,7 @@ AdvertiseInterpolatedPositionChanges(); } - virtual entity_pos_t GetHeightOffset() const + entity_pos_t GetHeightOffset() const override { if (m_RelativeToGround) return m_Y; @@ -433,7 +433,7 @@ return m_Y - baseY; } - virtual void SetHeightFixed(entity_pos_t y) + void SetHeightFixed(entity_pos_t y) override { // subtract the absolute height and replace it with a new absolute height m_LastYDifference = y - GetHeightFixed(); @@ -441,12 +441,12 @@ AdvertiseInterpolatedPositionChanges(); } - virtual entity_pos_t GetHeightFixed() const + entity_pos_t GetHeightFixed() const override { return GetHeightAtFixed(m_X, m_Z); } - virtual entity_pos_t GetHeightAtFixed(entity_pos_t x, entity_pos_t z) const + entity_pos_t GetHeightAtFixed(entity_pos_t x, entity_pos_t z) const override { if (!m_RelativeToGround) return m_Y; @@ -466,12 +466,12 @@ return m_Y + baseY; } - virtual bool IsHeightRelative() const + bool IsHeightRelative() const override { return m_RelativeToGround; } - virtual void SetHeightRelative(bool relative) + void SetHeightRelative(bool relative) override { // move y to use the right offset (from terrain or from map origin) m_Y = relative ? GetHeightOffset() : GetHeightFixed(); @@ -480,30 +480,30 @@ AdvertiseInterpolatedPositionChanges(); } - virtual bool CanFloat() const + bool CanFloat() const override { return m_Floating; } - virtual void SetFloating(bool flag) + void SetFloating(bool flag) override { m_Floating = flag; AdvertiseInterpolatedPositionChanges(); } - virtual void SetActorFloating(bool flag) + void SetActorFloating(bool flag) override { m_ActorFloating = flag; AdvertiseInterpolatedPositionChanges(); } - virtual void SetConstructionProgress(fixed progress) + void SetConstructionProgress(fixed progress) override { m_ConstructionProgress = progress; AdvertiseInterpolatedPositionChanges(); } - virtual CFixedVector3D GetPosition() const + CFixedVector3D GetPosition() const override { if (!m_InWorld) { @@ -514,7 +514,7 @@ return CFixedVector3D(m_X, GetHeightFixed(), m_Z); } - virtual CFixedVector2D GetPosition2D() const + CFixedVector2D GetPosition2D() const override { if (!m_InWorld) { @@ -525,7 +525,7 @@ return CFixedVector2D(m_X, m_Z); } - virtual CFixedVector3D GetPreviousPosition() const + CFixedVector3D GetPreviousPosition() const override { if (!m_InWorld) { @@ -536,7 +536,7 @@ return CFixedVector3D(m_PrevX, GetHeightAtFixed(m_PrevX, m_PrevZ), m_PrevZ); } - virtual CFixedVector2D GetPreviousPosition2D() const + CFixedVector2D GetPreviousPosition2D() const override { if (!m_InWorld) { @@ -547,12 +547,12 @@ return CFixedVector2D(m_PrevX, m_PrevZ); } - virtual fixed GetTurnRate() const + fixed GetTurnRate() const override { return m_RotYSpeed; } - virtual void TurnTo(entity_angle_t y) + void TurnTo(entity_angle_t y) override { if (m_TurretParent != INVALID_ENTITY) { @@ -566,7 +566,7 @@ UpdateMessageSubscriptions(); } - virtual void SetYRotation(entity_angle_t y) + void SetYRotation(entity_angle_t y) override { if (m_TurretParent != INVALID_ENTITY) { @@ -589,7 +589,7 @@ UpdateMessageSubscriptions(); } - virtual void SetXZRotation(entity_angle_t x, entity_angle_t z) + void SetXZRotation(entity_angle_t x, entity_angle_t z) override { m_RotX = x; m_RotZ = z; @@ -603,7 +603,7 @@ } } - virtual CFixedVector3D GetRotation() const + CFixedVector3D GetRotation() const override { entity_angle_t y = m_RotY; if (m_TurretParent != INVALID_ENTITY) @@ -615,7 +615,7 @@ return CFixedVector3D(m_RotX, y, m_RotZ); } - virtual fixed GetDistanceTravelled() const + fixed GetDistanceTravelled() const override { if (!m_InWorld) { @@ -656,7 +656,7 @@ return (m_ConstructionProgress.ToFloat() - 1.0f) * dy; } - virtual void GetInterpolatedPosition2D(float frameOffset, float& x, float& z, float& rotY) const + void GetInterpolatedPosition2D(float frameOffset, float& x, float& z, float& rotY) const override { if (!m_InWorld) { @@ -670,7 +670,7 @@ rotY = m_InterpolatedRotY; } - virtual CMatrix3D GetInterpolatedTransform(float frameOffset) const + CMatrix3D GetInterpolatedTransform(float frameOffset) const override { if (m_TurretParent != INVALID_ENTITY) { @@ -782,7 +782,7 @@ pos1.Y += GetConstructionProgressOffset(pos1); } - virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)) + void HandleMessage(const CMessage& msg, bool UNUSED(global)) override { switch (msg.GetType()) { Index: ps/trunk/source/simulation2/components/CCmpProjectileManager.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpProjectileManager.cpp +++ ps/trunk/source/simulation2/components/CCmpProjectileManager.cpp @@ -57,20 +57,20 @@ return ""; } - virtual void Init(const CParamNode& UNUSED(paramNode)) + void Init(const CParamNode& UNUSED(paramNode)) override { m_ActorSeed = 0; m_NextId = 1; } - virtual void Deinit() + void Deinit() override { for (size_t i = 0; i < m_Projectiles.size(); ++i) GetSimContext().GetUnitManager().DeleteUnit(m_Projectiles[i].unit); m_Projectiles.clear(); } - virtual void Serialize(ISerializer& serialize) + void Serialize(ISerializer& serialize) override { // Because this is just graphical effects, and because it's all non-deterministic floating point, // we don't do much serialization here. @@ -80,7 +80,7 @@ serialize.NumberU32_Unbounded("next id", m_NextId); } - virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) + void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override { Init(paramNode); @@ -88,7 +88,7 @@ deserialize.NumberU32_Unbounded("next id", m_NextId); } - virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)) + void HandleMessage(const CMessage& msg, bool UNUSED(global)) override { switch (msg.GetType()) { @@ -107,12 +107,12 @@ } } - virtual uint32_t LaunchProjectileAtPoint(const CFixedVector3D& launchPoint, const CFixedVector3D& target, fixed speed, fixed gravity, const std::wstring& actorName, const std::wstring& impactActorName, fixed impactAnimationLifetime) + uint32_t LaunchProjectileAtPoint(const CFixedVector3D& launchPoint, const CFixedVector3D& target, fixed speed, fixed gravity, const std::wstring& actorName, const std::wstring& impactActorName, fixed impactAnimationLifetime) override { return LaunchProjectile(launchPoint, target, speed, gravity, actorName, impactActorName, impactAnimationLifetime); } - virtual void RemoveProjectile(uint32_t); + void RemoveProjectile(uint32_t) override; void RenderModel(CModelAbstract& model, const CVector3D& position, SceneCollector& collector, const CFrustum& frustum, bool culling, const CLosQuerier& los, bool losRevealAll) const; Index: ps/trunk/source/simulation2/components/CCmpRallyPointRenderer.h =================================================================== --- ps/trunk/source/simulation2/components/CCmpRallyPointRenderer.h +++ ps/trunk/source/simulation2/components/CCmpRallyPointRenderer.h @@ -72,13 +72,13 @@ static std::string GetSchema(); static void ClassInit(CComponentManager& componentManager); - virtual void Init(const CParamNode& paramNode); - virtual void Deinit(); + void Init(const CParamNode& paramNode) override; + void Deinit() override; - virtual void Serialize(ISerializer& UNUSED(serialize)); - virtual void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)); + void Serialize(ISerializer& UNUSED(serialize)) override; + void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override; - virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)); + void HandleMessage(const CMessage& msg, bool UNUSED(global)) override; /* * Must be called whenever m_Displayed or the size of m_RallyPoints change, @@ -86,22 +86,22 @@ */ virtual void UpdateMessageSubscriptions(); - virtual void AddPosition_wrapper(const CFixedVector2D& pos); + void AddPosition_wrapper(const CFixedVector2D& pos) override; - virtual void SetPosition(const CFixedVector2D& pos); + void SetPosition(const CFixedVector2D& pos) override; - virtual void UpdatePosition(u32 rallyPointId, const CFixedVector2D& pos); + void UpdatePosition(u32 rallyPointId, const CFixedVector2D& pos) override; - virtual void SetDisplayed(bool displayed); + void SetDisplayed(bool displayed) override; - virtual void Reset(); + void Reset() override; - virtual void UpdateColor(); + void UpdateColor() override; /** * Returns true if at least one display rally point is set; i.e., if we have a point to render our marker/line at. */ - virtual bool IsSet() const; + bool IsSet() const override; DEFAULT_COMPONENT_ALLOCATOR(RallyPointRenderer) Index: ps/trunk/source/simulation2/components/CCmpRangeManager.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpRangeManager.cpp +++ ps/trunk/source/simulation2/components/CCmpRangeManager.cpp @@ -436,7 +436,7 @@ return ""; } - virtual void Init(const CParamNode& UNUSED(paramNode)) + void Init(const CParamNode& UNUSED(paramNode)) override { m_QueryNext = 1; @@ -462,7 +462,7 @@ m_LosVerticesPerSide = 0; } - virtual void Deinit() + void Deinit() override { } @@ -496,19 +496,19 @@ Serializer(serialize, "shared dirty visibility masks", m_SharedDirtyVisibilityMasks); } - virtual void Serialize(ISerializer& serialize) + void Serialize(ISerializer& serialize) override { SerializeCommon(serialize); } - virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) + void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override { Init(paramNode); SerializeCommon(deserialize); } - virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)) + void HandleMessage(const CMessage& msg, bool UNUSED(global)) override { switch (msg.GetType()) { @@ -781,7 +781,7 @@ } } - virtual void SetBounds(entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1) + void SetBounds(entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1) override { // Don't support rectangular looking maps. ENSURE(x1-x0 == z1-z0); @@ -794,7 +794,7 @@ ResetDerivedData(); } - virtual void Verify() + void Verify() override { // Ignore if map not initialised yet if (m_WorldX1.IsZero()) @@ -844,7 +844,7 @@ debug_warn(L"inconsistent los regions"); } - FastSpatialSubdivision* GetSubdivision() + FastSpatialSubdivision* GetSubdivision() override { return &m_Subdivision; } @@ -921,9 +921,9 @@ m_Subdivision.Add(it->first, CFixedVector2D(it->second.x, it->second.z), it->second.size); } - virtual tag_t CreateActiveQuery(entity_id_t source, + tag_t CreateActiveQuery(entity_id_t source, entity_pos_t minRange, entity_pos_t maxRange, - const std::vector& owners, int requiredInterface, u8 flags, bool accountForSize) + const std::vector& owners, int requiredInterface, u8 flags, bool accountForSize) override { tag_t id = m_QueryNext++; m_Queries[id] = ConstructQuery(source, minRange, maxRange, owners, requiredInterface, flags, accountForSize); @@ -931,9 +931,9 @@ return id; } - virtual tag_t CreateActiveParabolicQuery(entity_id_t source, + tag_t CreateActiveParabolicQuery(entity_id_t source, entity_pos_t minRange, entity_pos_t maxRange, entity_pos_t yOrigin, - const std::vector& owners, int requiredInterface, u8 flags) + const std::vector& owners, int requiredInterface, u8 flags) override { tag_t id = m_QueryNext++; m_Queries[id] = ConstructParabolicQuery(source, minRange, maxRange, yOrigin, owners, requiredInterface, flags, true); @@ -941,7 +941,7 @@ return id; } - virtual void DestroyActiveQuery(tag_t tag) + void DestroyActiveQuery(tag_t tag) override { if (m_Queries.find(tag) == m_Queries.end()) { @@ -952,7 +952,7 @@ m_Queries.erase(tag); } - virtual void EnableActiveQuery(tag_t tag) + void EnableActiveQuery(tag_t tag) override { std::map::iterator it = m_Queries.find(tag); if (it == m_Queries.end()) @@ -965,7 +965,7 @@ q.enabled = true; } - virtual void DisableActiveQuery(tag_t tag) + void DisableActiveQuery(tag_t tag) override { std::map::iterator it = m_Queries.find(tag); if (it == m_Queries.end()) @@ -978,7 +978,7 @@ q.enabled = false; } - virtual bool IsActiveQueryEnabled(tag_t tag) const + bool IsActiveQueryEnabled(tag_t tag) const override { std::map::const_iterator it = m_Queries.find(tag); if (it == m_Queries.end()) @@ -991,9 +991,9 @@ return q.enabled; } - virtual std::vector ExecuteQueryAroundPos(const CFixedVector2D& pos, + std::vector ExecuteQueryAroundPos(const CFixedVector2D& pos, entity_pos_t minRange, entity_pos_t maxRange, - const std::vector& owners, int requiredInterface, bool accountForSize) + const std::vector& owners, int requiredInterface, bool accountForSize) override { Query q = ConstructQuery(INVALID_ENTITY, minRange, maxRange, owners, requiredInterface, GetEntityFlagMask("normal"), accountForSize); std::vector r; @@ -1005,9 +1005,9 @@ return r; } - virtual std::vector ExecuteQuery(entity_id_t source, + std::vector ExecuteQuery(entity_id_t source, entity_pos_t minRange, entity_pos_t maxRange, - const std::vector& owners, int requiredInterface, bool accountForSize) + const std::vector& owners, int requiredInterface, bool accountForSize) override { PROFILE("ExecuteQuery"); @@ -1031,7 +1031,7 @@ return r; } - virtual std::vector ResetActiveQuery(tag_t tag) + std::vector ResetActiveQuery(tag_t tag) override { PROFILE("ResetActiveQuery"); @@ -1066,17 +1066,17 @@ return r; } - virtual std::vector GetEntitiesByPlayer(player_id_t player) const + std::vector GetEntitiesByPlayer(player_id_t player) const override { return GetEntitiesByMask(CalcOwnerMask(player)); } - virtual std::vector GetNonGaiaEntities() const + std::vector GetNonGaiaEntities() const override { return GetEntitiesByMask(~3u); // bit 0 for owner=-1 and bit 1 for gaia } - virtual std::vector GetGaiaAndNonGaiaEntities() const + std::vector GetGaiaAndNonGaiaEntities() const override { return GetEntitiesByMask(~1u); // bit 0 for owner=-1 } @@ -1095,7 +1095,7 @@ return entities; } - virtual void SetDebugOverlay(bool enabled) + void SetDebugOverlay(bool enabled) override { m_DebugOverlayEnabled = enabled; m_DebugOverlayDirty = true; @@ -1279,7 +1279,7 @@ } } - virtual entity_pos_t GetEffectiveParabolicRange(entity_id_t source, entity_id_t target, entity_pos_t range, entity_pos_t yOrigin) const + entity_pos_t GetEffectiveParabolicRange(entity_id_t source, entity_id_t target, entity_pos_t range, entity_pos_t yOrigin) const override { // For non-positive ranges, just return the range. if (range < entity_pos_t::Zero()) @@ -1302,7 +1302,7 @@ return effectiveRange; } - virtual entity_pos_t GetElevationAdaptedRange(const CFixedVector3D& pos1, const CFixedVector3D& rot, entity_pos_t range, entity_pos_t yOrigin, entity_pos_t angle) const + entity_pos_t GetElevationAdaptedRange(const CFixedVector3D& pos1, const CFixedVector3D& rot, entity_pos_t range, entity_pos_t yOrigin, entity_pos_t angle) const override { entity_pos_t r = entity_pos_t::Zero(); CFixedVector3D pos(pos1); @@ -1604,7 +1604,7 @@ collector.Submit(&m_DebugOverlayLines[i]); } - virtual u8 GetEntityFlagMask(const std::string& identifier) const + u8 GetEntityFlagMask(const std::string& identifier) const override { if (identifier == "normal") return FlagMasks::Normal; @@ -1615,7 +1615,7 @@ return FlagMasks::None; } - virtual void SetEntityFlag(entity_id_t ent, const std::string& identifier, bool value) + void SetEntityFlag(entity_id_t ent, const std::string& identifier, bool value) override { EntityMap::iterator it = m_EntityData.find(ent); @@ -1635,7 +1635,7 @@ // LOS implementation: - virtual CLosQuerier GetLosQuerier(player_id_t player) const + CLosQuerier GetLosQuerier(player_id_t player) const override { if (GetLosRevealAll(player)) return CLosQuerier(0xFFFFFFFFu, m_LosStateRevealed, m_LosVerticesPerSide); @@ -1643,7 +1643,7 @@ return CLosQuerier(GetSharedLosMask(player), m_LosState, m_LosVerticesPerSide); } - virtual void ActivateScriptedVisibility(entity_id_t ent, bool status) + void ActivateScriptedVisibility(entity_id_t ent, bool status) override { EntityMap::iterator it = m_EntityData.find(ent); if (it != m_EntityData.end()) @@ -1753,7 +1753,7 @@ return ComputeLosVisibility(handle, player); } - virtual LosVisibility GetLosVisibility(CEntityHandle ent, player_id_t player) const + LosVisibility GetLosVisibility(CEntityHandle ent, player_id_t player) const override { entity_id_t entId = ent.GetId(); @@ -1784,13 +1784,13 @@ return static_cast(GetPlayerVisibility(it->second.visibilities, player)); } - virtual LosVisibility GetLosVisibility(entity_id_t ent, player_id_t player) const + LosVisibility GetLosVisibility(entity_id_t ent, player_id_t player) const override { CEntityHandle handle = GetSimContext().GetComponentManager().LookupEntityHandle(ent); return GetLosVisibility(handle, player); } - virtual LosVisibility GetLosVisibilityPosition(entity_pos_t x, entity_pos_t z, player_id_t player) const + LosVisibility GetLosVisibilityPosition(entity_pos_t x, entity_pos_t z, player_id_t player) const override { int i = (x / LOS_TILE_SIZE).ToInt_RoundToNearest(); int j = (z / LOS_TILE_SIZE).ToInt_RoundToNearest(); @@ -1814,7 +1814,7 @@ return LosVisibility::HIDDEN; } - size_t GetVerticesPerSide() const + size_t GetVerticesPerSide() const override { return m_LosVerticesPerSide; } @@ -1886,7 +1886,7 @@ } } - virtual void RequestVisibilityUpdate(entity_id_t ent) + void RequestVisibilityUpdate(entity_id_t ent) override { if (std::find(m_ModifiedEntities.begin(), m_ModifiedEntities.end(), ent) == m_ModifiedEntities.end()) m_ModifiedEntities.push_back(ent); @@ -1916,7 +1916,7 @@ UpdateVisibility(ent, player); } - virtual void SetLosRevealAll(player_id_t player, bool enabled) + void SetLosRevealAll(player_id_t player, bool enabled) override { if (player == -1) m_LosRevealAll[MAX_LOS_PLAYER_ID+1] = enabled; @@ -1930,7 +1930,7 @@ m_GlobalVisibilityUpdate = true; } - virtual bool GetLosRevealAll(player_id_t player) const + bool GetLosRevealAll(player_id_t player) const override { // Special player value can force reveal-all for every player if (m_LosRevealAll[MAX_LOS_PLAYER_ID+1] || player == -1) @@ -1943,19 +1943,19 @@ return false; } - virtual void SetLosCircular(bool enabled) + void SetLosCircular(bool enabled) override { m_LosCircular = enabled; ResetDerivedData(); } - virtual bool GetLosCircular() const + bool GetLosCircular() const override { return m_LosCircular; } - virtual void SetSharedLos(player_id_t player, const std::vector& players) + void SetSharedLos(player_id_t player, const std::vector& players) override { m_SharedLosMasks[player] = CalcSharedLosMask(players); @@ -1977,12 +1977,12 @@ m_GlobalPlayerVisibilityUpdate[player-1] = 1; } - virtual u32 GetSharedLosMask(player_id_t player) const + u32 GetSharedLosMask(player_id_t player) const override { return m_SharedLosMasks[player]; } - void ExploreMap(player_id_t p) + void ExploreMap(player_id_t p) override { for (i32 j = 0; j < m_LosVerticesPerSide; ++j) for (i32 i = 0; i < m_LosVerticesPerSide; ++i) @@ -1997,7 +1997,7 @@ SeeExploredEntities(p); } - virtual void ExploreTerritories() + void ExploreTerritories() override { PROFILE3("ExploreTerritories"); @@ -2080,7 +2080,7 @@ } } - virtual void RevealShore(player_id_t p, bool enable) + void RevealShore(player_id_t p, bool enable) override { if (p <= 0 || p > MAX_LOS_PLAYER_ID) return; @@ -2494,12 +2494,12 @@ LosMove(i, visionRange, from, to); } - virtual u8 GetPercentMapExplored(player_id_t player) const + u8 GetPercentMapExplored(player_id_t player) const override { return m_ExploredVertices.at((u8)player) * 100 / m_TotalInworldVertices; } - virtual u8 GetUnionPercentMapExplored(const std::vector& players) const + u8 GetUnionPercentMapExplored(const std::vector& players) const override { u32 exploredVertices = 0; std::vector::const_iterator playerIt; Index: ps/trunk/source/simulation2/components/CCmpRangeOverlayRenderer.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpRangeOverlayRenderer.cpp +++ ps/trunk/source/simulation2/components/CCmpRangeOverlayRenderer.cpp @@ -56,31 +56,31 @@ return ""; } - virtual void Init(const CParamNode& UNUSED(paramNode)) + void Init(const CParamNode& UNUSED(paramNode)) override { m_Enabled = m_LastEnabledState = false; UpdateMessageSubscriptions(); } - virtual void Deinit() { } + void Deinit() override { } - virtual void Serialize(ISerializer& UNUSED(serialize)) + void Serialize(ISerializer& UNUSED(serialize)) override { } - virtual void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) + void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override { Init(paramNode); } - void ResetRangeOverlays() + void ResetRangeOverlays() override { m_RangeOverlayData.clear(); UpdateMessageSubscriptions(); m_Enabled = false; } - virtual void AddRangeOverlay(float radius, const std::string& texture, const std::string& textureMask, float thickness) + void AddRangeOverlay(float radius, const std::string& texture, const std::string& textureMask, float thickness) override { if (!CRenderer::IsInitialised()) return; @@ -98,7 +98,7 @@ UpdateMessageSubscriptions(); } - void HandleMessage(const CMessage& msg, bool UNUSED(global)) + void HandleMessage(const CMessage& msg, bool UNUSED(global)) override { switch (msg.GetType()) { @@ -135,7 +135,7 @@ std::unique_ptr line; }; - virtual void UpdateColor() + void UpdateColor() override { CmpPtr cmpOwnership(GetEntityHandle()); if (!cmpOwnership) Index: ps/trunk/source/simulation2/components/CCmpSelectable.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpSelectable.cpp +++ ps/trunk/source/simulation2/components/CCmpSelectable.cpp @@ -149,7 +149,7 @@ entity_pos_t m_Width; // width/radius entity_pos_t m_Height; // height/radius - virtual void Init(const CParamNode& paramNode) + void Init(const CParamNode& paramNode) override { m_EditorOnly = paramNode.GetChild("EditorOnly").IsOk(); @@ -215,23 +215,23 @@ UpdateMessageSubscriptions(); } - virtual void Deinit() { } + void Deinit() override { } - virtual void Serialize(ISerializer& UNUSED(serialize)) + void Serialize(ISerializer& UNUSED(serialize)) override { // Nothing to do here (the overlay object is not worth saving, it'll get // reconstructed by the GUI soon enough, I think) } - virtual void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) + void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override { // Need to call Init to reload the template properties Init(paramNode); } - virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)); + void HandleMessage(const CMessage& msg, bool UNUSED(global)) override; - virtual void SetSelectionHighlight(const CColor& color, bool selected) + void SetSelectionHighlight(const CColor& color, bool selected) override { m_Selected = selected; m_Color.r = color.r; @@ -257,7 +257,7 @@ SetSelectionHighlightAlpha(color.a); } - virtual void SetSelectionHighlightAlpha(float alpha) + void SetSelectionHighlightAlpha(float alpha) override { alpha = std::max(m_AlphaMin, alpha); @@ -269,13 +269,13 @@ UpdateMessageSubscriptions(); } - virtual void SetVisibility(bool visible) + void SetVisibility(bool visible) override { m_Visible = visible; UpdateMessageSubscriptions(); } - virtual bool IsEditorOnly() const + bool IsEditorOnly() const override { return m_EditorOnly; } @@ -309,7 +309,7 @@ /** * Set the color of the current owner. */ - virtual void UpdateColor(); + void UpdateColor() override; private: SOverlayDescriptor m_OverlayDescriptor; Index: ps/trunk/source/simulation2/components/CCmpSoundManager.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpSoundManager.cpp +++ ps/trunk/source/simulation2/components/CCmpSoundManager.cpp @@ -41,26 +41,26 @@ return ""; } - virtual void Init(const CParamNode& UNUSED(paramNode)) + void Init(const CParamNode& UNUSED(paramNode)) override { } - virtual void Deinit() + void Deinit() override { } - virtual void Serialize(ISerializer& UNUSED(serialize)) + void Serialize(ISerializer& UNUSED(serialize)) override { // Do nothing here - sounds are purely local, and don't need to be preserved across saved games etc // (If we add music support in here then we might want to save the music state, though) } - virtual void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) + void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override { Init(paramNode); } - virtual void PlaySoundGroup(const std::wstring& name, entity_id_t source) + void PlaySoundGroup(const std::wstring& name, entity_id_t source) override { if (!g_SoundManager || (source == INVALID_ENTITY)) return; @@ -84,21 +84,21 @@ g_SoundManager->PlayAsGroup(name, sourcePos, source, playerOwned); } - virtual void PlaySoundGroupAtPosition(const std::wstring& name, const CFixedVector3D& sourcePos) + void PlaySoundGroupAtPosition(const std::wstring& name, const CFixedVector3D& sourcePos) override { if (!g_SoundManager) return; g_SoundManager->PlayAsGroup(name, CVector3D(sourcePos), INVALID_ENTITY, false); } - virtual void PlaySoundGroupForPlayer(const VfsPath& groupPath, const player_id_t playerId) const + void PlaySoundGroupForPlayer(const VfsPath& groupPath, const player_id_t playerId) const override { if (!g_SoundManager) return; g_SoundManager->PlayAsGroup(groupPath, CVector3D(0.f, 0.f, 0.f), INVALID_ENTITY, GetSimContext().GetCurrentDisplayedPlayer() == playerId); } - virtual void StopMusic() + void StopMusic() override { if (!g_SoundManager) return; Index: ps/trunk/source/simulation2/components/CCmpTemplateManager.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpTemplateManager.cpp +++ ps/trunk/source/simulation2/components/CCmpTemplateManager.cpp @@ -43,7 +43,7 @@ return ""; } - virtual void Init(const CParamNode& UNUSED(paramNode)) + void Init(const CParamNode& UNUSED(paramNode)) override { m_DisableValidation = false; @@ -52,11 +52,11 @@ // TODO: support hotloading changes to the grammar } - virtual void Deinit() + void Deinit() override { } - virtual void Serialize(ISerializer& serialize) + void Serialize(ISerializer& serialize) override { std::map> templateMap; @@ -67,7 +67,7 @@ Serializer(serialize, "templates", templateMap); } - virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) + void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override { Init(paramNode); @@ -78,7 +78,7 @@ m_LatestTemplates[id] = mapEl.first; } - virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)) + void HandleMessage(const CMessage& msg, bool UNUSED(global)) override { switch (msg.GetType()) { @@ -94,30 +94,30 @@ } } - virtual void DisableValidation() + void DisableValidation() override { m_DisableValidation = true; } - virtual const CParamNode* LoadTemplate(entity_id_t ent, const std::string& templateName); + const CParamNode* LoadTemplate(entity_id_t ent, const std::string& templateName) override; - virtual const CParamNode* GetTemplate(const std::string& templateName); + const CParamNode* GetTemplate(const std::string& templateName) override; - virtual const CParamNode* GetTemplateWithoutValidation(const std::string& templateName); + const CParamNode* GetTemplateWithoutValidation(const std::string& templateName) override; - virtual bool TemplateExists(const std::string& templateName) const; + bool TemplateExists(const std::string& templateName) const override; - virtual const CParamNode* LoadLatestTemplate(entity_id_t ent); + const CParamNode* LoadLatestTemplate(entity_id_t ent) override; - virtual std::string GetCurrentTemplateName(entity_id_t ent) const; + std::string GetCurrentTemplateName(entity_id_t ent) const override; - virtual std::vector FindAllTemplates(bool includeActors) const; + std::vector FindAllTemplates(bool includeActors) const override; - virtual std::vector> GetCivData(); + std::vector> GetCivData() override; - virtual std::vector FindUsedTemplates() const; + std::vector FindUsedTemplates() const override; - virtual std::vector GetEntitiesUsingTemplate(const std::string& templateName) const; + std::vector GetEntitiesUsingTemplate(const std::string& templateName) const override; private: // Template loader Index: ps/trunk/source/simulation2/components/CCmpTerrain.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpTerrain.cpp +++ ps/trunk/source/simulation2/components/CCmpTerrain.cpp @@ -45,54 +45,54 @@ return ""; } - virtual void Init(const CParamNode& UNUSED(paramNode)) + void Init(const CParamNode& UNUSED(paramNode)) override { m_Terrain = &GetSimContext().GetTerrain(); } - virtual void Deinit() + void Deinit() override { } - virtual void Serialize(ISerializer& UNUSED(serialize)) + void Serialize(ISerializer& UNUSED(serialize)) override { } - virtual void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) + void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override { Init(paramNode); } - virtual bool IsLoaded() const + bool IsLoaded() const override { return m_Terrain->GetVerticesPerSide() != 0; } - virtual CFixedVector3D CalcNormal(entity_pos_t x, entity_pos_t z) const + CFixedVector3D CalcNormal(entity_pos_t x, entity_pos_t z) const override { CFixedVector3D normal; m_Terrain->CalcNormalFixed((x / (int)TERRAIN_TILE_SIZE).ToInt_RoundToZero(), (z / (int)TERRAIN_TILE_SIZE).ToInt_RoundToZero(), normal); return normal; } - virtual CVector3D CalcExactNormal(float x, float z) const + CVector3D CalcExactNormal(float x, float z) const override { return m_Terrain->CalcExactNormal(x, z); } - virtual entity_pos_t GetGroundLevel(entity_pos_t x, entity_pos_t z) const + entity_pos_t GetGroundLevel(entity_pos_t x, entity_pos_t z) const override { // TODO: this can crash if the terrain heightmap isn't initialised yet return m_Terrain->GetExactGroundLevelFixed(x, z); } - virtual float GetExactGroundLevel(float x, float z) const + float GetExactGroundLevel(float x, float z) const override { return m_Terrain->GetExactGroundLevel(x, z); } - virtual u16 GetTilesPerSide() const + u16 GetTilesPerSide() const override { ssize_t tiles = m_Terrain->GetTilesPerSide(); @@ -102,24 +102,24 @@ return (u16)tiles; } - virtual u32 GetMapSize() const + u32 GetMapSize() const override { return GetTilesPerSide() * TERRAIN_TILE_SIZE; } - virtual u16 GetVerticesPerSide() const + u16 GetVerticesPerSide() const override { ssize_t vertices = m_Terrain->GetVerticesPerSide(); ENSURE(1 <= vertices && vertices <= 65535); return (u16)vertices; } - virtual CTerrain* GetCTerrain() + CTerrain* GetCTerrain() override { return m_Terrain; } - virtual void ReloadTerrain(bool ReloadWater) + void ReloadTerrain(bool ReloadWater) override { // TODO: should refactor this code to be nicer @@ -150,7 +150,7 @@ MakeDirty(0, 0, tiles+1, tiles+1); } - virtual void MakeDirty(i32 i0, i32 j0, i32 i1, i32 j1) + void MakeDirty(i32 i0, i32 j0, i32 i1, i32 j1) override { CMessageTerrainChanged msg(i0, j0, i1, j1); GetSimContext().GetComponentManager().BroadcastMessage(msg); Index: ps/trunk/source/simulation2/components/CCmpTerritoryInfluence.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpTerritoryInfluence.cpp +++ ps/trunk/source/simulation2/components/CCmpTerritoryInfluence.cpp @@ -53,27 +53,27 @@ ""; } - virtual void Init(const CParamNode& paramNode) + void Init(const CParamNode& paramNode) override { m_Root = paramNode.GetChild("Root").ToBool(); m_Weight = (u16)paramNode.GetChild("Weight").ToInt(); m_Radius = paramNode.GetChild("Radius").ToInt(); } - virtual void Deinit() + void Deinit() override { } - virtual void Serialize(ISerializer& UNUSED(serialize)) + void Serialize(ISerializer& UNUSED(serialize)) override { } - virtual void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) + void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override { Init(paramNode); } - virtual bool IsRoot() const + bool IsRoot() const override { CmpPtr cmpValueModificationManager(GetSystemEntity()); if (!cmpValueModificationManager) @@ -82,7 +82,7 @@ return cmpValueModificationManager->ApplyModifications(L"TerritoryInfluence/Root", m_Root, GetEntityId()); } - virtual u16 GetWeight() const + u16 GetWeight() const override { CmpPtr cmpValueModificationManager(GetSystemEntity()); if (!cmpValueModificationManager) @@ -91,7 +91,7 @@ return cmpValueModificationManager->ApplyModifications(L"TerritoryInfluence/Weight", m_Weight, GetEntityId()); } - virtual u32 GetRadius() const + u32 GetRadius() const override { CmpPtr cmpValueModificationManager(GetSystemEntity()); if (!cmpValueModificationManager) Index: ps/trunk/source/simulation2/components/CCmpTerritoryManager.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpTerritoryManager.cpp +++ ps/trunk/source/simulation2/components/CCmpTerritoryManager.cpp @@ -52,7 +52,7 @@ CCmpTerritoryManager& m_TerritoryManager; TerritoryOverlay(CCmpTerritoryManager& manager); - virtual void BuildTextureRGBA(u8* data, size_t w, size_t h); + void BuildTextureRGBA(u8* data, size_t w, size_t h) override; }; class CCmpTerritoryManager : public ICmpTerritoryManager @@ -117,7 +117,7 @@ bool m_EnableLineDebugOverlays; ///< Enable node debugging overlays for boundary lines? std::vector m_DebugBoundaryLineNodes; - virtual void Init(const CParamNode& UNUSED(paramNode)) + void Init(const CParamNode& UNUSED(paramNode)) override { m_Territories = NULL; m_CostGrid = NULL; @@ -148,26 +148,26 @@ m_BorderSeparation = externalParamNode.GetChild("TerritoryManager").GetChild("BorderSeparation").ToFixed().ToFloat(); } - virtual void Deinit() + void Deinit() override { SAFE_DELETE(m_Territories); SAFE_DELETE(m_CostGrid); SAFE_DELETE(m_DebugOverlay); } - virtual void Serialize(ISerializer& serialize) + void Serialize(ISerializer& serialize) override { // Territory state can be recomputed as required, so we don't need to serialize any of it. serialize.Bool("trigger event", m_TriggerEvent); } - virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) + void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override { Init(paramNode); deserialize.Bool("trigger event", m_TriggerEvent); } - virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)) + void HandleMessage(const CMessage& msg, bool UNUSED(global)) override { switch (msg.GetType()) { @@ -237,19 +237,19 @@ MakeDirty(); } - virtual const Grid& GetTerritoryGrid() + const Grid& GetTerritoryGrid() override { CalculateTerritories(); ENSURE(m_Territories); return *m_Territories; } - virtual player_id_t GetOwner(entity_pos_t x, entity_pos_t z); - virtual std::vector GetNeighbours(entity_pos_t x, entity_pos_t z, bool filterConnected); - virtual bool IsConnected(entity_pos_t x, entity_pos_t z); + player_id_t GetOwner(entity_pos_t x, entity_pos_t z) override; + std::vector GetNeighbours(entity_pos_t x, entity_pos_t z, bool filterConnected) override; + bool IsConnected(entity_pos_t x, entity_pos_t z) override; - virtual void SetTerritoryBlinking(entity_pos_t x, entity_pos_t z, bool enable); - virtual bool IsTerritoryBlinking(entity_pos_t x, entity_pos_t z); + void SetTerritoryBlinking(entity_pos_t x, entity_pos_t z, bool enable) override; + bool IsTerritoryBlinking(entity_pos_t x, entity_pos_t z) override; // To support lazy updates of territory render data, // we maintain a DirtyID here and increment it whenever territories change; @@ -269,7 +269,7 @@ m_TriggerEvent = true; } - virtual bool NeedUpdateTexture(size_t* dirtyID) + bool NeedUpdateTexture(size_t* dirtyID) override { if (*dirtyID == m_DirtyID && !m_ColorChanged) return false; @@ -279,7 +279,7 @@ return true; } - virtual bool NeedUpdateAI(size_t* dirtyID, size_t* dirtyBlinkingID) const + bool NeedUpdateAI(size_t* dirtyID, size_t* dirtyBlinkingID) const override { if (*dirtyID == m_DirtyID && *dirtyBlinkingID == m_DirtyBlinkingID) return false; @@ -293,7 +293,7 @@ void CalculateTerritories(); - u8 GetTerritoryPercentage(player_id_t player); + u8 GetTerritoryPercentage(player_id_t player) override; std::vector ComputeBoundaries(); @@ -303,12 +303,12 @@ void RenderSubmit(SceneCollector& collector, const CFrustum& frustum, bool culling); - void SetVisibility(bool visible) + void SetVisibility(bool visible) override { m_Visible = visible; } - void UpdateColors(); + void UpdateColors() override; private: Index: ps/trunk/source/simulation2/components/CCmpTest.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpTest.cpp +++ ps/trunk/source/simulation2/components/CCmpTest.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2017 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -42,7 +42,7 @@ return ""; } - virtual void Init(const CParamNode& paramNode) + void Init(const CParamNode& paramNode) override { if (paramNode.GetChild("x").IsOk()) m_x = paramNode.GetChild("x").ToInt(); @@ -50,26 +50,26 @@ m_x = 11000; } - virtual void Deinit() + void Deinit() override { } - virtual void Serialize(ISerializer& serialize) + void Serialize(ISerializer& serialize) override { serialize.NumberI32_Unbounded("x", m_x); } - virtual void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserialize) + void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserialize) override { deserialize.NumberI32_Unbounded("x", m_x); } - virtual int GetX() + int GetX() override { return m_x; } - virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)) + void HandleMessage(const CMessage& msg, bool UNUSED(global)) override { switch (msg.GetType()) { @@ -109,31 +109,31 @@ return ""; } - virtual void Init(const CParamNode&) + void Init(const CParamNode&) override { m_x = 12000; } - virtual void Deinit() + void Deinit() override { } - virtual void Serialize(ISerializer& serialize) + void Serialize(ISerializer& serialize) override { serialize.NumberI32_Unbounded("x", m_x); } - virtual void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserialize) + void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserialize) override { deserialize.NumberI32_Unbounded("x", m_x); } - virtual int GetX() + int GetX() override { return m_x; } - virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)) + void HandleMessage(const CMessage& msg, bool UNUSED(global)) override { switch (msg.GetType()) { @@ -170,31 +170,31 @@ return ""; } - virtual void Init(const CParamNode&) + void Init(const CParamNode&) override { m_x = 21000; } - virtual void Deinit() + void Deinit() override { } - virtual void Serialize(ISerializer& serialize) + void Serialize(ISerializer& serialize) override { serialize.NumberI32_Unbounded("x", m_x); } - virtual void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserialize) + void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserialize) override { deserialize.NumberI32_Unbounded("x", m_x); } - virtual int GetX() + int GetX() override { return m_x; } - virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)) + void HandleMessage(const CMessage& msg, bool UNUSED(global)) override { switch (msg.GetType()) { @@ -220,7 +220,7 @@ public: DEFAULT_SCRIPT_WRAPPER(Test1Scripted) - virtual int GetX() + int GetX() override { return m_Script.Call ("GetX"); } @@ -235,7 +235,7 @@ public: DEFAULT_SCRIPT_WRAPPER(Test2Scripted) - virtual int GetX() + int GetX() override { return m_Script.Call ("GetX"); } Index: ps/trunk/source/simulation2/components/CCmpUnitMotion.h =================================================================== --- ps/trunk/source/simulation2/components/CCmpUnitMotion.h +++ ps/trunk/source/simulation2/components/CCmpUnitMotion.h @@ -280,7 +280,7 @@ ""; } - virtual void Init(const CParamNode& paramNode) + void Init(const CParamNode& paramNode) override { m_IsFormationController = paramNode.GetChild("FormationController").ToBool(); @@ -320,7 +320,7 @@ m_DebugOverlayEnabled = false; } - virtual void Deinit() + void Deinit() override { } @@ -360,12 +360,12 @@ Serializer(serialize, "short path", m_ShortPath.m_Waypoints); } - virtual void Serialize(ISerializer& serialize) + void Serialize(ISerializer& serialize) override { SerializeCommon(serialize); } - virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) + void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override { Init(paramNode); @@ -380,7 +380,7 @@ m_BlockMovement = cmpObstruction->GetBlockMovementFlag(false); } - virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)) + void HandleMessage(const CMessage& msg, bool UNUSED(global)) override { switch (msg.GetType()) { @@ -442,38 +442,38 @@ GetSimContext().GetComponentManager().DynamicSubscriptionNonsync(MT_RenderSubmit, this, needRender); } - virtual bool IsMoveRequested() const + bool IsMoveRequested() const override { return m_MoveRequest.m_Type != MoveRequest::NONE; } - virtual fixed GetSpeedMultiplier() const + fixed GetSpeedMultiplier() const override { return m_SpeedMultiplier; } - virtual void SetSpeedMultiplier(fixed multiplier) + void SetSpeedMultiplier(fixed multiplier) override { m_SpeedMultiplier = std::min(multiplier, m_RunMultiplier); m_Speed = m_SpeedMultiplier.Multiply(GetWalkSpeed()); } - virtual fixed GetSpeed() const + fixed GetSpeed() const override { return m_Speed; } - virtual fixed GetWalkSpeed() const + fixed GetWalkSpeed() const override { return m_WalkSpeed; } - virtual fixed GetRunMultiplier() const + fixed GetRunMultiplier() const override { return m_RunMultiplier; } - virtual CFixedVector2D EstimateFuturePosition(const fixed dt) const + CFixedVector2D EstimateFuturePosition(const fixed dt) const override { CmpPtr cmpPosition(GetEntityHandle()); if (!cmpPosition || !cmpPosition->IsInWorld()) @@ -492,12 +492,12 @@ return pos; } - virtual fixed GetAcceleration() const + fixed GetAcceleration() const override { return m_Acceleration; } - virtual void SetAcceleration(fixed acceleration) + void SetAcceleration(fixed acceleration) override { m_Acceleration = acceleration; } @@ -507,12 +507,12 @@ return m_TemplateWeight; } - virtual pass_class_t GetPassabilityClass() const + pass_class_t GetPassabilityClass() const override { return m_PassClass; } - virtual std::string GetPassabilityClassName() const + std::string GetPassabilityClassName() const override { return m_PassClassName; } @@ -525,58 +525,58 @@ m_PassClass = cmpPathfinder->GetPassabilityClass(passClassName); } - virtual fixed GetCurrentSpeed() const + fixed GetCurrentSpeed() const override { return m_CurrentSpeed; } - virtual void SetFacePointAfterMove(bool facePointAfterMove) + void SetFacePointAfterMove(bool facePointAfterMove) override { m_FacePointAfterMove = facePointAfterMove; } - virtual bool GetFacePointAfterMove() const + bool GetFacePointAfterMove() const override { return m_FacePointAfterMove; } - virtual void SetDebugOverlay(bool enabled) + void SetDebugOverlay(bool enabled) override { m_DebugOverlayEnabled = enabled; UpdateMessageSubscriptions(); } - virtual bool MoveToPointRange(entity_pos_t x, entity_pos_t z, entity_pos_t minRange, entity_pos_t maxRange) + bool MoveToPointRange(entity_pos_t x, entity_pos_t z, entity_pos_t minRange, entity_pos_t maxRange) override { return MoveTo(MoveRequest(CFixedVector2D(x, z), minRange, maxRange)); } - virtual bool MoveToTargetRange(entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange) + bool MoveToTargetRange(entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange) override { return MoveTo(MoveRequest(target, minRange, maxRange)); } - virtual void MoveToFormationOffset(entity_id_t controller, entity_pos_t x, entity_pos_t z) + void MoveToFormationOffset(entity_id_t controller, entity_pos_t x, entity_pos_t z) override { // Pass the controller to the move request anyways. MoveTo(MoveRequest(controller, CFixedVector2D(x, z))); } - virtual void SetMemberOfFormation(entity_id_t controller) + void SetMemberOfFormation(entity_id_t controller) override { m_FormationController = controller; } - virtual bool IsTargetRangeReachable(entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange); + bool IsTargetRangeReachable(entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange) override; - virtual void FaceTowardsPoint(entity_pos_t x, entity_pos_t z); + void FaceTowardsPoint(entity_pos_t x, entity_pos_t z) override; /** * Clears the current MoveRequest - the unit will stop and no longer try and move. * This should never be called from UnitMotion, since MoveToX orders are given * by other components - these components should also decide when to stop. */ - virtual void StopMoving() + void StopMoving() override { if (m_FacePointAfterMove) { @@ -595,7 +595,7 @@ m_ShortPath.m_Waypoints.clear(); } - virtual entity_pos_t GetUnitClearance() const + entity_pos_t GetUnitClearance() const override { return m_Clearance; } Index: ps/trunk/source/simulation2/components/CCmpUnitMotionManager.h =================================================================== --- ps/trunk/source/simulation2/components/CCmpUnitMotionManager.h +++ ps/trunk/source/simulation2/components/CCmpUnitMotionManager.h @@ -125,26 +125,26 @@ return ""; } - virtual void Init(const CParamNode& UNUSED(paramNode)); + void Init(const CParamNode& UNUSED(paramNode)) override; - virtual void Deinit() + void Deinit() override { } - virtual void Serialize(ISerializer& serialize); - virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize); + void Serialize(ISerializer& serialize) override; + void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override; - virtual void HandleMessage(const CMessage& msg, bool global); + void HandleMessage(const CMessage& msg, bool global) override; - virtual void Register(CCmpUnitMotion* component, entity_id_t ent, bool formationController); - virtual void Unregister(entity_id_t ent); + void Register(CCmpUnitMotion* component, entity_id_t ent, bool formationController) override; + void Unregister(entity_id_t ent) override; - virtual bool ComputingMotion() const + bool ComputingMotion() const override { return m_ComputingMotion; } - virtual bool IsPushingActivated() const + bool IsPushingActivated() const override { return m_PushingRadiusMultiplier != entity_pos_t::Zero(); } Index: ps/trunk/source/simulation2/components/CCmpUnitRenderer.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpUnitRenderer.cpp +++ ps/trunk/source/simulation2/components/CCmpUnitRenderer.cpp @@ -138,27 +138,27 @@ return ""; } - virtual void Init(const CParamNode& UNUSED(paramNode)) + void Init(const CParamNode& UNUSED(paramNode)) override { m_FrameNumber = 0; m_FrameOffset = 0.0f; m_EnableDebugOverlays = false; } - virtual void Deinit() + void Deinit() override { } - virtual void Serialize(ISerializer& UNUSED(serialize)) + void Serialize(ISerializer& UNUSED(serialize)) override { } - virtual void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) + void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override { Init(paramNode); } - virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)) + void HandleMessage(const CMessage& msg, bool UNUSED(global)) override { switch (msg.GetType()) { @@ -189,7 +189,7 @@ return &m_Units[tag.n - 1]; } - virtual tag_t AddUnit(CEntityHandle entity, CUnit* actor, const CBoundingSphere& boundsApprox, int flags) + tag_t AddUnit(CEntityHandle entity, CUnit* actor, const CBoundingSphere& boundsApprox, int flags) override { ENSURE(actor != NULL); @@ -218,7 +218,7 @@ return tag; } - virtual void RemoveUnit(tag_t tag) + void RemoveUnit(tag_t tag) override { SUnit* unit = LookupUnit(tag); unit->actor = NULL; @@ -235,7 +235,7 @@ unit->sweptBounds = CBoundingSphere(mid, radius); } - virtual void UpdateUnit(tag_t tag, CUnit* actor, const CBoundingSphere& boundsApprox) + void UpdateUnit(tag_t tag, CUnit* actor, const CBoundingSphere& boundsApprox) override { SUnit* unit = LookupUnit(tag); unit->actor = actor; @@ -243,7 +243,7 @@ RecomputeSweptBounds(unit); } - virtual void UpdateUnitPos(tag_t tag, bool inWorld, const CVector3D& pos0, const CVector3D& pos1) + void UpdateUnitPos(tag_t tag, bool inWorld, const CVector3D& pos0, const CVector3D& pos1) override { SUnit* unit = LookupUnit(tag); unit->inWorld = inWorld; @@ -259,17 +259,17 @@ void UpdateVisibility(SUnit& unit) const; - virtual float GetFrameOffset() const + float GetFrameOffset() const override { return m_FrameOffset; } - virtual void SetDebugOverlay(bool enabled) + void SetDebugOverlay(bool enabled) override { m_EnableDebugOverlays = enabled; } - virtual void PickAllEntitiesAtPoint(std::vector >& outEntities, const CVector3D& origin, const CVector3D& dir, bool allowEditorSelectables) const + void PickAllEntitiesAtPoint(std::vector >& outEntities, const CVector3D& origin, const CVector3D& dir, bool allowEditorSelectables) const override { // First, make a rough test with the worst-case bounding boxes to pick all // entities/models that could possibly be hit by the ray. Index: ps/trunk/source/simulation2/components/CCmpVision.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpVision.cpp +++ ps/trunk/source/simulation2/components/CCmpVision.cpp @@ -58,7 +58,7 @@ ""; } - virtual void Init(const CParamNode& paramNode) + void Init(const CParamNode& paramNode) override { m_BaseRange = m_Range = paramNode.GetChild("Range").ToFixed(); @@ -68,21 +68,21 @@ m_RevealShore = false; } - virtual void Deinit() + void Deinit() override { } - virtual void Serialize(ISerializer& UNUSED(serialize)) + void Serialize(ISerializer& UNUSED(serialize)) override { // No dynamic state to serialize } - virtual void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) + void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override { Init(paramNode); } - virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)) + void HandleMessage(const CMessage& msg, bool UNUSED(global)) override { switch (msg.GetType()) { @@ -130,12 +130,12 @@ GetSimContext().GetComponentManager().BroadcastMessage(msg); } - virtual entity_pos_t GetRange() const + entity_pos_t GetRange() const override { return m_Range; } - virtual bool GetRevealShore() const + bool GetRevealShore() const override { return m_RevealShore; } Index: ps/trunk/source/simulation2/components/CCmpVisualActor.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpVisualActor.cpp +++ ps/trunk/source/simulation2/components/CCmpVisualActor.cpp @@ -191,7 +191,7 @@ ""; } - virtual void Init(const CParamNode& paramNode) + void Init(const CParamNode& paramNode) override { m_Unit = NULL; m_R = m_G = m_B = fixed::FromInt(1); @@ -220,7 +220,7 @@ InitSelectionShapeDescriptor(paramNode); } - virtual void Deinit() + void Deinit() override { if (m_Unit) { @@ -252,7 +252,7 @@ // TODO: store actor variables? } - virtual void Serialize(ISerializer& serialize) + void Serialize(ISerializer& serialize) override { // TODO: store the actor name, if !debug and it differs from the template @@ -264,7 +264,7 @@ SerializeCommon(serialize); } - virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) + void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override { Init(paramNode); @@ -288,7 +288,7 @@ } } - virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)) + void HandleMessage(const CMessage& msg, bool UNUSED(global)) override { switch (msg.GetType()) { @@ -349,40 +349,40 @@ } } - virtual CBoundingBoxAligned GetBounds() const + CBoundingBoxAligned GetBounds() const override { if (!m_Unit) return CBoundingBoxAligned::EMPTY; return m_Unit->GetModel().GetWorldBounds(); } - virtual CUnit* GetUnit() + CUnit* GetUnit() override { return m_Unit; } - virtual CBoundingBoxOriented GetSelectionBox() const + CBoundingBoxOriented GetSelectionBox() const override { if (!m_Unit) return CBoundingBoxOriented::EMPTY; return m_Unit->GetModel().GetSelectionBox(); } - virtual CVector3D GetPosition() const + CVector3D GetPosition() const override { if (!m_Unit) return CVector3D(0, 0, 0); return m_Unit->GetModel().GetTransform().GetTranslation(); } - virtual std::wstring GetProjectileActor() const + std::wstring GetProjectileActor() const override { if (!m_Unit) return L""; return m_Unit->GetObject().m_ProjectileModelName; } - virtual CFixedVector3D GetProjectileLaunchPoint() const + CFixedVector3D GetProjectileLaunchPoint() const override { if (!m_Unit) return CFixedVector3D(); @@ -411,7 +411,7 @@ return CFixedVector3D(); } - virtual void SetVariant(const CStr& key, const CStr& selection) + void SetVariant(const CStr& key, const CStr& selection) override { if (m_VariantSelections[key] == selection) return; @@ -426,12 +426,12 @@ } } - virtual std::string GetAnimationName() const + std::string GetAnimationName() const override { return m_AnimName; } - virtual void SelectAnimation(const std::string& name, bool once = false, fixed speed = fixed::FromInt(1)) + void SelectAnimation(const std::string& name, bool once = false, fixed speed = fixed::FromInt(1)) override { m_AnimName = name; m_AnimOnce = once; @@ -453,7 +453,7 @@ m_Unit->GetAnimation()->SetAnimationState(m_AnimName, m_AnimOnce, m_AnimSpeed.ToFloat(), m_AnimDesync.ToFloat(), m_SoundGroup.c_str()); } - virtual void SelectMovementAnimation(const std::string& name, fixed speed) + void SelectMovementAnimation(const std::string& name, fixed speed) override { ENSURE(name == "idle" || name == "walk" || name == "run"); if (m_AnimName != "idle" && m_AnimName != "walk" && m_AnimName != "run") @@ -463,7 +463,7 @@ SelectAnimation(name, false, speed); } - virtual void SetAnimationSyncRepeat(fixed repeattime) + void SetAnimationSyncRepeat(fixed repeattime) override { m_AnimSyncRepeatTime = repeattime; @@ -471,7 +471,7 @@ m_Unit->GetAnimation()->SetAnimationSyncRepeat(m_AnimSyncRepeatTime.ToFloat()); } - virtual void SetAnimationSyncOffset(fixed actiontime) + void SetAnimationSyncOffset(fixed actiontime) override { m_AnimSyncOffsetTime = actiontime; @@ -479,7 +479,7 @@ m_Unit->GetAnimation()->SetAnimationSyncOffset(m_AnimSyncOffsetTime.ToFloat()); } - virtual void SetShadingColor(fixed r, fixed g, fixed b, fixed a) + void SetShadingColor(fixed r, fixed g, fixed b, fixed a) override { m_R = r; m_G = g; @@ -493,18 +493,18 @@ } } - virtual void SetVariable(const std::string& name, float value) + void SetVariable(const std::string& name, float value) override { if (m_Unit) m_Unit->GetModel().SetEntityVariable(name, value); } - virtual u32 GetActorSeed() const + u32 GetActorSeed() const override { return m_Seed; } - virtual void SetActorSeed(u32 seed) + void SetActorSeed(u32 seed) override { if (seed == m_Seed) return; @@ -513,7 +513,7 @@ ReloadActor(); } - virtual void RecomputeActorName() + void RecomputeActorName() override { CmpPtr cmpValueModificationManager(GetSystemEntity()); std::wstring newActorName; @@ -529,12 +529,12 @@ } } - virtual bool HasConstructionPreview() const + bool HasConstructionPreview() const override { return m_ConstructionPreview; } - virtual void Hotload(const VfsPath& name) + void Hotload(const VfsPath& name) override { if (!m_Unit) return; Index: ps/trunk/source/simulation2/components/CCmpWaterManager.cpp =================================================================== --- ps/trunk/source/simulation2/components/CCmpWaterManager.cpp +++ ps/trunk/source/simulation2/components/CCmpWaterManager.cpp @@ -49,23 +49,23 @@ return ""; } - virtual void Init(const CParamNode& UNUSED(paramNode)) + void Init(const CParamNode& UNUSED(paramNode)) override { } - virtual void Deinit() + void Deinit() override { // Clear the map size & data. if (CRenderer::IsInitialised()) g_Renderer.GetSceneRenderer().GetWaterManager().SetMapSize(0); } - virtual void Serialize(ISerializer& serialize) + void Serialize(ISerializer& serialize) override { serialize.NumberFixed_Unbounded("height", m_WaterHeight); } - virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) + void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override { Init(paramNode); @@ -77,7 +77,7 @@ RecomputeWaterData(); } - virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)) + void HandleMessage(const CMessage& msg, bool UNUSED(global)) override { switch (msg.GetType()) { @@ -101,7 +101,7 @@ } } - virtual void RecomputeWaterData() + void RecomputeWaterData() override { if (CRenderer::IsInitialised()) { @@ -113,7 +113,7 @@ GetSimContext().GetTerrain().MakeDirty(RENDERDATA_UPDATE_VERTICES); } - virtual void SetWaterLevel(entity_pos_t h) + void SetWaterLevel(entity_pos_t h) override { if (m_WaterHeight == h) return; @@ -126,12 +126,12 @@ GetSimContext().GetComponentManager().BroadcastMessage(msg); } - virtual entity_pos_t GetWaterLevel(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) const + entity_pos_t GetWaterLevel(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) const override { return m_WaterHeight; } - virtual float GetExactWaterLevel(float UNUSED(x), float UNUSED(z)) const + float GetExactWaterLevel(float UNUSED(x), float UNUSED(z)) const override { return m_WaterHeight.ToFloat(); } Index: ps/trunk/source/simulation2/components/ICmpAIInterface.cpp =================================================================== --- ps/trunk/source/simulation2/components/ICmpAIInterface.cpp +++ ps/trunk/source/simulation2/components/ICmpAIInterface.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2017 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -30,11 +30,11 @@ public: DEFAULT_SCRIPT_WRAPPER(AIInterfaceScripted) - virtual void GetRepresentation(JS::MutableHandleValue ret) + void GetRepresentation(JS::MutableHandleValue ret) override { m_Script.CallRef("GetRepresentation", ret); } - virtual void GetFullRepresentation(JS::MutableHandleValue ret, bool flushEvents = false) + void GetFullRepresentation(JS::MutableHandleValue ret, bool flushEvents = false) override { m_Script.CallRef("GetFullRepresentation", ret, flushEvents); } Index: ps/trunk/source/simulation2/components/ICmpAttack.cpp =================================================================== --- ps/trunk/source/simulation2/components/ICmpAttack.cpp +++ ps/trunk/source/simulation2/components/ICmpAttack.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -31,12 +31,12 @@ public: DEFAULT_SCRIPT_WRAPPER(AttackScripted) - virtual float GetRepeatTime(const std::string& type) const + float GetRepeatTime(const std::string& type) const override { return m_Script.Call("GetRepeatTime", type); } - virtual std::vector GetAttackTypes() const + std::vector GetAttackTypes() const override { return m_Script.Call>("GetAttackTypes"); } Index: ps/trunk/source/simulation2/components/ICmpFogging.cpp =================================================================== --- ps/trunk/source/simulation2/components/ICmpFogging.cpp +++ ps/trunk/source/simulation2/components/ICmpFogging.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -30,22 +30,22 @@ public: DEFAULT_SCRIPT_WRAPPER(FoggingScripted) - virtual bool IsActivated() + bool IsActivated() override { return m_Script.Call("IsActivated"); } - virtual bool WasSeen(player_id_t player) + bool WasSeen(player_id_t player) override { return m_Script.Call("WasSeen", player); } - virtual bool IsMiraged(player_id_t player) + bool IsMiraged(player_id_t player) override { return m_Script.Call("IsMiraged", player); } - virtual void ForceMiraging(player_id_t player) + void ForceMiraging(player_id_t player) override { return m_Script.CallVoid("ForceMiraging", player); } Index: ps/trunk/source/simulation2/components/ICmpGarrisonHolder.cpp =================================================================== --- ps/trunk/source/simulation2/components/ICmpGarrisonHolder.cpp +++ ps/trunk/source/simulation2/components/ICmpGarrisonHolder.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -30,12 +30,12 @@ public: DEFAULT_SCRIPT_WRAPPER(GarrisonHolderScripted) - virtual std::vector GetEntities() const + std::vector GetEntities() const override { return m_Script.Call>("GetEntities"); } - virtual void SetInitEntities(std::vector&& entities) + void SetInitEntities(std::vector&& entities) override { m_Script.CallVoid("SetInitGarrison", entities); } Index: ps/trunk/source/simulation2/components/ICmpGuiInterface.cpp =================================================================== --- ps/trunk/source/simulation2/components/ICmpGuiInterface.cpp +++ ps/trunk/source/simulation2/components/ICmpGuiInterface.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2017 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -30,7 +30,7 @@ public: DEFAULT_SCRIPT_WRAPPER(GuiInterfaceScripted) - virtual void ScriptCall(int player, const std::wstring& cmd, JS::HandleValue data, JS::MutableHandleValue ret) + void ScriptCall(int player, const std::wstring& cmd, JS::HandleValue data, JS::MutableHandleValue ret) override { m_Script.CallRef("ScriptCall", ret, player, cmd, data); } Index: ps/trunk/source/simulation2/components/ICmpIdentity.cpp =================================================================== --- ps/trunk/source/simulation2/components/ICmpIdentity.cpp +++ ps/trunk/source/simulation2/components/ICmpIdentity.cpp @@ -31,17 +31,17 @@ public: DEFAULT_SCRIPT_WRAPPER(IdentityScripted) - virtual std::string GetSelectionGroupName() + std::string GetSelectionGroupName() override { return m_Script.Call("GetSelectionGroupName"); } - virtual std::wstring GetPhenotype() + std::wstring GetPhenotype() override { return m_Script.Call("GetPhenotype"); } - virtual std::wstring GetCiv() + std::wstring GetCiv() override { return m_Script.Call("GetCiv"); } Index: ps/trunk/source/simulation2/components/ICmpMirage.cpp =================================================================== --- ps/trunk/source/simulation2/components/ICmpMirage.cpp +++ ps/trunk/source/simulation2/components/ICmpMirage.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2014 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -30,7 +30,7 @@ public: DEFAULT_SCRIPT_WRAPPER(MirageScripted) - virtual player_id_t GetPlayer() + player_id_t GetPlayer() override { return m_Script.Call("GetPlayer"); } Index: ps/trunk/source/simulation2/components/ICmpPlayer.cpp =================================================================== --- ps/trunk/source/simulation2/components/ICmpPlayer.cpp +++ ps/trunk/source/simulation2/components/ICmpPlayer.cpp @@ -32,27 +32,27 @@ public: DEFAULT_SCRIPT_WRAPPER(PlayerScripted) - virtual CColor GetDisplayedColor() + CColor GetDisplayedColor() override { return m_Script.Call("GetDisplayedColor"); } - virtual CFixedVector3D GetStartingCameraPos() + CFixedVector3D GetStartingCameraPos() override { return m_Script.Call("GetStartingCameraPos"); } - virtual CFixedVector3D GetStartingCameraRot() + CFixedVector3D GetStartingCameraRot() override { return m_Script.Call("GetStartingCameraRot"); } - virtual bool HasStartingCamera() + bool HasStartingCamera() override { return m_Script.Call("HasStartingCamera"); } - virtual std::string GetState() + std::string GetState() override { return m_Script.Call("GetState"); } Index: ps/trunk/source/simulation2/components/ICmpPlayerManager.cpp =================================================================== --- ps/trunk/source/simulation2/components/ICmpPlayerManager.cpp +++ ps/trunk/source/simulation2/components/ICmpPlayerManager.cpp @@ -30,12 +30,12 @@ public: DEFAULT_SCRIPT_WRAPPER(PlayerManagerScripted) - virtual int32_t GetNumPlayers() + int32_t GetNumPlayers() override { return m_Script.Call("GetNumPlayers"); } - virtual entity_id_t GetPlayerByID(int32_t id) + entity_id_t GetPlayerByID(int32_t id) override { return m_Script.Call("GetPlayerByID", (int)id); } Index: ps/trunk/source/simulation2/components/ICmpRallyPoint.cpp =================================================================== --- ps/trunk/source/simulation2/components/ICmpRallyPoint.cpp +++ ps/trunk/source/simulation2/components/ICmpRallyPoint.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -31,12 +31,12 @@ public: DEFAULT_SCRIPT_WRAPPER(RallyPointScripted) - virtual bool HasPositions() + bool HasPositions() override { return m_Script.Call("HasPositions"); } - virtual CFixedVector2D GetFirstPosition() + CFixedVector2D GetFirstPosition() override { return m_Script.Call("GetFirstPosition"); } Index: ps/trunk/source/simulation2/components/ICmpSound.cpp =================================================================== --- ps/trunk/source/simulation2/components/ICmpSound.cpp +++ ps/trunk/source/simulation2/components/ICmpSound.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -30,7 +30,7 @@ public: DEFAULT_SCRIPT_WRAPPER(SoundScripted) - virtual std::wstring GetSoundGroup(const std::wstring& soundName) const + std::wstring GetSoundGroup(const std::wstring& soundName) const override { return m_Script.Call("GetSoundGroup", soundName); } Index: ps/trunk/source/simulation2/components/ICmpTerritoryDecayManager.cpp =================================================================== --- ps/trunk/source/simulation2/components/ICmpTerritoryDecayManager.cpp +++ ps/trunk/source/simulation2/components/ICmpTerritoryDecayManager.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2017 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -30,7 +30,7 @@ public: DEFAULT_SCRIPT_WRAPPER(TerritoryDecayManagerScripted) - virtual void SetBlinkingEntities() + void SetBlinkingEntities() override { return m_Script.CallVoid("SetBlinkingEntities"); } Index: ps/trunk/source/simulation2/components/ICmpTurretHolder.cpp =================================================================== --- ps/trunk/source/simulation2/components/ICmpTurretHolder.cpp +++ ps/trunk/source/simulation2/components/ICmpTurretHolder.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -34,7 +34,7 @@ * @return - Correlation between garrisoned turrets (their ID) and which * turret point they occupy (name). */ - virtual std::vector > GetTurrets() const + std::vector > GetTurrets() const override { std::vector > turrets; std::vector entities = m_Script.Call>("GetEntities"); @@ -50,7 +50,7 @@ /** * Correlation between entities (ID) and the turret point they ought to occupy (name). */ - virtual void SetInitEntities(std::vector>&& entities) + void SetInitEntities(std::vector>&& entities) override { for (const std::pair& p : entities) m_Script.CallVoid("SetInitEntity", p.first, p.second); Index: ps/trunk/source/simulation2/components/ICmpUnitMotion.cpp =================================================================== --- ps/trunk/source/simulation2/components/ICmpUnitMotion.cpp +++ ps/trunk/source/simulation2/components/ICmpUnitMotion.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -51,117 +51,117 @@ public: DEFAULT_SCRIPT_WRAPPER(UnitMotionScripted) - virtual bool MoveToPointRange(entity_pos_t x, entity_pos_t z, entity_pos_t minRange, entity_pos_t maxRange) + bool MoveToPointRange(entity_pos_t x, entity_pos_t z, entity_pos_t minRange, entity_pos_t maxRange) override { return m_Script.Call("MoveToPointRange", x, z, minRange, maxRange); } - virtual bool MoveToTargetRange(entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange) + bool MoveToTargetRange(entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange) override { return m_Script.Call("MoveToTargetRange", target, minRange, maxRange); } - virtual void MoveToFormationOffset(entity_id_t target, entity_pos_t x, entity_pos_t z) + void MoveToFormationOffset(entity_id_t target, entity_pos_t x, entity_pos_t z) override { m_Script.CallVoid("MoveToFormationOffset", target, x, z); } - virtual void SetMemberOfFormation(entity_id_t controller) + void SetMemberOfFormation(entity_id_t controller) override { m_Script.CallVoid("SetMemberOfFormation", controller); } - virtual bool IsTargetRangeReachable(entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange) + bool IsTargetRangeReachable(entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange) override { return m_Script.Call("IsTargetRangeReachable", target, minRange, maxRange); } - virtual void FaceTowardsPoint(entity_pos_t x, entity_pos_t z) + void FaceTowardsPoint(entity_pos_t x, entity_pos_t z) override { m_Script.CallVoid("FaceTowardsPoint", x, z); } - virtual void StopMoving() + void StopMoving() override { m_Script.CallVoid("StopMoving"); } - virtual fixed GetCurrentSpeed() const + fixed GetCurrentSpeed() const override { return m_Script.Call("GetCurrentSpeed"); } - virtual bool IsMoveRequested() const + bool IsMoveRequested() const override { return m_Script.Call("IsMoveRequested"); } - virtual fixed GetSpeed() const + fixed GetSpeed() const override { return m_Script.Call("GetSpeed"); } - virtual fixed GetWalkSpeed() const + fixed GetWalkSpeed() const override { return m_Script.Call("GetWalkSpeed"); } - virtual fixed GetRunMultiplier() const + fixed GetRunMultiplier() const override { return m_Script.Call("GetRunMultiplier"); } - virtual void SetSpeedMultiplier(fixed multiplier) + void SetSpeedMultiplier(fixed multiplier) override { m_Script.CallVoid("SetSpeedMultiplier", multiplier); } - virtual fixed GetSpeedMultiplier() const + fixed GetSpeedMultiplier() const override { return m_Script.Call("GetSpeedMultiplier"); } - virtual CFixedVector2D EstimateFuturePosition(const fixed dt) const + CFixedVector2D EstimateFuturePosition(const fixed dt) const override { return m_Script.Call("EstimateFuturePosition", dt); } - virtual fixed GetAcceleration() const + fixed GetAcceleration() const override { return m_Script.Call("GetAcceleration"); } - virtual void SetAcceleration(fixed acceleration) + void SetAcceleration(fixed acceleration) override { m_Script.CallVoid("SetAcceleration", acceleration); } - virtual void SetFacePointAfterMove(bool facePointAfterMove) + void SetFacePointAfterMove(bool facePointAfterMove) override { m_Script.CallVoid("SetFacePointAfterMove", facePointAfterMove); } - virtual bool GetFacePointAfterMove() const + bool GetFacePointAfterMove() const override { return m_Script.Call("GetFacePointAfterMove"); } - virtual pass_class_t GetPassabilityClass() const + pass_class_t GetPassabilityClass() const override { return m_Script.Call("GetPassabilityClass"); } - virtual std::string GetPassabilityClassName() const + std::string GetPassabilityClassName() const override { return m_Script.Call("GetPassabilityClassName"); } - virtual entity_pos_t GetUnitClearance() const + entity_pos_t GetUnitClearance() const override { return m_Script.Call("GetUnitClearance"); } - virtual void SetDebugOverlay(bool enabled) + void SetDebugOverlay(bool enabled) override { m_Script.CallVoid("SetDebugOverlay", enabled); } Index: ps/trunk/source/simulation2/components/ICmpValueModificationManager.cpp =================================================================== --- ps/trunk/source/simulation2/components/ICmpValueModificationManager.cpp +++ ps/trunk/source/simulation2/components/ICmpValueModificationManager.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -30,27 +30,27 @@ public: DEFAULT_SCRIPT_WRAPPER(ValueModificationManagerScripted) - virtual fixed ApplyModifications(std::wstring valueName, fixed currentValue, entity_id_t entity) const + fixed ApplyModifications(std::wstring valueName, fixed currentValue, entity_id_t entity) const override { return m_Script.Call("ApplyModifications", valueName, currentValue, entity); } - virtual u32 ApplyModifications(std::wstring valueName, u32 currentValue, entity_id_t entity) const + u32 ApplyModifications(std::wstring valueName, u32 currentValue, entity_id_t entity) const override { return m_Script.Call("ApplyModifications", valueName, currentValue, entity); } - virtual u16 ApplyModifications(std::wstring valueName, u16 currentValue, entity_id_t entity) const + u16 ApplyModifications(std::wstring valueName, u16 currentValue, entity_id_t entity) const override { return m_Script.Call("ApplyModifications", valueName, currentValue, entity); } - virtual std::wstring ApplyModifications(std::wstring valueName, std::wstring currentValue, entity_id_t entity) const + std::wstring ApplyModifications(std::wstring valueName, std::wstring currentValue, entity_id_t entity) const override { return m_Script.Call("ApplyModifications", valueName, currentValue, entity); } - virtual bool ApplyModifications(std::wstring valueName, bool currentValue, entity_id_t entity) const + bool ApplyModifications(std::wstring valueName, bool currentValue, entity_id_t entity) const override { return m_Script.Call("ApplyModifications", valueName, currentValue, entity); } Index: ps/trunk/source/simulation2/components/ICmpVisibility.cpp =================================================================== --- ps/trunk/source/simulation2/components/ICmpVisibility.cpp +++ ps/trunk/source/simulation2/components/ICmpVisibility.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -30,12 +30,12 @@ public: DEFAULT_SCRIPT_WRAPPER(VisibilityScripted) - virtual bool IsActivated() + bool IsActivated() override { return m_Script.Call("IsActivated"); } - virtual LosVisibility GetVisibility(player_id_t player, bool isVisible, bool isExplored) + LosVisibility GetVisibility(player_id_t player, bool isVisible, bool isExplored) override { int visibility = m_Script.Call("GetVisibility", player, isVisible, isExplored); @@ -53,12 +53,12 @@ } } - virtual bool GetRetainInFog() + bool GetRetainInFog() override { return m_Script.Call("GetRetainInFog"); } - virtual bool GetAlwaysVisible() + bool GetAlwaysVisible() override { return m_Script.Call("GetAlwaysVisible"); } Index: ps/trunk/source/simulation2/components/tests/test_ObstructionManager.h =================================================================== --- ps/trunk/source/simulation2/components/tests/test_ObstructionManager.h +++ ps/trunk/source/simulation2/components/tests/test_ObstructionManager.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -26,32 +26,32 @@ DEFAULT_MOCK_COMPONENT() ICmpObstructionManager::ObstructionSquare obstruction; - virtual ICmpObstructionManager::tag_t GetObstruction() const { return ICmpObstructionManager::tag_t(); } - virtual bool GetObstructionSquare(ICmpObstructionManager::ObstructionSquare& out) const { out = obstruction; return true; } - virtual bool GetPreviousObstructionSquare(ICmpObstructionManager::ObstructionSquare& UNUSED(out)) const { return true; } - virtual entity_pos_t GetSize() const { return entity_pos_t::Zero(); } - virtual CFixedVector2D GetStaticSize() const { return CFixedVector2D(); } - virtual EObstructionType GetObstructionType() const { return ICmpObstruction::STATIC; } - virtual void SetUnitClearance(const entity_pos_t& UNUSED(clearance)) { } - virtual bool IsControlPersistent() const { return true; } - virtual bool CheckShorePlacement() const { return true; } - virtual EFoundationCheck CheckFoundation(const std::string& UNUSED(className)) const { return EFoundationCheck(); } - virtual EFoundationCheck CheckFoundation(const std::string& UNUSED(className), bool UNUSED(onlyCenterPoint)) const { return EFoundationCheck(); } - virtual std::string CheckFoundation_wrapper(const std::string& UNUSED(className), bool UNUSED(onlyCenterPoint)) const { return std::string(); } - virtual bool CheckDuplicateFoundation() const { return true; } - virtual std::vector GetEntitiesByFlags(ICmpObstructionManager::flags_t UNUSED(flags)) const { return std::vector(); } - virtual std::vector GetEntitiesBlockingMovement() const { return std::vector(); } - virtual std::vector GetEntitiesBlockingConstruction() const { return std::vector(); } - virtual std::vector GetEntitiesDeletedUponConstruction() const { return std::vector(); } - virtual void ResolveFoundationCollisions() const { } - virtual void SetActive(bool UNUSED(active)) { } - virtual void SetMovingFlag(bool UNUSED(enabled)) { } - virtual void SetDisableBlockMovementPathfinding(bool UNUSED(movementDisabled), bool UNUSED(pathfindingDisabled), int32_t UNUSED(shape)) { } - virtual bool GetBlockMovementFlag(bool) const { return true; } - virtual void SetControlGroup(entity_id_t UNUSED(group)) { } - virtual entity_id_t GetControlGroup() const { return INVALID_ENTITY; } - virtual void SetControlGroup2(entity_id_t UNUSED(group2)) { } - virtual entity_id_t GetControlGroup2() const { return INVALID_ENTITY; } + ICmpObstructionManager::tag_t GetObstruction() const override { return ICmpObstructionManager::tag_t(); } + bool GetObstructionSquare(ICmpObstructionManager::ObstructionSquare& out) const override { out = obstruction; return true; } + bool GetPreviousObstructionSquare(ICmpObstructionManager::ObstructionSquare& UNUSED(out)) const override { return true; } + entity_pos_t GetSize() const override { return entity_pos_t::Zero(); } + CFixedVector2D GetStaticSize() const override { return CFixedVector2D(); } + EObstructionType GetObstructionType() const override { return ICmpObstruction::STATIC; } + void SetUnitClearance(const entity_pos_t& UNUSED(clearance)) override { } + bool IsControlPersistent() const override { return true; } + bool CheckShorePlacement() const override { return true; } + EFoundationCheck CheckFoundation(const std::string& UNUSED(className)) const override { return EFoundationCheck(); } + EFoundationCheck CheckFoundation(const std::string& UNUSED(className), bool UNUSED(onlyCenterPoint)) const override { return EFoundationCheck(); } + std::string CheckFoundation_wrapper(const std::string& UNUSED(className), bool UNUSED(onlyCenterPoint)) const override { return std::string(); } + bool CheckDuplicateFoundation() const override { return true; } + std::vector GetEntitiesByFlags(ICmpObstructionManager::flags_t UNUSED(flags)) const override { return std::vector(); } + std::vector GetEntitiesBlockingMovement() const override { return std::vector(); } + std::vector GetEntitiesBlockingConstruction() const override { return std::vector(); } + std::vector GetEntitiesDeletedUponConstruction() const override { return std::vector(); } + void ResolveFoundationCollisions() const override { } + void SetActive(bool UNUSED(active)) override { } + void SetMovingFlag(bool UNUSED(enabled)) override { } + void SetDisableBlockMovementPathfinding(bool UNUSED(movementDisabled), bool UNUSED(pathfindingDisabled), int32_t UNUSED(shape)) override { } + bool GetBlockMovementFlag(bool) const override { return true; } + void SetControlGroup(entity_id_t UNUSED(group)) override { } + entity_id_t GetControlGroup() const override { return INVALID_ENTITY; } + void SetControlGroup2(entity_id_t UNUSED(group2)) override { } + entity_id_t GetControlGroup2() const override { return INVALID_ENTITY; } }; class TestCmpObstructionManager : public CxxTest::TestSuite Index: ps/trunk/source/simulation2/components/tests/test_Position.h =================================================================== --- ps/trunk/source/simulation2/components/tests/test_Position.h +++ ps/trunk/source/simulation2/components/tests/test_Position.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2017 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -26,21 +26,21 @@ public: DEFAULT_MOCK_COMPONENT() - virtual entity_pos_t GetWaterLevel(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) const + entity_pos_t GetWaterLevel(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) const override { return entity_pos_t::FromInt(100); } - virtual float GetExactWaterLevel(float UNUSED(x), float UNUSED(z)) const + float GetExactWaterLevel(float UNUSED(x), float UNUSED(z)) const override { return 100.f; } - virtual void RecomputeWaterData() + void RecomputeWaterData() override { } - virtual void SetWaterLevel(entity_pos_t UNUSED(h)) + void SetWaterLevel(entity_pos_t UNUSED(h)) override { } }; Index: ps/trunk/source/simulation2/components/tests/test_RangeManager.h =================================================================== --- ps/trunk/source/simulation2/components/tests/test_RangeManager.h +++ ps/trunk/source/simulation2/components/tests/test_RangeManager.h @@ -30,8 +30,8 @@ public: DEFAULT_MOCK_COMPONENT() - virtual entity_pos_t GetRange() const { return entity_pos_t::FromInt(66); } - virtual bool GetRevealShore() const { return false; } + entity_pos_t GetRange() const override { return entity_pos_t::FromInt(66); } + bool GetRevealShore() const override { return false; } }; class MockPositionRgm : public ICmpPosition @@ -39,38 +39,38 @@ public: DEFAULT_MOCK_COMPONENT() - virtual void SetTurretParent(entity_id_t UNUSED(id), const CFixedVector3D& UNUSED(pos)) {} - virtual entity_id_t GetTurretParent() const {return INVALID_ENTITY;} - virtual void UpdateTurretPosition() {} - virtual std::set* GetTurrets() { return NULL; } - virtual bool IsInWorld() const { return true; } - virtual void MoveOutOfWorld() { } - virtual void MoveTo(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) { } - virtual void MoveAndTurnTo(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z), entity_angle_t UNUSED(a)) { } - virtual void JumpTo(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) { } - virtual void SetHeightOffset(entity_pos_t UNUSED(dy)) { } - virtual entity_pos_t GetHeightOffset() const { return entity_pos_t::Zero(); } - virtual void SetHeightFixed(entity_pos_t UNUSED(y)) { } - virtual entity_pos_t GetHeightFixed() const { return entity_pos_t::Zero(); } - virtual entity_pos_t GetHeightAtFixed(entity_pos_t, entity_pos_t) const { return entity_pos_t::Zero(); } - virtual bool IsHeightRelative() const { return true; } - virtual void SetHeightRelative(bool UNUSED(relative)) { } - virtual bool CanFloat() const { return false; } - virtual void SetFloating(bool UNUSED(flag)) { } - virtual void SetActorFloating(bool UNUSED(flag)) { } - virtual void SetConstructionProgress(fixed UNUSED(progress)) { } - virtual CFixedVector3D GetPosition() const { return m_Pos; } - virtual CFixedVector2D GetPosition2D() const { return CFixedVector2D(m_Pos.X, m_Pos.Z); } - virtual CFixedVector3D GetPreviousPosition() const { return CFixedVector3D(); } - virtual CFixedVector2D GetPreviousPosition2D() const { return CFixedVector2D(); } - virtual fixed GetTurnRate() const { return fixed::Zero(); } - virtual void TurnTo(entity_angle_t UNUSED(y)) { } - virtual void SetYRotation(entity_angle_t UNUSED(y)) { } - virtual void SetXZRotation(entity_angle_t UNUSED(x), entity_angle_t UNUSED(z)) { } - virtual CFixedVector3D GetRotation() const { return CFixedVector3D(); } - virtual fixed GetDistanceTravelled() const { return fixed::Zero(); } - virtual void GetInterpolatedPosition2D(float UNUSED(frameOffset), float& x, float& z, float& rotY) const { x = z = rotY = 0; } - virtual CMatrix3D GetInterpolatedTransform(float UNUSED(frameOffset)) const { return CMatrix3D(); } + void SetTurretParent(entity_id_t UNUSED(id), const CFixedVector3D& UNUSED(pos)) override {} + entity_id_t GetTurretParent() const override {return INVALID_ENTITY;} + void UpdateTurretPosition() override {} + std::set* GetTurrets() override { return nullptr; } + bool IsInWorld() const override { return true; } + void MoveOutOfWorld() override { } + void MoveTo(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) override { } + void MoveAndTurnTo(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z), entity_angle_t UNUSED(a)) override { } + void JumpTo(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) override { } + void SetHeightOffset(entity_pos_t UNUSED(dy)) override { } + entity_pos_t GetHeightOffset() const override { return entity_pos_t::Zero(); } + void SetHeightFixed(entity_pos_t UNUSED(y)) override { } + entity_pos_t GetHeightFixed() const override { return entity_pos_t::Zero(); } + entity_pos_t GetHeightAtFixed(entity_pos_t, entity_pos_t) const override { return entity_pos_t::Zero(); } + bool IsHeightRelative() const override { return true; } + void SetHeightRelative(bool UNUSED(relative)) override { } + bool CanFloat() const override { return false; } + void SetFloating(bool UNUSED(flag)) override { } + void SetActorFloating(bool UNUSED(flag)) override { } + void SetConstructionProgress(fixed UNUSED(progress)) override { } + CFixedVector3D GetPosition() const override { return m_Pos; } + CFixedVector2D GetPosition2D() const override { return CFixedVector2D(m_Pos.X, m_Pos.Z); } + CFixedVector3D GetPreviousPosition() const override { return CFixedVector3D(); } + CFixedVector2D GetPreviousPosition2D() const override { return CFixedVector2D(); } + fixed GetTurnRate() const override { return fixed::Zero(); } + void TurnTo(entity_angle_t UNUSED(y)) override { } + void SetYRotation(entity_angle_t UNUSED(y)) override { } + void SetXZRotation(entity_angle_t UNUSED(x), entity_angle_t UNUSED(z)) override { } + CFixedVector3D GetRotation() const override { return CFixedVector3D(); } + fixed GetDistanceTravelled() const override { return fixed::Zero(); } + void GetInterpolatedPosition2D(float UNUSED(frameOffset), float& x, float& z, float& rotY) const override { x = z = rotY = 0; } + CMatrix3D GetInterpolatedTransform(float UNUSED(frameOffset)) const override { return CMatrix3D(); } CFixedVector3D m_Pos; }; @@ -82,32 +82,32 @@ MockObstructionRgm(entity_pos_t s) : m_Size(s) {}; - virtual ICmpObstructionManager::tag_t GetObstruction() const { return {}; }; - virtual bool GetObstructionSquare(ICmpObstructionManager::ObstructionSquare&) const { return false; }; - virtual bool GetPreviousObstructionSquare(ICmpObstructionManager::ObstructionSquare&) const { return false; }; - virtual entity_pos_t GetSize() const { return m_Size; }; - virtual CFixedVector2D GetStaticSize() const { return {}; }; - virtual EObstructionType GetObstructionType() const { return {}; }; - virtual void SetUnitClearance(const entity_pos_t&) {}; - virtual bool IsControlPersistent() const { return {}; }; - virtual bool CheckShorePlacement() const { return {}; }; - virtual EFoundationCheck CheckFoundation(const std::string&) const { return {}; }; - virtual EFoundationCheck CheckFoundation(const std::string& , bool) const { return {}; }; - virtual std::string CheckFoundation_wrapper(const std::string&, bool) const { return {}; }; - virtual bool CheckDuplicateFoundation() const { return {}; }; - virtual std::vector GetEntitiesByFlags(ICmpObstructionManager::flags_t) const { return {}; }; - virtual std::vector GetEntitiesBlockingMovement() const { return {}; }; - virtual std::vector GetEntitiesBlockingConstruction() const { return {}; }; - virtual std::vector GetEntitiesDeletedUponConstruction() const { return {}; }; - virtual void ResolveFoundationCollisions() const {}; - virtual void SetActive(bool) {}; - virtual void SetMovingFlag(bool) {}; - virtual void SetDisableBlockMovementPathfinding(bool, bool, int32_t) {}; - virtual bool GetBlockMovementFlag(bool) const { return {}; }; - virtual void SetControlGroup(entity_id_t) {}; - virtual entity_id_t GetControlGroup() const { return {}; }; - virtual void SetControlGroup2(entity_id_t) {}; - virtual entity_id_t GetControlGroup2() const { return {}; }; + ICmpObstructionManager::tag_t GetObstruction() const override { return {}; }; + bool GetObstructionSquare(ICmpObstructionManager::ObstructionSquare&) const override { return false; }; + bool GetPreviousObstructionSquare(ICmpObstructionManager::ObstructionSquare&) const override { return false; }; + entity_pos_t GetSize() const override { return m_Size; }; + CFixedVector2D GetStaticSize() const override { return {}; }; + EObstructionType GetObstructionType() const override { return {}; }; + void SetUnitClearance(const entity_pos_t&) override {}; + bool IsControlPersistent() const override { return {}; }; + bool CheckShorePlacement() const override { return {}; }; + EFoundationCheck CheckFoundation(const std::string&) const override { return {}; }; + EFoundationCheck CheckFoundation(const std::string& , bool) const override { return {}; }; + std::string CheckFoundation_wrapper(const std::string&, bool) const override { return {}; }; + bool CheckDuplicateFoundation() const override { return {}; }; + std::vector GetEntitiesByFlags(ICmpObstructionManager::flags_t) const override { return {}; }; + std::vector GetEntitiesBlockingMovement() const override { return {}; }; + std::vector GetEntitiesBlockingConstruction() const override { return {}; }; + std::vector GetEntitiesDeletedUponConstruction() const override { return {}; }; + void ResolveFoundationCollisions() const override {}; + void SetActive(bool) override {}; + void SetMovingFlag(bool) override {}; + void SetDisableBlockMovementPathfinding(bool, bool, int32_t) override {}; + bool GetBlockMovementFlag(bool) const override { return {}; }; + void SetControlGroup(entity_id_t) override {}; + entity_id_t GetControlGroup() const override { return {}; }; + void SetControlGroup2(entity_id_t) override {}; + entity_id_t GetControlGroup2() const override { return {}; }; private: entity_pos_t m_Size; }; Index: ps/trunk/source/simulation2/scripting/ScriptComponent.h =================================================================== --- ps/trunk/source/simulation2/scripting/ScriptComponent.h +++ ps/trunk/source/simulation2/scripting/ScriptComponent.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -102,31 +102,31 @@ { \ return ""; \ } \ - virtual void Init(const CParamNode& paramNode) \ + void Init(const CParamNode& paramNode) override \ { \ m_Script.Init(paramNode, GetEntityId()); \ } \ - virtual void Deinit() \ + void Deinit() override \ { \ m_Script.Deinit(); \ } \ - virtual void HandleMessage(const CMessage& msg, bool global) \ + void HandleMessage(const CMessage& msg, bool global) override \ { \ m_Script.HandleMessage(msg, global); \ } \ - virtual void Serialize(ISerializer& serialize) \ + void Serialize(ISerializer& serialize) override \ { \ m_Script.Serialize(serialize); \ } \ - virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) \ + void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override \ { \ m_Script.Deserialize(paramNode, deserialize, GetEntityId()); \ } \ - virtual JS::Value GetJSInstance() const \ + JS::Value GetJSInstance() const override \ { \ return m_Script.GetInstance(); \ } \ - virtual int GetComponentTypeId() const \ + int GetComponentTypeId() const override \ { \ return CID_##cname; \ } \ Index: ps/trunk/source/simulation2/system/Component.h =================================================================== --- ps/trunk/source/simulation2/system/Component.h +++ ps/trunk/source/simulation2/system/Component.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -39,26 +39,26 @@ #define DEFAULT_COMPONENT_ALLOCATOR(cname) \ static IComponent* Allocate(const ScriptInterface&, JS::HandleValue) { return new CCmp##cname(); } \ static void Deallocate(IComponent* cmp) { delete static_cast (cmp); } \ - virtual int GetComponentTypeId() const \ + int GetComponentTypeId() const override \ { \ return CID_##cname; \ } #define DEFAULT_MOCK_COMPONENT() \ - virtual int GetComponentTypeId() const \ + int GetComponentTypeId() const override \ { \ return -1; \ } \ - virtual void Init(const CParamNode& UNUSED(paramNode)) \ + void Init(const CParamNode& UNUSED(paramNode)) override \ { \ } \ - virtual void Deinit() \ + void Deinit() override \ { \ } \ - virtual void Serialize(ISerializer& UNUSED(serialize)) \ + void Serialize(ISerializer& UNUSED(serialize)) override \ { \ } \ - virtual void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& UNUSED(deserialize)) \ + void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& UNUSED(deserialize)) override \ { \ } \ Index: ps/trunk/source/simulation2/system/ComponentTest.h =================================================================== --- ps/trunk/source/simulation2/system/ComponentTest.h +++ ps/trunk/source/simulation2/system/ComponentTest.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -193,56 +193,56 @@ public: DEFAULT_MOCK_COMPONENT() - virtual bool IsLoaded() const + bool IsLoaded() const override { return true; } - virtual CFixedVector3D CalcNormal(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) const + CFixedVector3D CalcNormal(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) const override { return CFixedVector3D(fixed::FromInt(0), fixed::FromInt(1), fixed::FromInt(0)); } - virtual CVector3D CalcExactNormal(float UNUSED(x), float UNUSED(z)) const + CVector3D CalcExactNormal(float UNUSED(x), float UNUSED(z)) const override { return CVector3D(0.f, 1.f, 0.f); } - virtual entity_pos_t GetGroundLevel(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) const + entity_pos_t GetGroundLevel(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) const override { return entity_pos_t::FromInt(50); } - virtual float GetExactGroundLevel(float UNUSED(x), float UNUSED(z)) const + float GetExactGroundLevel(float UNUSED(x), float UNUSED(z)) const override { return 50.f; } - virtual u16 GetTilesPerSide() const + u16 GetTilesPerSide() const override { return 16; } - virtual u32 GetMapSize() const + u32 GetMapSize() const override { return GetTilesPerSide() * TERRAIN_TILE_SIZE; } - virtual u16 GetVerticesPerSide() const + u16 GetVerticesPerSide() const override { return 17; } - virtual CTerrain* GetCTerrain() + CTerrain* GetCTerrain() override { - return NULL; + return nullptr; } - virtual void MakeDirty(i32 UNUSED(i0), i32 UNUSED(j0), i32 UNUSED(i1), i32 UNUSED(j1)) + void MakeDirty(i32 UNUSED(i0), i32 UNUSED(j0), i32 UNUSED(i1), i32 UNUSED(j1)) override { } - virtual void ReloadTerrain(bool UNUSED(ReloadWater)) + void ReloadTerrain(bool UNUSED(ReloadWater)) override { } };