From bf452e7f6a3fa0e41964fc8e2c57e1e577cd1682 Mon Sep 17 00:00:00 2001 From: pixel Date: Sun, 20 Jun 2004 23:51:59 +0000 Subject: Put some modifications in the overall. Font to texture doesn't work though. --- lib/texture.cc | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'lib/texture.cc') diff --git a/lib/texture.cc b/lib/texture.cc index d7cfa7c..a8036bc 100644 --- a/lib/texture.cc +++ b/lib/texture.cc @@ -11,10 +11,8 @@ #define DEBUG 1 -#ifdef TRACE_TEXTURES mogltk::texture * mogltk::texture::header = 0; mogltk::texture * mogltk::texture::footer = 0; -#endif mogltk::texture * mogltk::texture::active = 0; @@ -41,7 +39,6 @@ mogltk::texture::texture(int w, int h, bool plane) throw (GeneralException) : wi SDL_FillRect(surface, 0, 0); -#ifdef TRACE_TEXTURES next = 0; prev = footer; footer = this; @@ -51,7 +48,6 @@ mogltk::texture::texture(int w, int h, bool plane) throw (GeneralException) : wi if (prev) { prev->next = this; } -#endif } mogltk::texture::texture(Handle * h, bool plane) throw (GeneralException) : @@ -107,7 +103,6 @@ mogltk::texture::texture(Handle * h, bool plane) throw (GeneralException) : SDL_FreeSurface(temp); -#ifdef TRACE_TEXTURES next = 0; prev = footer; footer = this; @@ -117,7 +112,6 @@ mogltk::texture::texture(Handle * h, bool plane) throw (GeneralException) : if (prev) { prev->next = this; } -#endif } mogltk::texture::~texture() { @@ -129,7 +123,6 @@ mogltk::texture::~texture() { glDeleteTextures(1, &tex); } -#ifdef TRACE_TEXTURES if (prev) { prev->next = next; } @@ -145,7 +138,6 @@ mogltk::texture::~texture() { if (this == header) { header = next; } -#endif } Uint32 * mogltk::texture::GetPixels() { @@ -215,7 +207,6 @@ void mogltk::texture::Bind(bool expand) { active = this; -#ifdef TRACE_TEXTURES if (header == this) return; @@ -231,9 +222,10 @@ void mogltk::texture::Bind(bool expand) { footer = prev; } + next = header; + prev = 0; header->prev = this; header = this; -#endif } GLuint mogltk::texture::GetWidth() { @@ -256,6 +248,17 @@ void mogltk::texture::Taint(void) { tainted = true; } +void mogltk::texture::Taintall(void) { + if (header) + header->recTaint(); +} + +void mogltk::texture::recTaint(void) { + Taint(); + if (next) + next->recTaint(); +} + #ifdef WORDS_BIGENDIAN #define NTEX_SIGNATURE 0x4e544558 #else -- cgit v1.2.3