You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.1 KiB
42 lines
1.1 KiB
#pragma once |
|
|
|
#include <string> |
|
|
|
#include <expected.hpp> |
|
|
|
#include "clx_sprite.hpp" |
|
#include "utils/status_macros.hpp" |
|
|
|
namespace devilution { |
|
|
|
OwnedClxSpriteListOrSheet LoadClxListOrSheet(const char *path); |
|
|
|
tl::expected<OwnedClxSpriteListOrSheet, std::string> LoadClxListOrSheetWithStatus(const char *path); |
|
|
|
inline OwnedClxSpriteList LoadClx(const char *path) |
|
{ |
|
return LoadClxListOrSheet(path).list(); |
|
} |
|
|
|
inline tl::expected<OwnedClxSpriteList, std::string> LoadClxWithStatus(const char *path) |
|
{ |
|
ASSIGN_OR_RETURN(OwnedClxSpriteListOrSheet result, LoadClxListOrSheetWithStatus(path)); |
|
return std::move(result).list(); |
|
} |
|
|
|
inline OwnedClxSpriteSheet LoadClxSheet(const char *path) |
|
{ |
|
return LoadClxListOrSheet(path).sheet(); |
|
} |
|
|
|
OptionalOwnedClxSpriteListOrSheet LoadOptionalClxListOrSheet(const char *path); |
|
|
|
inline OptionalOwnedClxSpriteList LoadOptionalClx(const char *path) |
|
{ |
|
OptionalOwnedClxSpriteListOrSheet result = LoadOptionalClxListOrSheet(path); |
|
if (!result) |
|
return std::nullopt; |
|
return std::move(*result).list(); |
|
} |
|
|
|
} // namespace devilution
|
|
|