Files
DevilutionX/Source/engine/load_cel.cpp
Gleb Mazovetskiy 5bf0b8bc96 Add more missing <cstdint> includes
https://github.com/diasurgical/devilutionX/pull/6095 only added includes
for `uint32_t`, this PR also adds the includes for the remaining
integral types.
2023-05-10 16:29:27 +01:00

39 lines
860 B
C++

#include "engine/load_cel.hpp"
#include <cstddef>
#include <cstdint>
#ifdef DEBUG_CEL_TO_CL2_SIZE
#include <iostream>
#endif
#include "mpq/mpq_common.hpp"
#include "utils/str_cat.hpp"
#ifdef UNPACKED_MPQS
#include "engine/load_clx.hpp"
#else
#include "engine/load_file.hpp"
#include "utils/cel_to_clx.hpp"
#endif
namespace devilution {
OwnedClxSpriteListOrSheet LoadCelListOrSheet(const char *pszName, PointerOrValue<uint16_t> widthOrWidths)
{
char path[MaxMpqPathSize];
*BufCopy(path, pszName, DEVILUTIONX_CEL_EXT) = '\0';
#ifdef UNPACKED_MPQS
return LoadClxListOrSheet(path);
#else
size_t size;
std::unique_ptr<uint8_t[]> data = LoadFileInMem<uint8_t>(path, &size);
#ifdef DEBUG_CEL_TO_CL2_SIZE
std::cout << path;
#endif
return CelToClx(data.get(), size, widthOrWidths);
#endif
}
} // namespace devilution