image.cpp 635 B

1234567891011121314151617181920212223
  1. #include <irrlicht/path.h>
  2. #include <wallpaperengine/fs/fileResolver.h>
  3. #include "object3d.h"
  4. #include "image.h"
  5. namespace wp
  6. {
  7. image::image (json json_data) : object3d (object3d::Type::Type_Image)
  8. {
  9. json::const_iterator visible = json_data.find ("visible");
  10. json::const_iterator file = json_data.find ("image");
  11. if (visible != json_data.end () && (*visible).is_boolean () == true)
  12. {
  13. this->m_visible = *visible;
  14. }
  15. if (file != json_data.end () && (*file).is_string () == true)
  16. {
  17. this->m_file = wp::fs::resolver.resolve (*file);
  18. }
  19. }
  20. }