X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=ABM2%2FAmaltheia%2FSprite.cpp;h=155960e3db36de859b13464dc3aa4e3d7272c8cb;hb=7e17dd0a93c740a3a88a06fddc2e72855cee9798;hp=a8c10a869d2c171150f070118ec695f499d43064;hpb=9dae6dd1f05eed22b6ce5e75bd1e5893d5ee1ac6;p=matthijs%2FABM2.git diff --git a/ABM2/Amaltheia/Sprite.cpp b/ABM2/Amaltheia/Sprite.cpp index a8c10a8..155960e 100644 --- a/ABM2/Amaltheia/Sprite.cpp +++ b/ABM2/Amaltheia/Sprite.cpp @@ -22,7 +22,6 @@ #include -Graphics *gr; float z_order = 1.0; @@ -42,14 +41,14 @@ void Sprite::glEnter2DMode() glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // glBlendFunc(GL_SRC_ALPHA, GL_ONE); - glViewport(0, 0, gr->getWidth(), gr->getHeight()); + glViewport(0, 0, this->g->getWidth(), this->g->getHeight()); glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); - glOrtho(0.0, (GLdouble)gr->getWidth(), (GLdouble)gr->getHeight(), 0.0, 0.0, -2.0); -// gluOrtho2D(0.0, (GLdouble)gr->getWidth(), (GLdouble)gr->getHeight(), 0.0); + glOrtho(0.0, (GLdouble)this->g->getWidth(), (GLdouble)this->g->getHeight(), 0.0, 0.0, -2.0); +// gluOrtho2D(0.0, (GLdouble)this->g->getWidth(), (GLdouble)this->g->getHeight(), 0.0); glMatrixMode(GL_MODELVIEW); glPushMatrix(); @@ -78,8 +77,8 @@ Sprite::Sprite( char * filename, colour key, int tw, int th, Graphics *g) tileHeight=th; glAlphaFunc(GL_NOTEQUAL, 0); - glEnable(GL_ALPHA_TEST); - tex = new Texture(filename, key, g); + glEnable(GL_ALPHA_TEST); + tex = new Texture(filename, key, g); texW = tex->getWidth(); texH = tex->getHeight(); @@ -99,7 +98,7 @@ Sprite::~Sprite(void) void Sprite::blit(int x, int y, float scalex, float scaley, int dx, int dy, colour col) { - z_order-=0.000001; + z_order-=0.0001; glEnter2DMode(); // glColor4ub((colour & 0x00FF0000) >> 16, (colour & 0x0000FF00) >> 8, // (colour & 0x000000FF), (colour & 0xFF000000) >> 24);