Fix game:addSpawnShapesByZone
[ryzomcore.git] / nel / tools / 3d / tile_edit_qt / browser_model.h
blob83b92e15361975cea0d04af21389bebdc2bbb4b3
1 #ifndef BROWSERMODEL_H
2 #define BROWSERMODEL_H
4 #include <vector>
5 #include <string>
6 #include <nel/3d/tile_bank.h>
9 //TODO titegus: Equals TTileType?
10 enum TileType
12 _128x128 = 0,
13 _256x256 = 1,
14 Transition = 2,
15 Displace = 3,
16 UnSet = 4
20 //TODO titegus: Equals TBitmap ?
21 enum TileTexture
23 Diffuse = 0,
24 Additive = 1,
25 Alpha = 2
29 class TileInfo
31 public:
32 TileInfo();
33 TileInfo(int id, TileType tileType);
35 void Init(int id, TileType tileType);
36 bool Load (int index, std::vector<NLMISC::CBGRA>* Alpha);
37 void Delete ();
38 const std::string getRelativeFileName (TileTexture type, int index);
40 //data
41 std::vector<NLMISC::CBGRA> Bits;
42 std::vector<NLMISC::CBGRA> alphaBits;
43 std::vector<NLMISC::CBGRA> nightBits;
45 int loaded, nightLoaded, alphaLoaded; //tells if the tile was already loaded or not
46 std::string path, nightPath, alphaPath;
48 int getId() const { return id; }
49 void setId(int i) { id = i; }
50 int getTileType() const { return tileType; }
52 static std::string fixPath(const std::string &path);
54 private:
55 int id; //tile index (in the Browser)
56 TileType tileType;
59 typedef std::vector<TileInfo> tilelist;
61 class TileList
63 public:
64 TileList();
66 int addTile128 ();
67 int addTile256 ();
69 void removeTile128 (int index);
70 void removeTile256 (int index);
72 bool setTile128 (int tile, const std::string& name, NL3D::CTile::TBitmap type);
73 bool setTile256 (int tile, const std::string& name, NL3D::CTile::TBitmap type);
74 bool setTileTransition (int tile, const std::string& name, NL3D::CTile::TBitmap type);
75 bool setTileTransitionAlpha (int tile, const std::string& name, int rot);
76 bool setDisplacement (int tile, const std::string& name, NL3D::CTile::TBitmap type);
78 void clearTile128 (int index, NL3D::CTile::TBitmap bitmap);
79 void clearTile256 (int index, NL3D::CTile::TBitmap bitmap);
80 void clearTransition (int index, NL3D::CTile::TBitmap bitmap);
81 void clearDisplacement (int index, NL3D::CTile::TBitmap bitmap);
83 void Reload(int first, int last, TileType n);
85 int GetSize(int n);
86 tilelist::iterator GetFirst(int n);
87 tilelist::iterator GetLast(int n);
88 tilelist::iterator Get(int i, int n);
90 public:
91 tilelist theList[4];
92 #define theList128 theList[0]
93 #define theList256 theList[1]
94 #define theListTransition theList[2]
95 #define theListDisplacement theList[3]
96 int _tileSet;
99 #endif