From: Mikko Rasa Date: Tue, 23 Jun 2020 16:38:56 +0000 (+0300) Subject: Remove support for inline textures in RenderPass X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=b4b7ee4b3b767b8cc097ffe8205c71f3afbe5d39;p=libs%2Fgl.git Remove support for inline textures in RenderPass The datafile system has advanced sufficiently that this particular case of inlining is no longer needed. --- diff --git a/source/renderpass.cpp b/source/renderpass.cpp index b6eb1d95..97a0970b 100644 --- a/source/renderpass.cpp +++ b/source/renderpass.cpp @@ -248,31 +248,11 @@ RenderPass::TextureLoader::TextureLoader(Texturing &t, unsigned i, Collection *c index(i) { add("texture", &TextureLoader::texture); - add("texture2d", &TextureLoader::texture2d); -} - -void RenderPass::TextureLoader::finish() -{ - if(tex) - { - obj.attach(index, *tex); - tex.release(); - } } void RenderPass::TextureLoader::texture(const string &name) { - tex = &get_collection().get(name); - tex.keep(); -} - -void RenderPass::TextureLoader::texture2d() -{ - tex = new Texture2D; - if(coll) - load_sub(static_cast(*tex), get_collection()); - else - load_sub(static_cast(*tex)); + obj.attach(index, get_collection().get(name)); } } // namespace GL diff --git a/source/renderpass.h b/source/renderpass.h index 428c74ce..7a2f6568 100644 --- a/source/renderpass.h +++ b/source/renderpass.h @@ -17,8 +17,6 @@ class Texturing; /** Encapsulates the data that determines the appearance of a rendered surface. This includes shader and data for it, material and texturing. - -XXX Does not delete inline texture from datafiles properly */ class RenderPass { @@ -48,15 +46,11 @@ private: { private: unsigned index; - RefPtr tex; public: TextureLoader(Texturing &, unsigned, Collection *); private: - virtual void finish(); - void texture(const std::string &); - void texture2d(); }; RefPtr shprog;