summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-10-10 19:14:48 +0300
committerAndrei Karas <akaras@inbox.ru>2013-10-10 19:14:48 +0300
commite8f099cace1d77dd9ff12b4231871c6e122a739d (patch)
treea873108303b514b2e67191e5f04d51e3c3a53f69
parent768a7e7499a95bb3ce14600e8050bcbbaaeed31f (diff)
downloadmanaverse-e8f099cace1d77dd9ff12b4231871c6e122a739d.tar.gz
manaverse-e8f099cace1d77dd9ff12b4231871c6e122a739d.tar.bz2
manaverse-e8f099cace1d77dd9ff12b4231871c6e122a739d.tar.xz
manaverse-e8f099cace1d77dd9ff12b4231871c6e122a739d.zip
fix code style.
-rw-r--r--src/client.cpp1
-rw-r--r--src/debug/debug_new.h1
-rw-r--r--src/eventsmanager.cpp5
-rw-r--r--src/eventsmanager.h7
-rw-r--r--src/gui/widgets/browserbox_unittest.cc2
-rw-r--r--src/gui/widgets/listbox.cpp4
-rw-r--r--src/gui/widgets/listbox.h2
-rw-r--r--src/input/multitouchmanager.cpp4
-rw-r--r--src/input/multitouchmanager.h4
-rw-r--r--src/render/graphics.cpp2
-rw-r--r--src/touchmanager.cpp45
11 files changed, 47 insertions, 30 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 39c7beb52..db0a6c2ab 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -294,6 +294,7 @@ Client::Client(const Options &options) :
mDesktop(nullptr),
mSetupButton(nullptr),
mVideoButton(nullptr),
+ mHelpButton(nullptr),
mThemesButton(nullptr),
mPerfomanceButton(nullptr),
#ifdef ANDROID
diff --git a/src/debug/debug_new.h b/src/debug/debug_new.h
index 67b588f32..00861f0bf 100644
--- a/src/debug/debug_new.h
+++ b/src/debug/debug_new.h
@@ -43,6 +43,7 @@
#define M_DEBUG_NEW_H
#include <new>
+#include <stdio.h>
/**
* @def HAVE_PLACEMENT_DELETE
diff --git a/src/eventsmanager.cpp b/src/eventsmanager.cpp
index a9e2f4169..4786e4402 100644
--- a/src/eventsmanager.cpp
+++ b/src/eventsmanager.cpp
@@ -232,8 +232,9 @@ void EventsManager::logEvent(const SDL_Event &event)
logger->log("event: SDL_MULTIGESTURE: %u %f,%f (%f,%f) %d,%d",
static_cast<unsigned int>(gesture.touchId),
gesture.dTheta, gesture.dDist,
- gesture.x * w, gesture.y * h, (int)gesture.numFingers,
- (int)gesture.padding);
+ gesture.x * w, gesture.y * h,
+ static_cast<int>(gesture.numFingers),
+ static_cast<int>(gesture.padding));
break;
}
case SDL_KEYDOWN:
diff --git a/src/eventsmanager.h b/src/eventsmanager.h
index 690745ad6..0cf891729 100644
--- a/src/eventsmanager.h
+++ b/src/eventsmanager.h
@@ -24,7 +24,6 @@
#include "configlistener.h"
#include <string>
-#include <map>
#include <SDL_events.h>
@@ -46,14 +45,14 @@ class EventsManager final : public ConfigListener
void handleGameEvents();
#ifdef USE_SDL2
- void handleSDL2WindowEvent(const SDL_Event &event);
+ static void handleSDL2WindowEvent(const SDL_Event &event);
#else
- void handleActive(const SDL_Event &event);
+ static void handleActive(const SDL_Event &event);
#endif
void optionChanged(const std::string &name);
- void logEvent(const SDL_Event &event);
+ static void logEvent(const SDL_Event &event);
protected:
bool mLogInput;
diff --git a/src/gui/widgets/browserbox_unittest.cc b/src/gui/widgets/browserbox_unittest.cc
index 1c38d735f..2d45e507f 100644
--- a/src/gui/widgets/browserbox_unittest.cc
+++ b/src/gui/widgets/browserbox_unittest.cc
@@ -53,7 +53,7 @@ TEST(browserbox, test1)
Theme *theme = Theme::instance();
gcn::Widget::setGlobalFont(new SDLFont("/usr/share/fonts/truetype/"
"ttf-dejavu/DejaVuSans-Oblique.ttf", 18));
- BrowserBox *box = new BrowserBox(nullptr, BrowserBox::AUTO_WRAP);
+ BrowserBox *box = new BrowserBox(nullptr, BrowserBox::AUTO_WRAP, "");
box->setWidth(100);
std::string row = "test";
box->addRow(row);
diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp
index 76eadff0a..b6d31c239 100644
--- a/src/gui/widgets/listbox.cpp
+++ b/src/gui/widgets/listbox.cpp
@@ -68,7 +68,7 @@ ListBox::ListBox(const Widget2 *const widget,
mItemPadding = mSkin->getOption("itemPadding");
}
- const gcn::Font *font = getFont();
+ const gcn::Font *const font = getFont();
if (font)
mRowHeight = font->getHeight() + 2 * mItemPadding;
else
@@ -258,7 +258,7 @@ void ListBox::mouseReleased(gcn::MouseEvent &event)
mPressedIndex = -2;
}
-void ListBox::mouseReleased1(gcn::MouseEvent &mouseEvent)
+void ListBox::mouseReleased1(const gcn::MouseEvent &mouseEvent)
{
if (mouseEvent.getButton() == gcn::MouseEvent::LEFT)
{
diff --git a/src/gui/widgets/listbox.h b/src/gui/widgets/listbox.h
index 865a67216..fa5906077 100644
--- a/src/gui/widgets/listbox.h
+++ b/src/gui/widgets/listbox.h
@@ -77,7 +77,7 @@ class ListBox : public gcn::ListBox,
void mouseReleased(gcn::MouseEvent &event) override;
- void mouseReleased1(gcn::MouseEvent &event);
+ void mouseReleased1(const gcn::MouseEvent &event);
void mouseDragged(gcn::MouseEvent &event) override;
diff --git a/src/input/multitouchmanager.cpp b/src/input/multitouchmanager.cpp
index 82ccb0b3c..a693e1fd9 100644
--- a/src/input/multitouchmanager.cpp
+++ b/src/input/multitouchmanager.cpp
@@ -30,8 +30,8 @@
MultiTouchManager multiTouchManager;
-
-MultiTouchManager::MultiTouchManager()
+MultiTouchManager::MultiTouchManager() :
+ mEvents()
{
}
diff --git a/src/input/multitouchmanager.h b/src/input/multitouchmanager.h
index ca4328459..34a536e50 100644
--- a/src/input/multitouchmanager.h
+++ b/src/input/multitouchmanager.h
@@ -21,12 +21,12 @@
#ifndef INPUT_MULTITOUCHMANAGER_H
#define INPUT_MULTITOUCHMANAGER_H
-#include <SDL_events.h>
-
#include <map>
#include "localconsts.h"
+union SDL_Event;
+
struct MultiTouchEvent
{
bool active;
diff --git a/src/render/graphics.cpp b/src/render/graphics.cpp
index 3cad42a3b..4ea219802 100644
--- a/src/render/graphics.cpp
+++ b/src/render/graphics.cpp
@@ -93,7 +93,7 @@ Graphics::~Graphics()
if (mGLContext)
{
SDL_GL_DeleteContext(mGLContext);
- mGLContext = 0;
+ mGLContext = nullptr;
}
#endif
#endif
diff --git a/src/touchmanager.cpp b/src/touchmanager.cpp
index 6471fa27c..bad706867 100644
--- a/src/touchmanager.cpp
+++ b/src/touchmanager.cpp
@@ -410,7 +410,8 @@ void TouchManager::loadButtons()
loadTouchItem(&mButtons[1], "dbutton.xml", "dbutton_image.xml",
"2", x, y, sz, sz, RIGHT, "screenActionButton1", "");
loadTouchItem(&mButtons[0], "dbutton.xml", "dbutton_image.xml",
- "1", skipWidth, y, sz, sz, RIGHT, "screenActionButton0", "");
+ "1", skipWidth, y, sz, sz, RIGHT,
+ "screenActionButton0", "");
break;
}
// 2x2
@@ -419,9 +420,11 @@ void TouchManager::loadButtons()
loadTouchItem(&mButtons[3], "dbutton.xml", "dbutton_image.xml",
"4", x, y, sz, sz, RIGHT, "screenActionButton3", "");
loadTouchItem(&mButtons[2], "dbutton.xml", "dbutton_image.xml",
- "3", skipWidth, y, sz, sz, RIGHT, "screenActionButton2", "");
+ "3", skipWidth, y, sz, sz, RIGHT,
+ "screenActionButton2", "");
loadTouchItem(&mButtons[1], "dbutton.xml", "dbutton_image.xml",
- "2", x, skipHeight, sz, sz, RIGHT, "screenActionButton1", "");
+ "2", x, skipHeight, sz, sz, RIGHT,
+ "screenActionButton1", "");
loadTouchItem(&mButtons[0], "dbutton.xml", "dbutton_image.xml",
"1", skipWidth, skipHeight, sz, sz, RIGHT,
"screenActionButton0", "");
@@ -436,11 +439,14 @@ void TouchManager::loadButtons()
loadTouchItem(&mButtons[8], "dbutton.xml", "dbutton_image.xml",
"9", x, y, sz, sz, RIGHT, "screenActionButton8", "");
loadTouchItem(&mButtons[7], "dbutton.xml", "dbutton_image.xml",
- "8", skipWidth, y, sz, sz, RIGHT, "screenActionButton7", "");
+ "8", skipWidth, y, sz, sz, RIGHT,
+ "screenActionButton7", "");
loadTouchItem(&mButtons[6], "dbutton.xml", "dbutton_image.xml",
- "7", skipWidth2, y, sz, sz, RIGHT, "screenActionButton6", "");
+ "7", skipWidth2, y, sz, sz, RIGHT,
+ "screenActionButton6", "");
loadTouchItem(&mButtons[5], "dbutton.xml", "dbutton_image.xml",
- "6", x, skipHeight, sz, sz, RIGHT, "screenActionButton5", "");
+ "6", x, skipHeight, sz, sz, RIGHT,
+ "screenActionButton5", "");
loadTouchItem(&mButtons[4], "dbutton.xml", "dbutton_image.xml",
"5", skipWidth, skipHeight, sz, sz, RIGHT,
"screenActionButton4", "");
@@ -448,7 +454,8 @@ void TouchManager::loadButtons()
"4", skipWidth2, skipHeight, sz, sz, RIGHT,
"screenActionButton3", "");
loadTouchItem(&mButtons[2], "dbutton.xml", "dbutton_image.xml",
- "3", x, skipHeight2, sz, sz, RIGHT, "screenActionButton2", "");
+ "3", x, skipHeight2, sz, sz, RIGHT,
+ "screenActionButton2", "");
loadTouchItem(&mButtons[1], "dbutton.xml", "dbutton_image.xml",
"2", skipWidth, skipHeight2, sz, sz, RIGHT,
"screenActionButton1", "");
@@ -465,13 +472,17 @@ void TouchManager::loadButtons()
loadTouchItem(&mButtons[7], "dbutton.xml", "dbutton_image.xml",
"8", x, y, sz, sz, RIGHT, "screenActionButton7", "");
loadTouchItem(&mButtons[6], "dbutton.xml", "dbutton_image.xml",
- "7", skipWidth, y, sz, sz, RIGHT, "screenActionButton6", "");
+ "7", skipWidth, y, sz, sz, RIGHT,
+ "screenActionButton6", "");
loadTouchItem(&mButtons[5], "dbutton.xml", "dbutton_image.xml",
- "6", skipWidth2, y, sz, sz, RIGHT, "screenActionButton5", "");
+ "6", skipWidth2, y, sz, sz, RIGHT,
+ "screenActionButton5", "");
loadTouchItem(&mButtons[4], "dbutton.xml", "dbutton_image.xml",
- "5", skipWidth3, y, sz, sz, RIGHT, "screenActionButton4", "");
+ "5", skipWidth3, y, sz, sz, RIGHT,
+ "screenActionButton4", "");
loadTouchItem(&mButtons[3], "dbutton.xml", "dbutton_image.xml",
- "4", x, skipHeight, sz, sz, RIGHT, "screenActionButton3", "");
+ "4", x, skipHeight, sz, sz, RIGHT,
+ "screenActionButton3", "");
loadTouchItem(&mButtons[2], "dbutton.xml", "dbutton_image.xml",
"3", skipWidth, skipHeight, sz, sz, RIGHT,
"screenActionButton2", "");
@@ -496,11 +507,14 @@ void TouchManager::loadButtons()
"dbutton_image.xml", "11", skipWidth, y, sz, sz, RIGHT,
"screenActionButton10", "");
loadTouchItem(&mButtons[9], "dbutton.xml", "dbutton_image.xml",
- "10", skipWidth2, y, sz, sz, RIGHT, "screenActionButton9", "");
+ "10", skipWidth2, y, sz, sz, RIGHT,
+ "screenActionButton9", "");
loadTouchItem(&mButtons[8], "dbutton.xml", "dbutton_image.xml",
- "9", skipWidth3, y, sz, sz, RIGHT, "screenActionButton8", "");
+ "9", skipWidth3, y, sz, sz, RIGHT,
+ "screenActionButton8", "");
loadTouchItem(&mButtons[7], "dbutton.xml", "dbutton_image.xml",
- "8", x, skipHeight, sz, sz, RIGHT, "screenActionButton7", "");
+ "8", x, skipHeight, sz, sz, RIGHT,
+ "screenActionButton7", "");
loadTouchItem(&mButtons[6], "dbutton.xml", "dbutton_image.xml",
"7", skipWidth, skipHeight, sz, sz, RIGHT,
"screenActionButton6", "");
@@ -511,7 +525,8 @@ void TouchManager::loadButtons()
"5", skipWidth3, skipHeight, sz, sz, RIGHT,
"screenActionButton4", "");
loadTouchItem(&mButtons[3], "dbutton.xml", "dbutton_image.xml",
- "4", x, skipHeight2, sz, sz, RIGHT, "screenActionButton3", "");
+ "4", x, skipHeight2, sz, sz, RIGHT,
+ "screenActionButton3", "");
loadTouchItem(&mButtons[2], "dbutton.xml", "dbutton_image.xml",
"3", skipWidth, skipHeight2, sz, sz, RIGHT,
"screenActionButton2", "");