diff --git a/.gitignore b/.gitignore index 1ed394c..47b3d4c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ -build* +build Testing -*.bin -*.png +assets *.tiled-session diff --git a/assets/tileset.tsx b/assets/tileset.tsx deleted file mode 100644 index 4a4d946..0000000 --- a/assets/tileset.tsx +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt index e55e9e2..c2a5c8e 100644 --- a/game/CMakeLists.txt +++ b/game/CMakeLists.txt @@ -7,7 +7,9 @@ else() target_link_libraries(game PRIVATE engine) endif() set_default_target_options(game) -target_compile_definitions(game PRIVATE ASSET_DIR="${ASSET_DIR}") +target_compile_definitions(game PRIVATE + MAP_DIR="${CMAKE_SOURCE_DIR}/map" + ASSET_DIR="${ASSET_DIR}") target_include_directories(game PUBLIC include) target_link_libraries(game PRIVATE diff --git a/game/main.c b/game/main.c index fc81803..c79729c 100644 --- a/game/main.c +++ b/game/main.c @@ -250,8 +250,8 @@ static unsigned load_objtype( xmlNodePtr sprites) { static char buf[MAX_PATH_LEN]; - assert(strlen(ASSET_DIR) + strlen(templ) + 1 < MAX_PATH_LEN); - strcpy(buf, ASSET_DIR); + assert(strlen(MAP_DIR) + strlen(templ) + 1 < MAX_PATH_LEN); + strcpy(buf, MAP_DIR); strcat(buf, "/"); strcat(buf, templ); @@ -361,8 +361,8 @@ static void load_objects(gamestate_t *state, xmlNodePtr node, SDL_Renderer *renderer) { char path[MAX_PATH_LEN]; - assert(strlen(ASSET_DIR OBJSPRITES) < MAX_PATH_LEN); - strcpy(path, ASSET_DIR OBJSPRITES); + assert(strlen(MAP_DIR OBJSPRITES) < MAX_PATH_LEN); + strcpy(path, MAP_DIR OBJSPRITES); xmlDocPtr spritesdoc = xmlParseFile(path); xmlNodePtr sprites = xmlDocGetRootElement(spritesdoc); @@ -498,8 +498,8 @@ void game_init(void *mem, SDL_Renderer *renderer) gamestate_t *state = (gamestate_t *)mem; // Load map - assert(strlen(ASSET_DIR MAP_ASSET) < MAX_PATH_LEN); - strcpy(path, ASSET_DIR MAP_ASSET); + assert(strlen(MAP_DIR MAP_ASSET) < MAX_PATH_LEN); + strcpy(path, MAP_DIR MAP_ASSET); load_map(state, path, renderer); // Load tileset diff --git a/assets/game.tiled-project b/map/game.tiled-project similarity index 100% rename from assets/game.tiled-project rename to map/game.tiled-project diff --git a/assets/map.tmx b/map/map.tmx similarity index 100% rename from assets/map.tmx rename to map/map.tmx diff --git a/assets/objectsprites.tsx b/map/objectsprites.tsx similarity index 76% rename from assets/objectsprites.tsx rename to map/objectsprites.tsx index 707aa8a..e1c787c 100644 --- a/assets/objectsprites.tsx +++ b/map/objectsprites.tsx @@ -2,7 +2,7 @@ - + @@ -11,7 +11,7 @@ - + @@ -20,7 +20,7 @@ - + @@ -29,7 +29,7 @@ - + @@ -38,7 +38,7 @@ - + diff --git a/assets/overworld.tsx b/map/overworld.tsx similarity index 98% rename from assets/overworld.tsx rename to map/overworld.tsx index 0723c25..3f83a7e 100644 --- a/assets/overworld.tsx +++ b/map/overworld.tsx @@ -1,6 +1,6 @@ - + diff --git a/assets/templates/flag.tx b/map/templates/flag.tx similarity index 100% rename from assets/templates/flag.tx rename to map/templates/flag.tx diff --git a/assets/templates/fountain.tx b/map/templates/fountain.tx similarity index 100% rename from assets/templates/fountain.tx rename to map/templates/fountain.tx diff --git a/assets/templates/house.tx b/map/templates/house.tx similarity index 100% rename from assets/templates/house.tx rename to map/templates/house.tx diff --git a/assets/templates/tower.tx b/map/templates/tower.tx similarity index 100% rename from assets/templates/tower.tx rename to map/templates/tower.tx diff --git a/assets/templates/waterfall.tx b/map/templates/waterfall.tx similarity index 100% rename from assets/templates/waterfall.tx rename to map/templates/waterfall.tx