VGearsUtility.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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/VGearsApplication.h"
  17. #include "common/OgreBase.h"
  18. namespace VGears{
  19. /**
  20. * Provides utilities for the application.
  21. */
  22. class Utility : public Application{
  23. public:
  24. /**
  25. * Constructor.
  26. *
  27. * @param[in] argc Number of arguments passed to the application.
  28. * @param[in] argv List of arguments passed to the application.
  29. */
  30. Utility(int argc, char *argv[]);
  31. /**
  32. * Destructor.
  33. */
  34. virtual ~Utility();
  35. /**
  36. * Decodes a FF7 encoded string.
  37. *
  38. * It doesn't work for compressed strings.
  39. *
  40. * @param[in] bytes Raw bytes to read from.
  41. * @param[in] size Number of bytes in the bytes parameter.
  42. * @return The decoded string.
  43. */
  44. static std::string DecodeString(const u8* bytes, const unsigned int size);
  45. protected:
  46. private:
  47. /**
  48. * Constructor.
  49. */
  50. Utility();
  51. /**
  52. * The frame listener.
  53. */
  54. DisplayFrameListener *frame_listener_;
  55. /**
  56. * The application scene manager.
  57. */
  58. Ogre::SceneManager *scene_manager_;
  59. /**
  60. * The engine camera.
  61. */
  62. Ogre::Camera *camera_;
  63. /**
  64. * The engine viewport.
  65. */
  66. Ogre::Viewport *viewport_;
  67. };
  68. }