dungeon_crawler

view prototype/src/tile.h @ 42:6d71dd4760f9

added flag to force the use of the fallback renderer
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 30 Aug 2012 05:38:03 +0300
parents fa8f89d06f6f
children dfd3a413ef9e
line source
1 #ifndef TILE_H_
2 #define TILE_H_
4 #include <vector>
5 #include <map>
6 #include <assimp/scene.h>
7 #include <psys/psys.h>
8 #include "mesh.h"
9 #include "light.h"
11 enum {
12 TILE_NORTH = 1,
13 TILE_SOUTH = 2,
14 TILE_EAST = 4,
15 TILE_WEST = 8,
16 TILE_ALL = 0xffff
17 };
19 class TileSet;
21 class Tile {
22 private:
23 TileSet *tset;
25 std::vector<Mesh*> meshes;
26 std::vector<unsigned int> mesh_side, light_side;
27 std::vector<Light*> lights;
28 std::vector<struct psys_attributes*> psattr;
30 int load_lights(const aiScene *scn);
31 int load_meshes(const aiScene *scn, const std::map<aiMesh*, aiNode*> &nmap);
33 public:
34 Tile(TileSet *tileset = 0);
35 ~Tile();
37 bool load(const char *fname);
39 void update(unsigned long msec, float dt);
41 void draw(unsigned int drawmask) const;
42 void draw_lights(unsigned int drawmask) const;
43 };
46 #endif // TILE_H_