diff --git a/libopenage/renderer/demo/demo_0.cpp b/libopenage/renderer/demo/demo_0.cpp index d1d679c0e4..d027c2d1e0 100644 --- a/libopenage/renderer/demo/demo_0.cpp +++ b/libopenage/renderer/demo/demo_0.cpp @@ -2,6 +2,7 @@ #include "demo_0.h" +#include "renderer/demo/util.h" #include "renderer/gui/integration/public/gui_application_with_logger.h" #include "renderer/opengl/window.h" #include "renderer/render_pass.h" @@ -9,7 +10,6 @@ #include "renderer/resources/mesh_data.h" #include "renderer/resources/shader_source.h" #include "renderer/shader_program.h" -#include "renderer/demo/util.h" namespace openage::renderer::tests { @@ -51,7 +51,7 @@ void renderer_demo_0(const util::Path &path) { false, }; - if (!check_uniform_completeness({display_stuff})) { + if (not check_uniform_completeness({display_stuff})) { log::log(WARN << "Uniforms not complete."); } diff --git a/libopenage/renderer/demo/demo_1.cpp b/libopenage/renderer/demo/demo_1.cpp index 2fb3ce6201..baa471b7b2 100644 --- a/libopenage/renderer/demo/demo_1.cpp +++ b/libopenage/renderer/demo/demo_1.cpp @@ -6,6 +6,7 @@ #include #include +#include "renderer/demo/util.h" #include "renderer/gui/integration/public/gui_application_with_logger.h" #include "renderer/opengl/window.h" #include "renderer/render_pass.h" @@ -15,7 +16,6 @@ #include "renderer/shader_program.h" #include "renderer/texture.h" #include "util/math_constants.h" -#include "renderer/demo/util.h" namespace openage::renderer::tests { @@ -173,7 +173,7 @@ void renderer_demo_1(const util::Path &path) { auto pass2 = renderer->add_render_pass({display_obj}, renderer->get_display_target()); - if (!check_uniform_completeness({obj1, obj2, obj3, proj_update, display_obj})) { + if (not check_uniform_completeness({obj1, obj2, obj3, proj_update, display_obj})) { log::log(WARN << "Uniforms not complete."); } diff --git a/libopenage/renderer/demo/demo_2.cpp b/libopenage/renderer/demo/demo_2.cpp index 863ea8c979..1c92469bb5 100644 --- a/libopenage/renderer/demo/demo_2.cpp +++ b/libopenage/renderer/demo/demo_2.cpp @@ -6,6 +6,7 @@ #include #include +#include "renderer/demo/util.h" #include "renderer/gui/integration/public/gui_application_with_logger.h" #include "renderer/opengl/window.h" #include "renderer/render_pass.h" @@ -18,7 +19,6 @@ #include "renderer/resources/texture_data.h" #include "renderer/shader_program.h" #include "renderer/texture.h" -#include "renderer/demo/util.h" namespace openage::renderer::tests { @@ -225,7 +225,7 @@ void renderer_demo_2(const util::Path &path) { auto pass2 = renderer->add_render_pass({display_obj}, renderer->get_display_target()); - if (!check_uniform_completeness({proj_update, obj1, display_obj})) { + if (not check_uniform_completeness({proj_update, obj1, display_obj})) { log::log(WARN << "Uniforms not complete."); } diff --git a/libopenage/renderer/demo/demo_4.cpp b/libopenage/renderer/demo/demo_4.cpp index 35c795c427..7f4704a38a 100644 --- a/libopenage/renderer/demo/demo_4.cpp +++ b/libopenage/renderer/demo/demo_4.cpp @@ -5,6 +5,7 @@ #include #include +#include "renderer/demo/util.h" #include "renderer/gui/integration/public/gui_application_with_logger.h" #include "renderer/opengl/window.h" #include "renderer/render_pass.h" @@ -16,7 +17,6 @@ #include "renderer/resources/shader_source.h" #include "renderer/resources/texture_data.h" #include "renderer/shader_program.h" -#include "renderer/demo/util.h" #include "time/clock.h" @@ -166,7 +166,7 @@ void renderer_demo_4(const util::Path &path) { auto pass2 = renderer->add_render_pass({display_obj}, renderer->get_display_target()); - if (!check_uniform_completeness({proj_update, obj1, display_obj})) { + if (not check_uniform_completeness({proj_update, obj1, display_obj})) { log::log(WARN << "Uniforms not complete."); } diff --git a/libopenage/renderer/demo/demo_5.cpp b/libopenage/renderer/demo/demo_5.cpp index 744c1b9fc7..34e8f4db22 100644 --- a/libopenage/renderer/demo/demo_5.cpp +++ b/libopenage/renderer/demo/demo_5.cpp @@ -7,6 +7,7 @@ #include #include "renderer/camera/camera.h" +#include "renderer/demo/util.h" #include "renderer/gui/integration/public/gui_application_with_logger.h" #include "renderer/opengl/window.h" #include "renderer/render_pass.h" @@ -17,7 +18,6 @@ #include "renderer/shader_program.h" #include "renderer/uniform_buffer.h" #include "renderer/uniform_input.h" -#include "renderer/demo/util.h" namespace openage::renderer::tests { @@ -135,7 +135,7 @@ void renderer_demo_5(const util::Path &path) { "tex", gltex); - if (!check_uniform_completeness({terrain_obj})) { + if (not check_uniform_completeness({terrain_obj})) { log::log(WARN << "Uniforms not complete."); } diff --git a/libopenage/renderer/demo/demo_6.cpp b/libopenage/renderer/demo/demo_6.cpp index 016d9d41a3..e8beaafc6c 100644 --- a/libopenage/renderer/demo/demo_6.cpp +++ b/libopenage/renderer/demo/demo_6.cpp @@ -9,6 +9,7 @@ #include "renderer/camera/camera.h" #include "renderer/camera/frustum_2d.h" #include "renderer/camera/frustum_3d.h" +#include "renderer/demo/util.h" #include "renderer/gui/integration/public/gui_application_with_logger.h" #include "renderer/opengl/window.h" #include "renderer/render_pass.h" @@ -23,7 +24,6 @@ #include "renderer/shader_program.h" #include "renderer/texture.h" #include "renderer/uniform_buffer.h" -#include "renderer/demo/util.h" #include "time/clock.h" #include "util/path.h" #include "util/vector.h" @@ -490,7 +490,7 @@ void RenderManagerDemo6::create_render_passes() { {display_obj_3d, display_obj_2d, display_obj_frame}, renderer->get_display_target()); - if (!check_uniform_completeness({display_obj_3d, display_obj_2d, display_obj_frame})) { + if (not check_uniform_completeness({display_obj_3d, display_obj_2d, display_obj_frame})) { log::log(WARN << "Uniforms not complete."); } } diff --git a/libopenage/renderer/demo/util.cpp b/libopenage/renderer/demo/util.cpp index d94a0d6209..83092ba8a1 100644 --- a/libopenage/renderer/demo/util.cpp +++ b/libopenage/renderer/demo/util.cpp @@ -1,22 +1,21 @@ // Copyright 2015-2024 the openage authors. See copying.md for legal info. #include "util.h" + #include "renderer/uniform_input.h" namespace openage::renderer::tests { bool check_uniform_completeness(const std::vector &renderables) { - bool all_complete = true; - // Iterate over each renderable object for (const auto &renderable : renderables) { if (renderable.uniform && !renderable.uniform->is_complete()) { - all_complete = false; + return false; } } - return all_complete; + return true; } } // namespace openage::renderer::tests diff --git a/libopenage/renderer/demo/util.h b/libopenage/renderer/demo/util.h index a584d94af9..8d8130a306 100644 --- a/libopenage/renderer/demo/util.h +++ b/libopenage/renderer/demo/util.h @@ -3,6 +3,7 @@ #pragma once #include + #include "renderer/renderable.h" namespace openage::renderer::tests { diff --git a/libopenage/renderer/opengl/uniform_input.cpp b/libopenage/renderer/opengl/uniform_input.cpp index 4a8a4b0496..2be81e287f 100644 --- a/libopenage/renderer/opengl/uniform_input.cpp +++ b/libopenage/renderer/opengl/uniform_input.cpp @@ -51,7 +51,7 @@ GlUniformBufferInput::GlUniformBufferInput(const std::shared_ptr } bool GlUniformInput::is_complete() const { - for (const auto& uniform : this->update_offs) { + for (const auto &uniform : this->update_offs) { if (!uniform.used) { return false; } diff --git a/libopenage/renderer/opengl/uniform_input.h b/libopenage/renderer/opengl/uniform_input.h index d635836b05..c46c235414 100644 --- a/libopenage/renderer/opengl/uniform_input.h +++ b/libopenage/renderer/opengl/uniform_input.h @@ -35,10 +35,10 @@ class GlUniformInput final : public UniformInput { public: GlUniformInput(const std::shared_ptr &prog); - /** - * Check if all uniforms have been set. - */ - bool is_complete() const override; + /** + * Check if all uniforms have been set. + */ + bool is_complete() const override; /** * Store the IDs of the uniforms from the shader set by this uniform input.