From: Mikko Rasa Date: Thu, 31 Oct 2019 00:44:55 +0000 (+0200) Subject: Remove various old deprecated things X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=df20a7e137542a4156cc5ffa8118d59de6b68547;p=libs%2Fgl.git Remove various old deprecated things Mark remaining ones as deprecated with a compiler attribute. --- diff --git a/source/ambientocclusion.cpp b/source/ambientocclusion.cpp index ed7d1636..3fbaf81a 100644 --- a/source/ambientocclusion.cpp +++ b/source/ambientocclusion.cpp @@ -79,10 +79,6 @@ void AmbientOcclusion::set_occlusion_radius(float r) shdata.uniform("occlusion_radius", r); } -void AmbientOcclusion::set_depth_ratio(float) -{ -} - void AmbientOcclusion::set_darkness(float darkness) { shdata.uniform("darkness", darkness); diff --git a/source/ambientocclusion.h b/source/ambientocclusion.h index 41918994..ff1e8244 100644 --- a/source/ambientocclusion.h +++ b/source/ambientocclusion.h @@ -59,9 +59,6 @@ public: void set_occlusion_radius(float); void set_edge_depth_threshold(float); - // Deprecated - void set_depth_ratio(float); - void set_darkness(float); virtual void render(Renderer &, const Texture2D &, const Texture2D &); diff --git a/source/animatedobject.h b/source/animatedobject.h index 2b640b76..f9b8824e 100644 --- a/source/animatedobject.h +++ b/source/animatedobject.h @@ -2,6 +2,7 @@ #define MSP_GL_ANIMATEDOBJECT_H_ #include +#include #include #include "keyframe.h" #include "matrix.h" @@ -40,8 +41,7 @@ public: ProgramData &get_shader_data(); const ProgramData &get_shader_data() const; - // Deprecated - void set_uniform(const std::string &, const KeyFrame::AnimatedUniform &); + DEPRECATED void set_uniform(const std::string &, const KeyFrame::AnimatedUniform &); virtual const Matrix *get_matrix() const { return &matrix; } diff --git a/source/camera.h b/source/camera.h index d0e80bc9..b10ccb93 100644 --- a/source/camera.h +++ b/source/camera.h @@ -60,10 +60,6 @@ public: float get_far_clip() const { return clip_far; } const Geometry::Angle &get_frustum_rotation() const { return rotate; } - // Deprecated, use set/get_aspect_ratio instead - void set_aspect(float a) { set_aspect_ratio(a); } - float get_aspect() const { return get_aspect_ratio(); } - void set_position(const Vector3 &); void set_look_direction(const Vector3 &); void look_at(const Vector3 &); diff --git a/source/colorcurve.cpp b/source/colorcurve.cpp index 54fbc767..f11b83ae 100644 --- a/source/colorcurve.cpp +++ b/source/colorcurve.cpp @@ -41,15 +41,6 @@ void ColorCurve::set_brightness_response(float b) shdata.uniform("brightness_response", b, t, pow(t, b)); } -void ColorCurve::set_peak(float) -{ -} - -void ColorCurve::set_brightness(float b) -{ - set_brightness_response(1/b); -} - void ColorCurve::set_gamma(float g) { if(g<0.1 || g>10) diff --git a/source/colorcurve.h b/source/colorcurve.h index dac0ac08..d8697d83 100644 --- a/source/colorcurve.h +++ b/source/colorcurve.h @@ -61,10 +61,6 @@ public: /** Sets the exponent of the */ void set_brightness_response(float); - // Deprecated functions - void set_peak(float); - void set_brightness(float); - /** Sets the gamma value used for mapping output colors. Allowed range is from 0.1 to 10. */ void set_gamma(float); diff --git a/source/light.cpp b/source/light.cpp index 8104e896..e910411f 100644 --- a/source/light.cpp +++ b/source/light.cpp @@ -83,11 +83,6 @@ void Light::set_spot_exponent(float e) spot_exp = e; } -void Light::set_spot_cutoff(float c) -{ - set_spot_cutoff(Geometry::Angle::from_degrees(c)); -} - void Light::set_spot_cutoff(const Geometry::Angle &c) { if(c::zero() || (c>Geometry::Angle::right() && c!=Geometry::Angle::straight())) diff --git a/source/light.h b/source/light.h index b2047262..e94f3c5a 100644 --- a/source/light.h +++ b/source/light.h @@ -88,9 +88,6 @@ public: /** Sets the angular falloff exponent of the spotlight. Must be >= 0. */ void set_spot_exponent(float); - /// Deprecated. - void set_spot_cutoff(float); - /** Sets the cutoff angle of a spotlight. Beyond this angle from its axis the spotlight provides no illumination. Must be between 0 and 90 degrees, or exactly 180 degrees to indicate a non-spotlight. */ diff --git a/source/lighting.cpp b/source/lighting.cpp index c6207a76..eeb4f30e 100644 --- a/source/lighting.cpp +++ b/source/lighting.cpp @@ -155,7 +155,7 @@ void Lighting::Loader::sky_color(float r, float g, float b) void Lighting::Loader::zenith_direction(float x, float y, float z) { - obj.set_sky_direction(Vector3(x, y, z)); + obj.set_zenith_direction(Vector3(x, y, z)); } } // namespace GL diff --git a/source/lighting.h b/source/lighting.h index c36b3352..572b2c89 100644 --- a/source/lighting.h +++ b/source/lighting.h @@ -62,9 +62,6 @@ public: effect without shaders. */ void set_zenith_direction(const Vector3 &); - /// Deprecated alias for set_zenith_direction - void set_sky_direction(const Vector3 &d) { set_zenith_direction(d); } - /** Sets the angle where skylight cuts off, counted from the true horizon. Has no effect without shaders. */ void set_horizon_angle(const Geometry::Angle &); diff --git a/source/object.cpp b/source/object.cpp index 1852f91b..25daf13e 100644 --- a/source/object.cpp +++ b/source/object.cpp @@ -38,7 +38,7 @@ Object::~Object() { if(lods[0].mesh && lod0_watched) if(ResourceManager *rm = lods[0].mesh->get_manager()) - rm->unwatch_resource(*lods[0].mesh, *this); + rm->unobserve_resource(*lods[0].mesh, *this); } Object::LevelOfDetail &Object::get_lod(unsigned i, const char *caller) @@ -59,7 +59,7 @@ void Object::set_mesh(unsigned i, const Mesh *m) RefPtr &ptr = get_lod(i, "Object::set_mesh").mesh; if(i==0 && ptr && lod0_watched) if(ResourceManager *rm = ptr->get_manager()) - rm->unwatch_resource(*ptr, *this); + rm->unobserve_resource(*ptr, *this); ptr = m; ptr.keep(); lod0_watched = false; @@ -67,7 +67,7 @@ void Object::set_mesh(unsigned i, const Mesh *m) if(i==0 && m) if(ResourceManager *rm = m->get_manager()) { - rm->watch_resource(*m, *this); + rm->observe_resource(*m, *this); lod0_watched = true; } diff --git a/source/pipeline.cpp b/source/pipeline.cpp index 9fcf3518..b98ddb8a 100644 --- a/source/pipeline.cpp +++ b/source/pipeline.cpp @@ -106,52 +106,6 @@ void Pipeline::set_multisample(unsigned s) } } -void Pipeline::set_camera(const Camera *c) -{ - camera = c; -} - -Pipeline::Pass &Pipeline::add_pass(const Tag &tag) -{ - passes.push_back(Pass(tag, 0)); - return passes.back(); -} - -void Pipeline::add_renderable(Renderable &r) -{ - for(vector::iterator i=renderables.begin(); i!=renderables.end(); ++i) - if(i->renderable==&r) - { - i->passes.clear(); - return; - } - - renderables.push_back(&r); -} - -void Pipeline::add_renderable_for_pass(Renderable &r, const Tag &tag) -{ - for(vector::iterator i=renderables.begin(); i!=renderables.end(); ++i) - if(i->renderable==&r) - { - i->passes.insert(tag); - return; - } - - renderables.push_back(&r); - renderables.back().passes.insert(tag); -} - -void Pipeline::remove_renderable(Renderable &r) -{ - for(vector::iterator i=renderables.begin(); i!=renderables.end(); ++i) - if(i->renderable==&r) - { - renderables.erase(i); - return; - } -} - Pipeline::Pass &Pipeline::add_pass(const Tag &tag, Renderable &r) { passes.push_back(Pass(tag, &r)); diff --git a/source/pipeline.h b/source/pipeline.h index d2ce6ab8..dd80ef3b 100644 --- a/source/pipeline.h +++ b/source/pipeline.h @@ -109,13 +109,6 @@ public: bool get_hdr() const { return hdr; } unsigned get_multisample() const { return samples; } - // Deprecated - void set_camera(const Camera *); - Pass &add_pass(const Tag &tag); - void add_renderable(Renderable &); - void add_renderable_for_pass(Renderable &, const Tag &); - void remove_renderable(Renderable &); - /** Adds a pass to the pipeline. It's permissible to add the same Renderable multiple times. */ Pass &add_pass(const Tag &, Renderable &); diff --git a/source/postprocessor.cpp b/source/postprocessor.cpp index 28ae71b0..f67bf4cf 100644 --- a/source/postprocessor.cpp +++ b/source/postprocessor.cpp @@ -3,20 +3,6 @@ #include "postprocessor.h" #include "shader.h" -namespace { - -const char fullscreen_vs_source[] = - "attribute vec4 vertex;\n" - "varying vec2 texcoord;\n" - "void main()\n" - "{\n" - " gl_Position = vertex;\n" - " texcoord = vertex.xy*0.5+0.5;\n" - "}\n"; - -} - - namespace Msp { namespace GL { @@ -25,12 +11,6 @@ void PostProcessor::render(Renderer &, const Texture2D &color, const Texture2D & render(color, depth); } -Shader &PostProcessor::get_fullscreen_vertex_shader() -{ - static VertexShader shader(fullscreen_vs_source); - return shader; -} - const Mesh &PostProcessor::get_fullscreen_quad() { static const Mesh &mesh = create_fullscreen_quad(); diff --git a/source/postprocessor.h b/source/postprocessor.h index 6e3153da..ae864c07 100644 --- a/source/postprocessor.h +++ b/source/postprocessor.h @@ -46,14 +46,6 @@ public: virtual void render(Renderer &, const Texture2D &, const Texture2D &); protected: - /** Returns a vertex shader suitable for rendering a full-screen quad. - Input vertices are assumed to be in normalized device coordinates; no - transform is performed. The shader provides a varying vec2 texcoord for - a fragment shader to access textures. - - Deprecated in favor of the builtin postprocess.glsl module. */ - static Shader &get_fullscreen_vertex_shader(); - /** Returns a mesh consisting of a single quad, covering the entire screen. The vertices are in normalized device coordinates. */ static const Mesh &get_fullscreen_quad(); diff --git a/source/renderer.cpp b/source/renderer.cpp index 62e5ced0..d01a1f0c 100644 --- a/source/renderer.cpp +++ b/source/renderer.cpp @@ -44,13 +44,6 @@ Renderer::~Renderer() end(); } -void Renderer::begin(const Camera *c) -{ - end(); - if(c) - set_camera(*c); -} - void Renderer::set_camera(const Camera &c) { state->camera = &c; diff --git a/source/renderer.h b/source/renderer.h index dd732bd8..3533139b 100644 --- a/source/renderer.h +++ b/source/renderer.h @@ -105,13 +105,6 @@ public: Renderer(const Camera *); ~Renderer(); - /** Resets all internal state and restarts rendering. There must be no - unpopped state in the stack. It is permissible to call begin() multiple - times without an intervening end(). - - Deprecated; use end() and set_camera() instead.*/ - void begin(const Camera *); - /** Sets the camera to render from. The modelview matrix is reset to the camera's view matrix. */ void set_camera(const Camera &); diff --git a/source/resourcemanager.h b/source/resourcemanager.h index 9dcd9b99..cf34a825 100644 --- a/source/resourcemanager.h +++ b/source/resourcemanager.h @@ -155,10 +155,6 @@ public: void observe_resource(const Resource &, ResourceObserver &); void unobserve_resource(const Resource &, ResourceObserver &); - // Deprecated names - void watch_resource(const Resource &r, ResourceObserver &o) { observe_resource(r, o); } - void unwatch_resource(const Resource &r, ResourceObserver &o) { unobserve_resource(r, o); } - void tick(); private: void dispatch_work(); diff --git a/source/resourcewatcher.h b/source/resourcewatcher.h deleted file mode 100644 index 5281d24d..00000000 --- a/source/resourcewatcher.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef MSP_GL_RESOURCEWATCHER_H_ -#define MSP_GL_RESOURCEWATCHER_H_ - -#include "resourceobserver.h" - -namespace Msp { -namespace GL { - -// Deprecated name -typedef ResourceObserver ResourceWatcher; - -} // namespace GL -} // namespace Msp - -#endif diff --git a/source/texture.h b/source/texture.h index bd000a32..3fa29f60 100644 --- a/source/texture.h +++ b/source/texture.h @@ -1,6 +1,7 @@ #ifndef MSP_GL_TEXTURE_H_ #define MSP_GL_TEXTURE_H_ +#include #include #include #include "datatype.h" @@ -176,7 +177,7 @@ public: void set_auto_generate_mipmap(bool); /// Deprecated. Use set_auto_generate_mipmap instead. - void set_generate_mipmap(bool g) { set_auto_generate_mipmap(g); } + DEPRECATED void set_generate_mipmap(bool g) { set_auto_generate_mipmap(g); } /** Sets depth texture comparison. Has no effect on other formats. When comparison is enabled, the third component of the texture coordinate is diff --git a/source/texture3d.h b/source/texture3d.h index 437c852a..679b6a50 100644 --- a/source/texture3d.h +++ b/source/texture3d.h @@ -71,7 +71,7 @@ public: height times its depth. Deprecated in favor of the base class version.*/ - void load_image(const std::string &fn, int dp = -1); + DEPRECATED void load_image(const std::string &fn, int dp = -1); using Texture::load_image; diff --git a/source/view.cpp b/source/view.cpp index 7ab41912..fe783110 100644 --- a/source/view.cpp +++ b/source/view.cpp @@ -24,12 +24,6 @@ void View::set_content(Renderable *r) content = r; } -void View::synchronize_camera_aspect(Camera &c) -{ - synced_cameras.push_back(&c); - c.set_aspect_ratio(get_aspect_ratio()); -} - void View::render() { Bind bind_fbo(target); diff --git a/source/view.h b/source/view.h index 24188de4..cf0f4d64 100644 --- a/source/view.h +++ b/source/view.h @@ -19,7 +19,6 @@ protected: Framebuffer ⌖ Camera *camera; Renderable *content; - std::list synced_cameras; View(Framebuffer &); @@ -31,10 +30,6 @@ public: void set_camera(Camera *); void set_content(Renderable *); - // Deprecated - float get_aspect() const { return get_aspect_ratio(); } - void synchronize_camera_aspect(Camera &); - virtual void render(); }; diff --git a/source/windowview.cpp b/source/windowview.cpp index 0927407a..a11f738c 100644 --- a/source/windowview.cpp +++ b/source/windowview.cpp @@ -27,8 +27,6 @@ void WindowView::window_resized(unsigned w, unsigned h) float aspect = static_cast(w)/h; if(camera) camera->set_aspect_ratio(aspect); - for(list::iterator i=synced_cameras.begin(); i!=synced_cameras.end(); ++i) - (*i)->set_aspect_ratio(aspect); } } // namespace GL