summaryrefslogtreecommitdiff
path: root/game/vehicles
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-05-01 21:29:01 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2023-05-01 21:29:01 +0100
commitc977c02ba3a6ad6ada3f1a458b41a77f2be2b871 (patch)
tree40914fd6b27b1d74ebff87504d161851292d1b06 /game/vehicles
parentDon't explictly call destructor of contained element (diff)
downloadilt-c977c02ba3a6ad6ada3f1a458b41a77f2be2b871.tar.bz2
ilt-c977c02ba3a6ad6ada3f1a458b41a77f2be2b871.tar.xz
ilt-c977c02ba3a6ad6ada3f1a458b41a77f2be2b871.zip
Refactor InstanceVertices in terms of glContainer
Diffstat (limited to 'game/vehicles')
-rw-r--r--game/vehicles/railVehicleClass.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/game/vehicles/railVehicleClass.cpp b/game/vehicles/railVehicleClass.cpp
index 64a21be..148081f 100644
--- a/game/vehicles/railVehicleClass.cpp
+++ b/game/vehicles/railVehicleClass.cpp
@@ -46,26 +46,24 @@ RailVehicleClass::postLoad()
void
RailVehicleClass::render(const SceneShader & shader) const
{
- if (const auto count = instancesBody.count()) {
+ if (const auto count = instancesBody.size()) {
if (texture) {
texture->bind();
}
shader.basicInst.use();
bodyMesh->DrawInstanced(instanceVAO, static_cast<GLsizei>(count));
- bogies.front()->DrawInstanced(
- instancesBogiesVAO.front(), static_cast<GLsizei>(instancesBogies.front().count()));
- bogies.back()->DrawInstanced(instancesBogiesVAO.back(), static_cast<GLsizei>(instancesBogies.back().count()));
+ bogies.front()->DrawInstanced(instancesBogiesVAO.front(), static_cast<GLsizei>(instancesBogies.front().size()));
+ bogies.back()->DrawInstanced(instancesBogiesVAO.back(), static_cast<GLsizei>(instancesBogies.back().size()));
}
}
void
RailVehicleClass::shadows(const ShadowMapper & mapper) const
{
- if (const auto count = instancesBody.count()) {
+ if (const auto count = instancesBody.size()) {
mapper.dynamicPointInst.use();
bodyMesh->DrawInstanced(instanceVAO, static_cast<GLsizei>(count));
- bogies.front()->DrawInstanced(
- instancesBogiesVAO.front(), static_cast<GLsizei>(instancesBogies.front().count()));
- bogies.back()->DrawInstanced(instancesBogiesVAO.back(), static_cast<GLsizei>(instancesBogies.back().count()));
+ bogies.front()->DrawInstanced(instancesBogiesVAO.front(), static_cast<GLsizei>(instancesBogies.front().size()));
+ bogies.back()->DrawInstanced(instancesBogiesVAO.back(), static_cast<GLsizei>(instancesBogies.back().size()));
}
}