Files
devilutionX/Source/panels/info_box.cpp
T
Gleb Mazovetskiy 7fede6c4cb Clean up owned/unowned CelSprite ambiguity
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.
2022-03-06 04:49:13 +01:00

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