From e9e67b3971fbd2bf243e5232203c5dcd37001642 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Tue, 14 Feb 2023 04:09:14 +0000 Subject: [PATCH] Load combined missile CLX in UNPACKED_MPQS mode Companion PR: https://github.com/diasurgical/devilutionx-mpq-tools/pull/8 --- Source/misdat.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/misdat.cpp b/Source/misdat.cpp index e43aa8520..9e52b620e 100644 --- a/Source/misdat.cpp +++ b/Source/misdat.cpp @@ -6,6 +6,7 @@ #include "misdat.h" #include "engine/load_cl2.hpp" +#include "engine/load_clx.hpp" #include "missiles.h" #include "mpq/mpq_common.hpp" #include "utils/file_name_generator.hpp" @@ -286,6 +287,11 @@ void MissileFileData::LoadGFX() if (name[0] == '\0') return; +#ifdef UNPACKED_MPQS + char path[MaxMpqPathSize]; + *BufCopy(path, "missiles\\", name, ".clx") = '\0'; + sprites.emplace(OwnedClxSpriteListOrSheet { LoadClxListOrSheet(path) }); +#else if (animFAmt == 1) { char path[MaxMpqPathSize]; *BufCopy(path, "missiles\\", name) = '\0'; @@ -294,6 +300,7 @@ void MissileFileData::LoadGFX() FileNameGenerator pathGenerator({ "missiles\\", name }, DEVILUTIONX_CL2_EXT); sprites.emplace(OwnedClxSpriteListOrSheet { LoadMultipleCl2Sheet<16>(pathGenerator, animFAmt, animWidth) }); } +#endif } void InitMissileGFX(bool loadHellfireGraphics)