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