1 | #ifndef GAME_EDITOR_MAPITEMS_LAYER_TUNE_H |
2 | #define GAME_EDITOR_MAPITEMS_LAYER_TUNE_H |
3 | |
4 | #include "layer_tiles.h" |
5 | |
6 | struct STuneTileStateChange |
7 | { |
8 | bool m_Changed; |
9 | struct SData |
10 | { |
11 | int m_Number; |
12 | int m_Type; |
13 | int m_Index; |
14 | } m_Previous, m_Current; |
15 | }; |
16 | |
17 | class CLayerTune : public CLayerTiles |
18 | { |
19 | public: |
20 | CLayerTune(CEditor *pEditor, int w, int h); |
21 | CLayerTune(const CLayerTune &Other); |
22 | ~CLayerTune(); |
23 | |
24 | CTuneTile *m_pTuneTile; |
25 | unsigned char m_TuningNumber; |
26 | |
27 | void Resize(int NewW, int NewH) override; |
28 | void Shift(int Direction) override; |
29 | bool IsEmpty(const std::shared_ptr<CLayerTiles> &pLayer) override; |
30 | void BrushDraw(std::shared_ptr<CLayer> pBrush, float wx, float wy) override; |
31 | void BrushFlipX() override; |
32 | void BrushFlipY() override; |
33 | void BrushRotate(float Amount) override; |
34 | void FillSelection(bool Empty, std::shared_ptr<CLayer> pBrush, CUIRect Rect) override; |
35 | |
36 | EditorTileStateChangeHistory<STuneTileStateChange> m_History; |
37 | inline void ClearHistory() override |
38 | { |
39 | CLayerTiles::ClearHistory(); |
40 | m_History.clear(); |
41 | } |
42 | |
43 | std::shared_ptr<CLayer> Duplicate() const override; |
44 | const char *TypeName() const override; |
45 | |
46 | private: |
47 | void RecordStateChange(int x, int y, STuneTileStateChange::SData Previous, STuneTileStateChange::SData Current); |
48 | }; |
49 | |
50 | #endif |
51 | |