18 void setTool(
const std::string &tool);
19 std::string
getTool()
const {
return tool_; }
24 void setShape(
const std::string &shape);
25 std::string
getShape()
const {
return shape_; }
73 void collectBrushCells(
int tx,
int ty, std::vector<std::pair<int, int>> &out)
const;
74 void collectLineCells(
int x0,
int y0,
int x1,
int y1, std::vector<std::pair<int, int>> &out)
const;
75 void collectRectCells(
int x0,
int y0,
int x1,
int y1,
bool filled,
76 std::vector<std::pair<int, int>> &out)
const;
77 int applyCells(TileBuffer *buffer,
const std::vector<std::pair<int, int>> &cells,
int gid);
78 int applyStamp(TileBuffer *buffer,
int tx,
int ty);
79 int previewCells(TileBuffer *buffer,
const std::vector<std::pair<int, int>> &cells,
int gid);
80 bool validChange(
int index)
const;
81 bool validPreview(
int index)
const;
83 std::string tool_ =
"paint";
84 std::string shape_ =
"square";
90 std::vector<int> stamp_;
92 std::vector<Cell> changes_;
93 std::vector<Cell> preview_;
Unity GridBrushBase-inspired tile brush. Operates on TileBuffer; exposes preview + change list for UI...
int getPreviewX(int index) const
void setTool(const std::string &tool)
int getPreviewGid(int index) const
int paintLine(TileBuffer *buffer, int x0, int y0, int x1, int y1)
int previewAt(TileBuffer *buffer, int tx, int ty)
Fill preview buffer without mutating target.
void setStampTile(int lx, int ly, int gid)
int getPreviewCount() const
int eraseAt(TileBuffer *buffer, int tx, int ty)
int previewRect(TileBuffer *buffer, int x0, int y0, int x1, int y1, bool filled)
int paintAt(TileBuffer *buffer, int tx, int ty)
Apply current tool at / between cells. Returns cells changed.
int paintRect(TileBuffer *buffer, int x0, int y0, int x1, int y1, bool filled)
int previewLine(TileBuffer *buffer, int x0, int y0, int x1, int y1)
int getChangeNewGid(int index) const
int getChangeX(int index) const
void setEraseTile(int gid)
int getStampTile(int lx, int ly) const
int getChangeY(int index) const
std::string getShape() const
int getStampWidth() const
int getChangeOldGid(int index) const
void setShape(const std::string &shape)
int getPreviewY(int index) const
int floodFill(TileBuffer *buffer, int tx, int ty)
int getChangeCount() const
void setStampSize(int width, int height)
std::string getTool() const
int getStampHeight() const
Independent GID grid for map brushes (no hard dependency on map.TileLayer).