diff --git a/Packaging/resources/assets/data/xpbar.clx b/Packaging/resources/assets/data/xpbar.clx index 154f132a0..98f7e9170 100644 Binary files a/Packaging/resources/assets/data/xpbar.clx and b/Packaging/resources/assets/data/xpbar.clx differ diff --git a/Source/qol/xpbar.cpp b/Source/qol/xpbar.cpp index 659faf553..c3c1f8259 100644 --- a/Source/qol/xpbar.cpp +++ b/Source/qol/xpbar.cpp @@ -9,9 +9,11 @@ #include -#include "DiabloUI/art_draw.h" #include "control.h" +#include "engine/clx_sprite.hpp" +#include "engine/load_clx.hpp" #include "engine/point.hpp" +#include "engine/render/clx_render.hpp" #include "options.h" #include "utils/format_int.hpp" #include "utils/language.h" @@ -29,7 +31,7 @@ constexpr ColorGradient SilverGradient = { 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0 constexpr int BackWidth = 313; constexpr int BackHeight = 9; -Art xpbarArt; +OptionalOwnedClxSpriteList xpbarArt; void DrawBar(const Surface &out, Point screenPosition, int width, const ColorGradient &gradient) { @@ -50,9 +52,9 @@ void DrawEndCap(const Surface &out, Point point, int idx, const ColorGradient &g void InitXPBar() { if (*sgOptions.Gameplay.experienceBar) { - LoadMaskedArt("data\\xpbar.pcx", &xpbarArt, 1, 1); + xpbarArt = LoadOptionalClx("data\\xpbar.clx"); - if (xpbarArt.surface == nullptr) { + if (!xpbarArt) { app_fatal(_("Failed to load UI resources.\n" "\n" "Make sure devilutionx.mpq is in the game folder and that it is up to date.")); @@ -62,7 +64,7 @@ void InitXPBar() void FreeXPBar() { - xpbarArt.Unload(); + xpbarArt = std::nullopt; } void DrawXPBar(const Surface &out) @@ -76,7 +78,7 @@ void DrawXPBar(const Surface &out) const Point back = { mainPanel.position.x + mainPanel.size.width / 2 - 155, mainPanel.position.y + mainPanel.size.height - 11 }; const Point position = back + Displacement { 3, 2 }; - DrawArt(out, back, &xpbarArt); + RenderClxSprite(out, (*xpbarArt)[0], back); const int8_t charLevel = player._pLevel;