-
Notifications
You must be signed in to change notification settings - Fork 0
/
map.h
67 lines (51 loc) · 1.24 KB
/
map.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef __MAP_H__
#define __MAP_H__
#include "main.h"
#include <Box2D/Box2D.h>
#define SEED_MAP_LAYERS_MAX 128
class IMapLayer;
class Map : public IResource, public ISceneObject
{
public:
Map(b2World *world);
virtual ~Map();
virtual void Reset();
virtual u32 AddLayerTiled();
virtual u32 AddLayerMetadata();
virtual u32 AddLayerMosaic();
virtual IMapLayer *GetLayerAt(u32 index);
virtual IMapLayer *GetLayerByName(const char *name);
// ISceneObject
virtual void Update(f32 delta);
virtual void Render();
// IResource
using IResource::Load;
virtual BOOL Load(const char *filename, ResourceManager *res, IMemoryPool *pool);
virtual BOOL Unload();
// IObject
virtual int GetObjectType() const;
virtual const char *GetObjectName() const;
private:
enum eLayerType
{
LayerTypeTiled,
LayerTypeMetadata,
LayerTypeMosaic,
LayerTypeMax,
};
SceneNode<SEED_MAP_LAYERS_MAX> cMapLayers;
Array<IMapLayer *, SEED_MAP_LAYERS_MAX> arLayers;
File stFile;
u32 iViewWidthInTiles;
u32 iViewHeightInTiles;
u32 iWidthInTiles;
u32 iHeightInTiles;
Point2u ptiTileSize;
//u32 iTileWidth;
//u32 iTileHeight;
u32 iLayerCount;
f32 fTileWidth;
f32 fTileHeight;
b2World *world;
};
#endif // __MAP_H__