Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/components/CCmpUnitRenderer.cpp
/* Copyright (C) 2019 Wildfire Games. | /* Copyright (C) 2019 Wildfire Games. | ||||
historic_bruno: 2019 | |||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 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 | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
Show All 22 Lines | |||||
#include "graphics/ModelAbstract.h" | #include "graphics/ModelAbstract.h" | ||||
#include "graphics/ObjectEntry.h" | #include "graphics/ObjectEntry.h" | ||||
#include "graphics/Overlay.h" | #include "graphics/Overlay.h" | ||||
#include "graphics/Unit.h" | #include "graphics/Unit.h" | ||||
#include "maths/BoundingSphere.h" | #include "maths/BoundingSphere.h" | ||||
#include "maths/Matrix3D.h" | #include "maths/Matrix3D.h" | ||||
#include "ps/GameSetup/Config.h" | #include "ps/GameSetup/Config.h" | ||||
#include "ps/Profile.h" | #include "ps/Profile.h" | ||||
#include "renderer/RenderingOptions.h" | |||||
#include "renderer/Scene.h" | #include "renderer/Scene.h" | ||||
#include "tools/atlas/GameInterface/GameLoop.h" | #include "tools/atlas/GameInterface/GameLoop.h" | ||||
/** | /** | ||||
* Efficiently(ish) renders all the units in the world. | * Efficiently(ish) renders all the units in the world. | ||||
* | * | ||||
* The class maintains a list of all units that currently exist, and the data | * The class maintains a list of all units that currently exist, and the data | ||||
▲ Show 20 Lines • Show All 353 Lines • ▼ Show 20 Lines | if (!unit.actor) | ||||
continue; | continue; | ||||
if (unit.visibilityDirty) | if (unit.visibilityDirty) | ||||
UpdateVisibility(unit); | UpdateVisibility(unit); | ||||
if (unit.visibility == ICmpRangeManager::VIS_HIDDEN) | if (unit.visibility == ICmpRangeManager::VIS_HIDDEN) | ||||
continue; | continue; | ||||
if (!g_AtlasGameLoop->running && !g_RenderActors && (unit.flags & ACTOR_ONLY)) | if (!g_AtlasGameLoop->running && !g_RenderingOptions.GetRenderActors() && (unit.flags & ACTOR_ONLY)) | ||||
continue; | continue; | ||||
if (!g_AtlasGameLoop->running && (unit.flags & VISIBLE_IN_ATLAS_ONLY)) | if (!g_AtlasGameLoop->running && (unit.flags & VISIBLE_IN_ATLAS_ONLY)) | ||||
continue; | continue; | ||||
if (culling && !frustum.IsSphereVisible(unit.sweptBounds.GetCenter(), unit.sweptBounds.GetRadius())) | if (culling && !frustum.IsSphereVisible(unit.sweptBounds.GetCenter(), unit.sweptBounds.GetRadius())) | ||||
continue; | continue; | ||||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
2019