tiles2[62].SetOffset(Vector<int>(2, 0));
tiles2[63].SetOffset(Vector<int>(2, 0));
- Area areas[2];
- areas[0].SetTiles(tiles1, 64);
- areas[0].SetWidth(8);
- areas[1].SetTiles(tiles2, 64);
- areas[1].SetWidth(8);
+ Area areas1[2];
+ areas1[0].SetTiles(tiles1, 64);
+ areas1[0].SetWidth(8);
+ areas1[1].SetTiles(tiles2, 64);
+ areas1[1].SetWidth(8);
- Trigger triggers[1];
- triggers[0].SetTilePosition(Vector<int>(8, 3));
+ Trigger triggers1[1];
+ triggers1[0].SetTilePosition(Vector<int>(8, 3));
SDL_Surface *tilesetImg(IMG_Load("test-data/tileset.png"));
Sprite tileset(tilesetImg, tileSize, tileSize);
- Map map;
- map.SetAreas(areas, 2);
- map.SetTileset(&tileset);
- map.SetTriggers(triggers, 1);
- map.SetWidth(2);
+ Map map1;
+ map1.SetAreas(areas1, 2);
+ map1.SetTileset(&tileset);
+ map1.SetTriggers(triggers1, 1);
+ map1.SetWidth(2);
+
+ Tile tiles3[64];
+
+ tiles3[ 0].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_NORTH | Tile::BLOCK_WEST);
+ tiles3[ 1].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_NORTH);
+ tiles3[ 2].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_NORTH);
+ tiles3[ 3].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_NORTH);
+ tiles3[ 4].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_NORTH);
+ tiles3[ 5].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_NORTH);
+ tiles3[ 6].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_NORTH);
+ tiles3[ 7].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_NORTH | Tile::BLOCK_EAST);
+
+ tiles3[ 8].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_WEST);
+ tiles3[ 9].SetOffset(Vector<int>(3, 0));
+ tiles3[10].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_SOUTH);
+ tiles3[11].SetOffset(Vector<int>(4, 0)).SetFlags(Tile::BLOCK_SOUTH);
+ tiles3[12].SetOffset(Vector<int>(4, 0)).SetFlags(Tile::BLOCK_SOUTH);
+ tiles3[13].SetOffset(Vector<int>(4, 0)).SetFlags(Tile::BLOCK_SOUTH);
+ tiles3[14].SetOffset(Vector<int>(4, 0));
+ tiles3[15].SetOffset(Vector<int>(4, 0)).SetFlags(Tile::BLOCK_EAST | Tile::BLOCK_SOUTH);
+
+ tiles3[16].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_WEST);
+ tiles3[17].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_EAST);
+ tiles3[18].SetOffset(Vector<int>(0, 0));
+ tiles3[19].SetOffset(Vector<int>(1, 0));
+ tiles3[20].SetOffset(Vector<int>(1, 0));
+ tiles3[21].SetOffset(Vector<int>(3, 2));
+ tiles3[22].SetOffset(Vector<int>(4, 2)).SetFlags(Tile::BLOCK_EAST | Tile::BLOCK_SOUTH | Tile::BLOCK_WEST);
+ tiles3[23].SetOffset(Vector<int>(5, 2));
+
+ tiles3[24].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_WEST);
+ tiles3[25].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_EAST);
+ tiles3[26].SetOffset(Vector<int>(0, 1));
+ tiles3[27].SetOffset(Vector<int>(2, 0));
+ tiles3[28].SetOffset(Vector<int>(2, 0));
+ tiles3[29].SetOffset(Vector<int>(1, 2));
+ tiles3[30].SetOffset(Vector<int>(1, 2));
+ tiles3[31].SetOffset(Vector<int>(1, 2));
+
+ tiles3[32].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_WEST);
+ tiles3[33].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_EAST);
+ tiles3[34].SetOffset(Vector<int>(0, 1));
+ tiles3[35].SetOffset(Vector<int>(2, 0));
+ tiles3[36].SetOffset(Vector<int>(2, 0));
+ tiles3[37].SetOffset(Vector<int>(2, 3));
+ tiles3[38].SetOffset(Vector<int>(3, 3));
+ tiles3[39].SetOffset(Vector<int>(0, 3));
+
+ tiles3[40].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_WEST);
+ tiles3[41].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_EAST);
+ tiles3[42].SetOffset(Vector<int>(0, 1));
+ tiles3[43].SetOffset(Vector<int>(2, 0));
+ tiles3[44].SetOffset(Vector<int>(2, 0));
+ tiles3[45].SetOffset(Vector<int>(2, 4));
+ tiles3[46].SetOffset(Vector<int>(3, 4));
+ tiles3[47].SetOffset(Vector<int>(0, 4));
+
+ tiles3[48].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_WEST);
+ tiles3[49].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_EAST);
+ tiles3[50].SetOffset(Vector<int>(0, 1));
+ tiles3[51].SetOffset(Vector<int>(2, 0));
+ tiles3[52].SetOffset(Vector<int>(2, 0));
+ tiles3[53].SetOffset(Vector<int>(4, 1));
+ tiles3[54].SetOffset(Vector<int>(5, 1));
+ tiles3[55].SetOffset(Vector<int>(3, 1));
+
+ tiles3[56].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_SOUTH | Tile::BLOCK_WEST);
+ tiles3[57].SetOffset(Vector<int>(3, 0)).SetFlags(Tile::BLOCK_EAST | Tile::BLOCK_SOUTH);
+ tiles3[58].SetOffset(Vector<int>(0, 1));
+ tiles3[59].SetOffset(Vector<int>(2, 0));
+ tiles3[60].SetOffset(Vector<int>(2, 0));
+ tiles3[61].SetOffset(Vector<int>(2, 0));
+ tiles3[62].SetOffset(Vector<int>(2, 0));
+ tiles3[63].SetOffset(Vector<int>(2, 0));
+
+ Area areas2[1];
+ areas2[0].SetTiles(tiles3, 64);
+ areas2[0].SetWidth(8);
+
+ Trigger triggers2[1];
+ triggers2[0].SetTilePosition(Vector<int>(6, 2));
+
+ Map map2;
+ map2.SetAreas(areas2, 1);
+ map2.SetTileset(&tileset);
+ map2.SetTriggers(triggers2, 1);
+ map2.SetWidth(1);
SDL_Surface *mapMaximImg(IMG_Load("test-data/maxim-map.png"));
Sprite mapMaximSprite(mapMaximImg, 32, 64);
battleState->AddHero(dekar);
state = battleState;
} else {
- MapState *mapState(new MapState(&map));
+ MapState *mapState(new MapState(&map1));
mapState->AddEntity(&mapMaxim);
mapState->AddEntity(&mapSelan);