From 014f3668eb47b1576bdc182b1db00417f9938cf1 Mon Sep 17 00:00:00 2001 From: Treeki Date: Thu, 27 Sep 2012 00:51:43 +0200 Subject: added untested support for world change nodes --- src/koopatlas/mapdata.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/koopatlas/mapdata.cpp') diff --git a/src/koopatlas/mapdata.cpp b/src/koopatlas/mapdata.cpp index 52a7937..29c6a23 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) { + for (int i = 0; i < data->worldCount; i++) { + if (data->worlds[i].key == id) + return &data->worlds[i]; + } + + return 0; +} + + /****************************************************************************** * Generic Layer ******************************************************************************/ -- cgit v1.2.3 From 411c5a8e210b5cbca330a5438e2406dbe1ffecab Mon Sep 17 00:00:00 2001 From: Treeki Date: Thu, 27 Sep 2012 04:40:34 +0200 Subject: made world changes work, and HUD colourising and other fun things --- src/koopatlas/mapdata.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/koopatlas/mapdata.cpp') diff --git a/src/koopatlas/mapdata.cpp b/src/koopatlas/mapdata.cpp index 29c6a23..d4f9d0c 100644 --- a/src/koopatlas/mapdata.cpp +++ b/src/koopatlas/mapdata.cpp @@ -286,7 +286,7 @@ void dKPMapData_c::fixup() { } -const dKPWorldDef_s *dKPMapData_c::findWorldDef(int id) { +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]; -- cgit v1.2.3