diff options
author | Torbjörn Andersson | 2003-11-11 07:43:02 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2003-11-11 07:43:02 +0000 |
commit | 446a01ba09192a132ee9b6e40129161a7ec09be0 (patch) | |
tree | 720edb242a2b0ef813092c01d5efc76d000e37ff /sword2/driver/rdwin.cpp | |
parent | 0bcc7ce80eb6a8daa35bf2591281974cceff8078 (diff) | |
download | scummvm-rg350-446a01ba09192a132ee9b6e40129161a7ec09be0.tar.gz scummvm-rg350-446a01ba09192a132ee9b6e40129161a7ec09be0.tar.bz2 scummvm-rg350-446a01ba09192a132ee9b6e40129161a7ec09be0.zip |
Moved low-level keyboard and mouse handling to a new Input class, and
renamed the Display class Graphics for no better reason than me liking the
phrase "sound and graphics" better than "sound and display".
svn-id: r11258
Diffstat (limited to 'sword2/driver/rdwin.cpp')
-rw-r--r-- | sword2/driver/rdwin.cpp | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/sword2/driver/rdwin.cpp b/sword2/driver/rdwin.cpp index 911bc1b646..050e8b3021 100644 --- a/sword2/driver/rdwin.cpp +++ b/sword2/driver/rdwin.cpp @@ -20,8 +20,6 @@ #include "common/stdafx.h" #include "sword2/sword2.h" #include "sword2/driver/driver96.h" -#include "sword2/driver/_mouse.h" -#include "sword2/driver/keyboard.h" #include "sword2/driver/d_draw.h" #include "sword2/driver/render.h" #include "sword2/driver/menu.h" @@ -33,29 +31,29 @@ namespace Sword2 { // OSystem Event Handler. Full of cross platform goodness and 99% fat free! // --------------------------------------------------------------------------- -void Sword2Engine::parseEvents() { +void Input::parseEvents(void) { OSystem::Event event; - while (_system->poll_event(&event)) { - switch(event.event_code) { + while (g_system->poll_event(&event)) { + switch (event.event_code) { case OSystem::EVENT_KEYDOWN: - WriteKey(event.kbd.ascii, event.kbd.keycode, event.kbd.flags); + writeKey(event.kbd.ascii, event.kbd.keycode, event.kbd.flags); break; case OSystem::EVENT_MOUSEMOVE: - g_display->_mouseX = event.mouse.x; - g_display->_mouseY = event.mouse.y - MENUDEEP; + _mouseX = event.mouse.x; + _mouseY = event.mouse.y - MENUDEEP; break; case OSystem::EVENT_LBUTTONDOWN: - LogMouseEvent(RD_LEFTBUTTONDOWN); + logMouseEvent(RD_LEFTBUTTONDOWN); break; case OSystem::EVENT_RBUTTONDOWN: - LogMouseEvent(RD_RIGHTBUTTONDOWN); + logMouseEvent(RD_RIGHTBUTTONDOWN); break; case OSystem::EVENT_LBUTTONUP: - LogMouseEvent(RD_LEFTBUTTONUP); + logMouseEvent(RD_LEFTBUTTONUP); break; case OSystem::EVENT_RBUTTONUP: - LogMouseEvent(RD_RIGHTBUTTONUP); + logMouseEvent(RD_RIGHTBUTTONUP); break; case OSystem::EVENT_QUIT: g_sword2->closeGame(); @@ -66,7 +64,7 @@ void Sword2Engine::parseEvents() { } } -void Display::setNeedFullRedraw() { +void Graphics::setNeedFullRedraw() { _needFullRedraw = true; } @@ -75,8 +73,8 @@ void Display::setNeedFullRedraw() { * windows and the interface it provides. */ -void Display::updateDisplay(void) { - g_sword2->parseEvents(); +void Graphics::updateDisplay(void) { + g_input->parseEvents(); fadeServer(); // FIXME: We re-render the entire picture area of the screen for each @@ -95,7 +93,7 @@ void Display::updateDisplay(void) { * Set the window title */ -void Display::setWindowName(const char *windowName) { +void Graphics::setWindowName(const char *windowName) { OSystem::Property prop; prop.caption = windowName; |