From c6961c03289205acee0faed8dc48fb7c7759005c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 3 Nov 2013 14:37:25 +0300 Subject: fix editdialog theming. --- src/gui/windows/editdialog.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/gui/windows/editdialog.cpp') diff --git a/src/gui/windows/editdialog.cpp b/src/gui/windows/editdialog.cpp index f3c583d00..8c76fd6b3 100644 --- a/src/gui/windows/editdialog.cpp +++ b/src/gui/windows/editdialog.cpp @@ -51,13 +51,15 @@ void EditDialog::postInit() const int fontHeight = getFont()->getHeight(); const int height = numRows * fontHeight; const int pad = getPadding(); - - setContentSize(mDefaultWidth, height + fontHeight + okButton->getHeight()); + const int pad2 = pad * 2; mTextField->setPosition(pad, pad); - mTextField->setWidth(mDefaultWidth - 2 * pad); - + mTextField->setWidth(mDefaultWidth - pad2); + const int buttonPadding = getOption("buttonPadding", 8) + + mTextField->getHeight(); + setContentSize(mDefaultWidth, okButton->getHeight() + + buttonPadding + pad2); okButton->setPosition((mDefaultWidth - okButton->getWidth()) / 2, - height + getOption("buttonPadding", 8)); + buttonPadding + pad); add(mTextField); add(okButton); -- cgit v1.2.3-70-g09d2 From fea0de5f467181252909f7c2456362a9c9401b0d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 3 Nov 2013 17:09:43 +0300 Subject: remove unused variable. --- src/gui/windows/editdialog.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/gui/windows/editdialog.cpp') diff --git a/src/gui/windows/editdialog.cpp b/src/gui/windows/editdialog.cpp index 8c76fd6b3..97ebc23ca 100644 --- a/src/gui/windows/editdialog.cpp +++ b/src/gui/windows/editdialog.cpp @@ -49,7 +49,6 @@ void EditDialog::postInit() const int numRows = 1; const int fontHeight = getFont()->getHeight(); - const int height = numRows * fontHeight; const int pad = getPadding(); const int pad2 = pad * 2; mTextField->setPosition(pad, pad); -- cgit v1.2.3-70-g09d2 From 0ca79840f3497375591a43b38d520ada03dfb2dd Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 5 Nov 2013 13:48:19 +0300 Subject: fix compilation warnings. --- src/gui/windows/editdialog.cpp | 2 -- src/resources/image.cpp | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'src/gui/windows/editdialog.cpp') diff --git a/src/gui/windows/editdialog.cpp b/src/gui/windows/editdialog.cpp index 97ebc23ca..05f55ad67 100644 --- a/src/gui/windows/editdialog.cpp +++ b/src/gui/windows/editdialog.cpp @@ -47,8 +47,6 @@ void EditDialog::postInit() // TRANSLATORS: edit dialog label Button *const okButton = new Button(this, _("OK"), mEventOk, this); - const int numRows = 1; - const int fontHeight = getFont()->getHeight(); const int pad = getPadding(); const int pad2 = pad * 2; mTextField->setPosition(pad, pad); diff --git a/src/resources/image.cpp b/src/resources/image.cpp index 4229cb8af..f185d103e 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -358,9 +358,9 @@ void Image::setAlpha(const float alpha) { for (int y = by; y < maxHeight; y ++) { - const int i1 = y * sw; - const int x1 = i1 + bx; - const int x2 = i1 + maxWidth; + const int idx = y * sw; + const int x1 = idx + bx; + const int x2 = idx + maxWidth; for (int i = x1; i < x2; i ++) { const uint8_t sourceAlpha = mAlphaChannel[i]; -- cgit v1.2.3-70-g09d2 From 5564df0ae67373da8ffb148fde95fdd9142c870b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 8 Nov 2013 14:52:18 +0300 Subject: fix code style. --- src/graphicsmanager.cpp | 10 +++++++--- src/gui/windows/editdialog.cpp | 2 -- src/net/netconsts.h | 7 ++++--- src/utils/files.cpp | 6 +++--- src/utils/xml.cpp | 2 +- 5 files changed, 15 insertions(+), 12 deletions(-) (limited to 'src/gui/windows/editdialog.cpp') diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp index c6c36d15d..ace00663e 100644 --- a/src/graphicsmanager.cpp +++ b/src/graphicsmanager.cpp @@ -365,9 +365,13 @@ void GraphicsManager::setVideoMode() int width = res[0]; int height = res[1]; #elif defined __native_client__ - const SDL_VideoInfo* info = SDL_GetVideoInfo(); - int width = info->current_w; - int height = info->current_h; +#ifdef USE_SDL2 + // not implimented +#else + const SDL_VideoInfo* info = SDL_GetVideoInfo(); + int width = info->current_w; + int height = info->current_h; +#endif #else int width = config.getIntValue("screenwidth"); int height = config.getIntValue("screenheight"); diff --git a/src/gui/windows/editdialog.cpp b/src/gui/windows/editdialog.cpp index 05f55ad67..a4711784e 100644 --- a/src/gui/windows/editdialog.cpp +++ b/src/gui/windows/editdialog.cpp @@ -26,8 +26,6 @@ #include "utils/gettext.h" -#include - #include "debug.h" EditDialog::EditDialog(const std::string &title, const std::string &msg, diff --git a/src/net/netconsts.h b/src/net/netconsts.h index 38f84ebaa..0af23b8a9 100644 --- a/src/net/netconsts.h +++ b/src/net/netconsts.h @@ -18,9 +18,10 @@ * along with this program. If not, see . */ -#ifndef NET_DEFAULTS_H -#define NET_DEFAULTS_H +#ifndef NET_NETCONSTS_H +#define NET_NETCONSTS_H +#include static const uint16_t DEFAULT_PORT = 6901; -#endif // NET_DEFAULTS_H +#endif // NET_NETCONSTS_H diff --git a/src/utils/files.cpp b/src/utils/files.cpp index bfaed472a..15b667ba8 100644 --- a/src/utils/files.cpp +++ b/src/utils/files.cpp @@ -20,12 +20,12 @@ #include "utils/files.h" -#include "logger.h" - +#if defined(ANDROID) || defined(__native_client__) #include "resources/resourcemanager.h" +#include "utils/physfstools.h" +#endif #include "utils/mkdir.h" -#include "utils/physfstools.h" #include "localconsts.h" diff --git a/src/utils/xml.cpp b/src/utils/xml.cpp index 60b4505c5..b87418079 100644 --- a/src/utils/xml.cpp +++ b/src/utils/xml.cpp @@ -44,7 +44,7 @@ static void xmlErrorLogger(void *ctx A_UNUSED, const char *msg A_UNUSED, ...) #endif ; -static void xmlErrorLogger(void *ctx A_UNUSED, const char *msg A_UNUSED, ...) +static void xmlErrorLogger(void *ctx A_UNUSED, const char *msg, ...) { unsigned size = 1024; const unsigned msgSize = strlen(msg); -- cgit v1.2.3-70-g09d2