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