ImageLocator.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. enum class EImageLayer
  14. {
  15. ALL,
  16. BODY,
  17. SHADOW,
  18. OVERLAY,
  19. };
  20. struct ImageLocator
  21. {
  22. std::optional<ImagePath> image;
  23. std::optional<AnimationPath> defFile;
  24. int defFrame = -1;
  25. int defGroup = -1;
  26. PlayerColor playerColored = PlayerColor::CANNOT_DETERMINE;
  27. bool verticalFlip = false;
  28. bool horizontalFlip = false;
  29. int8_t scalingFactor = 1;
  30. EImageLayer layer = EImageLayer::ALL;
  31. ImageLocator() = default;
  32. ImageLocator(const AnimationPath & path, int frame, int group);
  33. explicit ImageLocator(const JsonNode & config);
  34. explicit ImageLocator(const ImagePath & path);
  35. bool operator < (const ImageLocator & other) const;
  36. bool empty() const;
  37. ImageLocator copyFile() const;
  38. ImageLocator copyFileTransform() const;
  39. ImageLocator copyFileTransformScale() const;
  40. };