Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/components/CCmpPathfinder.cpp
Show All 33 Lines | |||||
#include "simulation2/helpers/MapEdgeTiles.h" | #include "simulation2/helpers/MapEdgeTiles.h" | ||||
#include "simulation2/helpers/Rasterize.h" | #include "simulation2/helpers/Rasterize.h" | ||||
#include "simulation2/helpers/VertexPathfinder.h" | #include "simulation2/helpers/VertexPathfinder.h" | ||||
#include "simulation2/serialization/SerializedPathfinder.h" | #include "simulation2/serialization/SerializedPathfinder.h" | ||||
#include "simulation2/serialization/SerializedTypes.h" | #include "simulation2/serialization/SerializedTypes.h" | ||||
#include "ps/CLogger.h" | #include "ps/CLogger.h" | ||||
#include "ps/CStr.h" | #include "ps/CStr.h" | ||||
#include "ps/ParamNodeLayer.h" | |||||
#include "ps/Profile.h" | #include "ps/Profile.h" | ||||
#include "ps/XML/Xeromyces.h" | #include "ps/XML/Xeromyces.h" | ||||
#include "renderer/Scene.h" | #include "renderer/Scene.h" | ||||
REGISTER_COMPONENT_TYPE(Pathfinder) | REGISTER_COMPONENT_TYPE(Pathfinder) | ||||
void CCmpPathfinder::Init(const CParamNode& UNUSED(paramNode)) | void CCmpPathfinder::Init(const CParamNode& UNUSED(paramNode)) | ||||
{ | { | ||||
Show All 13 Lines | void CCmpPathfinder::Init(const CParamNode& UNUSED(paramNode)) | ||||
// Register Relax NG validator | // Register Relax NG validator | ||||
CXeromyces::AddValidator(g_VFS, "pathfinder", "simulation/data/pathfinder.rng"); | CXeromyces::AddValidator(g_VFS, "pathfinder", "simulation/data/pathfinder.rng"); | ||||
// Since this is used as a system component (not loaded from an entity template), | // Since this is used as a system component (not loaded from an entity template), | ||||
// we can't use the real paramNode (it won't get handled properly when deserializing), | // we can't use the real paramNode (it won't get handled properly when deserializing), | ||||
// so load the data from a special XML file. | // so load the data from a special XML file. | ||||
CParamNode externalParamNode; | CParamNode externalParamNode; | ||||
CParamNode::LoadXML(externalParamNode, L"simulation/data/pathfinder.xml", "pathfinder"); | CParamNode::ApplyXML(externalParamNode, L"simulation/data/pathfinder.xml", "pathfinder"); | ||||
// Previously all move commands during a turn were | // Previously all move commands during a turn were | ||||
// queued up and processed asynchronously at the start | // queued up and processed asynchronously at the start | ||||
// of the next turn. Now we are processing queued up | // of the next turn. Now we are processing queued up | ||||
// events several times duing the turn. This improves | // events several times duing the turn. This improves | ||||
// responsiveness and units move more smoothly especially. | // responsiveness and units move more smoothly especially. | ||||
// when in formation. There is still a call at the | // when in formation. There is still a call at the | ||||
// beginning of a turn to process all outstanding moves - | // beginning of a turn to process all outstanding moves - | ||||
▲ Show 20 Lines • Show All 909 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator