23#include "guillaume/components/image.hpp"
29 if (_texturePath == path) {
34 _usingFallback =
false;
41 if (_fallbackPath == path) {
67 _usingFallback = usingFallback;
73 return _usingFallback;
Image(void)=default
Default constructor for the Image component.
Image & setTexturePath(const std::string &path)
Choose the texture to draw.
LoadState
Whether the texture could be loaded, as recorded by systems::ImageRender.
@ Pending
Not attempted since the path was set.
@ Failed
Neither loaded; nothing is drawn.
Image & setLoadState(LoadState state, bool usingFallback=false)
Record the outcome of a load attempt. Called by systems::ImageRender.
Image & setFallbackPath(const std::string &path)
Set the texture drawn when the main texture fails to load.
LoadState getLoadState(void) const
Get the outcome of the last load attempt.
const std::string & getTexturePath(void) const
Get the path of the texture to draw.
bool isUsingFallback(void) const
Check whether the fallback texture is drawn.
const std::string & getFallbackPath(void) const
Get the path of the fallback texture.
void setHasChanged(bool hasChanged)
Raise or lower the changed flag.
State. Every class here is plain data attached to an entity.