FF7ModelListFileManager.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * Copyright (C) 2022 The V-Gears Team
  3. *
  4. * This file is part of V-Gears
  5. *
  6. * V-Gears is free software: you can redistribute it and/or modify it under
  7. * terms of the GNU General Public License as published by the Free Software
  8. * Foundation, version 3.0 (GPLv3) of the License.
  9. *
  10. * V-Gears is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #pragma once
  16. #include <OgreResourceManager.h>
  17. #include "QGearsPrerequisites.h"
  18. #include "FF7ModelListFile.h"
  19. namespace QGears{
  20. namespace FF7{
  21. /**
  22. * A manager for model list files.
  23. */
  24. class _QGearsExport ModelListFileManager :
  25. public Ogre::ResourceManager,
  26. public Ogre::Singleton<ModelListFileManager>
  27. {
  28. public:
  29. /**
  30. * Constructor.
  31. */
  32. ModelListFileManager();
  33. /**
  34. * Destructor.
  35. */
  36. virtual ~ModelListFileManager();
  37. /**
  38. * Retrieves a singleton to the manager.
  39. */
  40. static ModelListFileManager& GetSingleton();
  41. /**
  42. * Retrieves a pointer to the manager singleton.
  43. */
  44. static ModelListFileManager *GetSingletonPtr();
  45. protected:
  46. /**
  47. * Loads the manager.
  48. *
  49. * @param name[in] The unique name of the manager.
  50. * @param handle[in] @todo Understand and document.
  51. * @param group[in] The name of the resource group to which this
  52. * resource belong.
  53. * @param is_manual[in] True if the resource is manually loaded,
  54. * false otherwise.
  55. * @param loader[in] Pointer to a ManualResourceLoader
  56. * implementation which will be called when the Resource wishes to
  57. * load (should be supplied if is_manual is set to true). It can be
  58. * null, but the Resource will never be able to reload if anything
  59. * ever causes it to unload. Therefore provision of a proper
  60. * ManualResourceLoader instance is strongly recommended.
  61. * @param create_params[in] Unused.
  62. */
  63. Ogre::Resource *createImpl(
  64. const Ogre::String &name, Ogre::ResourceHandle handle,
  65. const Ogre::String &group, bool is_manual,
  66. Ogre::ManualResourceLoader *loader,
  67. const Ogre::NameValuePairList *create_params
  68. );
  69. };
  70. }
  71. }