@ElmIcon.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /******************************************************************************/
  2. /******************************************************************************/
  3. class ElmIcon : ElmData
  4. {
  5. enum FLAG // !! these enums are saved !!
  6. {
  7. HAS_COLOR=1<<0, // if image is not monochromatic (r!=g || r!=b) (this member is not synced, it is inherited from image data)
  8. HAS_ALPHA=1<<1, // if any alpha pixel is not 255 (this member is not synced, it is inherited from image data)
  9. };
  10. static const uint InheritVariation; // use from object in case it overrides default variation
  11. byte flag; // FLAG
  12. UID icon_settings_id, obj_id, anim_id;
  13. uint variation_id;
  14. flt anim_pos;
  15. TimeStamp icon_settings_time, obj_time, file_time, anim_id_time, anim_pos_time, variation_time;
  16. ElmImage::TYPE type(Project *proj)C;
  17. bool hasColor( )C; ElmIcon&hasColor(bool on);
  18. bool hasAlpha( )C; ElmIcon&hasAlpha(bool on);
  19. IMAGE_TYPE androidType(Project *proj)C; // if want to be compressed then use ETC2_A8 or ETC2 or ETC1
  20. IMAGE_TYPE iOSType(Project *proj)C; // if want to be compressed then use PVRTC1_4
  21. IMAGE_TYPE webType(Project *proj)C; // if want to be compressed with alpha then use BC3
  22. bool equal(C ElmIcon &src)C;
  23. bool newer(C ElmIcon &src)C;
  24. virtual bool mayContain(C UID &id)C override;
  25. // operations
  26. virtual void newData()override;
  27. uint undo(C ElmIcon &src);
  28. uint sync(C ElmIcon &src);
  29. bool syncFile(C ElmIcon &src);
  30. // io
  31. virtual bool save(File &f)C override;
  32. virtual bool load(File &f)override;
  33. virtual void save(MemPtr<TextNode> nodes)C override;
  34. virtual void load(C MemPtr<TextNode> &nodes)override;
  35. public:
  36. ElmIcon();
  37. };
  38. /******************************************************************************/
  39. /******************************************************************************/
  40. /******************************************************************************/