From efe6b18900d5f83db1d1be3217b29f154a36209d Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 31 Jul 2022 22:27:41 +0200 Subject: [PATCH] Move two basic crypt setpices in to dun files --- CMake/Assets.cmake | 2 + .../assets/NLevels/L5Data/cornerstone.dun | Bin 0 -> 854 bytes .../assets/NLevels/L5Data/uberroom.dun | Bin 0 -> 820 bytes Source/levels/crypt.cpp | 37 +++++------------- test/drlg_l1_test.cpp | 4 ++ 5 files changed, 15 insertions(+), 28 deletions(-) create mode 100644 Packaging/resources/assets/NLevels/L5Data/cornerstone.dun create mode 100644 Packaging/resources/assets/NLevels/L5Data/uberroom.dun diff --git a/CMake/Assets.cmake b/CMake/Assets.cmake index a299ea05e..73e6d3b59 100644 --- a/CMake/Assets.cmake +++ b/CMake/Assets.cmake @@ -159,6 +159,8 @@ set(devilutionx_assets gendata/cutstartw.pcx Levels/L1Data/SklKngT.dun Levels/L2Data/BonechaT.dun + NLevels/L5Data/cornerstone.dun + NLevels/L5Data/uberroom.dun ui_art/black_diablo.pcx ui_art/black_hellfire.pcx ui_art/creditsw.pcx diff --git a/Packaging/resources/assets/NLevels/L5Data/cornerstone.dun b/Packaging/resources/assets/NLevels/L5Data/cornerstone.dun new file mode 100644 index 0000000000000000000000000000000000000000..486bb366d633d1700eac1509474098e12001498c GIT binary patch literal 854 zcmZQ&U}a!oU;;xn21bT_hBXYlK$;Ou^D;;RS-fD#$iNO&$ILJaMnhmU1aOA{0I-t+ AUH||9 literal 0 HcmV?d00001 diff --git a/Packaging/resources/assets/NLevels/L5Data/uberroom.dun b/Packaging/resources/assets/NLevels/L5Data/uberroom.dun new file mode 100644 index 0000000000000000000000000000000000000000..1e5e77397dbb702996f69512b2ca230ab7243aa3 GIT binary patch literal 820 zcmZQ!U}Gp|XabVF42=vq42(dUks+HQ9Y{}N$YMwXi?0BSvokO;Fa!CcU^E0qatHtb Dt9b>j literal 0 HcmV?d00001 diff --git a/Source/levels/crypt.cpp b/Source/levels/crypt.cpp index f1f648256..807a3f598 100644 --- a/Source/levels/crypt.cpp +++ b/Source/levels/crypt.cpp @@ -1,5 +1,6 @@ #include "levels/crypt.h" +#include "engine/load_file.hpp" #include "engine/point.hpp" #include "items.h" #include "levels/drlg_l1.h" @@ -192,30 +193,6 @@ const Miniset CryptStar { } }; -const Miniset UberRoomPattern { - { 4, 6 }, - {}, - { - { 115, 130, 6, 13 }, - { 129, 108, 1, 13 }, - { 1, 107, 103, 13 }, - { 146, 106, 102, 13 }, - { 129, 168, 1, 13 }, - { 7, 2, 3, 13 }, - } -}; -const Miniset CornerstoneRoomPattern { - { 5, 5 }, - {}, - { - { 4, 2, 2, 2, 6 }, - { 1, 111, 172, 13, 1 }, - { 1, 172, 13, 13, 25 }, - { 1, 13, 13, 13, 1 }, - { 7, 2, 2, 2, 3 }, - } -}; - enum Tile : uint8_t { // clang-format off VWall = 1, @@ -707,18 +684,22 @@ void SetCryptRoom() IsUberRoomOpened = false; IsUberLeverActivated = false; - SetPiece = { position, UberRoomPattern.size }; + auto dunData = LoadFileInMem("NLevels\\L5Data\\uberroom.dun"); - UberRoomPattern.place(position, true); + SetPiece = { position, { dunData[0], dunData[1] } }; + + PlaceDunTiles(dunData.get(), position, 0); } void SetCornerRoom() { Point position = SelectChamber(); - SetPiece = { position, CornerstoneRoomPattern.size }; + auto dunData = LoadFileInMem("NLevels\\L5Data\\cornerstone.dun"); + + SetPiece = { position, { dunData[0], dunData[1] } }; - CornerstoneRoomPattern.place(position, true); + PlaceDunTiles(dunData.get(), position, 0); } void FixCryptDirtTiles() diff --git a/test/drlg_l1_test.cpp b/test/drlg_l1_test.cpp index ca60c8993..ef7e026e1 100644 --- a/test/drlg_l1_test.cpp +++ b/test/drlg_l1_test.cpp @@ -190,6 +190,8 @@ TEST(Drlg_l1, CreateL5Dungeon_crypt_1_2122696790) { LoadExpectedLevelData("hellfire/21-2122696790.dun"); + paths::SetAssetsPath(paths::BasePath() + "/assets"); + TestCreateDungeon(21, 2122696790, ENTRY_TWARPDN); EXPECT_EQ(ViewPosition, Point(61, 81)); TestCreateDungeon(21, 2122696790, ENTRY_PREV); @@ -224,6 +226,8 @@ TEST(Drlg_l1, CreateL5Dungeon_crypt_4_1324803725) { LoadExpectedLevelData("hellfire/24-1324803725.dun"); + paths::SetAssetsPath(paths::BasePath() + "/assets"); + TestCreateDungeon(24, 1324803725, ENTRY_MAIN); EXPECT_EQ(ViewPosition, Point(79, 47)); }