summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorpixel <pixel>2003-02-06 18:59:03 +0000
committerpixel <pixel>2003-02-06 18:59:03 +0000
commit2ce366684532475971543bfdfa7abeb001354371 (patch)
tree736cfb96165ec4e484db8145e53cc856d53cfbbc /lib
parentbb32e12dbbcae1703a7998579eeac21bad6386b4 (diff)
Writing NTEX support...
Diffstat (limited to 'lib')
-rw-r--r--lib/gltexture.cc18
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;