diff --git a/doomsday/client/src/resource/resourcesystem.cpp b/doomsday/client/src/resource/resourcesystem.cpp index ced0818606..450d39b2e1 100644 --- a/doomsday/client/src/resource/resourcesystem.cpp +++ b/doomsday/client/src/resource/resourcesystem.cpp @@ -759,20 +759,20 @@ DENG2_PIMPL(ResourceSystem) bool cacheGroups = true) { // Already in the queue? - bool isQueued = false; + bool alreadyQueued = false; foreach(CacheTask *baseTask, cacheQueue) { if(MaterialCacheTask *task = dynamic_cast(baseTask)) { if(&material == task->material && &contextSpec == task->spec) { - isQueued = true; + alreadyQueued = true; break; } } } - if(!isQueued) + if(!alreadyQueued) { cacheQueue.append(new MaterialCacheTask(material, contextSpec)); } diff --git a/doomsday/client/src/resource/texture.cpp b/doomsday/client/src/resource/texture.cpp index c95fd725bd..83a4e29896 100644 --- a/doomsday/client/src/resource/texture.cpp +++ b/doomsday/client/src/resource/texture.cpp @@ -91,11 +91,6 @@ Texture::~Texture() { DENG2_FOR_AUDIENCE(Deletion, i) i->textureBeingDeleted(*this); -#ifdef __CLIENT__ - /// @todo ResourceSystem should observe Deletion. - App_ResourceSystem().releaseGLTexturesFor(*this); -#endif - if(!manifest().schemeName().compareWithoutCase("Textures")) { CompositeTexture *pcTex = reinterpret_cast(userDataPointer()); diff --git a/doomsday/client/src/resource/texturevariant.cpp b/doomsday/client/src/resource/texturevariant.cpp index d5c85cc886..54fdee94b6 100644 --- a/doomsday/client/src/resource/texturevariant.cpp +++ b/doomsday/client/src/resource/texturevariant.cpp @@ -263,34 +263,35 @@ String TextureVariantSpec::asText() const DENG2_PIMPL(Texture::Variant) { - /// Superior Texture of which this is a derivative. - Texture &texture; + Texture &texture; /// The base for which "this" is a context derivative. + TextureVariantSpec const &spec; /// Usage context specification. + Flags flags; - /// Specification used to derive this variant. - TextureVariantSpec const &spec; - - /// Variant flags. - Texture::Variant::Flags flags; - - /// Source of this texture. - res::Source texSource; + res::Source texSource; ///< Logical source of the image. /// Name of the associated GL texture object. + /// @todo Use GLTexture uint glTexName; /// Prepared coordinates for the bottom right of the texture minus border. float s, t; - Instance(Public *i, Texture &generalCase, - TextureVariantSpec const &spec) : Base(i), - texture(generalCase), - spec(spec), - flags(0), - texSource(res::None), - glTexName(0), - s(0), - t(0) + Instance(Public *i, Texture &generalCase, TextureVariantSpec const &spec) + : Base(i) + , texture(generalCase) + , spec(spec) + , flags(0) + , texSource(res::None) + , glTexName(0) + , s(0) + , t(0) {} + + ~Instance() + { + // Release any GL texture we may have prepared. + self.release(); + } }; Texture::Variant::Variant(Texture &generalCase, TextureVariantSpec const &spec)