26 #include "resources/map/map.h"
41 Cell(
const int x0,
const int y0) :
71 if (width < 2 || height < 2)
77 if ((tiles ==
nullptr) || (
data ==
nullptr))
83 while (findWalkableTile(
x,
y, width, height, tiles,
data))
85 fillNum(
x,
y, width, height, num, tiles,
data);
99 STD_VECTOR<Cell> cells;
100 cells.push_back(Cell(
x,
y));
101 while (!cells.empty())
103 const Cell cell = cells.back();
108 data[
x + width *
y] = num;
111 ptr = (
x - 1) + width *
y;
115 cells.push_back(Cell(
x - 1,
y));
122 ptr = (
x + 1) + width *
y;
126 cells.push_back(Cell(
x + 1,
y));
133 ptr =
x + width * (
y - 1);
137 cells.push_back(Cell(
x,
y - 1));
144 ptr =
x + width * (
y + 1);
148 cells.push_back(Cell(
x,
y + 1));
160 const int *
const data)
162 for (
int y = 0;
y < height;
y ++)
164 const int y2 =
y * width;
165 for (
int x = 0;
x < width;
x ++)
167 const int ptr =
x + y2;
const MetaTile * getMetaTiles() const
static bool findWalkableTile(int &x1, int &y1, const int width, const int height, const MetaTile *const tiles, const int *const data)
static void fillNum(int x, int y, const int width, const int height, const int num, const MetaTile *const tiles, int *const data)
static Resource * loadWalkLayer(const Map *const map)
#define A_DEFAULT_COPY(func)
static const int blockWalkMask
Cell(const int x0, const int y0)