summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-17 00:17:13 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-17 00:17:13 +0300
commit26f2c689298bb2077000b81ff3fe14328a89feb8 (patch)
tree2821e64165ca0ee2b7f18fb8ec3f53bf1f52a0a7
parente528b472ec803ecdec29e9e19c037c83adf30c1f (diff)
downloadmv-26f2c689298bb2077000b81ff3fe14328a89feb8.tar.gz
mv-26f2c689298bb2077000b81ff3fe14328a89feb8.tar.bz2
mv-26f2c689298bb2077000b81ff3fe14328a89feb8.tar.xz
mv-26f2c689298bb2077000b81ff3fe14328a89feb8.zip
Fix code style.
-rw-r--r--src/actions/chat.cpp2
-rw-r--r--src/gui/fonts/font.cpp2
-rw-r--r--src/gui/models/shopitems.cpp2
-rw-r--r--src/gui/sdlinput.cpp1
-rw-r--r--src/net/tmwa/guildmanager.h6
-rw-r--r--src/render/graphics.cpp1
-rw-r--r--src/render/graphics.h3
-rw-r--r--src/resources/map/maplayer.cpp19
-rw-r--r--src/resources/mstack.h4
-rw-r--r--src/simpleanimation.cpp2
10 files changed, 17 insertions, 25 deletions
diff --git a/src/actions/chat.cpp b/src/actions/chat.cpp
index cf85ad60c..974cc057f 100644
--- a/src/actions/chat.cpp
+++ b/src/actions/chat.cpp
@@ -560,7 +560,7 @@ impHandler0(chatGuildTab)
return true;
}
-impHandler0(hat)
+impHandler(hat)
{
if (!localPlayer)
return false;
diff --git a/src/gui/fonts/font.cpp b/src/gui/fonts/font.cpp
index 469d4e81c..d689ef88c 100644
--- a/src/gui/fonts/font.cpp
+++ b/src/gui/fonts/font.cpp
@@ -66,8 +66,6 @@
#include "gui/fonts/font.h"
-#include "logger.h"
-
#include "gui/fonts/textchunk.h"
#include "render/graphics.h"
diff --git a/src/gui/models/shopitems.cpp b/src/gui/models/shopitems.cpp
index 3a0d933cc..409ca3f63 100644
--- a/src/gui/models/shopitems.cpp
+++ b/src/gui/models/shopitems.cpp
@@ -128,7 +128,7 @@ void ShopItems::erase(const unsigned int i)
if (i >= static_cast<unsigned int>(mShopItems.size()))
return;
- ShopItem *item = *(mShopItems.begin() + i);
+ const ShopItem *const item = *(mShopItems.begin() + i);
std::vector<ShopItem*>::iterator it;
if (findInAllItems(it, item))
mAllShopItems.erase(it);
diff --git a/src/gui/sdlinput.cpp b/src/gui/sdlinput.cpp
index 6afa510d5..cc3693418 100644
--- a/src/gui/sdlinput.cpp
+++ b/src/gui/sdlinput.cpp
@@ -75,7 +75,6 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "logger.h"
#include "sdlshared.h"
#include "input/inputmanager.h"
diff --git a/src/net/tmwa/guildmanager.h b/src/net/tmwa/guildmanager.h
index 2fa6b2df8..4a03f02b9 100644
--- a/src/net/tmwa/guildmanager.h
+++ b/src/net/tmwa/guildmanager.h
@@ -18,8 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef GUILDMANAGER_H
-#define GUILDMANAGER_H
+#ifndef NET_TMWA_GUILDMANAGER_H
+#define NET_TMWA_GUILDMANAGER_H
#ifdef TMWA_SUPPORT
@@ -103,4 +103,4 @@ class GuildManager final
extern GuildManager *guildManager;
#endif // TMWA_SUPPORT
-#endif // GUILDMANAGER_H
+#endif // NET_TMWA_GUILDMANAGER_H
diff --git a/src/render/graphics.cpp b/src/render/graphics.cpp
index 63ce578e4..e40a4eb7d 100644
--- a/src/render/graphics.cpp
+++ b/src/render/graphics.cpp
@@ -69,7 +69,6 @@
#include "configuration.h"
#include "graphicsmanager.h"
#endif
-#include "logger.h"
#if defined(USE_OPENGL) && defined(USE_X11)
#include "render/mglxinit.h"
diff --git a/src/render/graphics.h b/src/render/graphics.h
index 62a3848d7..d6860d621 100644
--- a/src/render/graphics.h
+++ b/src/render/graphics.h
@@ -82,9 +82,6 @@
#include <SDL_render.h>
#endif
-#include <stack>
-#include <string>
-
#include "localconsts.h"
#ifdef USE_SDL2
diff --git a/src/resources/map/maplayer.cpp b/src/resources/map/maplayer.cpp
index ef1c1961c..2389de12b 100644
--- a/src/resources/map/maplayer.cpp
+++ b/src/resources/map/maplayer.cpp
@@ -37,7 +37,6 @@
#include "resources/map/mapitem.h"
#include "resources/map/maprowvertexes.h"
-#include "resources/map/maptype.h"
#include "resources/map/speciallayer.h"
#include "debug.h"
@@ -401,8 +400,8 @@ void MapLayer::drawFringe(Graphics *const graphics, int startX, int startY,
const int y32s = (y + mActorsFix) * mapTileSize;
BLOCK_START("MapLayer::drawFringe drawmobs")
- // If drawing the fringe layer, make sure all actors above this row of
- // tiles have been drawn
+ // If drawing the fringe layer, make sure all actors above this
+ // row of tiles have been drawn
while (ai != ai_end && (*ai)->getSortPixelY() <= y32s)
{
(*ai)->draw(graphics, -scrollX, -scrollY);
@@ -446,8 +445,8 @@ void MapLayer::drawFringe(Graphics *const graphics, int startX, int startY,
const int y32s = (y + mActorsFix) * mapTileSize;
BLOCK_START("MapLayer::drawFringe drawmobs")
- // If drawing the fringe layer, make sure all actors above this row of
- // tiles have been drawn
+ // If drawing the fringe layer, make sure all actors above this
+ // row of tiles have been drawn
while (ai != ai_end && (*ai)->getSortPixelY() <= y32s)
{
(*ai)->draw(graphics, -scrollX, -scrollY);
@@ -465,8 +464,8 @@ void MapLayer::drawFringe(Graphics *const graphics, int startX, int startY,
const int yWidth = y * mWidth;
BLOCK_START("MapLayer::drawFringe drawmobs")
- // If drawing the fringe layer, make sure all actors above this row of
- // tiles have been drawn
+ // If drawing the fringe layer, make sure all actors above this
+ // row of tiles have been drawn
while (ai != ai_end && (*ai)->getSortPixelY() <= y32s)
{
(*ai)->draw(graphics, -scrollX, -scrollY);
@@ -551,8 +550,8 @@ void MapLayer::drawFringe(Graphics *const graphics, int startX, int startY,
const int yWidth = y * mWidth;
BLOCK_START("MapLayer::drawFringe drawmobs")
- // If drawing the fringe layer, make sure all actors above this row of
- // tiles have been drawn
+ // If drawing the fringe layer, make sure all actors above this
+ // row of tiles have been drawn
while (ai != ai_end && (*ai)->getSortPixelY() <= y32s)
{
(*ai)->draw(graphics, -scrollX, -scrollY);
@@ -566,12 +565,12 @@ void MapLayer::drawFringe(Graphics *const graphics, int startX, int startY,
for (int x = startX; x < endX; x++, tilePtr++)
{
const int x32 = x * mapTileSize;
- int c = 0;
const Image *const img = *tilePtr;
if (img)
{
const int px = x32 + dx;
const int py = py0 - img->mBounds.h;
+ int c = 0;
if (mSpecialFlag || img->mBounds.h <= mapTileSize)
{
int width = 0;
diff --git a/src/resources/mstack.h b/src/resources/mstack.h
index 3e7c28b80..c7c78a748 100644
--- a/src/resources/mstack.h
+++ b/src/resources/mstack.h
@@ -28,7 +28,7 @@
template<typename T>
struct MStack final
{
- MStack(const size_t maxSize) :
+ explicit MStack(const size_t maxSize) :
mStack(new T[maxSize]),
mMaxSize(maxSize),
mPointer(mStack - 1),
@@ -42,6 +42,8 @@ struct MStack final
delete [] mStack;
}
+ A_DELETE_COPY(MStack)
+
T &push()
{
if (mPointer == mEndPointer)
diff --git a/src/simpleanimation.cpp b/src/simpleanimation.cpp
index cb5ee732e..6341f04e1 100644
--- a/src/simpleanimation.cpp
+++ b/src/simpleanimation.cpp
@@ -22,8 +22,6 @@
#include "simpleanimation.h"
-#include "logger.h"
-
#include "resources/map/mapconsts.h"
#include "render/graphics.h"