ImageLocator.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * ImageLocator.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include "../../lib/filesystem/ResourcePath.h"
  12. #include "../../lib/constants/EntityIdentifiers.h"
  13. struct ImageLocator
  14. {
  15. std::optional<ImagePath> image;
  16. std::optional<AnimationPath> defFile;
  17. int defFrame = -1;
  18. int defGroup = -1;
  19. bool verticalFlip = false;
  20. bool horizontalFlip = false;
  21. int8_t scalingFactor = 1;
  22. PlayerColor playerColored = PlayerColor::CANNOT_DETERMINE;
  23. bool layerShadow = false;
  24. bool layerBody = true;
  25. bool layerOverlay = false;
  26. ImageLocator() = default;
  27. ImageLocator(const AnimationPath & path, int frame, int group);
  28. explicit ImageLocator(const JsonNode & config);
  29. explicit ImageLocator(const ImagePath & path);
  30. bool operator < (const ImageLocator & other) const;
  31. bool empty() const;
  32. ImageLocator copyFile() const;
  33. ImageLocator copyFileTransform() const;
  34. ImageLocator copyFileTransformScale() const;
  35. };