mirror of
https://github.com/libretro/devilutionX.git
synced 2026-11-09 17:22:49 -10:00
Converted using the following commands: ``` cd Packaging/resources/assets pcx2clx --transparent-color 1 --num-sprites 256 fonts/*.pcx && rm fonts/*.pcx pcx2clx --num-sprites 2 ui_art/dvl_but_sml.pcx && rm ui_art/dvl_but_sml.pcx pcx2clx --transparent-color 1 data/hintbox.pcx data/hintboxbackground.pcx && rm data/hintbox.pcx data/hintboxbackground.pcx pcx2clx --transparent-color 1 --num-sprites 6 data/hinticons.pcx && rm data/hinticons.pcx pcx2clx --num-sprites 2 data/panel8buc.pcx data/dirtybuc.pcx data/dirtybucp.pcx && rm data/panel8buc.pcx data/dirtybuc.pcx data/dirtybucp.pcx pcx2clx --transparent-color 1 data/healthbox.pcx && rm data/healthbox.pcx pcx2clx --transparent-color 1 --num-sprites 6 data/resistance.pcx && rm data/resistance.pcx pcx2clx --transparent-color 1 --num-sprites 5 data/monstertags.pcx && rm data/monstertags.pcx pcx2clx --transparent-color 1 data/stash.pcx && rm data/stash.pcx pcx2clx --transparent-color 1 --num-sprites 5 data/stashnavbtns.pcx && rm data/stashnavbtns.pcx pcx2clx **/*.pcx && rm **/*.pcx git checkout master -- ui_art/black_diablo.pcx ui_art/black_hellfire.pcx data/charbg.pcx data/talkbutton.pcx data/panel8bucp.pcx rm ui_art/black_diablo.clx ui_art/black_hellfire.clx data/charbg.clx data/talkbutton.clx data/panel8bucp.clx ```
32 lines
779 B
C++
32 lines
779 B
C++
#include "engine/load_clx.hpp"
|
|
|
|
#include <SDL.h>
|
|
|
|
#ifdef USE_SDL1
|
|
#include "utils/sdl2_to_1_2_backports.h"
|
|
#endif
|
|
|
|
#include "engine/assets.hpp"
|
|
#include "engine/load_file.hpp"
|
|
|
|
namespace devilution {
|
|
|
|
OptionalOwnedClxSpriteListOrSheet LoadOptionalClxListOrSheet(const char *path)
|
|
{
|
|
SDL_RWops *handle = OpenAsset(path);
|
|
if (handle == nullptr)
|
|
return std::nullopt;
|
|
const size_t size = SDL_RWsize(handle);
|
|
std::unique_ptr<uint8_t[]> data { new uint8_t[size] };
|
|
SDL_RWread(handle, data.get(), size, 1);
|
|
SDL_RWclose(handle);
|
|
return OwnedClxSpriteListOrSheet { std::move(data) };
|
|
}
|
|
|
|
OwnedClxSpriteListOrSheet LoadClxListOrSheet(const char *path)
|
|
{
|
|
return OwnedClxSpriteListOrSheet { LoadFileInMem<uint8_t>(path) };
|
|
}
|
|
|
|
} // namespace devilution
|