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.
19 lines
459 B
C++
19 lines
459 B
C++
#include "engine/load_cl2.hpp"
|
|
|
|
#include <memory>
|
|
#include <utility>
|
|
|
|
#include "engine/load_file.hpp"
|
|
#include "utils/cl2_to_clx.hpp"
|
|
|
|
namespace devilution {
|
|
|
|
OwnedClxSpriteListOrSheet LoadCl2ListOrSheet(const char *pszName, PointerOrValue<uint16_t> widthOrWidths)
|
|
{
|
|
size_t size;
|
|
std::unique_ptr<uint8_t[]> data = LoadFileInMem<uint8_t>(pszName, &size);
|
|
return Cl2ToClx(std::move(data), size, widthOrWidths);
|
|
}
|
|
|
|
} // namespace devilution
|