HdImageLoader.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * HdImageLoader.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 "HdImageLoader.h"
  12. #include "PakLoader.h"
  13. #include "../../../lib/constants/EntityIdentifiers.h"
  14. #include "../../../lib/filesystem/ResourcePath.h"
  15. VCMI_LIB_NAMESPACE_BEGIN
  16. class Point;
  17. class PlayerColor;
  18. VCMI_LIB_NAMESPACE_END
  19. struct SDL_Surface;
  20. class SDLImageShared;
  21. class PakLoader;
  22. class DdsFormat;
  23. class HdImageLoader
  24. {
  25. private:
  26. std::shared_ptr<PakLoader> pakLoader;
  27. std::shared_ptr<DdsFormat> ddsFormat;
  28. std::map<std::string, std::vector<int>> flagData;
  29. void loadFlagData();
  30. int scalingFactor;
  31. std::array<SDL_Surface *, 2> flagImg;
  32. public:
  33. HdImageLoader();
  34. ~HdImageLoader();
  35. std::shared_ptr<SDLImageShared> getImage(const ImagePath & path, const Point & fullSize, const Point & margins, bool shadow, bool overlay);
  36. std::optional<std::tuple<ResourcePath, PakLoader::ArchiveEntry, PakLoader::ImageEntry>> find(const ImagePath & path);
  37. bool exists(const ImagePath & path);
  38. };