22 void setTool(
const std::string &tool);
24 std::string
getTool()
const {
return tool_; }
27 void setSize(
int size);
32 void setShape(
const std::string &
shape);
34 std::string
getShape()
const {
return shape_; }
37 void setTile(
int gid);
42 void setEraseTile(
int gid);
53 void setStampTile(
int lx,
int ly,
int gid);
55 int getStampTile(
int lx,
int ly)
const;
68 int paintRect(
TileBuffer *
buffer,
int x0,
int y0,
int x1,
int y1,
bool filled);
75 int previewRect(
TileBuffer *
buffer,
int x0,
int y0,
int x1,
int y1,
bool filled);
80 int getPreviewX(
int index)
const;
82 int getPreviewY(
int index)
const;
84 int getPreviewGid(
int index)
const;
89 int getChangeX(
int index)
const;
91 int getChangeY(
int index)
const;
93 int getChangeOldGid(
int index)
const;
95 int getChangeNewGid(
int index)
const;
107 void collectBrushCells(
int tx,
int ty, std::vector<std::pair<int, int>> &out)
const;
108 void collectLineCells(
int x0,
int y0,
int x1,
int y1, std::vector<std::pair<int, int>> &out)
const;
109 void collectRectCells(
int x0,
int y0,
int x1,
int y1,
bool filled,
110 std::vector<std::pair<int, int>> &out)
const;
111 int applyCells(TileBuffer *
buffer,
const std::vector<std::pair<int, int>> &
cells,
int gid);
112 int applyStamp(TileBuffer *
buffer,
int tx,
int ty);
113 int previewCells(TileBuffer *
buffer,
const std::vector<std::pair<int, int>> &
cells,
int gid);
114 bool validChange(
int index)
const;
115 bool validPreview(
int index)
const;
117 std::string tool_ =
"paint";
118 std::string shape_ =
"square";
124 std::vector<int> stamp_;
126 std::vector<Cell> changes_;
127 std::vector<Cell> preview_;
#define EVENGINE_API_DOMAINS
std::unique_ptr< gpgpu::GpuBuffer > buffer
std::array< PixelCell, kPixelChunkSize *kPixelChunkSize > cells
Unity GridBrushBase-inspired tile brush. Operates on TileBuffer; exposes preview + change list for UI...
int getTile() const
Returns the tile.
std::string getTool() const
Returns the tool.
int getSize() const
Returns the size.
int getStampHeight() const
Returns the stamp height.
int getEraseTile() const
Returns the erase tile.
int getPreviewCount() const
Returns the preview count.
std::string getShape() const
Returns the shape.
int getChangeCount() const
Returns the change count.
int getStampWidth() const
Returns the stamp width.
Independent GID grid for map brushes (no hard dependency on map.TileLayer).