Files
devilutionX/Source/engine/load_cel.cpp
T
Gleb Mazovetskiy 961866e1c4 CLX: A new graphics format
The format is almost identical to CL2, except it uses the frame header
to store frame width and height instead of 5 32-line offsets.

This means we always have access to frame dimensions, so we can use it
as an on-disk format for our graphics as well.

Additionally, we may be able to optimize the rendering even more
in the future now that we have guaranteed knowledge of frame dimensions.
2022-08-03 02:38:55 +02:00

23 lines
536 B
C++

#include "engine/load_cel.hpp"
#ifdef DEBUG_CEL_TO_CL2_SIZE
#include <iostream>
#endif
#include "engine/load_file.hpp"
#include "utils/cel_to_clx.hpp"
namespace devilution {
OwnedClxSpriteListOrSheet LoadCelListOrSheet(const char *pszName, PointerOrValue<uint16_t> widthOrWidths)
{
size_t size;
std::unique_ptr<uint8_t[]> data = LoadFileInMem<uint8_t>(pszName, &size);
#ifdef DEBUG_CEL_TO_CL2_SIZE
std::cout << pszName;
#endif
return CelToClx(data.get(), size, widthOrWidths);
}
} // namespace devilution