diff options
author | Chris Apers | 2007-01-20 18:20:36 +0000 |
---|---|---|
committer | Chris Apers | 2007-01-20 18:20:36 +0000 |
commit | 0e36e6b50097ffe89cae449e7098d0dbf4ce18d2 (patch) | |
tree | 7134065f2e2c0ddea6adb25c43e0635d006b5a41 /backends/platform/PalmOS/Src/os5_event.cpp | |
parent | ecf5b465bb3a742fdfad6941bfb0814408f1b2db (diff) | |
download | scummvm-rg350-0e36e6b50097ffe89cae449e7098d0dbf4ce18d2.tar.gz scummvm-rg350-0e36e6b50097ffe89cae449e7098d0dbf4ce18d2.tar.bz2 scummvm-rg350-0e36e6b50097ffe89cae449e7098d0dbf4ce18d2.zip |
Added support fir hi-res games to standard PalmOS 5 devices (BS, TOuche, ...)
Added aspect ratio selection too
svn-id: r25131
Diffstat (limited to 'backends/platform/PalmOS/Src/os5_event.cpp')
-rw-r--r-- | backends/platform/PalmOS/Src/os5_event.cpp | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/backends/platform/PalmOS/Src/os5_event.cpp b/backends/platform/PalmOS/Src/os5_event.cpp index ee0464f8f8..915da4ba4f 100644 --- a/backends/platform/PalmOS/Src/os5_event.cpp +++ b/backends/platform/PalmOS/Src/os5_event.cpp @@ -30,14 +30,23 @@ void OSystem_PalmOS5::get_coordinates(EventPtr ev, Coord &x, Coord &y) { x = (ev->screenX - _screenOffset.x); y = (ev->screenY - _screenOffset.y); - + if (_stretched) { - if (OPTIONS_TST(kOptModeLandscape)) { - x = (x * 2 / 3); - y = (y * 2 / 3); + Int32 w, h; + + if (_mode == GFX_NORMAL) { + + h = gVars->screenHeight - MIN_OFFSET * 2; + w = gVars->screenWidth; + x = (_screenWidth * x) / w; + y = (_screenHeight * y) / h; + } else { - y = ((ev->screenX - _screenOffset.y) * 2) / 3; - x = 320 - ((ev->screenY - _screenOffset.x) * 2) / 3 - 1; + + h = (_ratio.adjustAspect == kRatioHeight ? _ratio.height : gVars->screenFullHeight); + w = (_ratio.adjustAspect == kRatioWidth ? _ratio.width : gVars->screenFullWidth); + x = (_screenWidth * x) / w; + y = (_screenHeight * y) / h; } } } @@ -56,21 +65,17 @@ bool OSystem_PalmOS5::check_event(Event &event, EventPtr ev) { if (_keyMouse.hasMore) { switch (ev->data.keyDown.chr) { // hot swap gfx - case 0x1B04: +// case 0x1B04: case vchrHard1: printf("swap\n"); if (OPTIONS_TST(kOptCollapsible)) hotswap_gfx_mode(_mode == GFX_WIDE ? GFX_NORMAL: GFX_WIDE); return false; // not a key - // ESC key +// case 0x1B05: case vchrHard2: - _lastKey = kKeyNone; - event.type = EVENT_KEYDOWN; - event.kbd.keycode = 27; - event.kbd.ascii = 27; - event.kbd.flags = 0; - return true; + setFeatureState(kFeatureAspectRatioCorrection, 0); + return false; // not a key // F5 = menu case vchrHard3: |