From 5654d5c0a056f9cfc99ac608d16aa0a601b997f5 Mon Sep 17 00:00:00 2001 From: Treeki Date: Fri, 21 Sep 2012 23:03:33 +0200 Subject: updated map data format --- src/koopatlas/mapdata.cpp | 4 +++- src/koopatlas/mapdata.h | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/koopatlas/mapdata.cpp b/src/koopatlas/mapdata.cpp index ab8ef3a..52a7937 100644 --- a/src/koopatlas/mapdata.cpp +++ b/src/koopatlas/mapdata.cpp @@ -152,7 +152,7 @@ bool dKPMapData_c::load(const char *filename) { fixup(); bool didLoadTilesets = loadTilesets(); - bool didLoadBG = (bgLoader.load("/Maps/Water.brres") != 0); + bool didLoadBG = (bgLoader.load(data->backgroundName) != 0); return didLoadTilesets && didLoadBG; } @@ -203,6 +203,8 @@ void dKPMapData_c::fixup() { fixRef(data->layers); fixRef(data->tilesets); fixRef(data->unlockData); + fixRef(data->sectors); + fixRef(data->backgroundName); for (int iLayer = 0; iLayer < data->layerCount; iLayer++) { dKPLayer_s *layer = fixRef(data->layers[iLayer]); diff --git a/src/koopatlas/mapdata.h b/src/koopatlas/mapdata.h index 40e1a43..70c31ee 100644 --- a/src/koopatlas/mapdata.h +++ b/src/koopatlas/mapdata.h @@ -179,6 +179,9 @@ struct dKPLayer_s { }; struct dKPMapFile_s { + u32 magic; + int version; + int layerCount; dKPLayer_s **layers; @@ -187,7 +190,9 @@ struct dKPMapFile_s { u8 *unlockData; - dKPLayer_s::sector_s sectors[1]; // variable size + dKPLayer_s::sector_s *sectors; + + const char *backgroundName; }; class dKPMapData_c { -- cgit v1.2.3