git repos / saland

commit 8328a07b

sago007 · 2020-07-15 14:14
8328a07b2d1c5e9f2b4e2b0733ed792f4e05d420 patch · browse files
parent 0e5612e2a22ff02cba94bc5aaab89f2e5da18d71

Add template for a forrest region

Changed files

A data/maps/template_forrest.tmx
M src/saland/GameRegion.cpp before
diff --git a/data/maps/template_forrest.tmx b/data/maps/template_forrest.tmx new file mode 100644 index 0000000..30f74ea --- /dev/null +++ b/data/maps/template_forrest.tmx
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<map version="1.2" tiledversion="1.3.2" orientation="orthogonal" renderorder="right-down" compressionlevel="0" width="100" height="100" tilewidth="32" tileheight="32" infinite="0" nextlayerid="5" nextobjectid="12">
+ <tileset firstgid="1" source="terrain.tsx"/>
+ <tileset firstgid="1025" name="city_outside" tilewidth="32" tileheight="32" tilecount="432" columns="24">
+ <image source="../textures/city_outside.png" width="768" height="576"/>
+ </tileset>
+ <layer id="1" name="ground_1" width="100" height="100">
+ <data encoding="base64" compression="zlib">
+ eAHt2zEKACAIAEB7q/3/DfUAxwSDG1wcJOIGBc0VkcIfMMAAAwwwwAADDDDAAAMMMMAAAwwwwAADDDDAAAMMMMAAAwwwwAADDDDAAAMMMMAAAwwwwAADDDDAAAMMXAObAw4YYIABBhhggIHvDVQ9XZVzY+zOmgEGGGCAAQYYYIABBhhggAEGGGCAAQYYYIABBhhggAEGGGCAAQYYYIABBqYYsOPE4hSL3sEiAwwwwAADDDDAAAMMdBswAzPWbUx9xhhggAEGGGCAAQYYYIABBhhggAEGGGCAAQYYYIABBhhggAEGGGCAAQYYYIABBhhggIG3Bg4x3kMn
+ </data>
+ </layer>
+ <layer id="2" name="ground_2" width="100" height="100">
+ <data encoding="base64" compression="zlib">
+ eAHt0DEBAAAAwqD1T+1lC4hAYcCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMDABwacQAAB
+ </data>
+ </layer>
+ <layer id="3" name="blocking" width="100" height="100">
+ <data encoding="base64" compression="zlib">
+ eAHt0DEBAAAAwqD1T+1lC4hAYcCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMCAAQMGDBgwYMDABwacQAAB
+ </data>
+ </layer>
+ <objectgroup id="4" name="object1">
+ <object id="9" name="Player" type="playerStart" x="1894.29" y="1207.01"/>
+ </objectgroup>
+</map>
diff --git a/src/saland/GameRegion.cpp b/src/saland/GameRegion.cpp index 09e2f18..92c0d1d 100644 --- a/src/saland/GameRegion.cpp +++ b/src/saland/GameRegion.cpp
@@ -122,6 +122,9 @@ void GameRegion::Init(int x, int y, const std::string& worldName, bool forceRese
std::string loadMap = mapFileName;
if (!sago::FileExists(loadMap.c_str()) || forceResetWorld) {
loadMap = "maps/sample1.tmx";
+ if (region_x == -1 && region_y == 0) {
+ loadMap = "maps/template_forrest.tmx";
+ }
if (region_x == 0 && region_y == -2) {
loadMap = "maps/city_0x-2.tmx";
}