From c8f98daaaba04ba93d6d7170302d8b91c3410fa5 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 18 Oct 2014 00:14:27 +0300 Subject: [PATCH] Replace Texturing::Attachment with a simple Texture pointer No point to have the struct now that TexEnv is gone. --- source/texturing.cpp | 12 +++--------- source/texturing.h | 9 +-------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/source/texturing.cpp b/source/texturing.cpp index db8ee653..093c602e 100644 --- a/source/texturing.cpp +++ b/source/texturing.cpp @@ -31,7 +31,7 @@ void Texturing::set_attachment(unsigned attch, const Texture *tex) if(attachments.size()<=attch) attachments.resize(attch+1); - attachments[attch].tex = tex; + attachments[attch] = tex; if(current()==this) bind_attachment(attch); @@ -39,9 +39,8 @@ void Texturing::set_attachment(unsigned attch, const Texture *tex) void Texturing::bind_attachment(unsigned i) const { - const Attachment &attch = attachments[i]; - if(attch.tex) - attch.tex->bind_to(i); + if(const Texture *tex = attachments[i]) + tex->bind_to(i); else Texture::unbind_from(i); } @@ -76,10 +75,5 @@ void Texturing::unbind() } } - -Texturing::Attachment::Attachment(): - tex(0) -{ } - } // namespace GL } // namespace Msp; diff --git a/source/texturing.h b/source/texturing.h index daeb2bb8..34141c64 100644 --- a/source/texturing.h +++ b/source/texturing.h @@ -12,14 +12,7 @@ class Texture; class Texturing: public Bindable { private: - struct Attachment - { - const Texture *tex; - - Attachment(); - }; - - std::vector attachments; + std::vector attachments; public: ~Texturing(); -- 2.43.0