diff --git a/Crawler/Crawler.cpp b/Crawler/Crawler.cpp index b25ec06d..27880b8a 100644 --- a/Crawler/Crawler.cpp +++ b/Crawler/Crawler.cpp @@ -1385,7 +1385,48 @@ void Crawler::InitializeLevel(std::string mapFile,MapName map){ MAP_TILESETS["assets/maps/"+baseSourceDir].animationData=tileset.GetData().AnimationData; MAP_TILESETS["assets/maps/"+baseSourceDir].reflectiveData=tileset.GetData().ReflectiveData; std::cout<<"assets/maps/"+baseSourceDir<<" Animation Data Size: "<Load("assets/maps/"+tileset.GetData().ImageData.data["source"]); + std::string mapPath="assets/maps/"+tileset.GetData().ImageData.data["source"]; + if(std::filesystem::exists(mapPath)){ + r->Load(mapPath); + }else{ + std::cout<<"WARNING! "<Create(tileset.GetData().imagewidth,tileset.GetData().imageheight); + SetDrawTarget(r->Sprite()); + int tileXCount=tileset.GetData().imagewidth/tileset.GetData().tilewidth; + int tileYCount=tileset.GetData().imageheight/tileset.GetData().tileheight; + vi2d tileSize={tileset.GetData().tilewidth,tileset.GetData().tileheight}; + + const int colorCombinations=255*6; + + for(int y=0;yDecal()->Update(); + } } } diff --git a/Crawler/TSXParser.h b/Crawler/TSXParser.h index ec51013d..c1c37f66 100644 --- a/Crawler/TSXParser.h +++ b/Crawler/TSXParser.h @@ -49,6 +49,7 @@ using namespace olc; struct Tileset{ XMLTag ImageData; int tilewidth=0,tileheight=0; + int imagewidth=0,imageheight=0; std::map ForegroundTileData; std::map UpperForegroundTileData; std::map CollisionData; @@ -136,6 +137,8 @@ class TSXParser{ } else if (newTag.tag=="image") { parsedTilesetInfo.ImageData=newTag; + parsedTilesetInfo.imagewidth=newTag.GetInteger("width"); + parsedTilesetInfo.imageheight=newTag.GetInteger("height"); } else if (newTag.tag=="tile"&&newTag.data["type"]=="ForegroundTile"){ previousTag=newTag.tag; diff --git a/Crawler/Version.h b/Crawler/Version.h index eaf8bded..f082a554 100644 --- a/Crawler/Version.h +++ b/Crawler/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 0 #define VERSION_MINOR 2 #define VERSION_PATCH 1 -#define VERSION_BUILD 3937 +#define VERSION_BUILD 3941 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Crawler/assets/maps/commercial_assets/README.txt b/Crawler/assets/maps/commercial_assets/README.txt deleted file mode 100644 index 5a65bcd8..00000000 --- a/Crawler/assets/maps/commercial_assets/README.txt +++ /dev/null @@ -1 +0,0 @@ -Files located in this directory will not be included in the actual repository, which means they will not get distributed elsewhere illegally! \ No newline at end of file