From 6b63855d6e31a4d63ced9c803847ee35c70ee514 Mon Sep 17 00:00:00 2001 From: pixel Date: Sun, 9 Feb 2003 19:29:34 +0000 Subject: Whoups.. --- include/gltexture.h | 5 ++++- lib/gltexture.cc | 6 +++--- src/test.cc | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/include/gltexture.h b/include/gltexture.h index 2a5ab0b..bcfed2d 100644 --- a/include/gltexture.h +++ b/include/gltexture.h @@ -7,10 +7,13 @@ #include namespace mogltk { + enum texture_type { + RAW_RGBA, + }; class texture : public Base { public: texture(int = 256, int = 256, bool = false) throw (GeneralException); - texture(Handle *, bool = false) throw (GeneralException); + texture(Handle *, bool = false, texture_type = RAW_RGBA) throw (GeneralException); virtual ~texture(); SDL_Surface * GetSurface(); void Generate(); diff --git a/lib/gltexture.cc b/lib/gltexture.cc index b674c50..601d24f 100644 --- a/lib/gltexture.cc +++ b/lib/gltexture.cc @@ -21,7 +21,7 @@ mogltk::texture * mogltk::texture::active = 0; mogltk::texture::texture(int w, int h, bool plane) throw (GeneralException) : width(w), height(h), texture_allocated(false), planar(plane), tainted(true) { - if ((BITCOUNT(w) != 1) || (BITCOUNT(h) != 1)) + if ((!ISPOT(w)) || (!ISPOT(h))) throw GeneralException(_("Size of the texture not a power of 2!")); if (!(surface = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 32, @@ -53,7 +53,7 @@ mogltk::texture::texture(int w, int h, bool plane) throw (GeneralException) : wi #endif } -mogltk::texture::texture(Handle * h, bool plane) throw (GeneralException) : +mogltk::texture::texture(Handle * h, bool plane, texture_type ttype) throw (GeneralException) : texture_allocated(false), planar(plane), tainted(true) { SDL_Surface * temp; @@ -68,7 +68,7 @@ mogltk::texture::texture(Handle * h, bool plane) throw (GeneralException) : width = temp->w; height = temp->h; - if ((BITCOUNT(width) != 1) || (BITCOUNT(height) != 1)) { + if ((!ISPOT(width)) || (!ISPOT(height))) { SDL_FreeSurface(temp); throw GeneralException(_("Size of the texture not a power of 2!")); } diff --git a/src/test.cc b/src/test.cc index a25f7a1..0bb2fde 100644 --- a/src/test.cc +++ b/src/test.cc @@ -12,13 +12,14 @@ CODE_BEGINS virtual int startup() throw (GeneralException) { verbosity = M_INFO; mogltk::glbase::setup(); + new Archive("datas.paq"); Input * fonte = new Input("font-2.bin"); mogltk::font font(fonte); delete fonte; verbosity = M_INFO; - Input * pattern = new Input("pattern6.bmp"); + Input * pattern = new Input("pattern6.rgba"); mogltk::texture * mytex = new mogltk::texture(pattern, true); delete pattern; -- cgit v1.2.3