aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/wintermute/PlatformSDL.cpp21
-rw-r--r--engines/wintermute/PlatformSDL.h5
2 files changed, 6 insertions, 20 deletions
diff --git a/engines/wintermute/PlatformSDL.cpp b/engines/wintermute/PlatformSDL.cpp
index 3ed76aefa9..740a0bfa87 100644
--- a/engines/wintermute/PlatformSDL.cpp
+++ b/engines/wintermute/PlatformSDL.cpp
@@ -35,16 +35,6 @@ THE SOFTWARE.
#include "common/textconsole.h"
#include "common/system.h"
-#include "SDL.h" // TODO remove
-
-#ifdef __WIN32__
-# include <dbghelp.h>
-# include <direct.h>
-#else
-# include <unistd.h>
-#endif
-
-
namespace WinterMute {
CBGame *CBPlatform::Game = NULL;
@@ -313,7 +303,7 @@ void CBPlatform::HandleEvent(Common::Event *event) {
}
//////////////////////////////////////////////////////////////////////////
-int CBPlatform::SDLEventWatcher(void *userdata, SDL_Event *event) {
+int CBPlatform::SDLEventWatcher(void *userdata, Common::Event *event) {
//TODO
/* if (event->type == SDL_WINDOWEVENT && event->window.event == SDL_WINDOWEVENT_MINIMIZED) {
if (Game) Game->AutoSaveOnExit();
@@ -346,17 +336,16 @@ void CBPlatform::OutputDebugString(LPCSTR lpOutputString) {
//////////////////////////////////////////////////////////////////////////
uint32 CBPlatform::GetTime() {
- return SDL_GetTicks();
+ return g_system->getMillis();
}
//////////////////////////////////////////////////////////////////////////
BOOL CBPlatform::GetCursorPos(LPPOINT lpPoint) {
CBRenderSDL *renderer = static_cast<CBRenderSDL *>(Game->_renderer);
- int x, y;
- SDL_GetMouseState(&x, &y);
- lpPoint->x = x;
- lpPoint->y = y;
+ Common::Point p = g_system->getEventManager()->getMousePos();
+ lpPoint->x = p.x;
+ lpPoint->y = p.y;
renderer->PointFromScreen(lpPoint);
diff --git a/engines/wintermute/PlatformSDL.h b/engines/wintermute/PlatformSDL.h
index 788a534983..cfb5b6e930 100644
--- a/engines/wintermute/PlatformSDL.h
+++ b/engines/wintermute/PlatformSDL.h
@@ -34,13 +34,10 @@
#include "wintypes.h"
#include "common/events.h"
-union SDL_Event;
-
namespace WinterMute {
class CBGame;
-
//////////////////////////////////////////////////////////////////////////
class CBPlatform {
public:
@@ -82,7 +79,7 @@ public:
static char *strlwr(char *string);
// sdl event callback
- static int SDLEventWatcher(void *userdata, SDL_Event *event);
+ static int SDLEventWatcher(void *userdata, Common::Event *event);
private:
static CBGame *Game;