ImageLocator.h 751 B

12345678910111213141516171819202122232425262728293031
  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. struct ImageLocator
  13. {
  14. std::optional<ImagePath> image;
  15. std::optional<AnimationPath> defFile;
  16. int defFrame = -1;
  17. int defGroup = -1;
  18. bool verticalFlip = false;
  19. bool horizontalFlip = false;
  20. ImageLocator() = default;
  21. ImageLocator(const AnimationPath & path, int frame, int group);
  22. explicit ImageLocator(const JsonNode & config);
  23. explicit ImageLocator(const ImagePath & path);
  24. bool operator < (const ImageLocator & other) const;
  25. bool empty() const;
  26. };