From 91d87a3ecae2b21a87829442d82e65f071009e92 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 13 Sep 2021 20:13:36 +0300 Subject: [PATCH] Remove deprecated constructors from effects --- source/effects/environmentmap.cpp | 12 ------------ source/effects/environmentmap.h | 1 - source/effects/shadowmap.cpp | 25 +++++-------------------- source/effects/shadowmap.h | 4 ---- 4 files changed, 5 insertions(+), 37 deletions(-) diff --git a/source/effects/environmentmap.cpp b/source/effects/environmentmap.cpp index ced4a104..8770aba5 100644 --- a/source/effects/environmentmap.cpp +++ b/source/effects/environmentmap.cpp @@ -10,18 +10,6 @@ using namespace std; namespace Msp { namespace GL { -EnvironmentMap::EnvironmentMap(unsigned s, Renderable &r, Renderable &e): - Effect(r), - environment(e), - irradiance_shprog(Resources::get_global().get("_envmap_irradiance.glsl.shader")), - specular_shprog(Resources::get_global().get("_envmap_specular.glsl.shader")), - fullscreen_mesh(Resources::get_global().get("_fullscreen_quad.mesh")), - sampler(Resources::get_global().get("_linear_clamp.samp")), - mip_sampler(Resources::get_global().get("_mip_clamp.samp")) -{ - init(s, RGB8, 1); -} - EnvironmentMap::EnvironmentMap(unsigned s, PixelFormat f, Renderable &r, Renderable &e): Effect(r), environment(e), diff --git a/source/effects/environmentmap.h b/source/effects/environmentmap.h index e02687b7..9c8447f6 100644 --- a/source/effects/environmentmap.h +++ b/source/effects/environmentmap.h @@ -55,7 +55,6 @@ private: unsigned update_delay; public: - EnvironmentMap(unsigned size, Renderable &rend, Renderable &env); EnvironmentMap(unsigned size, PixelFormat, Renderable &rend, Renderable &env); EnvironmentMap(unsigned size, PixelFormat, unsigned, Renderable &rend, Renderable &env); private: diff --git a/source/effects/shadowmap.cpp b/source/effects/shadowmap.cpp index bcdb0c9f..f688a6e3 100644 --- a/source/effects/shadowmap.cpp +++ b/source/effects/shadowmap.cpp @@ -14,29 +14,14 @@ namespace GL { ShadowMap::ShadowMap(unsigned s, Renderable &r, const Light &l, Renderable &c): Effect(r), + size(s), light(l), shadow_caster(c), - sampler(Resources::get_global().get("_linear_clamp_shadow.samp")) + sampler(Resources::get_global().get("_linear_clamp_shadow.samp")), + radius(1), + depth_bias(4), + rendered(false) { - init(s); -} - -ShadowMap::ShadowMap(unsigned s, Renderable &r, const Light &l): - Effect(r), - light(l), - shadow_caster(r), - sampler(Resources::get_global().get("_linear_clamp_shadow.samp")) -{ - init(s); -} - -void ShadowMap::init(unsigned s) -{ - size = s; - radius = 1; - depth_bias = 4; - rendered = false; - depth_buf.storage(DEPTH_COMPONENT32F, size, size, 1); fbo.set_format((DEPTH_ATTACHMENT,DEPTH_COMPONENT32F)); fbo.attach(DEPTH_ATTACHMENT, depth_buf, 0); diff --git a/source/effects/shadowmap.h b/source/effects/shadowmap.h index 67f2cf6c..81563a72 100644 --- a/source/effects/shadowmap.h +++ b/source/effects/shadowmap.h @@ -41,11 +41,7 @@ private: public: ShadowMap(unsigned, Renderable &, const Light &, Renderable &); - DEPRECATED ShadowMap(unsigned, Renderable &, const Light &); -private: - void init(unsigned); -public: /** Sets the ShadowMap target point and radius. The transformation matrix is computed so that a sphere with the specified parameters will be completely covered by the ShadowMap. */ -- 2.43.0