@ImportTerrainTask.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /******************************************************************************/
  2. /******************************************************************************/
  3. class ImportTerrainTask : Window
  4. {
  5. bool height_do, mtrl_do, color_do, color_img_alpha;
  6. int height_mode, mtrl_mode, color_mode, res;
  7. flt mtrl_blend, color_blend, grid_level;
  8. Vec2 height;
  9. VecI2 area_xy;
  10. RectI area_rect;
  11. UID world_id;
  12. WorldVer *world_ver;
  13. Image height_image, mtrl_image, color_image;
  14. MaterialPtr mtrl, mtrl_channels[4];
  15. Progress progress;
  16. static void Stop(ImportTerrainTask &it);
  17. void create(ImportTerrainClass &it);
  18. class MaterialIntensities
  19. {
  20. class Mtrl
  21. {
  22. byte index;
  23. flt intensity;
  24. };
  25. static int Compare(C Mtrl &a, C Mtrl &b); // we sort from higher to lower order, so swap 'a' 'b' order
  26. Mtrl mtrl[8]; int mtrls;
  27. void set(int i, byte &index, flt &intensity);
  28. void addMtrl(byte index, flt intensity);
  29. void sort();
  30. public:
  31. MaterialIntensities();
  32. };
  33. void import(Heightmap &hm);
  34. void update();
  35. bool step();
  36. public:
  37. ImportTerrainTask();
  38. };
  39. /******************************************************************************/
  40. /******************************************************************************/
  41. /******************************************************************************/