QGearsLZSFLevelFile.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 "QGearsFLevelFile.h"
  17. namespace QGears{
  18. /**
  19. * Handles LZS compressed flevel files.
  20. */
  21. class LZSFLevelFile : public FLevelFile{
  22. public:
  23. /**
  24. * Constructor.
  25. *
  26. * @param creator[in] Pointer to the ResourceManager that is
  27. * creating this resource.
  28. * @param name[in] The unique name of the resource.
  29. * @param handle[in] @todo Understand and document.
  30. * @param group[in] The name of the resource group to which this
  31. * resource belong.
  32. * @param is_manual[in] True if the resource is manually loaded,
  33. * false otherwise.
  34. * @param loader[in] Pointer to a ManualResourceLoader
  35. * implementation which will be called when the Resource wishes to
  36. * load (should be supplied if is_manual is set to true). It can be
  37. * null, but the Resource will never be able to reload if anything
  38. * ever causes it to unload. Therefore provision of a proper
  39. * ManualResourceLoader instance is strongly recommended.
  40. */
  41. LZSFLevelFile(
  42. Ogre::ResourceManager *creator, const String &name,
  43. Ogre::ResourceHandle handle, const String &group,
  44. bool is_manual = false, Ogre::ManualResourceLoader *loader = NULL
  45. );
  46. /**
  47. * Destructor.
  48. */
  49. virtual ~LZSFLevelFile();
  50. /**
  51. * The type of resource.
  52. */
  53. static const String RESOURCE_TYPE;
  54. protected:
  55. /**
  56. * Checks the resource type.
  57. *
  58. * @return The resource type.
  59. */
  60. virtual const String& getResourceType() const;
  61. /**
  62. * Opens the resource.
  63. */
  64. virtual Ogre::DataStreamPtr openResource() override;
  65. };
  66. }