summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-07-04 20:45:15 +0300
committerAndrei Karas <akaras@inbox.ru>2014-07-05 00:21:16 +0300
commitaf2f4f8ab50a209502b929082b11a7a07e6c5499 (patch)
tree4ad3e2efb564fd523deb5a0925941bf4abac319a
parentb90595ef486f10d4b5e069e9363a2df5270fe717 (diff)
downloadmv-af2f4f8ab50a209502b929082b11a7a07e6c5499.tar.gz
mv-af2f4f8ab50a209502b929082b11a7a07e6c5499.tar.bz2
mv-af2f4f8ab50a209502b929082b11a7a07e6c5499.tar.xz
mv-af2f4f8ab50a209502b929082b11a7a07e6c5499.zip
Fix code style.
-rw-r--r--src/eventsmanager.cpp14
-rw-r--r--src/gui/windows/inventorywindow.cpp2
-rw-r--r--src/input/inputmanager.cpp2
-rw-r--r--src/render/imagegraphics.cpp2
-rw-r--r--src/render/mgldefines.h1
-rw-r--r--src/render/mglfunctions.h34
-rw-r--r--src/render/mglxinit.h6
-rw-r--r--src/resources/db/itemdb.cpp1
-rw-r--r--src/resources/itemtypemap.h2
-rw-r--r--src/resources/itemtypemapdata.h6
-rw-r--r--src/resources/openglimagehelper.cpp3
-rw-r--r--src/utils/glxhelper.cpp6
-rw-r--r--src/utils/glxhelper.h8
13 files changed, 46 insertions, 41 deletions
diff --git a/src/eventsmanager.cpp b/src/eventsmanager.cpp
index 15197c087..cdb1a5f03 100644
--- a/src/eventsmanager.cpp
+++ b/src/eventsmanager.cpp
@@ -205,16 +205,16 @@ void EventsManager::logEvent(const SDL_Event &event)
{
switch (event.type)
{
- case SDL_MOUSEMOTION:
- logger->log("event: SDL_MOUSEMOTION: %d,%d,%d",
- event.motion.state, event.motion.x, event.motion.y);
- break;
#ifdef USE_SDL2
#define winEventLog(name, name2) \
case name: \
str = name2; \
break
+ case SDL_MOUSEMOTION:
+ logger->log("event: SDL_MOUSEMOTION: %u,%u,%u",
+ event.motion.state, event.motion.x, event.motion.y);
+ break;
case SDL_FINGERDOWN:
{
const SDL_TouchFingerEvent &touch = event.tfinger;
@@ -338,6 +338,10 @@ void EventsManager::logEvent(const SDL_Event &event)
logger->log("SDL_APP_DIDENTERBACKGROUND");
break;
#else
+ case SDL_MOUSEMOTION:
+ logger->log("event: SDL_MOUSEMOTION: %u,%d,%d",
+ event.motion.state, event.motion.x, event.motion.y);
+ break;
case SDL_KEYDOWN:
logger->log("event: SDL_KEYDOWN: %d,%d,%d", event.key.state,
event.key.keysym.scancode, event.key.keysym.unicode);
@@ -407,7 +411,7 @@ void EventsManager::logEvent(const SDL_Event &event)
#endif
#endif
default:
- logger->log("event: other: %d", event.type);
+ logger->log("event: other: %u", event.type);
break;
};
}
diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp
index 2802a063d..bd7a50674 100644
--- a/src/gui/windows/inventorywindow.cpp
+++ b/src/gui/windows/inventorywindow.cpp
@@ -64,8 +64,6 @@
#include "resources/iteminfo.h"
-#include "resources/db/itemdb.h"
-
#include "utils/delete2.h"
#include <string>
diff --git a/src/input/inputmanager.cpp b/src/input/inputmanager.cpp
index 75656114f..c6e2b7091 100644
--- a/src/input/inputmanager.cpp
+++ b/src/input/inputmanager.cpp
@@ -602,8 +602,8 @@ bool InputManager::handleEvent(const SDL_Event &event)
{
if (triggerAction(joystick->getActionVector(event)))
{
- return true;
BLOCK_END("InputManager::handleEvent")
+ return true;
}
}
break;
diff --git a/src/render/imagegraphics.cpp b/src/render/imagegraphics.cpp
index b439fb0e4..d85c68a18 100644
--- a/src/render/imagegraphics.cpp
+++ b/src/render/imagegraphics.cpp
@@ -26,8 +26,6 @@
#include "main.h"
-#include "resources/image.h"
-
#include "debug.h"
ImegeGraphics::ImegeGraphics() :
diff --git a/src/render/mgldefines.h b/src/render/mgldefines.h
index 109744b91..d42dca853 100644
--- a/src/render/mgldefines.h
+++ b/src/render/mgldefines.h
@@ -88,6 +88,7 @@
#define GL_VERTEX_SHADER 0x8B31
#define GL_COMPILE_STATUS 0x8B81
#define GL_LINK_STATUS 0x8B82
+#define GL_VALIDATE_STATUS 0x8B83
#define GL_INFO_LOG_LENGTH 0x8B84
#endif
diff --git a/src/render/mglfunctions.h b/src/render/mglfunctions.h
index 59f05e190..900042710 100644
--- a/src/render/mglfunctions.h
+++ b/src/render/mglfunctions.h
@@ -36,23 +36,27 @@
reinterpret_cast<const GLubyte*>(name))
#endif
-#define assignFunction(func, name) m##func \
- = reinterpret_cast<func##_t>(getFunction(name)); \
- if (m##func == nullptr) \
- logger->log(std::string("function not found: ") + name); \
- else \
- logger->log(std::string("assigned function: ") + name);
-
-#define assignFunctionEmu(func, name) m##func \
- = reinterpret_cast<func##_t>(getFunction(name)); \
- if (m##func == nullptr) \
+#define assignFunction(func, name) \
{ \
- m##func = emu##func; \
- logger->log(std::string("emulated function: ") + name); \
- } \
- else \
+ m##func = reinterpret_cast<func##_t>(getFunction(name)); \
+ if (m##func == nullptr) \
+ logger->log(std::string("function not found: ") + name); \
+ else \
+ logger->log(std::string("assigned function: ") + name); \
+ }
+
+#define assignFunctionEmu(func, name) \
{ \
- logger->log(std::string("assigned function: ") + name); \
+ m##func = reinterpret_cast<func##_t>(getFunction(name)); \
+ if (m##func == nullptr) \
+ { \
+ m##func = emu##func; \
+ logger->log(std::string("emulated function: ") + name); \
+ } \
+ else \
+ { \
+ logger->log(std::string("assigned function: ") + name); \
+ } \
}
#define emulateFunction(func) m##func = emu##func; \
diff --git a/src/render/mglxinit.h b/src/render/mglxinit.h
index 4322a7d0f..47622e7cc 100644
--- a/src/render/mglxinit.h
+++ b/src/render/mglxinit.h
@@ -18,8 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef RENDER_MXGLINIT_H
-#define RENDER_MXGLINIT_H
+#ifndef RENDER_MGLXINIT_H
+#define RENDER_MGLXINIT_H
#include "main.h"
#if defined(USE_OPENGL) && defined(USE_X11)
@@ -30,4 +30,4 @@ namespace Glx
} // namespace Glx
#endif // defined(USE_OPENGL) && defined(USE_X11)
-#endif // RENDER_MXGLINIT_H
+#endif // RENDER_MGLXINIT_H
diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp
index 8eaa0ce9f..a8cd1422c 100644
--- a/src/resources/db/itemdb.cpp
+++ b/src/resources/db/itemdb.cpp
@@ -37,7 +37,6 @@
#include "utils/delete2.h"
#include "utils/dtor.h"
-#include "utils/gettext.h"
#include "utils/translation/podict.h"
diff --git a/src/resources/itemtypemap.h b/src/resources/itemtypemap.h
index 789d9211b..7852347c1 100644
--- a/src/resources/itemtypemap.h
+++ b/src/resources/itemtypemap.h
@@ -23,6 +23,8 @@
#include "resources/itemtype.h"
+#include <string>
+
#include "localconsts.h"
struct ItemTypeMap final
diff --git a/src/resources/itemtypemapdata.h b/src/resources/itemtypemapdata.h
index 8cd7437e9..8707127fe 100644
--- a/src/resources/itemtypemapdata.h
+++ b/src/resources/itemtypemapdata.h
@@ -21,12 +21,14 @@
#ifndef RESOURCES_ITEMTYPEMAPDATA_H
#define RESOURCES_ITEMTYPEMAPDATA_H
-#include "localconsts.h"
-
#include "utils/gettext.h"
#include "resources/itemtypemap.h"
+#include <string>
+
+#include "localconsts.h"
+
ItemTypeMap itemTypeMap[] =
{
{"generic", ItemType::UNUSABLE,
diff --git a/src/resources/openglimagehelper.cpp b/src/resources/openglimagehelper.cpp
index 18a220f01..6187764e9 100644
--- a/src/resources/openglimagehelper.cpp
+++ b/src/resources/openglimagehelper.cpp
@@ -169,14 +169,13 @@ SDL_Surface *OpenGLImageHelper::convertSurface(SDL_Surface *tmpImage,
amask = 0xff000000;
#endif
- SDL_Surface *oldImage = nullptr;
if (tmpImage->format->BitsPerPixel != 32
|| realWidth != width || realHeight != height
|| rmask != tmpImage->format->Rmask
|| gmask != tmpImage->format->Gmask
|| amask != tmpImage->format->Amask)
{
- oldImage = tmpImage;
+ SDL_Surface *oldImage = tmpImage;
#ifdef USE_SDL2
SDL_SetSurfaceBlendMode(oldImage, SDL_BLENDMODE_NONE);
#endif
diff --git a/src/utils/glxhelper.cpp b/src/utils/glxhelper.cpp
index 1624b6309..bd50d8c61 100644
--- a/src/utils/glxhelper.cpp
+++ b/src/utils/glxhelper.cpp
@@ -36,7 +36,7 @@ static int ErrorHandler(Display *d A_UNUSED, XErrorEvent *e A_UNUSED)
return 0;
}
-void *GlxHelper::createContext(const unsigned int window,
+void *GlxHelper::createContext(const unsigned long window,
void *const display0,
const int major,
const int minor)
@@ -61,7 +61,7 @@ void *GlxHelper::createContext(const unsigned int window,
XSetErrorHandler(handler);
return context;
}
- int glxAttribs[] =
+ int glxAttribs[] =
{
GLX_RENDER_TYPE, GLX_RGBA_BIT,
GLX_RED_SIZE, 3,
@@ -117,7 +117,7 @@ void *GlxHelper::createContext(const unsigned int window,
return context2;
}
-bool GlxHelper::makeCurrent(const unsigned int window,
+bool GlxHelper::makeCurrent(const unsigned long window,
void *const display,
void *const context)
{
diff --git a/src/utils/glxhelper.h b/src/utils/glxhelper.h
index ce3a5568d..528e3f7fb 100644
--- a/src/utils/glxhelper.h
+++ b/src/utils/glxhelper.h
@@ -27,19 +27,17 @@
#include "localconsts.h"
-//struct Display;
-
namespace GlxHelper
{
- void *createContext(const unsigned int window,
+ void *createContext(const unsigned long window,
void *const display,
const int major,
const int minor);
- bool makeCurrent(const unsigned int window,
+ bool makeCurrent(const unsigned long window,
void *const display,
void *const context);
-} // namespace Glx
+} // namespace GlxHelper
#endif // defined(USE_OPENGL) && defined(USE_X11)
#endif // UTILS_GLXHELPER_H