FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
mapsaver.cpp
Go to the documentation of this file.
1 /***************************************************************************
2 * Copyright (C) 2005-2017 by the FIFE team *
3 * http://www.fifengine.net *
4 * This file is part of FIFE. *
5 * *
6 * FIFE is free software; you can redistribute it and/or *
7 * modify it under the terms of the GNU Lesser General Public *
8 * License as published by the Free Software Foundation; either *
9 * version 2.1 of the License, or (at your option) any later version. *
10 * *
11 * This library is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14 * Lesser General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU Lesser General Public *
17 * License along with this library; if not, write to the *
18 * Free Software Foundation, Inc., *
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
20 ***************************************************************************/
21 
22 // Standard C++ library includes
23 
24 // 3rd party library includes
25 #include <tinyxml.h>
26 
27 // FIFE includes
28 // These includes are split up in two parts, separated by one empty line
29 // First block: files included from the FIFE root src directory
30 // Second block: files included from the same folder
31 #include "model/structures/map.h"
32 #include "model/structures/layer.h"
34 #include "model/structures/cell.h"
38 #include "model/metamodel/object.h"
40 #include "util/structures/point.h"
41 #include "util/structures/rect.h"
42 #include "view/visual.h"
43 #include "view/camera.h"
44 
45 #include "mapsaver.h"
46 
47 namespace FIFE {
48  static Logger _log(LM_NATIVE_SAVERS);
49 
51  //m_objectSaver = new ObjectSaver();
52  //m_animationSaver = new AnimationSaver();
53  //m_atlasSaver = new AtlasSaver();
54  }
55 
57  {
58 
59  }
60 
62  m_objectSaver = objectSaver;
63  }
64 
65 
67  m_animationSaver = animationSaver;
68  }
69 
70 
71  void MapSaver::setAtlasSaver(const FIFE::AtlasSaverPtr& atlasSaver) {
72  m_atlasSaver = atlasSaver;
73  }
74 
75  void MapSaver::save(const Map& map, const std::string& filename, const std::vector<std::string>& importFiles) {
76  TiXmlDocument doc;
77 
78  // add xml declaration
79  TiXmlDeclaration* decl = new TiXmlDeclaration("1.0", "ascii", "");
80  doc.LinkEndChild(decl);
81 
82  // add map element
83  TiXmlElement* mapElement = new TiXmlElement("map");
84  mapElement->SetAttribute("id", map.getId());
85  mapElement->SetAttribute("format", "1.0");
86  doc.LinkEndChild(mapElement);
87 
88  for (std::vector<std::string>::const_iterator iter = importFiles.begin(); iter != importFiles.end(); ++iter)
89  {
90  TiXmlElement* importElement = new TiXmlElement("import");
91  importElement->SetAttribute("file", *iter);
92 
93  // link to map element
94  mapElement->LinkEndChild(importElement);
95  }
96 
97  typedef std::list<Layer*> LayerList;
98  LayerList layers = map.getLayers();
99  for (LayerList::iterator iter = layers.begin(); iter != layers.end(); ++iter)
100  {
101  TiXmlElement* layerElement = new TiXmlElement("layer");
102  CellGrid* grid = (*iter)->getCellGrid();
103  layerElement->SetAttribute("id", (*iter)->getId());
104  layerElement->SetDoubleAttribute("x_offset", grid->getXShift());
105  layerElement->SetDoubleAttribute("y_offset", grid->getYShift());
106  layerElement->SetDoubleAttribute("z_offset", grid->getZShift());
107  layerElement->SetDoubleAttribute("x_scale", grid->getXScale());
108  layerElement->SetDoubleAttribute("y_scale", grid->getYScale());
109  layerElement->SetDoubleAttribute("rotation", grid->getRotation());
110  layerElement->SetAttribute("grid_type", grid->getType());
111  layerElement->SetAttribute("transparency", (*iter)->getLayerTransparency());
112 
113  std::string pathingStrategy;
114  switch ((*iter)->getPathingStrategy())
115  {
116  case CELL_EDGES_ONLY:
117  {
118  pathingStrategy = "cell_edges_only";
119  }
120  break;
122  {
123  pathingStrategy = "cell_edges_and_diagonals";
124  }
125  break;
126  default:
127  {
128  pathingStrategy = "cell_edges_only";
129  }
130  break;
131  }
132  layerElement->SetAttribute("pathing", pathingStrategy);
133 
134  std::string sortingStrategy;
135  switch ((*iter)->getSortingStrategy()) {
136  case SORTING_CAMERA:
137  {
138  sortingStrategy = "camera";
139  }
140  break;
141  case SORTING_LOCATION:
142  {
143  sortingStrategy = "location";
144  }
145  break;
147  {
148  sortingStrategy = "camera_and_location";
149  }
150  break;
151  default:
152  {
153  sortingStrategy = "camera";
154  }
155  break;
156  }
157  layerElement->SetAttribute("sorting", sortingStrategy);
158 
159  if ((*iter)->isWalkable()) {
160  layerElement->SetAttribute("layer_type", "walkable");
161  } else if ((*iter)->isInteract()) {
162  layerElement->SetAttribute("layer_type", "interact");
163  layerElement->SetAttribute("layer_type_id", (*iter)->getWalkableId());
164  }
165 
166  // add layer to document
167  mapElement->LinkEndChild(layerElement);
168 
169  // add instances tag to document
170  TiXmlElement* instancesElement = new TiXmlElement("instances");
171  layerElement->LinkEndChild(instancesElement);
172 
173  std::string currentNamespace = "";
174  typedef std::vector<Instance*> InstancesContainer;
175  InstancesContainer instances = (*iter)->getInstances();
176  for (InstancesContainer::iterator iter = instances.begin(); iter != instances.end(); ++iter)
177  {
178  Object* obj = (*iter)->getObject();
179  // don't save part instances
180  if (obj->isMultiPart()) {
181  continue;
182  }
183 
184  // create instance element
185  TiXmlElement* instanceElement = new TiXmlElement("i");
186 
187  if (!obj->getNamespace().empty() && currentNamespace != obj->getNamespace())
188  {
189  instanceElement->SetAttribute("ns", obj->getNamespace());
190 
191  // update current namespace
192  currentNamespace = obj->getNamespace();
193  }
194 
195  if (!(*iter)->getId().empty())
196  {
197  instanceElement->SetAttribute("id", (*iter)->getId());
198  }
199 
200  instanceElement->SetAttribute("o", obj->getId());
201 
202  ExactModelCoordinate position = (*iter)->getLocationRef().getExactLayerCoordinates();
203  instanceElement->SetDoubleAttribute("x", position.x);
204  instanceElement->SetDoubleAttribute("y", position.y);
205  instanceElement->SetDoubleAttribute("z", position.z);
206  instanceElement->SetAttribute("r", (*iter)->getRotation());
207 
208  if ((*iter)->isBlocking())
209  {
210  instanceElement->SetAttribute("blocking", (*iter)->isBlocking());
211  }
212 
213  if ((*iter)->getCellStackPosition() != obj->getCellStackPosition()) {
214  instanceElement->SetAttribute("cellstack", (*iter)->getCellStackPosition());
215  }
216 
217  if ((*iter)->isVisitor()) {
218  instanceElement->SetAttribute("visitor_radius", (*iter)->getVisitorRadius());
219  std::string shape("none");
220  if ((*iter)->getVisitorShape() == ITYPE_QUAD_SHAPE) {
221  shape = "quad";
222  } else if ((*iter)->getVisitorShape() == ITYPE_CIRCLE_SHAPE) {
223  shape = "circle";
224  }
225  instanceElement->SetAttribute("visitor_shape", shape);
226  }
227 
228  if ((*iter)->isSpecialCost()) {
229  if (!obj->isSpecialCost()) {
230  instanceElement->SetAttribute("cost_id", (*iter)->getCostId());
231  instanceElement->SetDoubleAttribute("cost", (*iter)->getCost());
232  } else if ((*iter)->getCostId() != obj->getCostId() ||
233  !Mathd::Equal((*iter)->getCost(), obj->getCost())) {
234  instanceElement->SetAttribute("cost_id", (*iter)->getCostId());
235  instanceElement->SetDoubleAttribute("cost", (*iter)->getCost());
236  }
237  }
238 
239  InstanceVisual* instanceVisual = (*iter)->getVisual<InstanceVisual>();
240  instanceElement->SetAttribute("stackpos", instanceVisual->getStackPosition());
241 
242  instancesElement->LinkEndChild(instanceElement);
243  }
244  }
245  // add cellcaches tag to document
246  TiXmlElement* cellcachesElement = new TiXmlElement("cellcaches");
247  mapElement->LinkEndChild(cellcachesElement);
248  for (LayerList::iterator iter = layers.begin(); iter != layers.end(); ++iter) {
249  CellCache* cache = (*iter)->getCellCache();
250  if (!cache) {
251  continue;
252  }
253  // add cellcache tag to document
254  TiXmlElement* cellcacheElement = new TiXmlElement("cellcache");
255  cellcacheElement->SetAttribute("id", (*iter)->getId());
256  cellcacheElement->SetDoubleAttribute("default_cost", cache->getDefaultCostMultiplier());
257  cellcacheElement->SetDoubleAttribute("default_speed", cache->getDefaultSpeedMultiplier());
258  cellcacheElement->SetAttribute("search_narrow", cache->isSearchNarrowCells());
259 
260  const std::set<Cell*>& narrowCells = cache->getNarrowCells();
261  bool saveNarrows = !cache->isSearchNarrowCells() && !narrowCells.empty();
262 
263  const std::vector<std::vector<Cell*> >& cells = cache->getCells();
264  std::vector<std::vector<Cell*> >::const_iterator it = cells.begin();
265  for (; it != cells.end(); ++it) {
266  std::vector<Cell*>::const_iterator cit = (*it).begin();
267  for (; cit != (*it).end(); ++cit) {
268  Cell* cell = *cit;
269  std::list<std::string> costIds = cache->getCosts();
270  bool costsEmpty = costIds.empty();
271  bool defaultCost = cell->defaultCost();
272  bool defaultSpeed = cell->defaultSpeed();
273 
274  // check if area is part of the cell or object
275  std::vector<std::string> areaIds = cache->getCellAreas(cell);
276  std::vector<std::string> cellAreaIds;
277  bool areasEmpty = areaIds.empty();
278  if (!areasEmpty) {
279  const std::set<Instance*>& cellInstances = cell->getInstances();
280  if (!cellInstances.empty()) {
281  std::vector<std::string>::iterator area_it = areaIds.begin();
282  for (; area_it != areaIds.end(); ++area_it) {
283  bool objectArea = false;
284  std::set<Instance*>::const_iterator instance_it = cellInstances.begin();
285  for (; instance_it != cellInstances.end(); ++instance_it) {
286  if ((*instance_it)->getObject()->getArea() == *area_it) {
287  objectArea = true;
288  break;
289  }
290  }
291  if (!objectArea) {
292  cellAreaIds.push_back(*area_it);
293  }
294  }
295  } else {
296  cellAreaIds = areaIds;
297  }
298  areasEmpty = cellAreaIds.empty();
299  }
300 
301  CellVisualEffect cve = cell->getFoWType();
302  bool cellVisual = cve == CELLV_CONCEALED;
303  CellTypeInfo cti = cell->getCellType();
304  bool cellBlocker = (cti != CTYPE_CELL_NO_BLOCKER && cti != CTYPE_CELL_BLOCKER);
305  TransitionInfo* transition = cell->getTransition();
306  bool isNarrow = false;
307  if (saveNarrows) {
308  std::set<Cell*>::const_iterator narrow_it = narrowCells.find(cell);
309  if (narrow_it != narrowCells.end()) {
310  isNarrow = true;
311  }
312  }
313  if (costsEmpty && defaultCost && defaultSpeed && areasEmpty &&
314  cellVisual && cellBlocker && !transition && !isNarrow) {
315  continue;
316  }
317  // add cell tag to document
318  ModelCoordinate cellCoord = cell->getLayerCoordinates();
319  TiXmlElement* cellElement = new TiXmlElement("cell");
320  cellElement->SetAttribute("x", cellCoord.x);
321  cellElement->SetAttribute("y", cellCoord.y);
322  if (!defaultCost) {
323  cellElement->SetDoubleAttribute("default_cost", cell->getCostMultiplier());
324  }
325  if (!defaultSpeed) {
326  cellElement->SetDoubleAttribute("default_speed", cell->getSpeedMultiplier());
327  }
328  if (!cellVisual) {
329  if (cve == CELLV_REVEALED) {
330  cellElement->SetAttribute("state", "revealed");
331  } else {
332  cellElement->SetAttribute("state", "masked");
333  }
334  }
335  if (!cellBlocker) {
336  if (cti == CTYPE_CELL_NO_BLOCKER) {
337  cellElement->SetAttribute("blocker_type", "no_blocker");
338  } else {
339  cellElement->SetAttribute("blocker_type", "blocker");
340  }
341  }
342  if (isNarrow) {
343  cellElement->SetAttribute("narrow", true);
344  }
345  // add cost tag
346  if (!costsEmpty) {
347  std::list<std::string>::iterator cost_it = costIds.begin();
348  for (; cost_it != costIds.end(); ++cost_it) {
349  if (cache->existsCostForCell(*cost_it, cell)) {
350  TiXmlElement* costElement = new TiXmlElement("cost");
351  costElement->SetAttribute("id", *cost_it);
352  costElement->SetDoubleAttribute("value", cache->getCost(*cost_it));
353  cellElement->LinkEndChild(costElement);
354  }
355  }
356  }
357  // add area tag
358  if (!areasEmpty) {
359  std::vector<std::string>::iterator area_it = cellAreaIds.begin();
360  for (; area_it != cellAreaIds.end(); ++area_it) {
361  TiXmlElement* areaElement = new TiXmlElement("area");
362  areaElement->SetAttribute("id", *area_it);
363  areaElement->LinkEndChild(areaElement);
364  }
365  }
366  // add transition tag
367  if (transition) {
368  TiXmlElement* transitionElement = new TiXmlElement("transition");
369  transitionElement->SetAttribute("id", transition->m_layer->getId());
370  transitionElement->SetAttribute("x", transition->m_mc.x);
371  transitionElement->SetAttribute("y", transition->m_mc.y);
372  if (transition->m_mc.z != 0) {
373  transitionElement->SetAttribute("z", transition->m_mc.z);
374  }
375  if (transition->m_immediate) {
376  transitionElement->SetAttribute("immediate", true);
377  } else {
378  transitionElement->SetAttribute("immediate", false);
379  }
380  cellElement->LinkEndChild(transitionElement);
381  }
382  cellcacheElement->LinkEndChild(cellElement);
383  }
384  }
385  cellcachesElement->LinkEndChild(cellcacheElement);
386  }
387 
388  TriggerController* triggerController = map.getTriggerController();
389  std::vector<Trigger*> triggers = triggerController->getAllTriggers();
390  if (!triggers.empty()) {
391  // add triggers tag to document
392  TiXmlElement* triggersElement = new TiXmlElement("triggers");
393  mapElement->LinkEndChild(triggersElement);
394  for (std::vector<Trigger*>::iterator iter = triggers.begin(); iter != triggers.end(); ++iter) {
395  // add trigger tag to document
396  TiXmlElement* triggerElement = new TiXmlElement("trigger");
397  triggerElement->SetAttribute("name", (*iter)->getName());
398  triggerElement->SetAttribute("triggered", (*iter)->isTriggered());
399  triggerElement->SetAttribute("all_instances", (*iter)->isEnabledForAllInstances());
400  if ((*iter)->getAttached()) {
401  triggerElement->SetAttribute("attached_instance", (*iter)->getAttached()->getId());
402  triggerElement->SetAttribute("attached_layer", (*iter)->getAttached()->getLocationRef().getLayer()->getId());
403  }
404  const std::vector<Cell*>& cells = (*iter)->getAssignedCells();
405  if (!cells.empty()) {
406  for (std::vector<Cell*>::const_iterator citer = cells.begin(); citer != cells.end(); ++citer) {
407  TiXmlElement* cellElement = new TiXmlElement("assign");
408  cellElement->SetAttribute("layer_id", (*citer)->getLayer()->getId());
409  cellElement->SetAttribute("x", (*citer)->getLayerCoordinates().x);
410  cellElement->SetAttribute("y", (*citer)->getLayerCoordinates().y);
411  triggerElement->LinkEndChild(cellElement);
412  }
413  }
414  const std::vector<Instance*>& instances = (*iter)->getEnabledInstances();
415  if (!instances.empty()) {
416  for (std::vector<Instance*>::const_iterator citer = instances.begin(); citer != instances.end(); ++citer) {
417  TiXmlElement* instanceElement = new TiXmlElement("enabled");
418  instanceElement->SetAttribute("layer_id", (*citer)->getLocationRef().getLayer()->getId());
419  instanceElement->SetAttribute("instance_id", (*citer)->getId());
420  triggerElement->LinkEndChild(instanceElement);
421  }
422  }
423  const std::vector<TriggerCondition>& conditions = (*iter)->getTriggerConditions();
424  if (!conditions.empty()) {
425  for (std::vector<TriggerCondition>::const_iterator citer = conditions.begin(); citer != conditions.end(); ++citer) {
426  TiXmlElement* conditionElement = new TiXmlElement("condition");
427  conditionElement->SetAttribute("id", (*citer));
428  triggerElement->LinkEndChild(conditionElement);
429  }
430  }
431  triggersElement->LinkEndChild(triggerElement);
432  }
433  }
434 
435  typedef std::vector<Camera*> CameraContainer;
436  CameraContainer cameras = map.getCameras();
437  for (CameraContainer::iterator iter = cameras.begin(); iter != cameras.end(); ++iter)
438  {
439  if ((*iter)->getLocationRef().getMap()->getId() == map.getId())
440  {
441  TiXmlElement* cameraElement = new TiXmlElement("camera");
442 
443  cameraElement->SetAttribute("id", (*iter)->getId());
444  cameraElement->SetAttribute("ref_layer_id", (*iter)->getLocation().getLayer()->getId());
445  cameraElement->SetDoubleAttribute("zoom", (*iter)->getZoom());
446  cameraElement->SetDoubleAttribute("tilt", (*iter)->getTilt());
447  cameraElement->SetDoubleAttribute("rotation", (*iter)->getRotation());
448  if ((*iter)->isZToYEnabled()) {
449  cameraElement->SetDoubleAttribute("ztoy", (*iter)->getZToY());
450  }
451 
452  Rect viewport = (*iter)->getViewPort();
453  std::ostringstream viewportString;
454  viewportString << viewport.x << ","
455  << viewport.y << ","
456  << viewport.w << ","
457  << viewport.h;
458 
459  cameraElement->SetAttribute("viewport", viewportString.str());
460 
461  Point p = (*iter)->getCellImageDimensions();
462  cameraElement->SetAttribute("ref_cell_width", p.x);
463  cameraElement->SetAttribute("ref_cell_height", p.y);
464 
465  std::vector<float> lightingColor = (*iter)->getLightingColor();
466  bool writeLightingColor = false;
467  for (uint32_t i=0; i < lightingColor.size(); ++i)
468  {
469  if (lightingColor[i] < 1.0)
470  {
471  writeLightingColor = true;
472  break;
473  }
474  }
475 
476  if (writeLightingColor)
477  {
478  std::ostringstream lightingColorString;
479  for (uint32_t i=0; i < lightingColor.size(); ++i)
480  {
481  if (i > 0)
482  {
483  lightingColorString << ",";
484  }
485 
486  lightingColorString << lightingColor[i];
487 
488  cameraElement->SetAttribute("light_color", lightingColorString.str());
489  }
490  }
491 
492  mapElement->LinkEndChild(cameraElement);
493  }
494  }
495 
496  FILE* fp = 0;
497  #if defined(_MSC_VER) && (_MSC_VER >= 1400 )
498  fp = _fsopen( filename.c_str(), "w", _SH_DENYNO );
499  #else
500  fp = fopen( filename.c_str(), "w" );
501  #endif
502  // save the map xml file
503  doc.SaveFile(fp);
504  fclose(fp);
505  }
506 }
double getCost() const
Returns the cost.
Definition: object.cpp:309
double getCostMultiplier()
Returns the current cell cost.
Definition: cell.cpp:442
virtual void setAnimationSaver(const FIFE::AnimationSaverPtr &animationSaver)
allows setting which animation saver will be used to save animation files
Definition: mapsaver.cpp:66
Layer * m_layer
target layer
Definition: cell.h:85
const std::string & getNamespace() const
Definition: object.h:69
int32_t getStackPosition()
Gets current stack position of instance.
Definition: visual.cpp:221
T h
Height of the rectangle.
Definition: rect.h:93
Object class.
Definition: object.h:51
Instance visual contains data that is needed to visualize the instance on screen. ...
Definition: visual.h:158
double getSpeedMultiplier()
Returns the current cell speed.
Definition: cell.cpp:458
T x
The X Coordinate.
Definition: rect.h:84
AtlasSaverPtr m_atlasSaver
Definition: mapsaver.h:73
const std::string & getId() const
Definition: object.h:68
A CellCache is an abstract depiction of one or a few layers and contains additional information...
Definition: cellcache.h:111
ObjectSaverPtr m_objectSaver
Definition: mapsaver.h:71
virtual const std::string & getType() const =0
Type of cellgrid.
static Logger _log(LM_AUDIO)
std::string getCostId() const
Returns the cost id.
Definition: object.cpp:292
bool isMultiPart() const
Gets if object is a part of a multi object.
Definition: object.cpp:393
bool defaultCost()
Returns if cell use default cost.
Definition: cell.cpp:434
virtual void setObjectSaver(const FIFE::ObjectSaverPtr &objectSaver)
allows setting which object saver will be used to save object files
Definition: mapsaver.cpp:61
TriggerController * getTriggerController() const
Definition: map.h:220
std::vector< Trigger * > getAllTriggers()
Returns a vector with all trigger pointers.
const double getZShift() const
Get the cellgrid z shift.
Definition: cellgrid.h:176
const double getYScale() const
Get the cellgrid y-scaling.
Definition: cellgrid.h:210
Simple class to hold the data for transistions.
Definition: cell.h:82
virtual void setAtlasSaver(const FIFE::AtlasSaverPtr &atlasSaver)
allows setting which atlas saver will be used to save atlas files
Definition: mapsaver.cpp:71
static bool Equal(T _val1, T _val2)
Definition: fife_math.h:287
double getDefaultSpeedMultiplier()
Gets default speed for this CellCache.
Definition: cellcache.cpp:1156
const std::set< Instance * > & getInstances()
Returns all instances on this cell.
Definition: cell.cpp:503
uint8_t CellTypeInfo
Definition: cell.h:65
std::list< std::string > getCosts()
Returns all registered cost ids.
Definition: cellcache.cpp:1007
CellTypeInfo getCellType()
Returns blocker type.
Definition: cell.cpp:495
const double getXScale() const
Get the cellgrid x-scaling.
Definition: cellgrid.h:205
bool existsCostForCell(const std::string &costId, Cell *cell)
Gets if cell is assigned to cost identifier.
Definition: cellcache.cpp:1091
const double getRotation() const
Get the cellgrid rotation.
Definition: cellgrid.h:228
const double getXShift() const
Get the cellgrid x shift.
Definition: cellgrid.h:150
std::vector< std::string > getCellAreas(Cell *cell)
Returns all areas of a cell.
Definition: cellcache.cpp:1461
A basic cell on a CellCache.
Definition: cell.h:136
T y
The Y Coordinate.
Definition: rect.h:87
uint8_t CellVisualEffect
Definition: cell.h:78
const std::string & getId() const
Get the identifier for this map.
Definition: map.h:104
CellVisualEffect getFoWType()
Returns the cell visual.
Definition: cell.cpp:402
const ModelCoordinate getLayerCoordinates() const
Returns the layer coordinates of this cell.
Definition: cell.cpp:515
uint8_t getCellStackPosition() const
Returns cell stack position.
Definition: object.cpp:265
const std::string & getId() const
Get the id of this layer.
Definition: layer.cpp:81
const std::list< Layer * > & getLayers() const
Get the layers on this map.
Definition: map.h:120
const std::vector< std::vector< Cell * > > & getCells()
Returns all cells of this CellCache.
Definition: cellcache.cpp:717
bool isSpecialCost() const
Gets if object uses special cost.
Definition: object.cpp:275
const double getYShift() const
Get the cellgrid y shift.
Definition: cellgrid.h:163
double getCost(const std::string &costId)
Returns the cost value for the given id.
Definition: cellcache.cpp:991
virtual void save(const Map &map, const std::string &filename, const std::vector< std::string > &importFiles)
responsible for saving the map resource used to save map files
Definition: mapsaver.cpp:75
TransitionInfo * getTransition()
Returns the transition.
Definition: cell.cpp:585
This class serves as a central place to manage triggers for a Map.
A container of Layer(s).
Definition: map.h:88
const std::set< Cell * > & getNarrowCells()
Returns narrow cells.
Definition: cellcache.cpp:1368
unsigned int uint32_t
Definition: core.h:40
double getDefaultCostMultiplier()
Gets default cost for this CellCache.
Definition: cellcache.cpp:1148
MapSaver()
constructor
Definition: mapsaver.cpp:50
const std::vector< Camera * > & getCameras() const
Get a list containing all cameras.
Definition: map.cpp:295
~MapSaver()
destructor
Definition: mapsaver.cpp:56
bool defaultSpeed()
Returns if cell use default speed.
Definition: cell.cpp:450
T w
Width of the rectangle.
Definition: rect.h:90
bool m_immediate
use immediate
Definition: cell.h:93
bool isSearchNarrowCells()
Gets if narrow cells should be searched automatic.
Definition: cellcache.cpp:1388
AnimationSaverPtr m_animationSaver
Definition: mapsaver.h:72
ModelCoordinate m_mc
target coordinates
Definition: cell.h:89