@MtrlBrushClass.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /******************************************************************************/
  2. /******************************************************************************/
  3. class MtrlBrushClass : Window
  4. {
  5. int sel;
  6. GuiImage image [MtrlBrushSlots];
  7. MaterialPtr mtrl [MtrlBrushSlots];
  8. UID mtrl_id[MtrlBrushSlots];
  9. Button scale, hole, max1, max2;
  10. MaterialPtr scale_material;
  11. UID scale_material_id;
  12. MtrlBrushClass();
  13. static void PushedScale(MtrlBrushClass &mb);
  14. static void PushedHole (MtrlBrushClass &mb);
  15. static void PushedMax1 (MtrlBrushClass &mb);
  16. static void PushedMax2 (MtrlBrushClass &mb);
  17. MtrlBrushClass& create();
  18. void validateIcons();
  19. MaterialPtr getMaterial();
  20. void setMaterial(int i, C UID&mtrl_id);
  21. void setColors();
  22. void set(int i, SET_MODE mode=SET_DEFAULT);
  23. void erasing(C UID &elm_id);
  24. void drag(Memc<UID> &elms, GuiObj *focus_obj, C Vec2 &screen_pos);
  25. static void UpdateMaterial(Cell<Area> &cell, MaterialPtr &material, int thread_index);
  26. class MtrlBlend
  27. {
  28. MaterialPtr mtrl;
  29. flt blend;
  30. static int Compare(C MtrlBlend &a, C MtrlBlend &b); // compare in reverse order to list those with highest blend first
  31. };
  32. static void ReduceMaterial(Cell<Area> &cell, ptr user, int thread_index);
  33. static void DragMtrl(ptr slot_index, GuiObj *go, C Vec2 &screen_pos);
  34. void update();
  35. };
  36. /******************************************************************************/
  37. /******************************************************************************/
  38. extern MtrlBrushClass MtrlBrush;
  39. /******************************************************************************/