MimFile.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef MIM_FILE_H
  2. #define MIM_FILE_H
  3. #include "common/LzsFile.h"
  4. #include "../../common/Vram.h"
  5. class MimFile : public LzsFile
  6. {
  7. public:
  8. struct ClutColor
  9. {
  10. u8 r;
  11. u8 g;
  12. u8 b;
  13. u8 a;
  14. };
  15. MimFile( const Ogre::String& file );
  16. MimFile( File* pFile );
  17. MimFile( File* pFile, const u32 offset, const u32 length );
  18. MimFile( u8* pBuffer, const u32 offset, const u32 length );
  19. virtual ~MimFile();
  20. Surface* GetSurface( const u16 page_x, const u16 page_y, const u16 clut_x, const u16 clut_y, const u8 bpp, const int clut_start, const int clut_width, const Ogre::String& mod_type, const float mod_r, const float mod_g, const float mod_b );
  21. void GetModifiedClut( ClutColor& clut, const Ogre::String& mod_type, const float mod_r, const float mod_g, const float mod_b );
  22. //bool ClutCheck(const u16 page_x, const u16 page_y, const u16 clut_x, const u8 bpp, const u8 src_x, const u8 src_y, const u8 width, const u8 height, const u16 check_clut_x, const u16 check_clut_width );
  23. private:
  24. void InnerGetImage();
  25. private:
  26. struct MimHeader
  27. {
  28. u32 header2_offset; /**< @brief offset for second header */
  29. u16 x; /**< @brief x position of CLUT in VRAM */
  30. u16 y; /**< @brief y position of CLUT in VRAM */
  31. u16 width; /**< @brief number of colors in CLUT */
  32. u16 height; /**< @brief number of CLUT */
  33. };
  34. struct MimHeader2
  35. {
  36. u32 data_size; /**< @brief size of image data */
  37. u16 x; /**< @brief x position of image in VRAM */
  38. u16 y; /**< @brief y position of image in VRAM */
  39. u16 width; /**< @brief width of image */
  40. u16 height; /**< @brief height of image */
  41. };
  42. u16 mClutVramPositionX;
  43. u16 mClutVramPositionY;
  44. u16 mClutWidth;
  45. u16 mClutHeight;
  46. u16 mImageVramPositionX;
  47. u16 mImageVramPositionY;
  48. u16 mImageWidth;
  49. u16 mImageHeight;
  50. std::unique_ptr<Vram> m_Vram;
  51. };
  52. #endif