载入中...
搜索中...
未找到
src
modules
editor
TileBuffer.h
浏览该文件的文档.
1
#pragma once
2
3
#include <cstdint>
4
#include <vector>
5
6
namespace
eve::editor
{
7
9
class
TileBuffer
{
10
public
:
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
25
private
:
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
y
int y
Definition
Grass.cpp:135
height
float height
Definition
Grass.cpp:235
x
int x
Definition
Grass.cpp:135
width
int width
Definition
Pathfinder.cpp:144
eve::editor::TileBuffer
Independent GID grid for map brushes (no hard dependency on map.TileLayer).
Definition
TileBuffer.h:9
eve::editor::TileBuffer::fill
void fill(int gid)
Definition
TileBuffer.cpp:33
eve::editor::TileBuffer::clear
void clear()
Definition
TileBuffer.cpp:31
eve::editor::TileBuffer::getWidth
int getWidth() const
Definition
TileBuffer.h:13
eve::editor::TileBuffer::getGid
int getGid(int x, int y) const
Definition
TileBuffer.cpp:44
eve::editor::TileBuffer::inBounds
bool inBounds(int x, int y) const
Definition
TileBuffer.cpp:35
eve::editor::TileBuffer::resize
void resize(int width, int height)
Definition
TileBuffer.cpp:16
eve::editor::TileBuffer::setGid
void setGid(int x, int y, int gid)
Definition
TileBuffer.cpp:39
eve::editor::TileBuffer::getHeight
int getHeight() const
Definition
TileBuffer.h:14
eve::editor
Definition
Brush.cpp:10