summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game.cpp7
-rw-r--r--src/game.h1
-rw-r--r--src/graphic/graphic.cpp6
-rw-r--r--src/gui/char_select.cpp6
-rw-r--r--src/gui/char_server.cpp6
-rw-r--r--src/gui/login.cpp6
-rw-r--r--src/main.cpp9
7 files changed, 8 insertions, 33 deletions
diff --git a/src/game.cpp b/src/game.cpp
index b9b417df..e4fd0dff 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -47,7 +47,6 @@ volatile bool action_time = false;
int current_npc, server_tick;
extern unsigned char screen_mode;
int fps = 0, frame = 0;
-int mouseX = 0, mouseY = 0;
OkDialog *deathNotice = NULL;
@@ -286,12 +285,6 @@ void do_input()
}
}
- else if (event.type == SDL_MOUSEMOTION)
- {
- // Update the known mouse position
- mouseX = event.motion.x;
- mouseY = event.motion.y;
- }
// Push input to GUI when not used
if (!used) {
diff --git a/src/game.h b/src/game.h
index d15e6a83..13e8c472 100644
--- a/src/game.h
+++ b/src/game.h
@@ -62,7 +62,6 @@ extern char walk_status;
extern unsigned short src_x, src_y, x, y;
extern volatile int tick_time;
extern int server_tick;
-extern int mouseX, mouseY;
/**
* Main game loop
diff --git a/src/graphic/graphic.cpp b/src/graphic/graphic.cpp
index a0786e59..835698b4 100644
--- a/src/graphic/graphic.cpp
+++ b/src/graphic/graphic.cpp
@@ -222,6 +222,8 @@ void Graphics::drawImageRect(
void Graphics::updateScreen()
{
// Draw mouse before flipping
+ int mouseX, mouseY;
+ SDL_GetMouseState(&mouseX, &mouseY);
mouseCursor->draw(screen, mouseX - 5, mouseY - 2);
SDL_Flip(screen);
@@ -338,6 +340,10 @@ Engine::~Engine()
void Engine::draw()
{
+ // Get the current mouse position
+ int mouseX, mouseY;
+ SDL_GetMouseState(&mouseX, &mouseY);
+
map_x = (player_node->x - 13) * 32 +
get_x_offset(player_node);
map_y = (player_node->y - 9) * 32 +
diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp
index 128fbf7c..5032b196 100644
--- a/src/gui/char_select.cpp
+++ b/src/gui/char_select.cpp
@@ -441,12 +441,6 @@ void charSelect()
case SDL_QUIT:
state = EXIT;
break;
-
- case SDL_MOUSEMOTION:
- // Update the known mouse position
- mouseX = event.motion.x;
- mouseY = event.motion.y;
- break;
}
guiInput->pushInput(event);
diff --git a/src/gui/char_server.cpp b/src/gui/char_server.cpp
index 781f4a37..c0f1c523 100644
--- a/src/gui/char_server.cpp
+++ b/src/gui/char_server.cpp
@@ -126,12 +126,6 @@ void char_server() {
case SDL_QUIT:
state = EXIT;
break;
-
- case SDL_MOUSEMOTION:
- // Update the known mouse position
- mouseX = event.motion.x;
- mouseY = event.motion.y;
- break;
}
guiInput->pushInput(event);
diff --git a/src/gui/login.cpp b/src/gui/login.cpp
index d0cfa899..5496c01b 100644
--- a/src/gui/login.cpp
+++ b/src/gui/login.cpp
@@ -147,12 +147,6 @@ void login() {
state = EXIT;
}
break;
-
- case SDL_MOUSEMOTION:
- // Update the known mouse position
- mouseX = event.motion.x;
- mouseY = event.motion.y;
- break;
}
guiInput->pushInput(event);
diff --git a/src/main.cpp b/src/main.cpp
index 7e67bafd..99458bad 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -166,7 +166,8 @@ void init_engine() {
// Fill tmw.ini with defaults
config.setValue("host", "animesites.de");
config.setValue("port", 6901);
- config.setValue("screen", 1);
+ config.setValue("hwaccel", 0);
+ config.setValue("screen", 0);
config.setValue("sound", 1);
#ifdef __USE_UNIX98
char *chatlogFilename = new char[400];
@@ -309,12 +310,6 @@ int main(int argc, char *argv[]) {
case SDL_QUIT:
state = EXIT;
break;
-
- case SDL_MOUSEMOTION:
- // Update the known mouse position
- mouseX = event.motion.x;
- mouseY = event.motion.y;
- break;
}
guiInput->pushInput(event);