OgreGenUtilites.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef OGRE_GEN_UTILITES_H
  2. #define OGRE_GEN_UTILITES_H
  3. #include <Ogre.h>
  4. #include "Logger.h"
  5. #include "Vram.h"
  6. struct MeshData
  7. {
  8. Ogre::String name;
  9. int tex_width;
  10. int tex_height;
  11. };
  12. enum BPP
  13. {
  14. BPP_4 = 0,
  15. BPP_8 = 1,
  16. BPP_BLACK = -1
  17. };
  18. struct TexForGen
  19. {
  20. u16 texture_x;
  21. u16 texture_y;
  22. u16 palette_y;
  23. u16 palette_x;
  24. BPP bpp;
  25. int start_x;
  26. int start_y;
  27. bool operator==( const TexForGen& i ) const
  28. {
  29. return i.texture_x == texture_x &&
  30. i.texture_y == texture_y &&
  31. i.palette_y == palette_y &&
  32. i.palette_x == palette_x &&
  33. i.bpp == bpp;
  34. }
  35. };
  36. typedef std::vector< TexForGen > VectorTexForGen;
  37. void CreateTexture( Vram* vram, const MeshData& mesh_data, const Ogre::String& texture_file_name, const VectorTexForGen& textures );
  38. void CreateMaterial( const Ogre::String& material_name, const Ogre::String& material_file_name, const Ogre::String& texture_name, const Ogre::String& vertex_program, const Ogre::String& fragment_program );
  39. void CreateTextureFromVram( const Ogre::PixelBox& pb, Vram* vram, const int start_x, const int start_y, const int clut_x, const int clut_y, const int texture_x, const int texture_y, const BPP bpp, const bool transparency );
  40. void AddTexture( TexForGen& texture, const MeshData& data, VectorTexForGen& textures, Logger* logger );
  41. void AddTransparency( u32& colour, const bool transparency, const bool stp );
  42. #endif