QGearsRSDFile.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. -----------------------------------------------------------------------------
  3. The MIT License (MIT)
  4. Copyright (c) 2013-08-16 Tobias Peters <tobias.peters@kreativeffekt.at>
  5. Permission is hereby granted, free of charge, to any person obtaining a copy
  6. of this software and associated documentation files (the "Software"), to deal
  7. in the Software without restriction, including without limitation the rights
  8. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. copies of the Software, and to permit persons to whom the Software is
  10. furnished to do so, subject to the following conditions:
  11. The above copyright notice and this permission notice shall be included in
  12. all copies or substantial portions of the Software.
  13. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19. THE SOFTWARE.
  20. -----------------------------------------------------------------------------
  21. */
  22. #ifndef __QGearsRSDFile_H__
  23. #define __QGearsRSDFile_H__
  24. #include <OgreResource.h>
  25. #include <OgreMaterial.h>
  26. #include "common/TypeDefine.h"
  27. namespace QGears
  28. {
  29. class RSDFile : public Ogre::Resource
  30. {
  31. public:
  32. RSDFile( Ogre::ResourceManager *creator, const String &name
  33. ,Ogre::ResourceHandle handle, const String &group
  34. ,bool isManual = false, Ogre::ManualResourceLoader *loader = NULL );
  35. virtual ~RSDFile();
  36. static const String RESOURCE_TYPE;
  37. typedef std::vector<String> TextureNameList;
  38. typedef std::vector<Ogre::MaterialPtr> MaterialList;
  39. virtual void setPolygonName ( const String &polygon_name );
  40. virtual void setMaterialName( const String &material_name );
  41. virtual void setGroupName ( const String &group_name );
  42. virtual const String& getPolygonName ( void ) const;
  43. virtual const String& getMaterialName( void ) const;
  44. virtual const String& getGroupName ( void ) const;
  45. virtual size_t getTextureNameCount ( void ) const;
  46. virtual TextureNameList& getTextureNames( void );
  47. virtual String getMaterialBaseName( void ) const;
  48. protected:
  49. virtual void loadImpl();
  50. virtual void unloadImpl();
  51. virtual size_t calculateSize() const;
  52. virtual void addTexture( Ogre::Pass *pass, const size_t index ) const;
  53. private:
  54. String m_polygon_name;
  55. String m_material_name;
  56. String m_group_name;
  57. TextureNameList m_texture_names;
  58. MaterialList m_materials;
  59. };
  60. typedef Ogre::SharedPtr<RSDFile> RSDFilePtr;
  61. }
  62. #endif // __QGearsRSDFile_H__