mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 02:56:50 +02:00
cleanups
This commit is contained in:
parent
93da3ed5bd
commit
a366633f84
1 changed files with 10 additions and 8 deletions
|
@ -87,20 +87,22 @@ const gpu::PipelinePointer DrawStatus::getDrawItemStatusPipeline() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawStatus::setStatusIconMap(const gpu::TexturePointer& map) {
|
void DrawStatus::setStatusIconMap(const gpu::TexturePointer& map) {
|
||||||
_statusIconMap = map;
|
_statusIconMap = map;
|
||||||
}
|
}
|
||||||
|
|
||||||
const gpu::TexturePointer DrawStatus::getStatusIconMap() const {
|
const gpu::TexturePointer DrawStatus::getStatusIconMap() const {
|
||||||
return _statusIconMap;
|
return _statusIconMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawStatus::run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext, const ItemIDsBounds& inItems) {
|
void DrawStatus::run(const SceneContextPointer& sceneContext,
|
||||||
|
const RenderContextPointer& renderContext,
|
||||||
|
const ItemIDsBounds& inItems) {
|
||||||
assert(renderContext->args);
|
assert(renderContext->args);
|
||||||
assert(renderContext->args->_viewFrustum);
|
assert(renderContext->args->_viewFrustum);
|
||||||
RenderArgs* args = renderContext->args;
|
RenderArgs* args = renderContext->args;
|
||||||
auto& scene = sceneContext->_scene;
|
auto& scene = sceneContext->_scene;
|
||||||
const int NUM_STATUS_VEC4_PER_ITEM = 2;
|
const int NUM_STATUS_VEC4_PER_ITEM = 2;
|
||||||
const int VEC4_LENGTH = 4;
|
const int VEC4_LENGTH = 4;
|
||||||
|
|
||||||
// FIrst thing, we collect the bound and the status for all the items we want to render
|
// FIrst thing, we collect the bound and the status for all the items we want to render
|
||||||
int nbItems = 0;
|
int nbItems = 0;
|
||||||
|
@ -112,8 +114,8 @@ void DrawStatus::run(const SceneContextPointer& sceneContext, const RenderContex
|
||||||
_itemStatus = std::make_shared<gpu::Buffer>();;
|
_itemStatus = std::make_shared<gpu::Buffer>();;
|
||||||
}
|
}
|
||||||
|
|
||||||
_itemBounds->resize((inItems.size() * sizeof(AABox)));
|
_itemBounds->resize((inItems.size() * sizeof(AABox)));
|
||||||
_itemStatus->resize((inItems.size() * NUM_STATUS_VEC4_PER_ITEM * sizeof(glm::vec4)));
|
_itemStatus->resize((inItems.size() * NUM_STATUS_VEC4_PER_ITEM * sizeof(glm::vec4)));
|
||||||
AABox* itemAABox = reinterpret_cast<AABox*> (_itemBounds->editData());
|
AABox* itemAABox = reinterpret_cast<AABox*> (_itemBounds->editData());
|
||||||
glm::ivec4* itemStatus = reinterpret_cast<glm::ivec4*> (_itemStatus->editData());
|
glm::ivec4* itemStatus = reinterpret_cast<glm::ivec4*> (_itemStatus->editData());
|
||||||
for (auto& item : inItems) {
|
for (auto& item : inItems) {
|
||||||
|
@ -148,7 +150,7 @@ void DrawStatus::run(const SceneContextPointer& sceneContext, const RenderContex
|
||||||
}
|
}
|
||||||
|
|
||||||
nbItems++;
|
nbItems++;
|
||||||
itemAABox++;
|
itemAABox++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue