FF7ModelListFileSerializer.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. -----------------------------------------------------------------------------
  3. Copyright (c) 07.10.2013 Tobias Peters <tobias.peters@kreativeffekt.at>
  4. This file is part of Q-Gears
  5. Q-Gears is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, version 2.0 (GPLv2) of the License.
  8. Q-Gears is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. -----------------------------------------------------------------------------
  13. */
  14. #ifndef __FF7ModelListFileSerializer_H__
  15. #define __FF7ModelListFileSerializer_H__
  16. #include "common/TypeDefine.h"
  17. #include "data/QGearsSerializer.h"
  18. #include "FF7ModelListFile.h"
  19. namespace QGears
  20. {
  21. namespace FF7
  22. {
  23. class ModelListFileSerializer : public Serializer
  24. {
  25. public:
  26. ModelListFileSerializer();
  27. virtual ~ModelListFileSerializer();
  28. virtual void importModelListFile( Ogre::DataStreamPtr &stream, ModelListFile *pDest );
  29. typedef ModelListFile::AnimationDescription AnimationDescription;
  30. typedef ModelListFile::ModelDescription ModelDescription;
  31. enum {
  32. HRC_NAME_LENGTH = 8
  33. ,SCALE_LENGTH = 4
  34. };
  35. protected:
  36. virtual void readObject( Ogre::DataStreamPtr &stream, AnimationDescription &pDest );
  37. virtual void readObject( Ogre::DataStreamPtr &stream, ModelDescription &pDest );
  38. using Serializer::readObject;
  39. template<typename ValueType>
  40. void readVector( Ogre::DataStreamPtr &stream
  41. ,std::vector<ValueType> &pDest
  42. ,size_t count );
  43. private:
  44. };
  45. }
  46. }
  47. #endif // __FF7ModelListFileSerializer_H__