Files
devilutionX/Source/panels/info_box.cpp
T
Gleb Mazovetskiy 8ca71272b8 Load all CEL as CL2
Convert CEL files to CL2 at load time. CL2 format is more efficient and is about as fast to render.

CEL vs CL2 sizes, on dLvl 5: https://gist.github.com/glebm/9bbdd76962abcd4fd2405ecd3379af97

Memory:

* Peak memory (while loading): -300 KiB
* Memory in-game (dLvl5): -700 KiB
* RG99 binary size: -15 KiB (1333096 -> 1317192)

Performance on rg99:

* On average, -1 FPS in town.
* Same FPS in dungeon (20 FPS on dLvl 1).
2022-07-19 10:59:35 +02:00

23 lines
447 B
C++

#include "panels/info_box.hpp"
#include "engine/load_cel.hpp"
namespace devilution {
OptionalOwnedCelSprite pSTextBoxCels;
OptionalOwnedCelSprite pSTextSlidCels;
void InitInfoBoxGfx()
{
pSTextSlidCels = LoadCelAsCl2("Data\\TextSlid.CEL", 12);
pSTextBoxCels = LoadCelAsCl2("Data\\TextBox2.CEL", 271);
}
void FreeInfoBoxGfx()
{
pSTextBoxCels = std::nullopt;
pSTextSlidCels = std::nullopt;
}
} // namespace devilution