diff options
author | Colin Noga <Tempus@chronometry.ca> | 2012-09-27 22:59:41 -0500 |
---|---|---|
committer | Colin Noga <Tempus@chronometry.ca> | 2012-09-27 22:59:41 -0500 |
commit | 64f38f642113ac4bd5b1d96e76c9ae97965bc416 (patch) | |
tree | 99d9bbf4d577ae2d8a79fcb5f7101df1b57398fe /src/koopatlas/mapdata.cpp | |
parent | f9afbf1109b30bbc6011e81109b7e11961a4361a (diff) | |
parent | b3c37e5a9ef81250d6554fcbb8089154b4940c9f (diff) | |
download | kamek-64f38f642113ac4bd5b1d96e76c9ae97965bc416.tar.gz kamek-64f38f642113ac4bd5b1d96e76c9ae97965bc416.zip |
Merge branch 'level-select' of ssh://treeki.rustedlogic.net:30000/Kamek into level-select
Diffstat (limited to 'src/koopatlas/mapdata.cpp')
-rw-r--r-- | src/koopatlas/mapdata.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/koopatlas/mapdata.cpp b/src/koopatlas/mapdata.cpp index cbd0c69..d766bed 100644 --- a/src/koopatlas/mapdata.cpp +++ b/src/koopatlas/mapdata.cpp @@ -205,6 +205,12 @@ void dKPMapData_c::fixup() { fixRef(data->unlockData); fixRef(data->sectors); fixRef(data->backgroundName); + if (data->version >= 2) { + fixRef(data->worlds); + for (int i = 0; i < data->worldCount; i++) { + fixRef(data->worlds[i].name); + } + } for (int iLayer = 0; iLayer < data->layerCount; iLayer++) { dKPLayer_s *layer = fixRef(data->layers[iLayer]); @@ -280,6 +286,16 @@ void dKPMapData_c::fixup() { } +const dKPWorldDef_s *dKPMapData_c::findWorldDef(int id) const { + for (int i = 0; i < data->worldCount; i++) { + if (data->worlds[i].key == id) + return &data->worlds[i]; + } + + return 0; +} + + /****************************************************************************** * Generic Layer ******************************************************************************/ |