From 2ce366684532475971543bfdfa7abeb001354371 Mon Sep 17 00:00:00 2001 From: pixel Date: Thu, 6 Feb 2003 18:59:03 +0000 Subject: Writing NTEX support... --- lib/gltexture.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lib') diff --git a/lib/gltexture.cc b/lib/gltexture.cc index 76cfe5a..b674c50 100644 --- a/lib/gltexture.cc +++ b/lib/gltexture.cc @@ -4,8 +4,11 @@ #include #include "gltexture.h" #include "engine.h" - +#ifdef HAVE_CONFIG_H +#include "config.h" +#else #define _(x) x +#endif #define DEBUG 1 @@ -55,16 +58,15 @@ mogltk::texture::texture(Handle * h, bool plane) throw (GeneralException) : SDL_Surface * temp; -#if 0 +#if USE_SDLIMAGE if (!(temp = IMG_Load_RW(engine::RWFromHandle(h), 1))) throw GeneralException(_("Can't load image from Handle ") + h->GetName()); - - width = temp->w; - height = temp->h; #else - width = 256; - height = 256; + if (!(temp = LoadNTEX(h))) + throw GeneralException(_("Can't load texture from Handle ") + h->GetName()); #endif + width = temp->w; + height = temp->h; if ((BITCOUNT(width) != 1) || (BITCOUNT(height) != 1)) { SDL_FreeSurface(temp); @@ -88,10 +90,8 @@ mogltk::texture::texture(Handle * h, bool plane) throw (GeneralException) : throw GeneralException(_("Can't create RGB Surface")); } -#if 0 SDL_BlitSurface(temp, 0, surface, 0); SDL_FreeSurface(temp); -#endif #ifdef TRACE_TEXTURES next = 0; -- cgit v1.2.3