8#ifndef RTYPE_CLIENT_GAME_SPRITECUSTOMIZER_HPP_
9 #define RTYPE_CLIENT_GAME_SPRITECUSTOMIZER_HPP_
12 #include <unordered_map>
73 std::string
getSpritePath(
const std::string& entityName,
const std::string& defaultPath)
const;
86 const std::string& defaultPath,
87 int& outLeft,
int& outTop,
88 int& outWidth,
int& outHeight)
const;
Singleton class to manage custom sprite mappings globally.
SpriteCustomizer & operator=(const SpriteCustomizer &)=delete
std::filesystem::path _spriteMappingPath
static void clearTextureCaches()
Clear all texture caches in render systems This should be called when sprites are modified to ensure ...
SpriteCustomizer(const SpriteCustomizer &)=delete
void reloadMappings()
Reload sprite mappings (useful after modifications) This clears the cache and reloads from disk.
bool loadMappings()
Load sprite mappings from config file.
std::unordered_map< std::string, std::string > _customSpriteMappings
~SpriteCustomizer()=default
static void setRenderSystems(void *worldRenderSystem, void *uiRenderSystem)
Set render system pointers for cache clearing Called internally by Application during initialization.
SpriteCustomizer(SpriteCustomizer &&)=delete
std::string getSpriteInfo(const std::string &entityName, const std::string &defaultPath, int &outLeft, int &outTop, int &outWidth, int &outHeight) const
Get custom sprite info (path and coordinates for full sprite)
bool hasCustomSprite(const std::string &entityName) const
Check if an entity has a custom sprite.
std::string getSpritePath(const std::string &entityName, const std::string &defaultPath) const
Get the custom sprite path for an entity.
SpriteCustomizer & operator=(SpriteCustomizer &&)=delete
static SpriteCustomizer & getInstance()
Get the singleton instance.