@RiverBase.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /******************************************************************************/
  2. /******************************************************************************/
  3. class RiverBase
  4. {
  5. class Vtx
  6. {
  7. flt radius;
  8. Vec pos;
  9. void set(flt radius, C Vec &pos);
  10. public:
  11. Vtx();
  12. };
  13. bool removed;
  14. byte smooth;
  15. flt depth;
  16. Vec2 tex_scale;
  17. UID material;
  18. Memc<Vtx > vtxs;
  19. Memc<VecI2> edges;
  20. TimeStamp removed_time, smooth_time, depth_time, tex_scale_time, material_time, vtx_edge_time;
  21. // get
  22. bool equal(C RiverBase &src)C;
  23. bool newer(C RiverBase &src)C;
  24. bool getRect(Rect &rect)C;
  25. uint memUsage()C;
  26. // operations
  27. void setSmooth (byte smooth );
  28. void setDepth (flt depth );
  29. void setTexScale(C Vec2 &tex_scale);
  30. bool sync(C RiverBase &src);
  31. bool undo(C RiverBase &src);
  32. // draw
  33. void draw(C Color &color, C Color &depth_color=TRANSPARENT)C;
  34. // io
  35. bool save(File &f)C;
  36. bool load(File &f);
  37. bool load(C Str &name);
  38. public:
  39. RiverBase();
  40. };
  41. /******************************************************************************/
  42. /******************************************************************************/
  43. /******************************************************************************/