mirror of
https://github.com/diasurgical/DevilutionX.git
synced 2026-10-12 11:00:04 +00:00
https://github.com/diasurgical/devilutionx-mpq-tools produces an unpacked MPQ with all the graphics converted to CLX and the unused files removed. This is primarily useful on RAM-constrained platforms, such as PS2, because it eliminates the MPQ overhead. Adds a build option to load from such unpacked directories instead of the MPQ. These directories are searched for in the same locations where the MPQs would be searched for otherwise. Example directory layout: * /usr/local/share/diasurgical/devilutionx/diabdat/ -- unpacked and converted diabdat.mpq * /usr/local/share/diasurgical/devilutionx/hellfire/ -- unpacked and converted hellfire MPQs (all of them merged into 1 directory) * /usr/local/share/diasurgical/devilutionx/fonts/ -- unpacked fonts.mpq * /usr/local/share/diasurgical/devilutionx/pl/ -- unpacked pl.mpq These directory structure is produced by calling `unpack_and_minify_mpq`
34 lines
889 B
C++
34 lines
889 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
|
|
#include "engine/clx_sprite.hpp"
|
|
#include "utils/pointer_value_union.hpp"
|
|
|
|
#ifdef UNPACKED_MPQS
|
|
#define DEVILUTIONX_CEL_EXT ".clx"
|
|
#else
|
|
#define DEVILUTIONX_CEL_EXT ".cel"
|
|
#endif
|
|
|
|
namespace devilution {
|
|
|
|
OwnedClxSpriteListOrSheet LoadCelListOrSheet(const char *pszName, PointerOrValue<uint16_t> widthOrWidths);
|
|
|
|
inline OwnedClxSpriteList LoadCel(const char *pszName, uint16_t width)
|
|
{
|
|
return LoadCelListOrSheet(pszName, PointerOrValue<uint16_t> { width }).list();
|
|
}
|
|
|
|
inline OwnedClxSpriteList LoadCel(const char *pszName, const uint16_t *widths)
|
|
{
|
|
return LoadCelListOrSheet(pszName, PointerOrValue<uint16_t> { widths }).list();
|
|
}
|
|
|
|
inline OwnedClxSpriteSheet LoadCelSheet(const char *pszName, uint16_t width)
|
|
{
|
|
return LoadCelListOrSheet(pszName, PointerOrValue<uint16_t> { width }).sheet();
|
|
}
|
|
|
|
} // namespace devilution
|