36template <
class T> std::shared_ptr<T>
ResourceLoad(
const char* name) {
API export/import macros for cross-platform shared library symbol visibility.
#define API_EXPORT
Marks a symbol for export from (or import into) a shared library.
Definition Api.h:32
Core namespace for the libultraship engine framework.
Definition gfx_direct3d_common.h:14
API_EXPORT uint64_t ResourceGetCrcByName(const char *name)
Returns the 64-bit CRC that corresponds to the given resource path.
API_EXPORT uint16_t ResourceGetTexWidthByCrc(uint64_t crc)
Returns the texture width in pixels for the texture resource at crc.
API_EXPORT uint16_t ResourceGetTexWidthByName(const char *name)
Returns the texture width in pixels for the texture resource at name.
API_EXPORT void ResourceDirtyDirectory(const char *name)
Marks all resources under name as dirty so they are reloaded on next access.
API_EXPORT void ResourceUnloadByCrc(uint64_t crc)
Evicts the resource with the given CRC from the resource cache.
API_EXPORT void ResourceDirtyByCrc(uint64_t crc)
Marks the resource at crc as dirty so it is reloaded on next access.
std::shared_ptr< Ship::IResource > ResourceLoad(const char *name)
Loads a resource by its virtual path and returns a type-erased shared pointer.
API_EXPORT uint16_t ResourceGetTexHeightByName(const char *name)
Returns the texture height in pixels for the texture resource at name.
API_EXPORT size_t ResourceGetTexSizeByName(const char *name)
Returns the total texture data size in bytes for the texture at name.
API_EXPORT size_t ResourceGetTexSizeByCrc(uint64_t crc)
Returns the total texture data size in bytes for the texture at crc.
API_EXPORT void ResourceDirtyByName(const char *name)
Marks the resource at name as dirty so it is reloaded on next access.
API_EXPORT uint8_t ResourceGetIsCustomByCrc(uint64_t crc)
Returns non-zero if the resource at crc originates from a custom/mod archive.
API_EXPORT uint32_t IsResourceManagerLoaded()
Returns non-zero if the ResourceManager has been fully initialised and is ready.
API_EXPORT void ResourceUnloadByName(const char *name)
Evicts the resource with the given path from the resource cache.
API_EXPORT uint32_t ResourceHasGameVersion(uint32_t hash)
Returns non-zero if the given version hash is present in the loaded archives.
API_EXPORT uint8_t ResourceGetIsCustomByName(const char *name)
Returns non-zero if the resource at name originates from a custom/mod archive.
API_EXPORT void ResourceLoadDirectoryAsync(const char *name)
Queues all resources under name for background loading.
API_EXPORT const char * ResourceGetNameByCrc(uint64_t crc)
Returns the virtual path string that corresponds to the given 64-bit CRC.
API_EXPORT void ResourceClearCache()
Evicts all resources from the resource cache.
API_EXPORT void * ResourceGetDataByCrc(uint64_t crc)
Returns a raw pointer to the resource's data buffer by CRC.
void ResourceSetResourceManager(std::shared_ptr< Ship::ResourceManager > resourceManager)
API_EXPORT uint16_t ResourceGetTexHeightByCrc(uint64_t crc)
Returns the texture height in pixels for the texture resource at crc.
API_EXPORT void ResourceUnloadDirectory(const char *name)
Evicts all resources whose paths begin with name from the resource cache.
API_EXPORT size_t ResourceGetSizeByCrc(uint64_t crc)
Returns the raw data size in bytes of the resource with the given CRC.
API_EXPORT void ResourceGetGameVersions(uint32_t *versions, size_t versionsSize, size_t *versionsCount)
Retrieves the list of game version hashes present in the loaded archives.
API_EXPORT size_t ResourceGetSizeByName(const char *name)
Returns the raw data size in bytes of the resource with the given path.
API_EXPORT void ResourceLoadDirectory(const char *name)
Synchronously loads all resources whose paths begin with name.
API_EXPORT void * ResourceGetDataByName(const char *name)
Returns a raw pointer to the resource's data buffer by path.
std::shared_ptr< Ship::ResourceManager > ResourceGetResourceManager()