Changeset View
Changeset View
Standalone View
Standalone View
source/tools/atlas/GameInterface/ActorViewer.cpp
Show First 20 Lines • Show All 206 Lines • ▼ Show 20 Lines | public: | ||||
{ | { | ||||
return TerritoryTexture; | return TerritoryTexture; | ||||
} | } | ||||
/** | /** | ||||
* Recursively fetches the props of the currently displayed entity model and its submodels, and stores them for rendering. | * Recursively fetches the props of the currently displayed entity model and its submodels, and stores them for rendering. | ||||
*/ | */ | ||||
void UpdatePropList(); | void UpdatePropList(); | ||||
void UpdatePropListRecursive(CModelAbstract* model); | void UpdatePropListRecursive(CSceneObject* model); | ||||
}; | }; | ||||
void ActorViewerImpl::UpdatePropList() | void ActorViewerImpl::UpdatePropList() | ||||
{ | { | ||||
Props.clear(); | Props.clear(); | ||||
CmpPtr<ICmpVisual> cmpVisual(Simulation2, Entity); | CmpPtr<ICmpVisual> cmpVisual(Simulation2, Entity); | ||||
if (cmpVisual) | if (cmpVisual) | ||||
{ | { | ||||
CUnit* unit = cmpVisual->GetUnit(); | CUnit* unit = cmpVisual->GetUnit(); | ||||
if (unit) | if (unit) | ||||
{ | { | ||||
CModelAbstract& modelAbstract = unit->GetModel(); | CSceneObject& modelAbstract = unit->GetModel(); | ||||
UpdatePropListRecursive(&modelAbstract); | UpdatePropListRecursive(&modelAbstract); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
void ActorViewerImpl::UpdatePropListRecursive(CModelAbstract* modelAbstract) | void ActorViewerImpl::UpdatePropListRecursive(CSceneObject* modelAbstract) | ||||
{ | { | ||||
ENSURE(modelAbstract); | ENSURE(modelAbstract); | ||||
CModel* model = modelAbstract->ToCModel(); | CModel* model = modelAbstract->ToCModel(); | ||||
if (model) | if (model) | ||||
{ | { | ||||
std::vector<CModel::Prop>& modelProps = model->GetProps(); | std::vector<CModel::Prop>& modelProps = model->GetProps(); | ||||
for (CModel::Prop& modelProp : modelProps) | for (CModel::Prop& modelProp : modelProps) | ||||
▲ Show 20 Lines • Show All 313 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator