diff --git a/dCommon/ZoneFile.cpp b/dCommon/ZoneFile.cpp index 77fbcb52b..793e31c74 100644 --- a/dCommon/ZoneFile.cpp +++ b/dCommon/ZoneFile.cpp @@ -124,9 +124,11 @@ void ZoneFile::ReadScene(std::istream& file, uint32_t index) { } if (fileFormatVersion >= FileFormatVersion::LatePreAlpha) { - BinaryIO::BinaryRead(file, scene.color_r); - BinaryIO::BinaryRead(file, scene.color_b); - BinaryIO::BinaryRead(file, scene.color_g); + uint8_t r, b, g; + BinaryIO::BinaryRead(file, r); + BinaryIO::BinaryRead(file, b); + BinaryIO::BinaryRead(file, g); + scene.color = NiColor(r / 255.0f, g / 255.0f, b / 255.0f); } scenes.push_back(std::move(scene)); @@ -180,8 +182,8 @@ void ZoneFile::ReadZoneBoundaries(std::istream& file) { LWOINSTANCEID instanceID = 0; BinaryIO::BinaryRead(file, mapID); BinaryIO::BinaryRead(file, instanceID); - boundary.destZoneID = LWOZONEID(mapID, instanceID, 0); - BinaryIO::BinaryRead(file, boundary.destSceneID); + boundary.destinationZone = LWOZONEID(mapID, instanceID, 0); + BinaryIO::BinaryRead(file, boundary.destinationSceneID); BinaryIO::BinaryRead(file, boundary.spawnLocation); zoneBoundaries.push_back(boundary); } diff --git a/dCommon/ZoneFile.h b/dCommon/ZoneFile.h index d864db23e..ab57ed2cd 100644 --- a/dCommon/ZoneFile.h +++ b/dCommon/ZoneFile.h @@ -11,6 +11,7 @@ #include "dCommonVars.h" #include "NiPoint3.h" #include "NiQuaternion.h" +#include "NiColor.h" #include "LDFFormat.h" #include "eSceneType.h" #include "eWaypointCommandType.h" @@ -34,17 +35,15 @@ struct ZoneScene { std::string name; NiPoint3 unknown1; float unknown2{}; - uint8_t color_r{}; - uint8_t color_g{}; - uint8_t color_b{}; + NiColor color; }; // A line the player crosses to leave the zone (the client's LuzReader::ReadZoneBoundaryLines) struct ZoneBoundary { NiPoint3 normal; NiPoint3 point; - LWOZONEID destZoneID; // clone 0 - uint32_t destSceneID{}; + LWOZONEID destinationZone; // clone 0 + uint32_t destinationSceneID{}; NiPoint3 spawnLocation; }; diff --git a/tests/dCommonTests/ZoneFileTests.cpp b/tests/dCommonTests/ZoneFileTests.cpp index 9a6dbe408..9084884f1 100644 --- a/tests/dCommonTests/ZoneFileTests.cpp +++ b/tests/dCommonTests/ZoneFileTests.cpp @@ -121,10 +121,10 @@ TEST(ZoneFileTests, ReadsZoneBoundaries) { const auto& boundary = zone.zoneBoundaries[0]; EXPECT_EQ(boundary.normal, NiPoint3(1, 0, 0)); EXPECT_EQ(boundary.point, NiPoint3(10, 20, 30)); - EXPECT_EQ(boundary.destZoneID, LWOZONEID(1100, 7, 0)); - EXPECT_EQ(boundary.destSceneID, 4u); + EXPECT_EQ(boundary.destinationZone, LWOZONEID(1100, 7, 0)); + EXPECT_EQ(boundary.destinationSceneID, 4u); EXPECT_EQ(boundary.spawnLocation, NiPoint3(5, 6, 7)); - EXPECT_EQ(zone.zoneBoundaries[1].destZoneID, LWOZONEID(1200, 0, 0)); + EXPECT_EQ(zone.zoneBoundaries[1].destinationZone, LWOZONEID(1200, 0, 0)); EXPECT_EQ(zone.zoneRawPath, "zone.raw"); EXPECT_EQ(zone.zoneName, "Name"); EXPECT_EQ(zone.zoneDesc, "Description");