Walls And Holes  1
map2mesh.h
Go to the documentation of this file.
1 #ifndef TIMAMAP2MESH_H
2 #define TIMAMAP2MESH_H
3 
4 
5 #include <QObject>
6 #include <QSet>
7 #include <QMutex>
8 
9 #include "simpletexturedscene.h"
10 #include "simpletexturedobject.h"
11 
12 #include "tilemap.h"
13 
14 #include "m2mpropertyclass.h"
15 #include "m2mtilemesher.h"
16 
17 #include "array2d.h"
18 
22 class Map2Mesh : public QObject {
23 
24  Q_OBJECT
25 
26 public:
31  Map2Mesh(TileMap *tileMap, QObject *parent = nullptr);
32 
33 
38 
39 public slots:
45  void tileChanged(int x, int y);
46 
50  void remakeAll();
51 
52 
53 protected:
57  void updateScene();
58 
59 
64 
65 
70 
71 
75 
76 
81 
82 
87 
91  QSet<QPoint> mTilesToUpdate;
92 
97 
98 
99 public:
100  struct Properties {
102  };
103 };
104 
105 
106 #endif // TIMAMAP2MESH_H
SimpleTexturedScene::SharedSimpleTexturedScene SharedSimpleTexturedScene
Definition: simpletexturedscene.h:136
static M2MPropertyClass * Height
Definition: map2mesh.h:101
void remakeAll()
Completely remakes all tile meshes.
Definition: map2mesh.cpp:52
The M2MPropertyClass represents a property class in Tima&#39;s Map2Mesh code.
Definition: m2mpropertyclass.h:11
SharedSimpleTexturedScene mScene
The Scene which contains the output of the Map2Mesh object.
Definition: map2mesh.h:69
TileMap * mTileMap
The TileMap that is the input to this Map2Mesh object.
Definition: map2mesh.h:63
An object that keeps track of map-to-mesh conversion.
Definition: map2mesh.h:22
Definition: map2mesh.h:100
TileObjectGrid mTileObjects
Mesh data for every tile.
Definition: map2mesh.h:80
QSet< QPoint > mTilesToUpdate
Coordinates of tiles that need updating.
Definition: map2mesh.h:91
bool mSceneUpdateScheduled
Whether an updateScene() call has been scheduled. Used in tileChanged().
Definition: map2mesh.h:86
The Array2D class is basically a 2D implementation of QVector.
Definition: array2d.h:35
QMutex mSceneUpdateMutex
Mutex for scene-update related operations.
Definition: map2mesh.h:96
void tileChanged(int x, int y)
Modifies the mesh near the tile that changed.
Definition: map2mesh.cpp:31
SharedSimpleTexturedScene getScene() const
Returns the Scene that this Map2Mesh instance works with.
Definition: map2mesh.cpp:26
void updateScene()
Updates the scene for all tiles that need updates.
Definition: map2mesh.cpp:68
Definition: tilemap.h:14
Map2Mesh(TileMap *tileMap, QObject *parent=nullptr)
Creates the conversion object.
Definition: map2mesh.cpp:8