QGearsPaletteFileManager.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 "QGearsPaletteFile.h"
  19. namespace QGears{
  20. /**
  21. * A manager for palette files.
  22. */
  23. class _QGearsExport PaletteFileManager :
  24. public Ogre::ResourceManager, public Ogre::Singleton<PaletteFileManager>{
  25. public:
  26. /**
  27. * Constructor.
  28. */
  29. PaletteFileManager();
  30. /**
  31. * Destructor.
  32. */
  33. virtual ~PaletteFileManager();
  34. /**
  35. * Retrieves a singleton to the manager.
  36. */
  37. static PaletteFileManager& GetSingleton();
  38. /**
  39. * Retrieves a pointer to the manager singleton.
  40. */
  41. static PaletteFileManager* GetSingletonPtr();
  42. protected:
  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. 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. }