Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/components/CCmpRallyPointRenderer.h
/* Copyright (C) 2017 Wildfire Games. | |||||
* This file is part of 0 A.D. | |||||
* | |||||
* 0 A.D. is free software: you can redistribute it and/or modify | |||||
* it under the terms of the GNU General Public License as published by | |||||
* the Free Software Foundation, either version 2 of the License, or | |||||
* (at your option) any later version. | |||||
* | |||||
* 0 A.D. is distributed in the hope that it will be useful, | |||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
* GNU General Public License for more details. | |||||
* | |||||
* You should have received a copy of the GNU General Public License | |||||
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. | |||||
*/ | |||||
#ifndef INCLUDED_CCMPRALLYPOINTRENDERER | |||||
#define INCLUDED_CCMPRALLYPOINTRENDERER | |||||
#include "CCmpItineraryPointRenderer.h" | |||||
#include "ICmpRallyPointRenderer.h" | |||||
#include "simulation2/MessageTypes.h" | |||||
#include "simulation2/components/ICmpFootprint.h" | |||||
#include "simulation2/components/ICmpObstructionManager.h" | |||||
#include "simulation2/components/ICmpOwnership.h" | |||||
#include "simulation2/components/ICmpPathfinder.h" | |||||
#include "simulation2/components/ICmpPlayer.h" | |||||
#include "simulation2/components/ICmpPlayerManager.h" | |||||
#include "simulation2/components/ICmpPosition.h" | |||||
#include "simulation2/components/ICmpRangeManager.h" | |||||
#include "simulation2/components/ICmpTerrain.h" | |||||
#include "simulation2/components/ICmpVisual.h" | |||||
#include "simulation2/components/ICmpWaterManager.h" | |||||
#include "simulation2/helpers/Render.h" | |||||
#include "simulation2/helpers/Geometry.h" | |||||
#include "simulation2/system/Component.h" | |||||
#include "graphics/Overlay.h" | |||||
#include "graphics/TextureManager.h" | |||||
#include "ps/CLogger.h" | |||||
#include "ps/Profile.h" | |||||
#include "renderer/Renderer.h" | |||||
class CCmpRallyPointRenderer : public CCmpItineraryPointRenderer, public ICmpRallyPointRenderer | |||||
{ | |||||
public: | |||||
DEFAULT_COMPONENT_ALLOCATOR(RallyPointRenderer) | |||||
static std::string GetSchema(); | |||||
virtual void Init(const CParamNode& paramNode); | |||||
virtual void Deinit(); | |||||
virtual void Serialize(ISerializer& serialize); | |||||
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize); | |||||
virtual void AddPosition_wrapper(const CFixedVector2D& pos); | |||||
virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)); | |||||
virtual bool IsSet() const; | |||||
virtual void Reset(); | |||||
virtual void SetDisplayed(bool displayed); | |||||
virtual void SetPosition(const CFixedVector2D& pos); | |||||
virtual void UpdateMessageSubscriptions(); | |||||
virtual void UpdatePosition(u32 rallyPointId, const CFixedVector2D& pos); | |||||
protected: | |||||
virtual void AddPosition(CFixedVector2D pos, bool recompute); | |||||
virtual void ConstructAllOverlayLines(); | |||||
virtual void ConstructOverlayLines(size_t index); | |||||
virtual void FixFootprintWaypoints(std::vector<CVector2D>& coords, CmpPtr<ICmpPosition> cmpPosition, CmpPtr<ICmpFootprint> cmpFootprint) const; | |||||
virtual void GetClosestsEdgePointFrom(CFixedVector2D& result, CFixedVector2D& start, CmpPtr<ICmpPosition> cmpPosition, CmpPtr<ICmpFootprint> cmpFootprint) const; | |||||
virtual void GetVisibilitySegments(std::vector<SVisibilitySegment>& out, size_t index) const; | |||||
virtual void RecomputeAllItineraryPointPaths(); | |||||
virtual void RecomputeItineraryPointPath(size_t index, CmpPtr<ICmpPosition>& cmpPosition, CmpPtr<ICmpFootprint>& cmpFootprint, CmpPtr<ICmpPathfinder> cmpPathfinder); | |||||
virtual void RecomputeItineraryPointPath_wrapper(size_t index); | |||||
virtual void ReduceSegmentsByVisibility(std::vector<CVector2D>& coords, unsigned maxSegmentLinks = 0, bool floating = true) const; | |||||
virtual void RenderSubmit(SceneCollector& collector); | |||||
virtual void UpdateMarkers(); | |||||
virtual void UpdateOverlayLines(); | |||||
}; | |||||
REGISTER_COMPONENT_TYPE(RallyPointRenderer) | |||||
#endif // INCLUDED_CCMPRALLYPOINTRENDERER |
Wildfire Games · Phabricator