HiresTextures.h 1009 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Copyright 2008 Dolphin Emulator Project
  2. // Licensed under GPLv2+
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <memory>
  6. #include <string>
  7. #include <unordered_map>
  8. #include "VideoCommon/TextureDecoder.h"
  9. #include "VideoCommon/VideoCommon.h"
  10. class HiresTexture
  11. {
  12. public:
  13. static void Init();
  14. static void Update();
  15. static void Shutdown();
  16. static std::shared_ptr<HiresTexture> Search(
  17. const u8* texture, size_t texture_size,
  18. const u8* tlut, size_t tlut_size,
  19. u32 width, u32 height,
  20. int format, bool has_mipmaps
  21. );
  22. static std::string GenBaseName(
  23. const u8* texture, size_t texture_size,
  24. const u8* tlut, size_t tlut_size,
  25. u32 width, u32 height,
  26. int format, bool has_mipmaps,
  27. bool dump = false
  28. );
  29. ~HiresTexture();
  30. struct Level
  31. {
  32. u8* data;
  33. size_t data_size;
  34. u32 width, height;
  35. };
  36. std::vector<Level> m_levels;
  37. private:
  38. static HiresTexture* Load(const std::string& base_filename, u32 width, u32 height);
  39. static void Prefetch();
  40. HiresTexture() {}
  41. };