mirror of
https://github.com/libretro/devilutionX.git
synced 2026-11-13 04:34:45 -10:00
Makes `CelSprite` unowned and adds a new `OwnedCelSprite` class for owned sprites. This clarifies ownership and makes the code cleaner in a number of places. Additionally, because the `CelSprite` class is now tiny (1 less pointer), we can pass it by-value instead of by-reference, removing a pointer indirection in the rendering functions.
23 lines
451 B
C++
23 lines
451 B
C++
#include "panels/info_box.hpp"
|
|
|
|
#include "engine/load_cel.hpp"
|
|
|
|
namespace devilution {
|
|
|
|
std::optional<OwnedCelSprite> pSTextBoxCels;
|
|
std::optional<OwnedCelSprite> pSTextSlidCels;
|
|
|
|
void InitInfoBoxGfx()
|
|
{
|
|
pSTextSlidCels = LoadCel("Data\\TextSlid.CEL", 12);
|
|
pSTextBoxCels = LoadCel("Data\\TextBox2.CEL", 271);
|
|
}
|
|
|
|
void FreeInfoBoxGfx()
|
|
{
|
|
pSTextBoxCels = std::nullopt;
|
|
pSTextSlidCels = std::nullopt;
|
|
}
|
|
|
|
} // namespace devilution
|