ScummVM API documentation
tmx_map.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef NUVIE_FILES_TMX_MAP_H
23 #define NUVIE_FILES_TMX_MAP_H
24 
25 #include "ultima/nuvie/core/nuvie_defs.h"
26 #include "ultima/nuvie/files/nuvie_io_file.h"
27 
28 namespace Ultima {
29 namespace Nuvie {
30 
31 class Map;
32 class ObjManager;
33 class TileManager;
34 class NuvieIOFileWrite;
35 
36 class TMXMap {
37 private:
38  unsigned char *mapdata;
39  NuvieIOFileWrite file;
40  TileManager *tile_manager;
41  Map *map;
42  ObjManager *obj_manager;
43  Common::Path savedir;
44  Std::string savename;
45  //nuvie_game_t game_type;
46 
47 public:
48  TMXMap(TileManager *tm, Map *m, ObjManager *om);
49  virtual ~TMXMap();
50  bool exportTmxMapFiles(const Common::Path &dir, nuvie_game_t type);
51 private:
52  bool exportMapLevel(uint8 level);
53  void writeRoofTileset(uint8 level);
54  void writeLayer(NuvieIOFileWrite *tmx, uint16 width, Std::string layerName,
55  uint16 gidOffset, uint16 bitsPerTile, const unsigned char *data);
56  void writeObjectLayer(NuvieIOFileWrite *tmx, uint8 level);
57  void writeObjects(NuvieIOFileWrite *tmx, uint8 level, bool forceLower, bool toptiles);
58  Std::string writeObjectTile(Obj *obj, Std::string nameSuffix, uint16 tile_num, uint16 x, uint16 y, bool forceLower, bool toptile);
59  Std::string sint32ToString(sint32 value);
60  Std::string boolToString(bool value);
61  bool canDrawTile(Tile *t, bool forceLower, bool toptile);
62 };
63 
64 } // End of namespace Nuvie
65 } // End of namespace Ultima
66 
67 #endif
Definition: obj.h:84
Definition: map.h:147
Definition: path.h:52
Definition: tmx_map.h:36
Definition: nuvie_io_file.h:75
Definition: tile_manager.h:145
Definition: detection.h:27
Definition: string.h:30
Definition: obj_manager.h:75
Definition: tile_manager.h:113