aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/keyboard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/agi/keyboard.cpp')
-rw-r--r--engines/agi/keyboard.cpp36
1 files changed, 28 insertions, 8 deletions
diff --git a/engines/agi/keyboard.cpp b/engines/agi/keyboard.cpp
index 5a73afe6fb..3bc45af5d4 100644
--- a/engines/agi/keyboard.cpp
+++ b/engines/agi/keyboard.cpp
@@ -130,7 +130,7 @@ void AgiEngine::processScummVMEvents() {
}
break;
case Common::EVENT_KEYDOWN:
- if (event.kbd.hasFlags(Common::KBD_CTRL) && event.kbd.keycode == Common::KEYCODE_d) {
+ if (event.kbd.hasFlags(Common::KBD_CTRL | Common::KBD_SHIFT) && event.kbd.keycode == Common::KEYCODE_d) {
_console->attach();
break;
}
@@ -256,7 +256,28 @@ void AgiEngine::processScummVMEvents() {
// Original AGI actually created direction events in here
// We don't do that, that's why we create a stationary event instead, which will
// result in a direction change to 0 in handleController().
- keyEnqueue(AGI_KEY_STATIONARY);
+ switch (event.kbd.keycode) {
+ case Common::KEYCODE_LEFT:
+ case Common::KEYCODE_RIGHT:
+ case Common::KEYCODE_UP:
+ case Common::KEYCODE_DOWN:
+ case Common::KEYCODE_HOME:
+ case Common::KEYCODE_END:
+ case Common::KEYCODE_PAGEUP:
+ case Common::KEYCODE_PAGEDOWN:
+ case Common::KEYCODE_KP4:
+ case Common::KEYCODE_KP6:
+ case Common::KEYCODE_KP8:
+ case Common::KEYCODE_KP2:
+ case Common::KEYCODE_KP9:
+ case Common::KEYCODE_KP3:
+ case Common::KEYCODE_KP7:
+ case Common::KEYCODE_KP1:
+ keyEnqueue(AGI_KEY_STATIONARY);
+ break;
+ default:
+ break;
+ }
}
break;
@@ -292,7 +313,8 @@ bool AgiEngine::handleMouseClicks(uint16 &key) {
if (!cycleInnerLoopIsActive()) {
// Only do this, when no inner loop is currently active
- Common::Rect displayLineRect(DISPLAY_WIDTH, FONT_DISPLAY_HEIGHT);
+ Common::Rect displayLineRect = _gfx->getFontRectForDisplayScreen(0, 0, FONT_COLUMN_CHARACTERS, 1);
+// Common::Rect displayLineRect(_gfx->getDisplayScreenWidth(), _gfx->getDisplayFontHeight());
if (displayLineRect.contains(_mouse.pos)) {
// Mouse is inside first line of the screen
@@ -307,7 +329,7 @@ bool AgiEngine::handleMouseClicks(uint16 &key) {
// Prompt is currently enabled
int16 promptRow = _text->promptRow_Get();
- displayLineRect.moveTo(0, promptRow * FONT_DISPLAY_HEIGHT);
+ displayLineRect.moveTo(0, promptRow * _gfx->getDisplayFontHeight());
if (displayLineRect.contains(_mouse.pos)) {
// and user clicked within the line of the prompt
@@ -330,9 +352,7 @@ bool AgiEngine::handleMouseClicks(uint16 &key) {
_text->stringPos_Get(stringRow, stringColumn);
stringMaxLen = _text->stringGetMaxLen();
- Common::Rect displayRect(stringMaxLen * FONT_DISPLAY_WIDTH, FONT_DISPLAY_HEIGHT);
- displayRect.moveTo(stringColumn * FONT_DISPLAY_WIDTH, stringRow * FONT_DISPLAY_HEIGHT);
-
+ Common::Rect displayRect = _gfx->getFontRectForDisplayScreen(stringColumn, stringRow, stringMaxLen, 1);
if (displayRect.contains(_mouse.pos)) {
// user clicked inside the input space
showPredictiveDialog();
@@ -472,7 +492,7 @@ bool AgiEngine::handleController(uint16 key) {
// in case you walked to the log by using the mouse, so don't!!!
int16 egoDestinationX = _mouse.pos.x;
int16 egoDestinationY = _mouse.pos.y;
- adjustPosToGameScreen(egoDestinationX, egoDestinationY);
+ _gfx->translateDisplayPosToGameScreen(egoDestinationX, egoDestinationY);
screenObjEgo->motionType = kMotionEgo;
if (egoDestinationX < (screenObjEgo->xSize / 2)) {