]> git.tdb.fi Git - libs/gl.git/commitdiff
Remove support for inline textures in RenderPass
authorMikko Rasa <tdb@tdb.fi>
Tue, 23 Jun 2020 16:38:56 +0000 (19:38 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 23 Jun 2020 22:24:33 +0000 (01:24 +0300)
The datafile system has advanced sufficiently that this particular case
of inlining is no longer needed.

source/renderpass.cpp
source/renderpass.h

index b6eb1d954a958990716a730fd90702ee5341f092..97a0970b6f627e55d958f2860e7d16155807f3bd 100644 (file)
@@ -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<Texture>(name);
-       tex.keep();
-}
-
-void RenderPass::TextureLoader::texture2d()
-{
-       tex = new Texture2D;
-       if(coll)
-               load_sub(static_cast<Texture2D &>(*tex), get_collection());
-       else
-               load_sub(static_cast<Texture2D &>(*tex));
+       obj.attach(index, get_collection().get<Texture>(name));
 }
 
 } // namespace GL
index 428c74ce7b1f280046e4268b66ec7005d2cf7a4c..7a2f65688104015afe9650b4b5b6e5814a84a95f 100644 (file)
@@ -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<Texture> tex;
 
        public:
                TextureLoader(Texturing &, unsigned, Collection *);
        private:
-               virtual void finish();
-
                void texture(const std::string &);
-               void texture2d();
        };
 
        RefPtr<const Program> shprog;