dungeon_crawler
annotate 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 |
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@38 | 7 #include <psys/psys.h> |
nuclear@2 | 8 #include "mesh.h" |
nuclear@4 | 9 #include "light.h" |
nuclear@2 | 10 |
nuclear@3 | 11 enum { |
nuclear@3 | 12 TILE_NORTH = 1, |
nuclear@3 | 13 TILE_SOUTH = 2, |
nuclear@3 | 14 TILE_EAST = 4, |
nuclear@3 | 15 TILE_WEST = 8, |
nuclear@7 | 16 TILE_ALL = 0xffff |
nuclear@3 | 17 }; |
nuclear@3 | 18 |
nuclear@11 | 19 class TileSet; |
nuclear@11 | 20 |
nuclear@1 | 21 class Tile { |
nuclear@2 | 22 private: |
nuclear@11 | 23 TileSet *tset; |
nuclear@11 | 24 |
nuclear@2 | 25 std::vector<Mesh*> meshes; |
nuclear@21 | 26 std::vector<unsigned int> mesh_side, light_side; |
nuclear@3 | 27 std::vector<Light*> lights; |
nuclear@38 | 28 std::vector<struct psys_attributes*> psattr; |
nuclear@2 | 29 |
nuclear@4 | 30 int load_lights(const aiScene *scn); |
nuclear@7 | 31 int load_meshes(const aiScene *scn, const std::map<aiMesh*, aiNode*> &nmap); |
nuclear@4 | 32 |
nuclear@1 | 33 public: |
nuclear@11 | 34 Tile(TileSet *tileset = 0); |
nuclear@38 | 35 ~Tile(); |
nuclear@11 | 36 |
nuclear@1 | 37 bool load(const char *fname); |
nuclear@1 | 38 |
nuclear@38 | 39 void update(unsigned long msec, float dt); |
nuclear@38 | 40 |
nuclear@3 | 41 void draw(unsigned int drawmask) const; |
nuclear@23 | 42 void draw_lights(unsigned int drawmask) const; |
nuclear@1 | 43 }; |
nuclear@1 | 44 |
nuclear@5 | 45 |
nuclear@1 | 46 #endif // TILE_H_ |