* Use some more constants instead of literals.
authorMatthijs Kooijman <m.kooijman@student.utwente.nl>
Mon, 11 Jun 2007 20:40:59 +0000 (22:40 +0200)
committerMatthijs Kooijman <m.kooijman@student.utwente.nl>
Mon, 11 Jun 2007 20:40:59 +0000 (22:40 +0200)
 * Make Tiles draw themselves.

ABM2/Playground.cpp
ABM2/main.cpp

index 27f1f72ee591df6d8e244bdddfd71116348ce17a..9f66d7286a4c530701df977b9170b542f6ef23e0 100755 (executable)
@@ -507,6 +507,11 @@ Tile::~Tile()
 }\r
 void Tile::Draw()\r
 {\r
+       this->sprite->blit(\r
+               PLAYGROUND_BORDER_LEFT + this->col * FIELD_UNIT_WIDTH,\r
+               PLAYGROUND_BORDER_TOP + this->row * FIELD_UNIT_HEIGHT,\r
+               1.0, 1.0, this->subsprite, 0, COLOUR_RGBA(0, 0, 0, 255)\r
+       );\r
 #ifdef WIN32\r
        D3DXVECTOR3 center(0.0f, 0.0f, 0.0f);    // center at the upper-left corner\r
        D3DXVECTOR3 position((FLOAT)PLAYGROUND_BORDER_LEFT+subitem_width*col, (FLOAT)PLAYGROUND_BORDER_TOP+subitem_height*row, 0.0f);    // position at 50, 50 with no depth\r
index ed5e35f43ecc30fced089788e1c313be1ed07975..66f44f96f44e538283b34931bdd5b7e29fc0bffd 100755 (executable)
@@ -15,8 +15,8 @@
 #define SCREEN_HEIGHT 480\r
 \r
 SpriteData defaultSprites[] = {\r
-       {SPR_FIELD, "Data/FIELD0.png", 640, 480},\r
-       {SPR_TILE, "Data/Tiles0.png", 40, 36},\r
+       {SPR_FIELD, "Data/FIELD0.png", SCREEN_WIDTH, SCREEN_HEIGHT},\r
+       {SPR_TILE, "Data/Tiles0.png", FIELD_UNIT_WIDTH, FIELD_UNIT_HEIGHT},\r
        {SPR_NONE, NULL, 0, 0}\r
 };\r
 \r