Mercurial > fife-parpg
changeset 617:69ef061db940
Removed the remaining size_t references that affected the FIFE API and replaced them with more appropriate definitions. The remaining size_t definitions will remain as they wont cause any issues. fixes[t:152]
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Mon, 27 Sep 2010 21:18:24 +0000 |
parents | c770794d0a4a |
children | b5e7e14004a4 |
files | engine/core/model/model.cpp engine/core/model/model.h engine/core/model/model.i engine/core/model/structures/map.cpp engine/core/model/structures/map.h engine/core/model/structures/map.i |
diffstat | 6 files changed, 30 insertions(+), 30 deletions(-) [+] |
line wrap: on
line diff
--- a/engine/core/model/model.cpp Mon Sep 27 15:38:09 2010 +0000 +++ b/engine/core/model/model.cpp Mon Sep 27 21:18:24 2010 +0000 @@ -129,7 +129,7 @@ } } - size_t Model::getNumMaps() const { + uint32_t Model::getNumMaps() const { return m_maps.size(); }
--- a/engine/core/model/model.h Mon Sep 27 15:38:09 2010 +0000 +++ b/engine/core/model/model.h Mon Sep 27 21:18:24 2010 +0000 @@ -58,14 +58,14 @@ /** Constructor * */ - Model(RenderBackend* renderbackend, const std::vector<RendererBase*>& renderers, + Model(RenderBackend* renderbackend, const std::vector<RendererBase*>& renderers, ImagePool* imagepool, AnimationPool* animpool); /** Destructor * */ ~Model(); - + /** Add a map this model, and get a pointer to it. * The returned pointer is owned by the Model, so don't delete it! */ @@ -87,7 +87,7 @@ /** Return the number of maps in this model */ - size_t getNumMaps() const; + uint32_t getNumMaps() const; /** Removes all maps from this model */ @@ -98,7 +98,7 @@ std::list<std::string> getNamespaces() const; /** Add an object to the metamodel. - * + * * @param identifier A string for identifying this object; must be unique for its namespace. * @param parent Objects may optionally inherit values from a parent object. * @note This object belongs to the model, so don't delete the returned pointer @@ -126,29 +126,29 @@ /** Adds pather to model. Moves ownership to model */ void adoptPather(AbstractPather* pather); - + /** Returns pather corresponding given name. If none found, returns NULL */ AbstractPather* getPather(const std::string& pathername); - + /** Adds cellgrid to model. Moves ownership to model */ void adoptCellGrid(CellGrid* grid); - + /** Returns new copy of cellgrid corresponding given name. If none found, returns NULL */ CellGrid* getCellGrid(const std::string& gridtype); - + /** Called periodically to update events on model */ void update(); - + /** Sets speed for the model. With speed 1.0, everything runs with normal speed. * With speed 2.0, clock is ticking twice as fast. With 0, everything gets paused. * Negavtive values are not supported (throws NotSupported exception). */ void setTimeMultiplier(float multip) { m_timeprovider.setMultiplier(multip); } - + /** Gets model speed. @see setTimeMultiplier. */ double getTimeMultiplier() const { return m_timeprovider.getMultiplier(); }
--- a/engine/core/model/model.i Mon Sep 27 15:38:09 2010 +0000 +++ b/engine/core/model/model.i Mon Sep 27 21:18:24 2010 +0000 @@ -57,7 +57,7 @@ Object* getObject(const std::string& id, const std::string& name_space); std::list<Object*> getObjects(const std::string& name_space) const; - size_t getNumMaps() const; + uint32_t getNumMaps() const; void deleteMaps(); AbstractPather* getPather(const std::string& pathername);
--- a/engine/core/model/structures/map.cpp Mon Sep 27 15:38:09 2010 +0000 +++ b/engine/core/model/structures/map.cpp Mon Sep 27 21:18:24 2010 +0000 @@ -78,7 +78,7 @@ throw NotFound(id); } - size_t Map::getNumLayers() const { + uint32_t Map::getNumLayers() const { return m_layers.size(); }
--- a/engine/core/model/structures/map.h Mon Sep 27 15:38:09 2010 +0000 +++ b/engine/core/model/structures/map.h Mon Sep 27 21:18:24 2010 +0000 @@ -56,7 +56,7 @@ class MapChangeListener { public: virtual ~MapChangeListener() {}; - + /** Called when some layer is changed on map. @see LayerChangeListener * Layer is effectively changed, in case some of its instances * is created, deleted or changed during latest update cycle @@ -65,13 +65,13 @@ * @note Does not report layer creations and deletions */ virtual void onMapChanged(Map* map, std::vector<Layer*>& changedLayers) = 0; - + /** Called when some layer gets created on the map * @param map where change occurred * @param layer which got created */ virtual void onLayerCreate(Map* map, Layer* layer) = 0; - + /** Called when some instance gets deleted on layer * @param map where change occurred * @param layer which will be deleted @@ -92,8 +92,8 @@ * To add map to model, one should call Model::addMap (otherwise * map is not registered with the engine properly) */ - Map(const std::string& identifier, RenderBackend* renderbackend, - const std::vector<RendererBase*>& renderers, ImagePool* imagepool, + Map(const std::string& identifier, RenderBackend* renderbackend, + const std::vector<RendererBase*>& renderers, ImagePool* imagepool, AnimationPool* animpool, TimeProvider* tp_master=NULL); /** Destructor @@ -126,7 +126,7 @@ /** Get the overall number of layers */ - size_t getNumLayers() const; + uint32_t getNumLayers() const; /** Delete all layers from the map */ @@ -134,36 +134,36 @@ /** Maps coordinate from one layer to another */ - void getMatchingCoordinates(const ModelCoordinate& coord_to_map, const Layer* from_layer, + void getMatchingCoordinates(const ModelCoordinate& coord_to_map, const Layer* from_layer, const Layer* to_layer, std::vector<ModelCoordinate>& matching_coords) const; /** Called periodically to update events on map * @returns true, if map was changed */ bool update(); - + /** Sets speed for the map. See Model::setTimeMultiplier. */ void setTimeMultiplier(float multip) { m_timeprovider.setMultiplier(multip); } - + /** Gets model speed. @see setTimeMultiplier. */ float getTimeMultiplier() const { return m_timeprovider.getMultiplier(); } - + /** Gets timeprovider used in the map */ TimeProvider* getTimeProvider() { return &m_timeprovider; } - + /** Adds new change listener * @param listener to add */ void addChangeListener(MapChangeListener* listener); - + /** Removes associated change listener * @param listener to remove */ void removeChangeListener(MapChangeListener* listener); - + /** Returns true, if map information was changed during previous update round */ bool isChanged() { return !m_changedlayers.empty(); } @@ -188,7 +188,7 @@ /** Get a list containing all cameras. */ std::vector<Camera*>& getCameras(); - + private: std::string m_id; @@ -197,13 +197,13 @@ Map(const Map& map); Map& operator=(const Map& map); - + // listeners for map changes std::vector<MapChangeListener*> m_changelisteners; // holds changed layers after each update std::vector<Layer*> m_changedlayers; - + // holds the cameras attached to this map std::vector<Camera*> m_cameras;
--- a/engine/core/model/structures/map.i Mon Sep 27 15:38:09 2010 +0000 +++ b/engine/core/model/structures/map.i Mon Sep 27 21:18:24 2010 +0000 @@ -66,7 +66,7 @@ std::list<Layer*> getLayers() const; Layer* getLayer(const std::string& id); - size_t getNumLayers() const; + uint32_t getNumLayers() const; void deleteLayers(); void setTimeMultiplier(float multip);