CProjection.cpp 637 B

123456789101112131415161718192021222324252627282930
  1. #include "CProjection.h"
  2. using namespace WallpaperEngine::Core::Scenes;
  3. CProjection::CProjection (irr::u32 width, irr::u32 height) :
  4. m_width (width),
  5. m_height (height)
  6. {
  7. }
  8. const irr::u32& CProjection::getWidth () const
  9. {
  10. return this->m_width;
  11. }
  12. const irr::u32& CProjection::getHeight () const
  13. {
  14. return this->m_height;
  15. }
  16. CProjection* CProjection::fromJSON (json data)
  17. {
  18. auto width_it = jsonFindRequired (data, "width", "Projection must have width");
  19. auto height_it = jsonFindRequired (data, "height", "Projection must have height");
  20. return new CProjection (
  21. *width_it,
  22. *height_it
  23. );
  24. }