QGearsFLevelBackground2DLoader.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 <OgreResource.h>
  17. #include "data/QGearsBackgroundFile.h"
  18. #include "map/QGearsBackground2DFile.h"
  19. namespace QGears{
  20. class FLevelFile;
  21. /**
  22. * Handles 2D background loading.
  23. */
  24. class FLevelBackground2DLoader : public Ogre::ManualResourceLoader{
  25. public:
  26. /**
  27. * Constructor.
  28. *
  29. * @param flevel_file[in] Level file.
  30. */
  31. explicit FLevelBackground2DLoader(FLevelFile& flevel_file);
  32. /**
  33. * Destructor.
  34. */
  35. virtual ~FLevelBackground2DLoader();
  36. /**
  37. * Loads a resource.
  38. *
  39. * @param resource[in] The resource to load.
  40. */
  41. virtual void loadResource(Ogre::Resource *resource);
  42. protected:
  43. typedef Background2DFile::TileList TileList;
  44. typedef BackgroundFile::Layer Layer;
  45. typedef BackgroundFile::SpriteData SpriteData;
  46. typedef BackgroundFile::SpriteList SpriteList;
  47. private:
  48. /**
  49. * The flevel file.
  50. */
  51. FLevelFile &flevel_file_;
  52. };
  53. }