ZRect/ZImage problems

This commit is contained in:
James Turk 2003-01-08 06:07:06 +00:00
parent 586ecd6d9f
commit d4bb0e5c3d
3 changed files with 6 additions and 7 deletions

View File

@ -13,7 +13,7 @@
File: ZE_ZImage.cpp <br> File: ZE_ZImage.cpp <br>
Description: Implementation source file for core ZEngine Image or Texture Object. <br> Description: Implementation source file for core ZEngine Image or Texture Object. <br>
Author(s): James Turk, Gamer Tazar <br> Author(s): James Turk, Gamer Tazar <br>
$Id: ZE_ZImage.cpp,v 1.12 2003/01/07 06:11:26 cozman Exp $<br> $Id: ZE_ZImage.cpp,v 1.13 2003/01/08 06:07:06 cozman Exp $<br>
\file ZE_ZImage.cpp \file ZE_ZImage.cpp
\brief Source file for ZImage. \brief Source file for ZImage.
@ -204,7 +204,6 @@ void ZImage::Draw(float x, float y)
glTexCoord2f(rTexMinX,rTexMaxY); glVertex2f(x,y+rHeight); glTexCoord2f(rTexMinX,rTexMaxY); glVertex2f(x,y+rHeight);
glTexCoord2f(rTexMaxX,rTexMaxY); glVertex2f(x+rWidth,y+rHeight); glTexCoord2f(rTexMaxX,rTexMaxY); glVertex2f(x+rWidth,y+rHeight);
glEnd(); glEnd();
glBindTexture(GL_TEXTURE_2D,0); //reset to blank texture
} }
void ZImage::DrawRotated(int x, int y, float angle) void ZImage::DrawRotated(int x, int y, float angle)

View File

@ -13,7 +13,7 @@
File: ZE_ZRect.cpp <br> File: ZE_ZRect.cpp <br>
Description: Implementation source file for core ZEngine Rectangle Object. <br> Description: Implementation source file for core ZEngine Rectangle Object. <br>
Author(s): James Turk <br> Author(s): James Turk <br>
$Id: ZE_ZRect.cpp,v 1.5 2003/01/07 05:44:32 cozman Exp $<br> $Id: ZE_ZRect.cpp,v 1.6 2003/01/08 06:07:07 cozman Exp $<br>
\file ZE_ZRect.cpp \file ZE_ZRect.cpp
\brief Source file for ZRect. \brief Source file for ZRect.
@ -80,7 +80,7 @@ bool ZRect::operator<(const ZRect &rhs) const
else if(rWidth > rhs.Width()) else if(rWidth > rhs.Width())
return false; return false;
else else
return false; //nothing left to check they are == return false; //nothing left to check, they are ==
} }
} }
} }
@ -88,6 +88,7 @@ bool ZRect::operator<(const ZRect &rhs) const
void ZRect::Draw(Uint8 red, Uint8 green, Uint8 blue, Uint8 alpha) void ZRect::Draw(Uint8 red, Uint8 green, Uint8 blue, Uint8 alpha)
{ {
glBindTexture(GL_TEXTURE_2D,0); //reset to blank texture
glColor4ub(red,green,blue,alpha); glColor4ub(red,green,blue,alpha);
glBegin(GL_QUADS); glBegin(GL_QUADS);
glVertex2f(rX, rY); glVertex2f(rX, rY);
@ -95,7 +96,7 @@ void ZRect::Draw(Uint8 red, Uint8 green, Uint8 blue, Uint8 alpha)
glVertex2f(rX+rWidth, rY+rHeight); glVertex2f(rX+rWidth, rY+rHeight);
glVertex2f(rX, rY+rHeight); glVertex2f(rX, rY+rHeight);
glEnd(); glEnd();
glColor4ub(255,255,255,255); glColor4ub(255,255,255,255); //restore color setting
} }
void ZRect::Move(float x, float y) void ZRect::Move(float x, float y)

View File

@ -8,7 +8,7 @@
and the home of this Library is http://www.zengine.sourceforge.net and the home of this Library is http://www.zengine.sourceforge.net
*******************************************************************************/ *******************************************************************************/
/*$Id: ZRectTest.cpp,v 1.13 2003/01/04 05:18:51 cozman Exp $*/ /*$Id: ZRectTest.cpp,v 1.14 2003/01/08 06:07:07 cozman Exp $*/
#include <ZEngine.h> #include <ZEngine.h>
#include <string> #include <string>
@ -69,7 +69,6 @@ void Test()
} }
engine->Clear(); engine->Clear();
LogError(FormatStr("FPS=%.2f",1/engine->GetFrameTime()));
moveRect.Draw(255,0,0,128); moveRect.Draw(255,0,0,128);
stillRect.Draw(0,0,255,128); stillRect.Draw(0,0,255,128);
moveRect.Intersection(stillRect).Draw(0,255,0); moveRect.Intersection(stillRect).Draw(0,255,0);