13 gids_.assign(
static_cast<size_t>(width_) *
static_cast<size_t>(height_), 0);
18 std::vector<int> next(
static_cast<size_t>(
width) *
static_cast<size_t>(
height), 0);
19 int copyW = std::min(
width, width_);
20 int copyH = std::min(
height, height_);
21 for (
int y = 0;
y < copyH; ++
y) {
22 for (
int x = 0;
x < copyW; ++
x) {
23 next[
static_cast<size_t>(
y *
width +
x)] = gids_[
static_cast<size_t>(
y * width_ +
x)];
39 gids_[
static_cast<size_t>(
index(
x,
y))] = gid;
44 return gids_[
static_cast<size_t>(
index(
x,
y))];
EVENGINE_API_FOUNDATION public API.
void setGid(int x, int y, int gid)
Sets the gid.
void resize(int width, int height)
Resize.
bool containsCell(int x, int y) const
Return whether a cell belongs to this buffer.
int getGid(int x, int y) const
Returns the gid.
TileBuffer(int width, int height)
Tile buffer.