From d2d43da4f07e54c446532b85ba01d4d0f96d707a Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Fri, 11 May 2012 00:40:13 +0200 Subject: WINTERMUTE: Cleanup the includes in Platform SDL This should remove the last SDL-include in-engine --- engines/wintermute/PlatformSDL.cpp | 21 +++++---------------- engines/wintermute/PlatformSDL.h | 5 +---- 2 files changed, 6 insertions(+), 20 deletions(-) (limited to 'engines') 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 -# include -#else -# include -#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(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; -- cgit v1.2.3