载入中...
搜索中...
未找到
TileBuffer.h
浏览该文件的文档.
1#pragma once
2
3#include <cstdint>
4#include <vector>
5
6namespace eve::editor {
7
9class TileBuffer {
10public:
11 TileBuffer(int width, int height);
12
13 int getWidth() const { return width_; }
14 int getHeight() const { return height_; }
15
16 void resize(int width, int height);
17 void clear();
18 void fill(int gid);
19
20 void setGid(int x, int y, int gid);
21 int getGid(int x, int y) const;
22
23 bool inBounds(int x, int y) const;
24
25private:
26 int index(int x, int y) const { return y * width_ + x; }
27
28 int width_ = 0;
29 int height_ = 0;
30 std::vector<int> gids_;
31};
32
33} // namespace eve::editor
int y
Definition Grass.cpp:135
float height
Definition Grass.cpp:235
int x
Definition Grass.cpp:135
int width
Independent GID grid for map brushes (no hard dependency on map.TileLayer).
Definition TileBuffer.h:9
int getGid(int x, int y) const
bool inBounds(int x, int y) const
void resize(int width, int height)
void setGid(int x, int y, int gid)