QGearsFLevelFileManager.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 "QGearsFLevelFile.h"
  19. namespace QGears{
  20. /**
  21. * A manager for flevel files.
  22. */
  23. class _QGearsExport FLevelFileManager
  24. : public Ogre::ResourceManager, public Ogre::Singleton<FLevelFileManager>
  25. {
  26. public:
  27. /**
  28. * Constructor.
  29. */
  30. FLevelFileManager();
  31. /**
  32. * Destructor.
  33. */
  34. virtual ~FLevelFileManager();
  35. /**
  36. * Retrieves a singleton to the manager.
  37. */
  38. static FLevelFileManager& GetSingleton();
  39. /**
  40. * Retrieves a pointer to the manager singleton.
  41. */
  42. static FLevelFileManager* GetSingletonPtr();
  43. /**
  44. * Loads the manager.
  45. *
  46. * @param name[in] The unique name of the manager.
  47. * @param handle[in] @todo Understand and document.
  48. * @param group[in] The name of the resource group to which this
  49. * resource belong.
  50. * @param is_manual[in] True if the resource is manually loaded,
  51. * false otherwise.
  52. * @param loader[in] Pointer to a ManualResourceLoader
  53. * implementation which will be called when the Resource wishes to
  54. * load (should be supplied if is_manual is set to true). It can be
  55. * null, but the Resource will never be able to reload if anything
  56. * ever causes it to unload. Therefore provision of a proper
  57. * ManualResourceLoader instance is strongly recommended.
  58. * @param create_params[in] Unused.
  59. */
  60. virtual Ogre::Resource *createImpl(
  61. const Ogre::String &name, Ogre::ResourceHandle handle,
  62. const Ogre::String &group, bool is_manual,
  63. Ogre::ManualResourceLoader *loader,
  64. const Ogre::NameValuePairList *create_params
  65. );
  66. };
  67. }