summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-03 00:46:38 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-03 13:17:37 +0300
commit8b2464a723f7039a3efbc0c7d2e883729b3fa7dd (patch)
tree0564c85d8f6301d8a0b916f37612e27788d82853 /src/resources
parent63054bddcc1a306787250209b03c04086b9b472f (diff)
downloadmv-8b2464a723f7039a3efbc0c7d2e883729b3fa7dd.tar.gz
mv-8b2464a723f7039a3efbc0c7d2e883729b3fa7dd.tar.bz2
mv-8b2464a723f7039a3efbc0c7d2e883729b3fa7dd.tar.xz
mv-8b2464a723f7039a3efbc0c7d2e883729b3fa7dd.zip
Fix some casts.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/action.h2
-rw-r--r--src/resources/beinginfo.cpp2
-rw-r--r--src/resources/map/map.cpp4
-rw-r--r--src/resources/map/map.h11
4 files changed, 10 insertions, 9 deletions
diff --git a/src/resources/action.h b/src/resources/action.h
index 86a3740d1..edc2ea6ed 100644
--- a/src/resources/action.h
+++ b/src/resources/action.h
@@ -58,7 +58,7 @@ class Action final
void setLastFrameDelay(const int delay) noexcept;
protected:
- typedef std::map<int, Animation*> Animations;
+ typedef std::map<SpriteDirection::Type, Animation*> Animations;
typedef Animations::iterator AnimationIter;
Animations mAnimations;
diff --git a/src/resources/beinginfo.cpp b/src/resources/beinginfo.cpp
index e3cf9bb91..bd4359144 100644
--- a/src/resources/beinginfo.cpp
+++ b/src/resources/beinginfo.cpp
@@ -154,7 +154,7 @@ const SoundInfo &BeingInfo::getSound(const ItemSoundEvent::Type event) const
if (!vect || vect->empty())
return emptySound;
else
- return vect->at(static_cast<unsigned int>(rand()) % vect->size());
+ return vect->at(static_cast<size_t>(rand()) % vect->size());
}
const Attack *BeingInfo::getAttack(const int id) const
diff --git a/src/resources/map/map.cpp b/src/resources/map/map.cpp
index 99344e0fd..f7f4b900f 100644
--- a/src/resources/map/map.cpp
+++ b/src/resources/map/map.cpp
@@ -497,7 +497,7 @@ void Map::draw(Graphics *const graphics, int scrollX, int scrollY)
void Map::drawCollision(Graphics *const graphics,
const int scrollX, const int scrollY,
- const int debugFlags) const
+ const MapType::MapType drawFlags) const
{
const int endPixelY = graphics->mHeight + scrollY + mTileHeight - 1;
int startX = scrollX / mTileWidth;
@@ -514,7 +514,7 @@ void Map::drawCollision(Graphics *const graphics,
if (endY > mHeight)
endY = mHeight;
- if (debugFlags < MapType::SPECIAL)
+ if (drawFlags < MapType::SPECIAL)
{
graphics->setColor(userPalette->getColorWithAlpha(UserPalette::NET));
graphics->drawNet(
diff --git a/src/resources/map/map.h b/src/resources/map/map.h
index cf2d0c1e9..21976d38a 100644
--- a/src/resources/map/map.h
+++ b/src/resources/map/map.h
@@ -29,6 +29,7 @@
#include "resources/map/blockmask.h"
#include "resources/map/blocktype.h"
+#include "resources/map/maptype.h"
#include "resources/map/properties.h"
#include "listeners/configlistener.h"
@@ -115,7 +116,7 @@ class Map final : public Properties, public ConfigListener
*/
void drawCollision(Graphics *const graphics,
const int scrollX, const int scrollY,
- const int debugFlags) const;
+ const MapType::MapType drawFlags) const;
/**
* Adds a layer to this map. The map takes ownership of the layer.
@@ -217,10 +218,10 @@ class Map final : public Properties, public ConfigListener
void addAnimation(const int gid, TileAnimation *const animation)
{ mTileAnimations[gid] = animation; }
- void setDrawLayersFlags(const int n)
+ void setDrawLayersFlags(const MapType::MapType &n)
{ mDrawLayersFlags = n; }
- int getDrawLayersFlags() const A_WARN_UNUSED
+ MapType::MapType getDrawLayersFlags() const A_WARN_UNUSED
{ return mDrawLayersFlags; }
void addExtraLayer();
@@ -379,8 +380,8 @@ class Map final : public Properties, public ConfigListener
Actors mActors;
bool mHasWarps;
- // debug flags
- int mDrawLayersFlags;
+ // draw flags
+ MapType::MapType mDrawLayersFlags;
// Pathfinding members
unsigned int mOnClosedList;