summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/menuwindow.cpp3
-rw-r--r--src/gui/shoplistbox.cpp2
-rw-r--r--src/gui/updatewindow.cpp16
-rw-r--r--src/gui/viewport.cpp2
-rw-r--r--src/gui/viewport.h2
-rw-r--r--src/main.cpp4
6 files changed, 17 insertions, 12 deletions
diff --git a/src/gui/menuwindow.cpp b/src/gui/menuwindow.cpp
index ba4c8e94..a5b5c99e 100644
--- a/src/gui/menuwindow.cpp
+++ b/src/gui/menuwindow.cpp
@@ -58,7 +58,8 @@ MenuWindow::MenuWindow():
};
int x = 0, y = 3, h = 0;
- for (const char **curBtn = buttonNames; *curBtn; curBtn++) {
+ for (const char **curBtn = buttonNames; *curBtn; curBtn++)
+ {
gcn::Button *btn = new Button(*curBtn, *curBtn, &listener);
btn->setPosition(x, y);
add(btn);
diff --git a/src/gui/shoplistbox.cpp b/src/gui/shoplistbox.cpp
index 8cf0b639..946f518b 100644
--- a/src/gui/shoplistbox.cpp
+++ b/src/gui/shoplistbox.cpp
@@ -112,7 +112,7 @@ void ShopListBox::setSelected(int selected)
mSelected = std::min(mListModel->getNumberOfElements() - 1,
std::max(-1, selected));
- gcn::BasicContainer *parent = getParent();
+ gcn::Widget *parent = getParent();
if (parent)
{
gcn::Rectangle scroll;
diff --git a/src/gui/updatewindow.cpp b/src/gui/updatewindow.cpp
index d41dfe13..fe78a27b 100644
--- a/src/gui/updatewindow.cpp
+++ b/src/gui/updatewindow.cpp
@@ -28,8 +28,6 @@
#include <SDL_thread.h>
#include <zlib.h>
-#include <curl/curl.h>
-
#include <guichan/widgets/label.hpp>
#include "browserbox.h"
@@ -37,6 +35,9 @@
#include "progressbar.h"
#include "scrollarea.h"
+// Curl should be included after Guichan to avoid Windows redefinitions
+#include <curl/curl.h>
+
#include "../configuration.h"
#include "../log.h"
#include "../main.h"
@@ -137,7 +138,7 @@ void UpdaterWindow::action(const gcn::ActionEvent &event)
if (event.getId() == "cancel")
{
// Register the user cancel
- mUserCancel=true;
+ mUserCancel = true;
// Skip the updating process
if (mDownloadStatus == UPDATE_COMPLETE)
{
@@ -262,6 +263,11 @@ int UpdaterWindow::downloadThread(void *ptr)
curl_easy_setopt(curl, CURLOPT_WRITEDATA, outfile);
}
+#ifdef PACKAGE_VERSION
+ curl_easy_setopt(curl, CURLOPT_USERAGENT, "TMW/" PACKAGE_VERSION);
+#else
+ curl_easy_setopt(curl, CURLOPT_USERAGENT, "TMW");
+#endif
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, uw->mCurlError);
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0);
@@ -365,13 +371,13 @@ void UpdaterWindow::logic()
case UPDATE_ERROR:
if (mThread)
{
- if(mUserCancel){
+ if (mUserCancel) {
// Kill the thread, because user has canceled
SDL_KillThread(mThread);
// Set the flag to false again
mUserCancel = false;
}
- else{
+ else {
SDL_WaitThread(mThread, NULL);
}
mThread = NULL;
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 671ababa..5f316aea 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -324,7 +324,7 @@ Viewport::mousePressed(gcn::MouseEvent &event)
}
void
-Viewport::mouseMoved(gcn::MouseEvent &event)
+Viewport::mouseDragged(gcn::MouseEvent &event)
{
if (!mMap || !player_node)
return;
diff --git a/src/gui/viewport.h b/src/gui/viewport.h
index 80475fbf..f1cadd98 100644
--- a/src/gui/viewport.h
+++ b/src/gui/viewport.h
@@ -92,7 +92,7 @@ class Viewport : public WindowContainer, public gcn::MouseListener,
* Handles mouse move on map
*/
void
- mouseMoved(gcn::MouseEvent &event);
+ mouseDragged(gcn::MouseEvent &event);
/**
* Handles mouse button release on map.
diff --git a/src/main.cpp b/src/main.cpp
index 3a448494..dc186c84 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -39,8 +39,6 @@
#if (defined __USE_UNIX98 || defined __FreeBSD__)
#include <cerrno>
#include <sys/stat.h>
-#elif defined WIN32
-#define NOGDI
#endif
#include "configuration.h"
@@ -174,7 +172,7 @@ void initConfiguration(const Options &options)
{
// Fill configuration with defaults
logger->log("Initializing configuration...");
- config.setValue("host", "animesites.de");
+ config.setValue("host", "server.themanaworld.org");
config.setValue("port", 9601);
config.setValue("hwaccel", 0);
#if (defined __APPLE__ || defined WIN32) && defined USE_OPENGL