TxzFile.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 "common/QGearsResource.h"
  17. namespace QGears {
  18. /**
  19. * Handles TXZ files.
  20. *
  21. * TXZ files contains texture data used in the world map.
  22. */
  23. class TxzFile : public Resource{
  24. public:
  25. /**
  26. * The resource type.
  27. */
  28. static const String RESOURCE_TYPE;
  29. /**
  30. * Constructor.
  31. *
  32. * @param creator[in] Pointer to the ResourceManager that is
  33. * creating this resource.
  34. * @param name[in] The unique name of the resource.
  35. * @param handle[in] @todo Understand and document.
  36. * @param group[in] The name of the resource group to which this
  37. * resource belong.
  38. * @param is_manual[in] True if the resource is manually loaded,
  39. * false otherwise.
  40. * @param loader[in] Pointer to a ManualResourceLoader
  41. * implementation which will be called when the Resource wishes to
  42. * load (should be supplied if is_manual is set to true). It can be
  43. * null, but the Resource will never be able to reload if anything
  44. * ever causes it to unload. Therefore provision of a proper
  45. * ManualResourceLoader instance is strongly recommended.
  46. */
  47. TxzFile(
  48. Ogre::ResourceManager* creator, const Ogre::String& name,
  49. Ogre::ResourceHandle handle, const Ogre::String& group,
  50. bool isManual = false, Ogre::ManualResourceLoader* loader = 0
  51. );
  52. /**
  53. * Destructor.
  54. */
  55. virtual ~TxzFile();
  56. private:
  57. /**
  58. * Loads the file.
  59. */
  60. virtual void loadImpl() override final;
  61. /**
  62. * Unloads the file.
  63. */
  64. virtual void unloadImpl() override final;
  65. };
  66. typedef Ogre::SharedPtr<TxzFile> TxzFilePtr;
  67. }