From 90732aa7bed037ec8a5a380d2e0df240c54f717a Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Sat, 3 Aug 2024 08:09:48 +0100 Subject: [PATCH] Migrate objdat.cpp data to TSV --- CMake/Assets.cmake | 1 + Source/diablo.cpp | 1 + Source/levels/gendung.cpp | 13 ++ Source/levels/gendung.h | 6 + Source/objdat.cpp | 318 ++++++++++++------------------ Source/objdat.h | 80 +------- Source/objects.cpp | 14 +- assets/txtdata/objects/objdat.tsv | 110 +++++++++++ test/timedemo_test.cpp | 1 + uwp-project/devilutionx.vcxproj | 6 +- 10 files changed, 283 insertions(+), 267 deletions(-) create mode 100644 assets/txtdata/objects/objdat.tsv diff --git a/CMake/Assets.cmake b/CMake/Assets.cmake index aebf99e6bb8..263a1993cdf 100644 --- a/CMake/Assets.cmake +++ b/CMake/Assets.cmake @@ -166,6 +166,7 @@ set(devilutionx_assets txtdata/missiles/missile_sprites.tsv txtdata/monsters/monstdat.tsv txtdata/monsters/unique_monstdat.tsv + txtdata/objects/objdat.tsv txtdata/sound/effects.tsv txtdata/spells/spelldat.tsv ui_art/diablo.pal diff --git a/Source/diablo.cpp b/Source/diablo.cpp index b1b784a4335..2c56a60facd 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -2579,6 +2579,7 @@ int DiabloMain(int argc, char **argv) LoadMissileData(); LoadMonsterData(); LoadItemData(); + LoadObjectData(); DiabloInit(); #ifdef __UWP__ diff --git a/Source/levels/gendung.cpp b/Source/levels/gendung.cpp index 6faf76ef0a9..7142828f60f 100644 --- a/Source/levels/gendung.cpp +++ b/Source/levels/gendung.cpp @@ -772,4 +772,17 @@ void FloodTransparencyValues(uint8_t floorID) } } +tl::expected ParseDungeonType(std::string_view value) +{ + if (value.empty()) return DTYPE_NONE; + if (value == "DTYPE_TOWN") return DTYPE_TOWN; + if (value == "DTYPE_CATHEDRAL") return DTYPE_CATHEDRAL; + if (value == "DTYPE_CATACOMBS") return DTYPE_CATACOMBS; + if (value == "DTYPE_CAVES") return DTYPE_CAVES; + if (value == "DTYPE_HELL") return DTYPE_HELL; + if (value == "DTYPE_NEST") return DTYPE_NEST; + if (value == "DTYPE_CRYPT") return DTYPE_CRYPT; + return tl::make_unexpected("Unknown enum value"); +} + } // namespace devilution diff --git a/Source/levels/gendung.h b/Source/levels/gendung.h index b54f1267b55..9f41e287fa8 100644 --- a/Source/levels/gendung.h +++ b/Source/levels/gendung.h @@ -8,6 +8,10 @@ #include #include #include +#include +#include + +#include #include "engine/clx_sprite.hpp" #include "engine/point.hpp" @@ -71,6 +75,8 @@ enum dungeon_type : int8_t { DTYPE_NONE = -1, }; +tl::expected ParseDungeonType(std::string_view value); + enum lvl_entry : uint8_t { ENTRY_MAIN, ENTRY_PREV, diff --git a/Source/objdat.cpp b/Source/objdat.cpp index bbac168df5c..e0e15fc4144 100644 --- a/Source/objdat.cpp +++ b/Source/objdat.cpp @@ -5,6 +5,17 @@ */ #include "objdat.h" +#include +#include +#include + +#include +#include + +#include "data/file.hpp" +#include "data/iterators.hpp" +#include "data/record_reader.hpp" + namespace devilution { /** Maps from dun_object_id to object_id. */ @@ -158,197 +169,126 @@ const _object_id ObjTypeConv[] = { OBJ_L5SARC, }; +/** Contains the data related to each object ID. */ +std::vector AllObjects; + +/** Maps from object_graphic_id to object CEL name. */ +std::vector ObjMasterLoadList; + namespace { -constexpr auto Animated = ObjectDataFlags::Animated; -constexpr auto Solid = ObjectDataFlags::Solid; -constexpr auto MissilesPassThrough = ObjectDataFlags::MissilesPassThrough; -constexpr auto Light = ObjectDataFlags::Light; -constexpr auto Trap = ObjectDataFlags::Trap; -constexpr auto Breakable = ObjectDataFlags::Breakable; + +tl::expected ParseTheme(std::string_view value) +{ + if (value.empty()) return THEME_NONE; + if (value == "THEME_BARREL") return THEME_BARREL; + if (value == "THEME_SHRINE") return THEME_SHRINE; + if (value == "THEME_MONSTPIT") return THEME_MONSTPIT; + if (value == "THEME_SKELROOM") return THEME_SKELROOM; + if (value == "THEME_TREASURE") return THEME_TREASURE; + if (value == "THEME_LIBRARY") return THEME_LIBRARY; + if (value == "THEME_TORTURE") return THEME_TORTURE; + if (value == "THEME_BLOODFOUNTAIN") return THEME_BLOODFOUNTAIN; + if (value == "THEME_DECAPITATED") return THEME_DECAPITATED; + if (value == "THEME_PURIFYINGFOUNTAIN") return THEME_PURIFYINGFOUNTAIN; + if (value == "THEME_ARMORSTAND") return THEME_ARMORSTAND; + if (value == "THEME_GOATSHRINE") return THEME_GOATSHRINE; + if (value == "THEME_CAULDRON") return THEME_CAULDRON; + if (value == "THEME_MURKYFOUNTAIN") return THEME_MURKYFOUNTAIN; + if (value == "THEME_TEARFOUNTAIN") return THEME_TEARFOUNTAIN; + if (value == "THEME_BRNCROSS") return THEME_BRNCROSS; + if (value == "THEME_WEAPONRACK") return THEME_WEAPONRACK; + return tl::make_unexpected("Unknown enum value"); +} + +tl::expected ParseQuest(std::string_view value) +{ + if (value.empty()) return Q_INVALID; + if (value == "Q_ROCK") return Q_ROCK; + if (value == "Q_MUSHROOM") return Q_MUSHROOM; + if (value == "Q_GARBUD") return Q_GARBUD; + if (value == "Q_ZHAR") return Q_ZHAR; + if (value == "Q_VEIL") return Q_VEIL; + if (value == "Q_DIABLO") return Q_DIABLO; + if (value == "Q_BUTCHER") return Q_BUTCHER; + if (value == "Q_LTBANNER") return Q_LTBANNER; + if (value == "Q_BLIND") return Q_BLIND; + if (value == "Q_BLOOD") return Q_BLOOD; + if (value == "Q_ANVIL") return Q_ANVIL; + if (value == "Q_WARLORD") return Q_WARLORD; + if (value == "Q_SKELKING") return Q_SKELKING; + if (value == "Q_PWATER") return Q_PWATER; + if (value == "Q_SCHAMB") return Q_SCHAMB; + if (value == "Q_BETRAYER") return Q_BETRAYER; + if (value == "Q_GRAVE") return Q_GRAVE; + if (value == "Q_FARMER") return Q_FARMER; + if (value == "Q_GIRL") return Q_GIRL; + if (value == "Q_TRADER") return Q_TRADER; + if (value == "Q_DEFILER") return Q_DEFILER; + if (value == "Q_NAKRUL") return Q_NAKRUL; + if (value == "Q_CORNSTN") return Q_CORNSTN; + if (value == "Q_JERSEY") return Q_JERSEY; + return tl::make_unexpected("Unknown enum value"); +} + +tl::expected ParseObjectDataFlags(std::string_view value) +{ + if (value.empty()) return ObjectDataFlags::None; + if (value == "Animated") return ObjectDataFlags::Animated; + if (value == "Solid") return ObjectDataFlags::Solid; + if (value == "MissilesPassThrough") return ObjectDataFlags::MissilesPassThrough; + if (value == "Light") return ObjectDataFlags::Light; + if (value == "Trap") return ObjectDataFlags::Trap; + if (value == "Breakable") return ObjectDataFlags::Breakable; + return tl::make_unexpected("Unknown enum value"); +} + } // namespace -/** Contains the data related to each object ID. */ -const ObjectData AllObjects[109] = { - // clang-format off -// _object_id ofindex, minlvl, maxlvl, olvltype, otheme, oquest, flags, animDelay, animLen, animWidth, selFlag -/*OBJ_L1LIGHT*/ { OFILE_L1BRAZ, 0, 0, DTYPE_CATHEDRAL, THEME_NONE, Q_INVALID, Animated | Solid | MissilesPassThrough, 1, 26, 64, 0 }, -/*OBJ_L1LDOOR*/ { OFILE_L1DOORS, 0, 0, DTYPE_CATHEDRAL, THEME_NONE, Q_INVALID, Light | Trap, 1, 0, 64, 3 }, -/*OBJ_L1RDOOR*/ { OFILE_L1DOORS, 0, 0, DTYPE_CATHEDRAL, THEME_NONE, Q_INVALID, Light | Trap, 2, 0, 64, 3 }, -/*OBJ_SKFIRE*/ { OFILE_SKULFIRE, 0, 0, DTYPE_NONE, THEME_SKELROOM, Q_INVALID, Animated | Solid | MissilesPassThrough, 2, 11, 96, 0 }, -/*OBJ_LEVER*/ { OFILE_LEVER, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | MissilesPassThrough | Light | Trap, 1, 1, 96, 1 }, -/*OBJ_CHEST1*/ { OFILE_CHEST1, 1, 24, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | MissilesPassThrough | Light | Trap, 1, 0, 96, 1 }, -/*OBJ_CHEST2*/ { OFILE_CHEST2, 1, 24, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | MissilesPassThrough | Light | Trap, 1, 0, 96, 1 }, -/*OBJ_CHEST3*/ { OFILE_CHEST3, 1, 24, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | MissilesPassThrough | Light | Trap, 1, 0, 96, 1 }, -/*OBJ_CANDLE1*/ { OFILE_L1BRAZ, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, {}, 0, 0, 0, 0 }, -/*OBJ_CANDLE2*/ { OFILE_CANDLE2, 0, 0, DTYPE_NONE, THEME_SHRINE, Q_PWATER, Animated | Solid | MissilesPassThrough | Light, 2, 4, 96, 0 }, -/*OBJ_CANDLEO*/ { OFILE_L1BRAZ, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, {}, 0, 0, 0, 0 }, -/*OBJ_BANNERL*/ { OFILE_BANNER, 0, 0, DTYPE_NONE, THEME_SKELROOM, Q_INVALID, Solid | MissilesPassThrough | Light, 2, 0, 96, 0 }, -/*OBJ_BANNERM*/ { OFILE_BANNER, 0, 0, DTYPE_NONE, THEME_SKELROOM, Q_INVALID, Solid | MissilesPassThrough | Light, 1, 0, 96, 0 }, -/*OBJ_BANNERR*/ { OFILE_BANNER, 0, 0, DTYPE_NONE, THEME_SKELROOM, Q_INVALID, Solid | MissilesPassThrough | Light, 3, 0, 96, 0 }, -/*OBJ_SKPILE*/ { OFILE_SKULPILE, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | MissilesPassThrough | Light, 1, 1, 96, 0 }, -/*OBJ_SKSTICK1*/ { OFILE_L1BRAZ, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, {}, 0, 0, 0, 0 }, -/*OBJ_SKSTICK2*/ { OFILE_L1BRAZ, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, {}, 0, 0, 0, 0 }, -/*OBJ_SKSTICK3*/ { OFILE_L1BRAZ, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, {}, 0, 0, 0, 0 }, -/*OBJ_SKSTICK4*/ { OFILE_L1BRAZ, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, {}, 0, 0, 0, 0 }, -/*OBJ_SKSTICK5*/ { OFILE_L1BRAZ, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, {}, 0, 0, 0, 0 }, -/*OBJ_CRUX1*/ { OFILE_CRUXSK1, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | Light | Breakable, 1, 15, 96, 3 }, -/*OBJ_CRUX2*/ { OFILE_CRUXSK2, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | Light | Breakable, 1, 15, 96, 3 }, -/*OBJ_CRUX3*/ { OFILE_CRUXSK3, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | Light | Breakable, 1, 15, 96, 3 }, -/*OBJ_STAND*/ { OFILE_ROCKSTAN, 5, 5, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | MissilesPassThrough | Light, 1, 0, 96, 0 }, -/*OBJ_ANGEL*/ { OFILE_ANGEL, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | Light, 1, 0, 96, 0 }, -/*OBJ_BOOK2L*/ { OFILE_BOOK2, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | MissilesPassThrough | Light, 1, 0, 96, 3 }, -/*OBJ_BCROSS*/ { OFILE_BURNCROS, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, Animated | Solid, 0, 10, 160, 0 }, -/*OBJ_NUDEW2R*/ { OFILE_NUDE2, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, Animated | Solid | Light, 3, 6, 128, 0 }, -/*OBJ_SWITCHSKL*/ { OFILE_SWITCH4, 16, 16, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | MissilesPassThrough | Light | Trap, 1, 0, 96, 1 }, -/*OBJ_TNUDEM1*/ { OFILE_TNUDEM, 13, 15, DTYPE_NONE, THEME_NONE, Q_BUTCHER, Solid | Light, 1, 0, 128, 0 }, -/*OBJ_TNUDEM2*/ { OFILE_TNUDEM, 13, 15, DTYPE_NONE, THEME_TORTURE, Q_BUTCHER, Solid | Light, 2, 0, 128, 0 }, -/*OBJ_TNUDEM3*/ { OFILE_TNUDEM, 13, 15, DTYPE_NONE, THEME_TORTURE, Q_BUTCHER, Solid | Light, 3, 0, 128, 0 }, -/*OBJ_TNUDEM4*/ { OFILE_TNUDEM, 13, 15, DTYPE_NONE, THEME_TORTURE, Q_BUTCHER, Solid | Light, 4, 0, 128, 0 }, -/*OBJ_TNUDEW1*/ { OFILE_TNUDEW, 13, 15, DTYPE_NONE, THEME_TORTURE, Q_BUTCHER, Solid | Light, 1, 0, 128, 0 }, -/*OBJ_TNUDEW2*/ { OFILE_TNUDEW, 13, 15, DTYPE_NONE, THEME_TORTURE, Q_BUTCHER, Solid | Light, 2, 0, 128, 0 }, -/*OBJ_TNUDEW3*/ { OFILE_TNUDEW, 13, 15, DTYPE_NONE, THEME_TORTURE, Q_BUTCHER, Solid | Light, 3, 0, 128, 0 }, -/*OBJ_TORTURE1*/ { OFILE_TSOUL, 13, 15, DTYPE_NONE, THEME_NONE, Q_BUTCHER, MissilesPassThrough | Light, 1, 0, 128, 0 }, -/*OBJ_TORTURE2*/ { OFILE_TSOUL, 13, 15, DTYPE_NONE, THEME_NONE, Q_BUTCHER, MissilesPassThrough | Light, 2, 0, 128, 0 }, -/*OBJ_TORTURE3*/ { OFILE_TSOUL, 13, 15, DTYPE_NONE, THEME_NONE, Q_BUTCHER, MissilesPassThrough | Light, 3, 0, 128, 0 }, -/*OBJ_TORTURE4*/ { OFILE_TSOUL, 13, 15, DTYPE_NONE, THEME_NONE, Q_BUTCHER, MissilesPassThrough | Light, 4, 0, 128, 0 }, -/*OBJ_TORTURE5*/ { OFILE_TSOUL, 13, 15, DTYPE_NONE, THEME_NONE, Q_BUTCHER, MissilesPassThrough | Light, 5, 0, 128, 0 }, -/*OBJ_BOOK2R*/ { OFILE_BOOK2, 6, 6, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | MissilesPassThrough | Light, 4, 0, 96, 3 }, -/*OBJ_L2LDOOR*/ { OFILE_L2DOORS, 0, 0, DTYPE_CATACOMBS, THEME_NONE, Q_INVALID, Light | Trap, 1, 0, 64, 3 }, -/*OBJ_L2RDOOR*/ { OFILE_L2DOORS, 0, 0, DTYPE_CATACOMBS, THEME_NONE, Q_INVALID, Light | Trap, 2, 0, 64, 3 }, -/*OBJ_TORCHL*/ { OFILE_WTORCH4, 5, 8, DTYPE_NONE, THEME_NONE, Q_INVALID, Animated | MissilesPassThrough, 1, 9, 96, 0 }, -/*OBJ_TORCHR*/ { OFILE_WTORCH3, 5, 8, DTYPE_NONE, THEME_NONE, Q_INVALID, Animated | MissilesPassThrough, 1, 9, 96, 0 }, -/*OBJ_TORCHL2*/ { OFILE_WTORCH1, 5, 8, DTYPE_NONE, THEME_NONE, Q_INVALID, Animated | MissilesPassThrough, 1, 9, 96, 0 }, -/*OBJ_TORCHR2*/ { OFILE_WTORCH2, 5, 8, DTYPE_NONE, THEME_NONE, Q_INVALID, Animated | MissilesPassThrough, 1, 9, 96, 0 }, -/*OBJ_SARC*/ { OFILE_SARC, 1, 4, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | MissilesPassThrough | Light | Trap, 1, 5, 128, 3 }, -/*OBJ_FLAMEHOLE*/ { OFILE_FLAME1, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, MissilesPassThrough | Light, 1, 20, 96, 0 }, -/*OBJ_FLAMELVR*/ { OFILE_LEVER, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | MissilesPassThrough | Light | Trap, 1, 2, 96, 1 }, -/*OBJ_WATER*/ { OFILE_MINIWATR, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, Animated | Solid | Light, 1, 10, 64, 0 }, -/*OBJ_BOOKLVR*/ { OFILE_BOOK1, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | MissilesPassThrough | Light, 1, 0, 96, 3 }, -/*OBJ_TRAPL*/ { OFILE_TRAPHOLE, 1, 24, DTYPE_NONE, THEME_NONE, Q_INVALID, MissilesPassThrough | Light, 1, 0, 64, 0 }, -/*OBJ_TRAPR*/ { OFILE_TRAPHOLE, 1, 24, DTYPE_NONE, THEME_NONE, Q_INVALID, MissilesPassThrough | Light, 2, 0, 64, 0 }, -/*OBJ_BOOKSHELF*/ { OFILE_BCASE, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | Light, 1, 0, 96, 0 }, -/*OBJ_WEAPRACK*/ { OFILE_WEAPSTND, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | Light, 1, 0, 96, 0 }, -/*OBJ_BARREL*/ { OFILE_BARREL, 1, 15, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | MissilesPassThrough | Light | Breakable, 1, 9, 96, 3 }, -/*OBJ_BARRELEX*/ { OFILE_BARRELEX, 1, 15, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | MissilesPassThrough | Light | Breakable, 1, 10, 96, 3 }, -/*OBJ_SHRINEL*/ { OFILE_LSHRINEG, 0, 0, DTYPE_NONE, THEME_SHRINE, Q_INVALID, Light, 1, 11, 128, 3 }, -/*OBJ_SHRINER*/ { OFILE_RSHRINEG, 0, 0, DTYPE_NONE, THEME_SHRINE, Q_INVALID, Light, 1, 11, 128, 3 }, -/*OBJ_SKELBOOK*/ { OFILE_BOOK2, 0, 0, DTYPE_NONE, THEME_SKELROOM, Q_INVALID, Solid | MissilesPassThrough | Light, 4, 0, 96, 3 }, -/*OBJ_BOOKCASEL*/ { OFILE_BCASE, 0, 0, DTYPE_NONE, THEME_LIBRARY, Q_INVALID, Solid | Light, 3, 0, 96, 3 }, -/*OBJ_BOOKCASER*/ { OFILE_BCASE, 0, 0, DTYPE_NONE, THEME_LIBRARY, Q_INVALID, Solid | Light, 4, 0, 96, 3 }, -/*OBJ_BOOKSTAND*/ { OFILE_BOOK2, 0, 0, DTYPE_NONE, THEME_LIBRARY, Q_INVALID, Solid | MissilesPassThrough | Light, 1, 0, 96, 3 }, -/*OBJ_BOOKCANDLE*/ { OFILE_CANDLE2, 0, 0, DTYPE_NONE, THEME_LIBRARY, Q_INVALID, Animated | Solid | MissilesPassThrough | Light, 2, 4, 96, 0 }, -/*OBJ_BLOODFTN*/ { OFILE_BLOODFNT, 0, 0, DTYPE_NONE, THEME_BLOODFOUNTAIN, Q_INVALID, Animated | Solid | MissilesPassThrough | Light, 2, 10, 96, 3 }, -/*OBJ_DECAP*/ { OFILE_DECAP, 13, 15, DTYPE_NONE, THEME_DECAPITATED, Q_INVALID, Solid | MissilesPassThrough | Light, 1, 0, 96, 1 }, -/*OBJ_TCHEST1*/ { OFILE_CHEST1, 1, 24, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | MissilesPassThrough | Light | Trap, 1, 0, 96, 1 }, -/*OBJ_TCHEST2*/ { OFILE_CHEST2, 1, 24, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | MissilesPassThrough | Light | Trap, 1, 0, 96, 1 }, -/*OBJ_TCHEST3*/ { OFILE_CHEST3, 1, 24, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | MissilesPassThrough | Light | Trap, 1, 0, 96, 1 }, -/*OBJ_BLINDBOOK*/ { OFILE_BOOK1, 0, 0, DTYPE_NONE, THEME_NONE, Q_BLIND, Solid | MissilesPassThrough | Light, 1, 0, 96, 3 }, -/*OBJ_BLOODBOOK*/ { OFILE_BOOK1, 0, 0, DTYPE_NONE, THEME_NONE, Q_BLOOD, Solid | MissilesPassThrough | Light, 4, 0, 96, 3 }, -/*OBJ_PEDESTAL*/ { OFILE_PEDISTL, 0, 0, DTYPE_NONE, THEME_NONE, Q_BLOOD, Solid | MissilesPassThrough | Light, 1, 0, 96, 3 }, -/*OBJ_L3LDOOR*/ { OFILE_L3DOORS, 0, 0, DTYPE_CAVES, THEME_NONE, Q_INVALID, Light | Trap, 1, 0, 64, 3 }, -/*OBJ_L3RDOOR*/ { OFILE_L3DOORS, 0, 0, DTYPE_CAVES, THEME_NONE, Q_INVALID, Light | Trap, 2, 0, 64, 3 }, -/*OBJ_PURIFYINGFTN*/ { OFILE_PFOUNTN, 0, 0, DTYPE_NONE, THEME_PURIFYINGFOUNTAIN, Q_INVALID, Animated | Solid | MissilesPassThrough | Light, 2, 10, 128, 3 }, -/*OBJ_ARMORSTAND*/ { OFILE_ARMSTAND, 0, 0, DTYPE_NONE, THEME_ARMORSTAND, Q_INVALID, Solid | Light, 1, 0, 96, 3 }, -/*OBJ_ARMORSTANDN*/ { OFILE_ARMSTAND, 0, 0, DTYPE_NONE, THEME_ARMORSTAND, Q_INVALID, Solid | Light, 2, 0, 96, 0 }, -/*OBJ_GOATSHRINE*/ { OFILE_GOATSHRN, 0, 0, DTYPE_NONE, THEME_GOATSHRINE, Q_INVALID, Animated | Solid | MissilesPassThrough | Light, 2, 10, 96, 3 }, -/*OBJ_CAULDRON*/ { OFILE_CAULDREN, 13, 15, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | Light, 1, 0, 96, 3 }, -/*OBJ_MURKYFTN*/ { OFILE_MFOUNTN, 0, 0, DTYPE_NONE, THEME_MURKYFOUNTAIN, Q_INVALID, Animated | Solid | MissilesPassThrough | Light, 2, 10, 128, 3 }, -/*OBJ_TEARFTN*/ { OFILE_TFOUNTN, 0, 0, DTYPE_NONE, THEME_TEARFOUNTAIN, Q_INVALID, Animated | Solid | MissilesPassThrough | Light, 2, 4, 128, 3 }, -/*OBJ_ALTBOY*/ { OFILE_ALTBOY, 0, 0, DTYPE_NONE, THEME_NONE, Q_BETRAYER, Solid | MissilesPassThrough | Light, 1, 0, 128, 0 }, -/*OBJ_MCIRCLE1*/ { OFILE_MCIRL, 0, 0, DTYPE_NONE, THEME_NONE, Q_BETRAYER, MissilesPassThrough | Light, 1, 0, 96, 0 }, -/*OBJ_MCIRCLE2*/ { OFILE_MCIRL, 0, 0, DTYPE_NONE, THEME_NONE, Q_BETRAYER, MissilesPassThrough | Light, 1, 0, 96, 0 }, -/*OBJ_STORYBOOK*/ { OFILE_BKSLBRNT, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | MissilesPassThrough | Light, 1, 0, 96, 3 }, -/*OBJ_STORYCANDLE*/ { OFILE_CANDLE2, 0, 0, DTYPE_NONE, THEME_NONE, Q_BETRAYER, Animated | Solid | MissilesPassThrough | Light, 2, 4, 96, 0 }, -/*OBJ_STEELTOME*/ { OFILE_BOOK1, 0, 0, DTYPE_NONE, THEME_NONE, Q_WARLORD, Solid | MissilesPassThrough | Light, 4, 0, 96, 3 }, -/*OBJ_WARARMOR*/ { OFILE_ARMSTAND, 0, 0, DTYPE_NONE, THEME_NONE, Q_WARLORD, Solid | Light, 1, 0, 96, 3 }, -/*OBJ_WARWEAP*/ { OFILE_WEAPSTND, 0, 0, DTYPE_NONE, THEME_NONE, Q_WARLORD, Solid | Light, 1, 0, 96, 3 }, -/*OBJ_TBCROSS*/ { OFILE_BURNCROS, 0, 0, DTYPE_NONE, THEME_BRNCROSS, Q_INVALID, Animated | Solid, 0, 10, 160, 0 }, -/*OBJ_WEAPONRACK*/ { OFILE_WEAPSTND, 0, 0, DTYPE_NONE, THEME_WEAPONRACK, Q_INVALID, Solid | Light, 1, 0, 96, 3 }, -/*OBJ_WEAPONRACKN*/ { OFILE_WEAPSTND, 0, 0, DTYPE_NONE, THEME_WEAPONRACK, Q_INVALID, Solid | Light, 2, 0, 96, 0 }, -/*OBJ_MUSHPATCH*/ { OFILE_MUSHPTCH, 0, 0, DTYPE_NONE, THEME_NONE, Q_MUSHROOM, Solid | MissilesPassThrough | Light | Trap, 1, 0, 96, 3 }, -/*OBJ_LAZSTAND*/ { OFILE_LZSTAND, 0, 0, DTYPE_NONE, THEME_NONE, Q_BETRAYER, Solid | Light, 1, 0, 128, 3 }, -/*OBJ_SLAINHERO*/ { OFILE_DECAP, 9, 9, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | MissilesPassThrough | Light, 2, 0, 96, 1 }, -/*OBJ_SIGNCHEST*/ { OFILE_CHEST3, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | MissilesPassThrough | Light, 1, 0, 96, 1 }, -/*OBJ_BOOKSHELFR*/ { OFILE_BCASE, 0, 0, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | Light, 2, 0, 96, 0 }, -/*OBJ_POD*/ { OFILE_POD, 17, 20, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | MissilesPassThrough | Light | Breakable, 1, 9, 96, 3 }, -/*OBJ_PODEX*/ { OFILE_PODEX, 17, 20, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | MissilesPassThrough | Light | Breakable, 1, 10, 96, 3 }, -/*OBJ_URN*/ { OFILE_URN, 21, 24, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | MissilesPassThrough | Light | Breakable, 1, 9, 96, 3 }, -/*OBJ_URNEX*/ { OFILE_URNEX, 21, 24, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | MissilesPassThrough | Light | Breakable, 1, 10, 96, 3 }, -/*OBJ_L5BOOKS*/ { OFILE_L5BOOKS, 21, 24, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | MissilesPassThrough | Light, 1, 0, 96, 3 }, -/*OBJ_L5CANDLE*/ { OFILE_L5CANDLE, 21, 23, DTYPE_NONE, THEME_NONE, Q_INVALID, Animated | Solid | MissilesPassThrough | Light, 2, 4, 96, 0 }, -/*OBJ_L5LDOOR*/ { OFILE_L5DOORS, 0, 0, DTYPE_CRYPT, THEME_NONE, Q_INVALID, Light | Trap, 1, 0, 64, 3 }, -/*OBJ_L5RDOOR*/ { OFILE_L5DOORS, 0, 0, DTYPE_CRYPT, THEME_NONE, Q_INVALID, Light | Trap, 2, 0, 64, 3 }, -/*OBJ_L5LEVER*/ { OFILE_L5LEVER, 24, 24, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | MissilesPassThrough | Light | Trap, 1, 1, 96, 1 }, -/*OBJ_L5SARC*/ { OFILE_L5SARC, 21, 24, DTYPE_NONE, THEME_NONE, Q_INVALID, Solid | MissilesPassThrough | Light | Trap, 1, 5, 128, 3 }, - // clang-format on -}; -/** Maps from object_graphic_id to object CEL name. */ -const char *const ObjMasterLoadList[] = { - "l1braz", - "l1doors", - "lever", - "chest1", - "chest2", - "banner", - "skulpile", - "skulfire", - "skulstik", - "cruxsk1", - "cruxsk2", - "cruxsk3", - "book1", - "book2", - "rockstan", - "angel", - "chest3", - "burncros", - "candle2", - "nude2", - "switch4", - "tnudem", - "tnudew", - "tsoul", - "l2doors", - "wtorch4", - "wtorch3", - "sarc", - "flame1", - "prsrplt1", - "traphole", - "miniwatr", - "wtorch2", - "wtorch1", - "bcase", - "bshelf", - "weapstnd", - "barrel", - "barrelex", - "lshrineg", - "rshrineg", - "bloodfnt", - "decap", - "pedistl", - "l3doors", - "pfountn", - "armstand", - "goatshrn", - "cauldren", - "mfountn", - "tfountn", - "altboy", - "mcirl", - "bkslbrnt", - "mushptch", - "lzstand", - "l6pod1", - "l6pod2", - "l5door", - "l5lever", - "l5light", - "l5sarco", - "urn", - "urnexpld", - "l5books", -}; +void LoadObjectData() +{ + const std::string_view filename = "txtdata\\objects\\objdat.tsv"; + DataFile dataFile = DataFile::loadOrDie(filename); + dataFile.skipHeaderOrDie(filename); + + AllObjects.clear(); + ObjMasterLoadList.clear(); + + ankerl::unordered_dense::map filenameToId; + + for (DataFileRecord record : dataFile) { + RecordReader reader { record, filename }; + ObjectData &item = AllObjects.emplace_back(); + + reader.advance(); // skip id + + std::string filename; + reader.readString("file", filename); + if (const auto it = filenameToId.find(filename); it != filenameToId.end()) { + item.ofindex = it->second; + } else { + const auto id = static_cast(ObjMasterLoadList.size()); + ObjMasterLoadList.push_back(filename); + filenameToId.emplace(std::move(filename), id); + item.ofindex = id; + } + + reader.readInt("minLevel", item.minlvl); + reader.readInt("maxLevel", item.maxlvl); + reader.read("levelType", item.olvltype, ParseDungeonType); + reader.read("theme", item.otheme, ParseTheme); + reader.read("quest", item.oquest, ParseQuest); + reader.readEnumList("flags", item.flags, ParseObjectDataFlags); + reader.readInt("animDelay", item.animDelay); + reader.readInt("animLen", item.animLen); + reader.readInt("animWidth", item.animWidth); + reader.readInt("selFlag", item.selFlag); + } + + // Sanity check because we do not actually parse the IDs yet. + assert(static_cast(OBJ_LAST) + 1 == AllObjects.size()); + + AllObjects.shrink_to_fit(); + ObjMasterLoadList.shrink_to_fit(); +} } // namespace devilution diff --git a/Source/objdat.h b/Source/objdat.h index 8e697ae4850..fa5e1422865 100644 --- a/Source/objdat.h +++ b/Source/objdat.h @@ -6,6 +6,7 @@ #pragma once #include +#include #include "levels/gendung.h" #include "utils/enum_traits.h" @@ -33,74 +34,8 @@ enum theme_id : int8_t { THEME_NONE = -1, }; -enum object_graphic_id : int8_t { - OFILE_L1BRAZ, - OFILE_L1DOORS, - OFILE_LEVER, - OFILE_CHEST1, - OFILE_CHEST2, - OFILE_BANNER, - OFILE_SKULPILE, - OFILE_SKULFIRE, - OFILE_SKULSTIK, - OFILE_CRUXSK1, - OFILE_CRUXSK2, - OFILE_CRUXSK3, - OFILE_BOOK1, - OFILE_BOOK2, - OFILE_ROCKSTAN, - OFILE_ANGEL, - OFILE_CHEST3, - OFILE_BURNCROS, - OFILE_CANDLE2, - OFILE_NUDE2, - OFILE_SWITCH4, - OFILE_TNUDEM, - OFILE_TNUDEW, - OFILE_TSOUL, - OFILE_L2DOORS, - OFILE_WTORCH4, - OFILE_WTORCH3, - OFILE_SARC, - OFILE_FLAME1, - OFILE_PRSRPLT1, - OFILE_TRAPHOLE, - OFILE_MINIWATR, - OFILE_WTORCH2, - OFILE_WTORCH1, - OFILE_BCASE, - OFILE_BSHELF, - OFILE_WEAPSTND, - OFILE_BARREL, - OFILE_BARRELEX, - OFILE_LSHRINEG, - OFILE_RSHRINEG, - OFILE_BLOODFNT, - OFILE_DECAP, - OFILE_PEDISTL, - OFILE_L3DOORS, - OFILE_PFOUNTN, - OFILE_ARMSTAND, - OFILE_GOATSHRN, - OFILE_CAULDREN, - OFILE_MFOUNTN, - OFILE_TFOUNTN, - OFILE_ALTBOY, - OFILE_MCIRL, - OFILE_BKSLBRNT, - OFILE_MUSHPTCH, - OFILE_LZSTAND, - OFILE_POD, - OFILE_PODEX, - OFILE_L5DOORS, - OFILE_L5LEVER, - OFILE_L5CANDLE, - OFILE_L5SARC, - OFILE_URN, - OFILE_URNEX, - OFILE_L5BOOKS, - OFILE_NULL = -1, -}; +// Index into ObjMasterLoadList. +using object_graphic_id = uint8_t; enum _object_id : int8_t { OBJ_L1LIGHT, @@ -212,6 +147,8 @@ enum _object_id : int8_t { OBJ_L5RDOOR, OBJ_L5LEVER, OBJ_L5SARC, + + OBJ_LAST = OBJ_L5SARC, OBJ_NULL = -1, }; @@ -244,6 +181,7 @@ enum quest_id : int8_t { }; enum class ObjectDataFlags : uint8_t { + None = 0, Animated = 1U, Solid = 1U << 1, MissilesPassThrough = 1U << 2, @@ -298,7 +236,9 @@ struct ObjectData { }; extern const _object_id ObjTypeConv[]; -extern const ObjectData AllObjects[109]; -extern const char *const ObjMasterLoadList[]; +extern std::vector AllObjects; +extern std::vector ObjMasterLoadList; + +void LoadObjectData(); } // namespace devilution diff --git a/Source/objects.cpp b/Source/objects.cpp index 2cd1d279b3b..f67b63286e6 100644 --- a/Source/objects.cpp +++ b/Source/objects.cpp @@ -35,6 +35,7 @@ #include "minitext.h" #include "missiles.h" #include "monster.h" +#include "objdat.h" #include "options.h" #include "qol/stash.h" #include "stores.h" @@ -3681,7 +3682,7 @@ void LoadLevelObjects(uint16_t filesWidths[65]) } } - for (int i = OFILE_L1BRAZ; i <= OFILE_L5BOOKS; i++) { + for (size_t i = 0, n = ObjMasterLoadList.size(); i < n; ++i) { if (filesWidths[i] == 0) { continue; } @@ -3699,13 +3700,16 @@ void InitObjectGFX() uint16_t filesWidths[65] = {}; if (IsAnyOf(currlevel, 4, 8, 12)) { - filesWidths[OFILE_BKSLBRNT] = AllObjects[OBJ_STORYBOOK].animWidth; - filesWidths[OFILE_CANDLE2] = AllObjects[OBJ_STORYCANDLE].animWidth; + for (const auto id : { OBJ_STORYBOOK, OBJ_STORYCANDLE }) { + const ObjectData &obj = AllObjects[id]; + filesWidths[obj.ofindex] = obj.animWidth; + } } - for (const ObjectData objectData : AllObjects) { + for (size_t id = 0, n = AllObjects.size(); id < n; ++id) { + const ObjectData &objectData = AllObjects[id]; if (objectData.minlvl != 0 && currlevel >= objectData.minlvl && currlevel <= objectData.maxlvl) { - if (IsAnyOf(objectData.ofindex, OFILE_TRAPHOLE, OFILE_TRAPHOLE) && leveltype == DTYPE_HELL) { + if (IsAnyOf(static_cast<_object_id>(id), OBJ_TRAPL, OBJ_TRAPR) && leveltype == DTYPE_HELL) { continue; } diff --git a/assets/txtdata/objects/objdat.tsv b/assets/txtdata/objects/objdat.tsv new file mode 100644 index 00000000000..be0e43af8e8 --- /dev/null +++ b/assets/txtdata/objects/objdat.tsv @@ -0,0 +1,110 @@ +id file minLevel maxLevel levelType theme quest flags animDelay animLen animWidth selFlag +OBJ_L1LIGHT l1braz 0 0 DTYPE_CATHEDRAL Animated,Solid,MissilesPassThrough 1 26 64 0 +OBJ_L1LDOOR l1doors 0 0 DTYPE_CATHEDRAL Light,Trap 1 0 64 3 +OBJ_L1RDOOR l1doors 0 0 DTYPE_CATHEDRAL Light,Trap 2 0 64 3 +OBJ_SKFIRE skulfire 0 0 THEME_SKELROOM Animated,Solid,MissilesPassThrough 2 11 96 0 +OBJ_LEVER lever 0 0 Solid,MissilesPassThrough,Light,Trap 1 1 96 1 +OBJ_CHEST1 chest1 1 24 Solid,MissilesPassThrough,Light,Trap 1 0 96 1 +OBJ_CHEST2 chest2 1 24 Solid,MissilesPassThrough,Light,Trap 1 0 96 1 +OBJ_CHEST3 chest3 1 24 Solid,MissilesPassThrough,Light,Trap 1 0 96 1 +OBJ_CANDLE1 l1braz 0 0 0 0 0 0 +OBJ_CANDLE2 candle2 0 0 THEME_SHRINE Q_PWATER Animated,Solid,MissilesPassThrough,Light 2 4 96 0 +OBJ_CANDLEO l1braz 0 0 0 0 0 0 +OBJ_BANNERL banner 0 0 THEME_SKELROOM Solid,MissilesPassThrough,Light 2 0 96 0 +OBJ_BANNERM banner 0 0 THEME_SKELROOM Solid,MissilesPassThrough,Light 1 0 96 0 +OBJ_BANNERR banner 0 0 THEME_SKELROOM Solid,MissilesPassThrough,Light 3 0 96 0 +OBJ_SKPILE skulpile 0 0 Solid,MissilesPassThrough,Light 1 1 96 0 +OBJ_SKSTICK1 l1braz 0 0 0 0 0 0 +OBJ_SKSTICK2 l1braz 0 0 0 0 0 0 +OBJ_SKSTICK3 l1braz 0 0 0 0 0 0 +OBJ_SKSTICK4 l1braz 0 0 0 0 0 0 +OBJ_SKSTICK5 l1braz 0 0 0 0 0 0 +OBJ_CRUX1 cruxsk1 0 0 Solid,Light,Breakable 1 15 96 3 +OBJ_CRUX2 cruxsk2 0 0 Solid,Light,Breakable 1 15 96 3 +OBJ_CRUX3 cruxsk3 0 0 Solid,Light,Breakable 1 15 96 3 +OBJ_STAND rockstan 5 5 Solid,MissilesPassThrough,Light 1 0 96 0 +OBJ_ANGEL angel 0 0 Solid,Light 1 0 96 0 +OBJ_BOOK2L book2 0 0 Solid,MissilesPassThrough,Light 1 0 96 3 +OBJ_BCROSS burncros 0 0 Animated,Solid 0 10 160 0 +OBJ_NUDEW2R nude2 0 0 Animated,Solid,Light 3 6 128 0 +OBJ_SWITCHSKL switch4 16 16 Solid,MissilesPassThrough,Light,Trap 1 0 96 1 +OBJ_TNUDEM1 tnudem 13 15 Q_BUTCHER Solid,Light 1 0 128 0 +OBJ_TNUDEM2 tnudem 13 15 THEME_TORTURE Q_BUTCHER Solid,Light 2 0 128 0 +OBJ_TNUDEM3 tnudem 13 15 THEME_TORTURE Q_BUTCHER Solid,Light 3 0 128 0 +OBJ_TNUDEM4 tnudem 13 15 THEME_TORTURE Q_BUTCHER Solid,Light 4 0 128 0 +OBJ_TNUDEW1 tnudew 13 15 THEME_TORTURE Q_BUTCHER Solid,Light 1 0 128 0 +OBJ_TNUDEW2 tnudew 13 15 THEME_TORTURE Q_BUTCHER Solid,Light 2 0 128 0 +OBJ_TNUDEW3 tnudew 13 15 THEME_TORTURE Q_BUTCHER Solid,Light 3 0 128 0 +OBJ_TORTURE1 tsoul 13 15 Q_BUTCHER MissilesPassThrough,Light 1 0 128 0 +OBJ_TORTURE2 tsoul 13 15 Q_BUTCHER MissilesPassThrough,Light 2 0 128 0 +OBJ_TORTURE3 tsoul 13 15 Q_BUTCHER MissilesPassThrough,Light 3 0 128 0 +OBJ_TORTURE4 tsoul 13 15 Q_BUTCHER MissilesPassThrough,Light 4 0 128 0 +OBJ_TORTURE5 tsoul 13 15 Q_BUTCHER MissilesPassThrough,Light 5 0 128 0 +OBJ_BOOK2R book2 6 6 Solid,MissilesPassThrough,Light 4 0 96 3 +OBJ_L2LDOOR l2doors 0 0 DTYPE_CATACOMBS Light,Trap 1 0 64 3 +OBJ_L2RDOOR l2doors 0 0 DTYPE_CATACOMBS Light,Trap 2 0 64 3 +OBJ_TORCHL wtorch4 5 8 Animated,MissilesPassThrough 1 9 96 0 +OBJ_TORCHR wtorch3 5 8 Animated,MissilesPassThrough 1 9 96 0 +OBJ_TORCHL2 wtorch1 5 8 Animated,MissilesPassThrough 1 9 96 0 +OBJ_TORCHR2 wtorch2 5 8 Animated,MissilesPassThrough 1 9 96 0 +OBJ_SARC sarc 1 4 Solid,MissilesPassThrough,Light,Trap 1 5 128 3 +OBJ_FLAMEHOLE flame1 0 0 MissilesPassThrough,Light 1 20 96 0 +OBJ_FLAMELVR lever 0 0 Solid,MissilesPassThrough,Light,Trap 1 2 96 1 +OBJ_WATER miniwatr 0 0 Animated,Solid,Light 1 10 64 0 +OBJ_BOOKLVR book1 0 0 Solid,MissilesPassThrough,Light 1 0 96 3 +OBJ_TRAPL traphole 1 24 MissilesPassThrough,Light 1 0 64 0 +OBJ_TRAPR traphole 1 24 MissilesPassThrough,Light 2 0 64 0 +OBJ_BOOKSHELF bcase 0 0 Solid,Light 1 0 96 0 +OBJ_WEAPRACK weapstnd 0 0 Solid,Light 1 0 96 0 +OBJ_BARREL barrel 1 15 Solid,MissilesPassThrough,Light,Breakable 1 9 96 3 +OBJ_BARRELEX barrelex 1 15 Solid,MissilesPassThrough,Light,Breakable 1 10 96 3 +OBJ_SHRINEL lshrineg 0 0 THEME_SHRINE Light 1 11 128 3 +OBJ_SHRINER rshrineg 0 0 THEME_SHRINE Light 1 11 128 3 +OBJ_SKELBOOK book2 0 0 THEME_SKELROOM Solid,MissilesPassThrough,Light 4 0 96 3 +OBJ_BOOKCASEL bcase 0 0 THEME_LIBRARY Solid,Light 3 0 96 3 +OBJ_BOOKCASER bcase 0 0 THEME_LIBRARY Solid,Light 4 0 96 3 +OBJ_BOOKSTAND book2 0 0 THEME_LIBRARY Solid,MissilesPassThrough,Light 1 0 96 3 +OBJ_BOOKCANDLE candle2 0 0 THEME_LIBRARY Animated,Solid,MissilesPassThrough,Light 2 4 96 0 +OBJ_BLOODFTN bloodfnt 0 0 THEME_BLOODFOUNTAIN Animated,Solid,MissilesPassThrough,Light 2 10 96 3 +OBJ_DECAP decap 13 15 THEME_DECAPITATED Solid,MissilesPassThrough,Light 1 0 96 1 +OBJ_TCHEST1 chest1 1 24 Solid,MissilesPassThrough,Light,Trap 1 0 96 1 +OBJ_TCHEST2 chest2 1 24 Solid,MissilesPassThrough,Light,Trap 1 0 96 1 +OBJ_TCHEST3 chest3 1 24 Solid,MissilesPassThrough,Light,Trap 1 0 96 1 +OBJ_BLINDBOOK book1 0 0 Q_BLIND Solid,MissilesPassThrough,Light 1 0 96 3 +OBJ_BLOODBOOK book1 0 0 Q_BLOOD Solid,MissilesPassThrough,Light 4 0 96 3 +OBJ_PEDESTAL pedistl 0 0 Q_BLOOD Solid,MissilesPassThrough,Light 1 0 96 3 +OBJ_L3LDOOR l3doors 0 0 DTYPE_CAVES Light,Trap 1 0 64 3 +OBJ_L3RDOOR l3doors 0 0 DTYPE_CAVES Light,Trap 2 0 64 3 +OBJ_PURIFYINGFTN pfountn 0 0 THEME_PURIFYINGFOUNTAIN Animated,Solid,MissilesPassThrough,Light 2 10 128 3 +OBJ_ARMORSTAND armstand 0 0 THEME_ARMORSTAND Solid,Light 1 0 96 3 +OBJ_ARMORSTANDN armstand 0 0 THEME_ARMORSTAND Solid,Light 2 0 96 0 +OBJ_GOATSHRINE goatshrn 0 0 THEME_GOATSHRINE Animated,Solid,MissilesPassThrough,Light 2 10 96 3 +OBJ_CAULDRON cauldren 13 15 Solid,Light 1 0 96 3 +OBJ_MURKYFTN mfountn 0 0 THEME_MURKYFOUNTAIN Animated,Solid,MissilesPassThrough,Light 2 10 128 3 +OBJ_TEARFTN tfountn 0 0 THEME_TEARFOUNTAIN Animated,Solid,MissilesPassThrough,Light 2 4 128 3 +OBJ_ALTBOY altboy 0 0 Q_BETRAYER Solid,MissilesPassThrough,Light 1 0 128 0 +OBJ_MCIRCLE1 mcirl 0 0 Q_BETRAYER MissilesPassThrough,Light 1 0 96 0 +OBJ_MCIRCLE2 mcirl 0 0 Q_BETRAYER MissilesPassThrough,Light 1 0 96 0 +OBJ_STORYBOOK bkslbrnt 0 0 Solid,MissilesPassThrough,Light 1 0 96 3 +OBJ_STORYCANDLE candle2 0 0 Q_BETRAYER Animated,Solid,MissilesPassThrough,Light 2 4 96 0 +OBJ_STEELTOME book1 0 0 Q_WARLORD Solid,MissilesPassThrough,Light 4 0 96 3 +OBJ_WARARMOR armstand 0 0 Q_WARLORD Solid,Light 1 0 96 3 +OBJ_WARWEAP weapstnd 0 0 Q_WARLORD Solid,Light 1 0 96 3 +OBJ_TBCROSS burncros 0 0 THEME_BRNCROSS Animated,Solid 0 10 160 0 +OBJ_WEAPONRACK weapstnd 0 0 THEME_WEAPONRACK Solid,Light 1 0 96 3 +OBJ_WEAPONRACKN weapstnd 0 0 THEME_WEAPONRACK Solid,Light 2 0 96 0 +OBJ_MUSHPATCH mushptch 0 0 Q_MUSHROOM Solid,MissilesPassThrough,Light,Trap 1 0 96 3 +OBJ_LAZSTAND lzstand 0 0 Q_BETRAYER Solid,Light 1 0 128 3 +OBJ_SLAINHERO decap 9 9 Solid,MissilesPassThrough,Light 2 0 96 1 +OBJ_SIGNCHEST chest3 0 0 Solid,MissilesPassThrough,Light 1 0 96 1 +OBJ_BOOKSHELFR bcase 0 0 Solid,Light 2 0 96 0 +OBJ_POD l6pod1 17 20 Solid,MissilesPassThrough,Light,Breakable 1 9 96 3 +OBJ_PODEX l6pod2 17 20 Solid,MissilesPassThrough,Light,Breakable 1 10 96 3 +OBJ_URN urn 21 24 Solid,MissilesPassThrough,Light,Breakable 1 9 96 3 +OBJ_URNEX urnexpld 21 24 Solid,MissilesPassThrough,Light,Breakable 1 10 96 3 +OBJ_L5BOOKS l5books 21 24 Solid,MissilesPassThrough,Light 1 0 96 3 +OBJ_L5CANDLE l5light 21 23 Animated,Solid,MissilesPassThrough,Light 2 4 96 0 +OBJ_L5LDOOR l5door 0 0 DTYPE_CRYPT Light,Trap 1 0 64 3 +OBJ_L5RDOOR l5door 0 0 DTYPE_CRYPT Light,Trap 2 0 64 3 +OBJ_L5LEVER l5lever 24 24 Solid,MissilesPassThrough,Light,Trap 1 1 96 1 +OBJ_L5SARC l5sarco 21 24 Solid,MissilesPassThrough,Light,Trap 1 5 128 3 diff --git a/test/timedemo_test.cpp b/test/timedemo_test.cpp index 28fd3915508..9a783e23438 100644 --- a/test/timedemo_test.cpp +++ b/test/timedemo_test.cpp @@ -57,6 +57,7 @@ void RunTimedemo(std::string timedemoFolderName) LoadMissileData(); LoadMonsterData(); LoadItemData(); + LoadObjectData(); pfile_ui_set_hero_infos(Dummy_GetHeroInfo); gbLoadGame = true; diff --git a/uwp-project/devilutionx.vcxproj b/uwp-project/devilutionx.vcxproj index 81689119674..75a2553dfd9 100644 --- a/uwp-project/devilutionx.vcxproj +++ b/uwp-project/devilutionx.vcxproj @@ -79,7 +79,7 @@ pch.h $(IntDir)pch.pch - ..\Source;..\build\SDL\include;..\build\_deps\sdl_audiolib-src\include;..\build\_deps\sdl_audiolib-build;%(AdditionalIncludeDirectories) + ..\Source;..\build\SDL\include;..\build\_deps\sdl_audiolib-src\include;..\build\_deps\sdl_audiolib-build;..\3rdParty\tl;%(AdditionalIncludeDirectories) /bigobj %(AdditionalOptions) 4453;28204 _DEBUG;__UWP__=1;%(PreprocessorDefinitions) @@ -102,7 +102,7 @@ 4453;28204 NDEBUG;__UWP__=1;%(PreprocessorDefinitions) NotUsing - ..\Source;..\build\SDL\include;..\build\_deps\sdl_audiolib-src\include;..\build\_deps\sdl_audiolib-build;%(AdditionalIncludeDirectories) + ..\Source;..\build\SDL\include;..\build\_deps\sdl_audiolib-src\include;..\build\_deps\sdl_audiolib-build;..\3rdParty\tl;%(AdditionalIncludeDirectories) stdcpp17 @@ -142,4 +142,4 @@ - \ No newline at end of file +