From c0108c1022ede4743247081f408ca7780095e520 Mon Sep 17 00:00:00 2001 From: pixel Date: Mon, 7 Apr 2003 22:44:33 +0000 Subject: Strange bugs... --- include/Makefile.am | 2 +- include/sprite.h | 2 +- lib/base.cc | 4 ++-- lib/glsprite.cc | 4 +++- lib/sprite.cc | 6 ++---- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/Makefile.am b/include/Makefile.am index 60c38b6..1e67880 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,5 +1,5 @@ pkginclude_HEADERS = \ engine.h glbase.h glfont.h glshape.h glwidgets.h sprite.h \ -base.h font.h shape.h mcolor.h glsprite.h +base.h font.h shape.h mcolor.h glsprite.h texture.h noinst_HEADERS = gettext.h diff --git a/include/sprite.h b/include/sprite.h index c9e6653..feb9e51 100644 --- a/include/sprite.h +++ b/include/sprite.h @@ -13,7 +13,7 @@ namespace mogltk { Sprite(Handle *, int, int); Sprite(Uint8 *, int, int); virtual ~Sprite(); - void draw(int, int, ColorP = WHITE); + virtual void draw(int, int, ColorP = WHITE); protected: void Bind(); int GetSX(); diff --git a/lib/base.cc b/lib/base.cc index 310dde3..8c1c862 100644 --- a/lib/base.cc +++ b/lib/base.cc @@ -28,7 +28,7 @@ mogltk::base::base(int w, int h, int flags) throw(GeneralException) : surface(0) printm(M_INFO, "Video resolution: %dx%dx%d (ratio = %3.2f)\n", surface->w, surface->h, surface->format->BitsPerPixel, ratio); - SDL_ShowCursor(0); + SDL_ShowCursor(SDL_DISABLE); SDL_FillRect(surface, NULL, 0); SDL_Flip(surface); SDL_FillRect(surface, NULL, 0); @@ -57,7 +57,7 @@ mogltk::base::base(int w, int h, int flags, int) : surface(0) { width = w; height = h; - SDL_ShowCursor(0); + SDL_ShowCursor(SDL_DISABLE); } void mogltk::base::setsurface(SDL_Surface * _surface) throw (GeneralException) { diff --git a/lib/glsprite.cc b/lib/glsprite.cc index 01faada..3ccb2bd 100644 --- a/lib/glsprite.cc +++ b/lib/glsprite.cc @@ -21,9 +21,11 @@ void mogltk::glSprite::draw(int dx, int dy, ColorP c) { if (!was2D) mogltk::engine::glbase_o->Enter2DMode(); - + + printm(M_INFO, "Drawing gl Sprite at %i %i\n", dx, dy); c.Bind(); + printm(M_INFO, "Drawing sprite texture...\n"); Bind(); glBegin(GL_TRIANGLE_STRIP); glTexCoord2i(GetPX() , GetPY() ); glVertex2i(dx , dy ); diff --git a/lib/sprite.cc b/lib/sprite.cc index 74ea522..7e94ce5 100644 --- a/lib/sprite.cc +++ b/lib/sprite.cc @@ -52,9 +52,7 @@ void mogltk::Sprite::alloc() { } if (!found) { -#ifdef DEBUG printm(M_INFO, "Allocating a new texture for sprites\n"); -#endif posx = posy = 0; p = new TexList(TEXSIZE); } @@ -66,7 +64,7 @@ mogltk::Sprite::TexList::TexList(int size) { tex = new texture(size, size, true); if (header) - header->next->prev = this; + header->prev = this; prev = 0; next = header; header = this; @@ -142,7 +140,7 @@ void mogltk::Sprite::draw(int dx, int dy, ColorP c) { src.x = posx; src.y = posy; src.w = sx; src.h = sy; dst.x = dx; dst.y = dy; dst.w = sx; dst.h = sy; - printm(M_INFO, "Drawing sprite at %i %i\n", dx, dy); + printm(M_INFO, "Drawing SDL sprite at %i %i\n", dx, dy); SDL_BlitSurface(tlist->GetSurface(), &src, mogltk::engine::base_o->getsurface(), &dst); -- cgit v1.2.3