mirror of
https://github.com/libretro/devilutionX.git
synced 2026-11-09 17:22:49 -10:00
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.
23 lines
536 B
C++
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
|