CScene.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #pragma once
  2. #include <irrlicht/irrlicht.h>
  3. #include <nlohmann/json.hpp>
  4. #include "CProject.h"
  5. #include "CObject.h"
  6. #include "Scenes/CCamera.h"
  7. #include "Scenes/CProjection.h"
  8. namespace WallpaperEngine::Core
  9. {
  10. using json = nlohmann::json;
  11. class CProject;
  12. class CObject;
  13. class CScene
  14. {
  15. public:
  16. static CScene* fromFile (const irr::io::path& filename);
  17. CProject* getProject ();
  18. std::vector<CObject*>* getObjects ();
  19. const irr::video::SColorf &getAmbientColor() const;
  20. bool isBloom() const;
  21. irr::f64 getBloomStrength() const;
  22. irr::f64 getBloomThreshold() const;
  23. bool isCameraFade() const;
  24. bool isCameraParallax() const;
  25. irr::f64 getCameraParallaxAmount() const;
  26. irr::f64 getCameraParallaxDelay() const;
  27. irr::f64 getCameraParallaxMouseInfluence() const;
  28. bool isCameraPreview() const;
  29. bool isCameraShake() const;
  30. irr::f64 getCameraShakeAmplitude() const;
  31. irr::f64 getCameraShakeRoughness() const;
  32. irr::f64 getCameraShakeSpeed() const;
  33. const irr::video::SColorf &getClearColor() const;
  34. Scenes::CProjection *getOrthogonalProjection() const;
  35. const irr::video::SColorf &getSkylightColor() const;
  36. protected:
  37. friend class CProject;
  38. void setProject (CProject* project);
  39. Scenes::CCamera* getCamera ();
  40. CScene (
  41. Scenes::CCamera* camera,
  42. irr::video::SColorf ambientColor,
  43. bool bloom,
  44. irr::f64 bloomStrength,
  45. irr::f64 bloomThreshold,
  46. bool cameraFade,
  47. bool cameraParallax,
  48. irr::f64 cameraParallaxAmount,
  49. irr::f64 cameraParallaxDelay,
  50. irr::f64 cameraParallaxMouseInfluence,
  51. bool cameraPreview,
  52. bool cameraShake,
  53. irr::f64 cameraShakeAmplitude,
  54. irr::f64 cameraShakeRoughness,
  55. irr::f64 cameraShakeSpeed,
  56. irr::video::SColorf clearColor,
  57. Scenes::CProjection* orthogonalProjection,
  58. irr::video::SColorf skylightColor
  59. );
  60. void insertObject (CObject* object);
  61. private:
  62. CProject* m_project;
  63. Scenes::CCamera* m_camera;
  64. // data from general section on the json
  65. irr::video::SColorf m_ambientColor;
  66. bool m_bloom;
  67. irr::f64 m_bloomStrength;
  68. irr::f64 m_bloomThreshold;
  69. bool m_cameraFade;
  70. bool m_cameraParallax;
  71. irr::f64 m_cameraParallaxAmount;
  72. irr::f64 m_cameraParallaxDelay;
  73. irr::f64 m_cameraParallaxMouseInfluence;
  74. bool m_cameraPreview;
  75. bool m_cameraShake;
  76. irr::f64 m_cameraShakeAmplitude;
  77. irr::f64 m_cameraShakeRoughness;
  78. irr::f64 m_cameraShakeSpeed;
  79. irr::video::SColorf m_clearColor;
  80. Scenes::CProjection* m_orthogonalProjection;
  81. irr::video::SColorf m_skylightColor;
  82. std::vector<CObject*> m_objects;
  83. };
  84. };