dungeon_crawler

view prototype/src/tile.h @ 23:fa8f89d06f6f

progress with light rendering
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 23 Aug 2012 00:10:10 +0300
parents 0588f8a1a351
children 862461b686f4
line source
1 #ifndef TILE_H_
2 #define TILE_H_
4 #include <vector>
5 #include <map>
6 #include <assimp/scene.h>
7 #include "mesh.h"
8 #include "light.h"
10 enum {
11 TILE_NORTH = 1,
12 TILE_SOUTH = 2,
13 TILE_EAST = 4,
14 TILE_WEST = 8,
15 TILE_ALL = 0xffff
16 };
18 class TileSet;
20 class Tile {
21 private:
22 TileSet *tset;
24 std::vector<Mesh*> meshes;
25 std::vector<unsigned int> mesh_side, light_side;
26 std::vector<Light*> lights;
28 int load_lights(const aiScene *scn);
29 int load_meshes(const aiScene *scn, const std::map<aiMesh*, aiNode*> &nmap);
31 public:
32 Tile(TileSet *tileset = 0);
34 bool load(const char *fname);
36 void draw(unsigned int drawmask) const;
37 void draw_lights(unsigned int drawmask) const;
38 };
41 #endif // TILE_H_