summaryrefslogtreecommitdiff
path: root/test/test-render.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-01-08 16:34:43 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-01-08 16:34:43 +0000
commit8cd0977a3688fa705c83867c57505a47b9269369 (patch)
treeb7b48711051299607077ed31fdf3b3f6dd6cc41f /test/test-render.cpp
parentTidy shadow map creation (diff)
downloadilt-8cd0977a3688fa705c83867c57505a47b9269369.tar.bz2
ilt-8cd0977a3688fa705c83867c57505a47b9269369.tar.xz
ilt-8cd0977a3688fa705c83867c57505a47b9269369.zip
Fix up all the static analyzer warnings
Diffstat (limited to 'test/test-render.cpp')
-rw-r--r--test/test-render.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/test/test-render.cpp b/test/test-render.cpp
index 09aa9fb..7db847d 100644
--- a/test/test-render.cpp
+++ b/test/test-render.cpp
@@ -1,6 +1,6 @@
#define BOOST_TEST_MODULE test_render
-#include "test-helpers.hpp"
+#include "testHelpers.h"
#include "testMainWindow.h"
#include "testRenderOutput.h"
#include <boost/test/data/test_case.hpp>
@@ -26,18 +26,18 @@ class TestScene : public SceneProvider {
return gd;
}()};
void
- content(const SceneShader & shader) const
+ content(const SceneShader & shader) const override
{
terrain.render(shader);
train.render(shader, Location {{52, 50, 2}}, {Location {}, Location {}});
train.render(shader, Location {{52, 30, 2}}, {Location {}, Location {}});
}
void
- lights(const SceneShader &) const
+ lights(const SceneShader &) const override
{
}
void
- shadows(const ShadowMapper & shadowMapper) const
+ shadows(const ShadowMapper & shadowMapper) const override
{
terrain.shadows(shadowMapper);
train.shadows(shadowMapper, Location {{52, 50, 2}});
@@ -54,7 +54,7 @@ BOOST_DATA_TEST_CASE(cam,
dist, near, far)
{
static constexpr glm::vec4 pos {-10, -10, 60, 0};
- Camera cam {pos, half_pi, 1.f, near, far};
+ const Camera cam {pos, half_pi, 1.F, near, far};
const auto e = cam.extentsAtDist(dist);
@@ -70,7 +70,7 @@ BOOST_AUTO_TEST_CASE(basic)
{
SceneRenderer ss {size, output};
ss.camera.setView({-10, -10, 60}, glm::normalize(glm::vec3 {1, 1, -0.5F}));
- TestScene scene;
+ const TestScene scene;
ss.render(scene);
glDisable(GL_DEBUG_OUTPUT);
Texture::save(outImage, size, "/tmp/basic.tga");
@@ -93,12 +93,12 @@ BOOST_AUTO_TEST_CASE(pointlight)
{
for (int x = 50; x < 100; x += 20) {
for (int y = 50; y < 2000; y += 20) {
- shader.pointLight.add({x, y, 4}, {1.0, 1.0, 1.0}, 0.1);
+ shader.pointLight.add({x, y, 4}, {1.0, 1.0, 1.0}, 0.1F);
}
}
}
};
- PointLightScene scene;
+ const PointLightScene scene;
ss.render(scene);
glDisable(GL_DEBUG_OUTPUT);
Texture::save(outImage, size, "/tmp/pointlight.tga");
@@ -119,13 +119,13 @@ BOOST_AUTO_TEST_CASE(spotlight)
void
lights(const SceneShader & shader) const override
{
- shader.spotLight.add({50, 50, 15}, down, {1.0, 1.0, 1.0}, 0.01, 1);
- shader.spotLight.add({51, 59.5, 1}, north, {1.0, 1.0, 1.0}, 0.001, .5);
- shader.spotLight.add({53, 59.5, 1}, north, {1.0, 1.0, 1.0}, 0.001, .5);
- shader.spotLight.add({60, 50, 3}, north + east, {1.0, 1.0, 1.0}, 0.0001, .7);
+ shader.spotLight.add({50, 50, 15}, down, {1.0, 1.0, 1.0}, 0.01F, 1);
+ shader.spotLight.add({51, 59.5, 1}, north, {1.0, 1.0, 1.0}, 0.001F, .5);
+ shader.spotLight.add({53, 59.5, 1}, north, {1.0, 1.0, 1.0}, 0.001F, .5);
+ shader.spotLight.add({60, 50, 3}, north + east, {1.0, 1.0, 1.0}, 0.0001F, .7F);
}
};
- PointLightScene scene;
+ const PointLightScene scene;
ss.render(scene);
glDisable(GL_DEBUG_OUTPUT);
Texture::save(outImage, size, "/tmp/spotlight.tga");