diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/gltexture.cc | 18 | 
1 files changed, 9 insertions, 9 deletions
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 <generic.h>  #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;  | 
