From: Daniel Karbach Date: Sat, 6 Oct 2012 21:45:57 +0000 (+0200) Subject: added second map to transition to X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=42e75a9b9341a7c0446e29431a08980eca7de8c1;p=l2e.git added second map to transition to --- diff --git a/src/main.cpp b/src/main.cpp index f4f6965..1507311 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -387,23 +387,110 @@ int main(int argc, char **argv) { tiles2[62].SetOffset(Vector(2, 0)); tiles2[63].SetOffset(Vector(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(8, 3)); + Trigger triggers1[1]; + triggers1[0].SetTilePosition(Vector(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(3, 0)).SetFlags(Tile::BLOCK_NORTH | Tile::BLOCK_WEST); + tiles3[ 1].SetOffset(Vector(3, 0)).SetFlags(Tile::BLOCK_NORTH); + tiles3[ 2].SetOffset(Vector(3, 0)).SetFlags(Tile::BLOCK_NORTH); + tiles3[ 3].SetOffset(Vector(3, 0)).SetFlags(Tile::BLOCK_NORTH); + tiles3[ 4].SetOffset(Vector(3, 0)).SetFlags(Tile::BLOCK_NORTH); + tiles3[ 5].SetOffset(Vector(3, 0)).SetFlags(Tile::BLOCK_NORTH); + tiles3[ 6].SetOffset(Vector(3, 0)).SetFlags(Tile::BLOCK_NORTH); + tiles3[ 7].SetOffset(Vector(3, 0)).SetFlags(Tile::BLOCK_NORTH | Tile::BLOCK_EAST); + + tiles3[ 8].SetOffset(Vector(3, 0)).SetFlags(Tile::BLOCK_WEST); + tiles3[ 9].SetOffset(Vector(3, 0)); + tiles3[10].SetOffset(Vector(3, 0)).SetFlags(Tile::BLOCK_SOUTH); + tiles3[11].SetOffset(Vector(4, 0)).SetFlags(Tile::BLOCK_SOUTH); + tiles3[12].SetOffset(Vector(4, 0)).SetFlags(Tile::BLOCK_SOUTH); + tiles3[13].SetOffset(Vector(4, 0)).SetFlags(Tile::BLOCK_SOUTH); + tiles3[14].SetOffset(Vector(4, 0)); + tiles3[15].SetOffset(Vector(4, 0)).SetFlags(Tile::BLOCK_EAST | Tile::BLOCK_SOUTH); + + tiles3[16].SetOffset(Vector(3, 0)).SetFlags(Tile::BLOCK_WEST); + tiles3[17].SetOffset(Vector(3, 0)).SetFlags(Tile::BLOCK_EAST); + tiles3[18].SetOffset(Vector(0, 0)); + tiles3[19].SetOffset(Vector(1, 0)); + tiles3[20].SetOffset(Vector(1, 0)); + tiles3[21].SetOffset(Vector(3, 2)); + tiles3[22].SetOffset(Vector(4, 2)).SetFlags(Tile::BLOCK_EAST | Tile::BLOCK_SOUTH | Tile::BLOCK_WEST); + tiles3[23].SetOffset(Vector(5, 2)); + + tiles3[24].SetOffset(Vector(3, 0)).SetFlags(Tile::BLOCK_WEST); + tiles3[25].SetOffset(Vector(3, 0)).SetFlags(Tile::BLOCK_EAST); + tiles3[26].SetOffset(Vector(0, 1)); + tiles3[27].SetOffset(Vector(2, 0)); + tiles3[28].SetOffset(Vector(2, 0)); + tiles3[29].SetOffset(Vector(1, 2)); + tiles3[30].SetOffset(Vector(1, 2)); + tiles3[31].SetOffset(Vector(1, 2)); + + tiles3[32].SetOffset(Vector(3, 0)).SetFlags(Tile::BLOCK_WEST); + tiles3[33].SetOffset(Vector(3, 0)).SetFlags(Tile::BLOCK_EAST); + tiles3[34].SetOffset(Vector(0, 1)); + tiles3[35].SetOffset(Vector(2, 0)); + tiles3[36].SetOffset(Vector(2, 0)); + tiles3[37].SetOffset(Vector(2, 3)); + tiles3[38].SetOffset(Vector(3, 3)); + tiles3[39].SetOffset(Vector(0, 3)); + + tiles3[40].SetOffset(Vector(3, 0)).SetFlags(Tile::BLOCK_WEST); + tiles3[41].SetOffset(Vector(3, 0)).SetFlags(Tile::BLOCK_EAST); + tiles3[42].SetOffset(Vector(0, 1)); + tiles3[43].SetOffset(Vector(2, 0)); + tiles3[44].SetOffset(Vector(2, 0)); + tiles3[45].SetOffset(Vector(2, 4)); + tiles3[46].SetOffset(Vector(3, 4)); + tiles3[47].SetOffset(Vector(0, 4)); + + tiles3[48].SetOffset(Vector(3, 0)).SetFlags(Tile::BLOCK_WEST); + tiles3[49].SetOffset(Vector(3, 0)).SetFlags(Tile::BLOCK_EAST); + tiles3[50].SetOffset(Vector(0, 1)); + tiles3[51].SetOffset(Vector(2, 0)); + tiles3[52].SetOffset(Vector(2, 0)); + tiles3[53].SetOffset(Vector(4, 1)); + tiles3[54].SetOffset(Vector(5, 1)); + tiles3[55].SetOffset(Vector(3, 1)); + + tiles3[56].SetOffset(Vector(3, 0)).SetFlags(Tile::BLOCK_SOUTH | Tile::BLOCK_WEST); + tiles3[57].SetOffset(Vector(3, 0)).SetFlags(Tile::BLOCK_EAST | Tile::BLOCK_SOUTH); + tiles3[58].SetOffset(Vector(0, 1)); + tiles3[59].SetOffset(Vector(2, 0)); + tiles3[60].SetOffset(Vector(2, 0)); + tiles3[61].SetOffset(Vector(2, 0)); + tiles3[62].SetOffset(Vector(2, 0)); + tiles3[63].SetOffset(Vector(2, 0)); + + Area areas2[1]; + areas2[0].SetTiles(tiles3, 64); + areas2[0].SetWidth(8); + + Trigger triggers2[1]; + triggers2[0].SetTilePosition(Vector(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); @@ -467,7 +554,7 @@ int main(int argc, char **argv) { battleState->AddHero(dekar); state = battleState; } else { - MapState *mapState(new MapState(&map)); + MapState *mapState(new MapState(&map1)); mapState->AddEntity(&mapMaxim); mapState->AddEntity(&mapSelan);