1#ifndef GAME_EDITOR_MAPITEMS_LAYER_TILES_H
2#define GAME_EDITOR_MAPITEMS_LAYER_TILES_H
38 void ShiftImpl(T *pTiles,
int Direction,
int ShiftBy)
62 for(
int y = ShiftBy; y <
m_Height; ++y)
73 for(
int y =
m_Height - ShiftBy - 1; y >= 0; --y)
77 for(
int y = 0; y < ShiftBy; ++y)
88 for(
int x = 0; x <
m_Width / 2; x++)
89 std::swap(pTiles[y *
m_Width + x], pTiles[(y + 1) *
m_Width - 1 - x]);
94 for(
int y = 0; y <
m_Height / 2; y++)
95 for(
int x = 0; x <
m_Width; x++)
108 virtual void Resize(
int NewW,
int NewH);
109 virtual void Shift(
int Direction);
112 void Render(
bool Tileset =
false)
override;
122 virtual bool IsEmpty(
const std::shared_ptr<CLayerTiles> &pLayer);
128 void BrushDraw(std::shared_ptr<CLayer> pBrush,
vec2 WorldPos)
override;
133 std::shared_ptr<CLayer>
Duplicate()
const override;
134 const char *
TypeName()
const override;
157 void ExtractTiles(
int TilemapItemVersion,
const CTile *pSavedTiles,
size_t SavedTilesSize)
const;
159 void GetSize(
float *pWidth,
float *pHeight)
override
Definition: layer_tiles.h:35
int ConvertY(float y) const
Definition: layer_tiles.cpp:174
int BrushGrab(std::shared_ptr< CLayerGroup > pBrush, CUIRect Rect) override
Definition: layer_tiles.cpp:285
void FillSelection(bool Empty, std::shared_ptr< CLayer > pBrush, CUIRect Rect) override
Definition: layer_tiles.cpp:449
void BrushFlipX() override
Definition: layer_tiles.cpp:540
int m_Tune
Definition: layer_tiles.h:185
virtual void SetTile(int x, int y, CTile Tile)
Definition: layer_tiles.cpp:81
virtual bool IsEntitiesLayer() const override
Definition: layer_tiles.cpp:220
int m_Front
Definition: layer_tiles.h:183
static CUi::EPopupMenuFunctionResult RenderCommonProperties(SCommonPropState &State, CEditor *pEditor, CUIRect *pToolbox, std::vector< std::shared_ptr< CLayerTiles > > &vpLayers, std::vector< int > &vLayerIndices)
Definition: layer_tiles.cpp:1104
void Convert(CUIRect Rect, RECTi *pOut) const
Definition: layer_tiles.cpp:176
void FillGameTiles(EGameTileOp Fill)
Definition: layer_tiles.cpp:704
void BrushFlipY() override
Definition: layer_tiles.cpp:556
bool m_AutoAutoMap
Definition: layer_tiles.h:180
void ModifyEnvelopeIndex(FIndexModifyFunction pfnFunc) override
Definition: layer_tiles.cpp:1294
void ModifyImageIndex(FIndexModifyFunction pfnFunc) override
Definition: layer_tiles.cpp:1289
int m_Speedup
Definition: layer_tiles.h:182
CColor m_Color
Definition: layer_tiles.h:171
virtual void ClearHistory()
Definition: layer_tiles.h:189
int m_AutoMapperConfig
Definition: layer_tiles.h:178
void GetSize(float *pWidth, float *pHeight) override
Definition: layer_tiles.h:159
const char * TypeName() const override
Definition: layer_tiles.cpp:615
int m_Tele
Definition: layer_tiles.h:181
void ShiftImpl(T *pTiles, int Direction, int ShiftBy)
Definition: layer_tiles.h:38
void Clamp(RECTi *pRect) const
Definition: layer_tiles.cpp:194
CLayerTiles(CEditor *pEditor, int w, int h)
Definition: layer_tiles.cpp:16
int m_Game
Definition: layer_tiles.h:167
int ConvertX(float x) const
Definition: layer_tiles.cpp:173
void BrushFlipXImpl(T *pTiles)
Definition: layer_tiles.h:85
void RecordStateChange(int x, int y, CTile Previous, CTile Tile)
Definition: layer_tiles.cpp:93
int m_Switch
Definition: layer_tiles.h:184
~CLayerTiles()
Definition: layer_tiles.cpp:71
bool CanFillGameTiles() const
Definition: layer_tiles.cpp:893
void BrushFlipYImpl(T *pTiles)
Definition: layer_tiles.h:92
void ShowPreventUnusedTilesWarning()
Definition: layer_tiles.cpp:1299
char m_aFileName[IO_MAX_PATH_LENGTH]
Definition: layer_tiles.h:186
virtual void Resize(int NewW, int NewH)
Definition: layer_tiles.cpp:620
int m_Width
Definition: layer_tiles.h:169
int m_Seed
Definition: layer_tiles.h:179
virtual bool IsEmpty(const std::shared_ptr< CLayerTiles > &pLayer)
Definition: layer_tiles.cpp:225
void BrushSelecting(CUIRect Rect) override
Definition: layer_tiles.cpp:253
CTile * m_pTiles
Definition: layer_tiles.h:174
virtual void Shift(int Direction)
Definition: layer_tiles.cpp:656
void SetTileIgnoreHistory(int x, int y, CTile Tile) const
Definition: layer_tiles.cpp:88
void Render(bool Tileset=false) override
Definition: layer_tiles.cpp:131
int m_ColorEnv
Definition: layer_tiles.h:172
CUi::EPopupMenuFunctionResult RenderProperties(CUIRect *pToolbox) override
Definition: layer_tiles.cpp:905
int m_Height
Definition: layer_tiles.h:170
void PrepareForSave()
Definition: layer_tiles.cpp:101
virtual void ShowInfo()
Definition: layer_tiles.cpp:661
void MakePalette() const
Definition: layer_tiles.cpp:124
void BrushRotate(float Amount) override
Definition: layer_tiles.cpp:572
void Snap(CUIRect *pRect) const
Definition: layer_tiles.cpp:184
void FlagModified(int x, int y, int w, int h)
Definition: layer_tiles.cpp:1280
void BrushDraw(std::shared_ptr< CLayer > pBrush, vec2 WorldPos) override
Definition: layer_tiles.cpp:497
int m_Image
Definition: layer_tiles.h:168
void ExtractTiles(int TilemapItemVersion, const CTile *pSavedTiles, size_t SavedTilesSize) const
Definition: layer_tiles.cpp:115
static bool HasAutomapEffect(ETilesProp Prop)
Definition: layer_tiles.cpp:1309
EditorTileStateChangeHistory< STileStateChange > m_TilesHistory
Definition: layer_tiles.h:188
int m_ColorEnvOffset
Definition: layer_tiles.h:173
std::shared_ptr< CLayer > Duplicate() const override
Definition: layer_tiles.cpp:610
virtual CTile GetTile(int x, int y)
Definition: layer_tiles.cpp:76
Definition: mapitems.h:236
EPopupMenuFunctionResult
Definition: ui.h:289
ETilesProp
Definition: mapitems.h:69
std::function< void(int *pIndex)> FIndexModifyFunction
Definition: editor.h:52
EGameTileOp
Definition: enums.h:20
void mem_zero(T *block, size_t size)
Definition: system.h:178
void mem_copy(void *dest, const void *source, size_t size)
Definition: system.cpp:174
void mem_move(void *dest, const void *source, size_t size)
Definition: system.cpp:179
std::map< int, std::map< int, T > > EditorTileStateChangeHistory
Definition: layer_tiles.h:18
@ DIRECTION_DOWN
Definition: layer_tiles.h:25
@ DIRECTION_LEFT
Definition: layer_tiles.h:22
@ DIRECTION_UP
Definition: layer_tiles.h:24
@ DIRECTION_RIGHT
Definition: layer_tiles.h:23
constexpr T minimum(T a, T b)
Definition: math.h:120
Definition: layer_tiles.h:140
@ MODIFIED_SIZE
Definition: layer_tiles.h:143
@ MODIFIED_COLOR
Definition: layer_tiles.h:144
int m_Height
Definition: layer_tiles.h:148
int m_Modified
Definition: layer_tiles.h:146
int m_Color
Definition: layer_tiles.h:149
int m_Width
Definition: layer_tiles.h:147
Definition: layer_tiles.h:29
int y
Definition: layer_tiles.h:30
int x
Definition: layer_tiles.h:30
int h
Definition: layer_tiles.h:31
int w
Definition: layer_tiles.h:31
Definition: layer_tiles.h:11
CTile m_Previous
Definition: layer_tiles.h:13
bool m_Changed
Definition: layer_tiles.h:12
CTile m_Current
Definition: layer_tiles.h:14
@ IO_MAX_PATH_LENGTH
Definition: types.h:43