Skip to content

Commit

Permalink
Merge branch 'branch-1-3-0' of https://github.com/scummvm/scummvm int…
Browse files Browse the repository at this point in the history
…o branch-1-3-0
  • Loading branch information
agent-q committed May 21, 2011
2 parents 4076a04 + dd6b569 commit 92d0216
Show file tree
Hide file tree
Showing 15 changed files with 290 additions and 305 deletions.
17 changes: 11 additions & 6 deletions backends/platform/iphone/iphone_video.m
Expand Up @@ -178,13 +178,18 @@ uint getSizeNextPOT(uint size) {
}

bool getLocalMouseCoords(CGPoint *point) {
if (point->x < _screenRect.origin.x || point->x >= _screenRect.origin.x + _screenRect.size.width ||
point->y < _screenRect.origin.y || point->y >= _screenRect.origin.y + _screenRect.size.height) {
return false;
}
if (_overlayIsEnabled) {
point->x = point->x / _overlayHeight;
point->y = point->y / _overlayWidth;
} else {
if (point->x < _screenRect.origin.x || point->x >= _screenRect.origin.x + _screenRect.size.width ||
point->y < _screenRect.origin.y || point->y >= _screenRect.origin.y + _screenRect.size.height) {
return false;
}

point->x = (point->x - _screenRect.origin.x) / _screenRect.size.width;
point->y = (point->y - _screenRect.origin.y) / _screenRect.size.height;
point->x = (point->x - _screenRect.origin.x) / _screenRect.size.width;
point->y = (point->y - _screenRect.origin.y) / _screenRect.size.height;
}

return true;
}
Expand Down
22 changes: 8 additions & 14 deletions backends/platform/iphone/osys_events.cpp
Expand Up @@ -31,6 +31,7 @@

#include "osys_main.h"

static const int kQueuedInputEventDelay = 50;

bool OSystem_IPHONE::pollEvent(Common::Event &event) {
//printf("pollEvent()\n");
Expand All @@ -42,14 +43,7 @@ bool OSystem_IPHONE::pollEvent(Common::Event &event) {
_timerCallbackNext = curTime + _timerCallbackTimer;
}

if (_needEventRestPeriod) {
// Workaround: Some engines can't handle mouse-down and mouse-up events
// appearing right after each other, without a call returning no input in between.
_needEventRestPeriod = false;
return false;
}

if (_queuedInputEvent.type != (Common::EventType)0) {
if (_queuedInputEvent.type != (Common::EventType)0 && curTime >= _queuedEventTime) {
event = _queuedInputEvent;
_queuedInputEvent.type = (Common::EventType)0;
return true;
Expand Down Expand Up @@ -194,7 +188,7 @@ bool OSystem_IPHONE::handleEvent_mouseUp(Common::Event &event, int x, int y) {
_queuedInputEvent.mouse.x = _mouseX;
_queuedInputEvent.mouse.y = _mouseY;
_lastMouseTap = getMillis();
_needEventRestPeriod = true;
_queuedEventTime = _lastMouseTap + kQueuedInputEventDelay;
} else
return false;
}
Expand Down Expand Up @@ -235,7 +229,7 @@ bool OSystem_IPHONE::handleEvent_secondMouseUp(Common::Event &event, int x, int
event.kbd.flags = _queuedInputEvent.kbd.flags = 0;
event.kbd.keycode = _queuedInputEvent.kbd.keycode = Common::KEYCODE_ESCAPE;
event.kbd.ascii = _queuedInputEvent.kbd.ascii = Common::ASCII_ESCAPE;
_needEventRestPeriod = true;
_queuedEventTime = curTime + kQueuedInputEventDelay;
_lastSecondaryTap = 0;
} else if (!_mouseClickAndDragEnabled) {
//printf("Rightclick!\n");
Expand All @@ -246,7 +240,7 @@ bool OSystem_IPHONE::handleEvent_secondMouseUp(Common::Event &event, int x, int
_queuedInputEvent.mouse.x = _mouseX;
_queuedInputEvent.mouse.y = _mouseY;
_lastSecondaryTap = curTime;
_needEventRestPeriod = true;
_queuedEventTime = curTime + kQueuedInputEventDelay;
} else {
//printf("Right nothing!\n");
return false;
Expand Down Expand Up @@ -334,7 +328,7 @@ bool OSystem_IPHONE::handleEvent_mouseSecondDragged(Common::Event &event, int x,
event.kbd.flags = _queuedInputEvent.kbd.flags = 0;
event.kbd.keycode = _queuedInputEvent.kbd.keycode = Common::KEYCODE_F5;
event.kbd.ascii = _queuedInputEvent.kbd.ascii = Common::ASCII_F5;
_needEventRestPeriod = true;
_queuedEventTime = getMillis() + kQueuedInputEventDelay;
return true;
}

Expand Down Expand Up @@ -463,7 +457,7 @@ void OSystem_IPHONE::handleEvent_keyPressed(Common::Event &event, int keyPresse
event.kbd.flags = _queuedInputEvent.kbd.flags = 0;
event.kbd.keycode = _queuedInputEvent.kbd.keycode = (Common::KeyCode)keyPressed;
event.kbd.ascii = _queuedInputEvent.kbd.ascii = ascii;
_needEventRestPeriod = true;
_queuedEventTime = getMillis() + kQueuedInputEventDelay;
}

bool OSystem_IPHONE::handleEvent_swipe(Common::Event &event, int direction) {
Expand Down Expand Up @@ -530,7 +524,7 @@ bool OSystem_IPHONE::handleEvent_swipe(Common::Event &event, int direction) {
event.type = Common::EVENT_KEYDOWN;
_queuedInputEvent.type = Common::EVENT_KEYUP;
event.kbd.flags = _queuedInputEvent.kbd.flags = 0;
_needEventRestPeriod = true;
_queuedEventTime = getMillis() + kQueuedInputEventDelay;

return true;
}
6 changes: 3 additions & 3 deletions backends/platform/iphone/osys_main.cpp
Expand Up @@ -58,9 +58,9 @@ void *OSystem_IPHONE::s_soundParam = NULL;
OSystem_IPHONE::OSystem_IPHONE() :
_savefile(NULL), _mixer(NULL), _timer(NULL), _offscreen(NULL),
_overlayVisible(false), _fullscreen(NULL),
_mouseHeight(0), _mouseWidth(0), _mouseBuf(NULL), _lastMouseTap(0),
_secondaryTapped(false), _lastSecondaryTap(0), _screenOrientation(kScreenOrientationFlippedLandscape),
_needEventRestPeriod(false), _mouseClickAndDragEnabled(false),
_mouseHeight(0), _mouseWidth(0), _mouseBuf(NULL), _lastMouseTap(0), _queuedEventTime(0),
_secondaryTapped(false), _lastSecondaryTap(0),
_screenOrientation(kScreenOrientationFlippedLandscape), _mouseClickAndDragEnabled(false),
_gestureStartX(-1), _gestureStartY(-1), _fullScreenIsDirty(false), _fullScreenOverlayIsDirty(false),
_mouseDirty(false), _timeSuspended(0), _lastDragPosX(-1), _lastDragPosY(-1), _screenChangeCount(0),
_overlayHeight(0), _overlayWidth(0), _overlayBuffer(0)
Expand Down
2 changes: 1 addition & 1 deletion backends/platform/iphone/osys_main.h
Expand Up @@ -89,9 +89,9 @@ class OSystem_IPHONE : public BaseBackend, public PaletteManager {
bool _mouseDirty;
long _lastMouseDown;
long _lastMouseTap;
long _queuedEventTime;
Common::Rect _lastDrawnMouseRect;
Common::Event _queuedInputEvent;
bool _needEventRestPeriod;
bool _secondaryTapped;
long _lastSecondaryDown;
long _lastSecondaryTap;
Expand Down
Binary file modified backends/vkeybd/packs/vkeybd_default.zip
Binary file not shown.
1 change: 1 addition & 0 deletions configure
Expand Up @@ -3110,6 +3110,7 @@ case $_backend in
INCLUDES="$INCLUDES `$_sdlconfig --prefix="$_sdlpath" --cflags`"
LIBS="$LIBS `$_sdlconfig --prefix="$_sdlpath" --libs`"
LDFLAGS="$LDFLAGS"
DEFINES="$DEFINES -DSDL_BACKEND"
;;
ps2)
# TODO ps2
Expand Down
2 changes: 1 addition & 1 deletion engines/sci/console.cpp
Expand Up @@ -3775,7 +3775,7 @@ int Console::printObject(reg_t pos) {
DebugPrintf(" -- member variables:\n");
for (i = 0; (uint)i < obj->getVarCount(); i++) {
DebugPrintf(" ");
if (i < var_container->getVarCount()) {
if (var_container && i < var_container->getVarCount()) {
uint16 varSelector = var_container->getVarSelector(i);
DebugPrintf("[%03x] %s = ", varSelector, _engine->getKernel()->getSelectorName(varSelector).c_str());
} else
Expand Down
9 changes: 1 addition & 8 deletions engines/sci/engine/gc.cpp
Expand Up @@ -90,14 +90,7 @@ static void processWorkList(SegManager *segMan, WorklistManager &wm, const Commo
wm._worklist.pop_back();
if (reg.segment != stackSegment) { // No need to repeat this one
debugC(kDebugLevelGC, "[GC] Checking %04x:%04x", PRINT_REG(reg));
// WORKAROUND: We only check for valid offsets here. Fixes bugs
// #3299458 and #3295849.
// FIXME: Where are these invalid offsets coming from? The check
// below avoids a crash when examining invalid references, but the
// root of the problem lies elsewhere. These shouldn't be in the
// stack at all (unless these really are script bugs, in which case
// we should just keep the sanity check).
if (reg.segment < heap.size() && heap[reg.segment] && heap[reg.segment]->isValidOffset(reg.offset)) {
if (reg.segment < heap.size() && heap[reg.segment]) {
// Valid heap object? Find its outgoing references!
wm.pushArray(heap[reg.segment]->listAllOutgoingReferences(reg));
}
Expand Down
2 changes: 1 addition & 1 deletion engines/sci/engine/kscripts.cpp
Expand Up @@ -262,7 +262,7 @@ reg_t kDisposeScript(EngineState *s, int argc, reg_t *argv) {

SegmentId id = s->_segMan->getScriptSegment(script);
Script *scr = s->_segMan->getScriptIfLoaded(id);
if (scr) {
if (scr && !scr->isMarkedAsDeleted()) {
if (s->_executionStack.back().addr.pc.segment != id)
scr->setLockers(1);
}
Expand Down
2 changes: 2 additions & 0 deletions engines/sci/engine/script.cpp
Expand Up @@ -383,6 +383,7 @@ void Script::relocateSci3(reg_t block) {
}

void Script::incrementLockers() {
assert(!_markedAsDeleted);
_lockers++;
}

Expand All @@ -396,6 +397,7 @@ int Script::getLockers() const {
}

void Script::setLockers(int lockers) {
assert(lockers == 0 || !_markedAsDeleted);
_lockers = lockers;
}

Expand Down
2 changes: 1 addition & 1 deletion engines/sci/event.cpp
Expand Up @@ -253,7 +253,7 @@ SciEvent EventManager::getScummVMEvent() {
// When Ctrl AND Alt are pressed together with a regular key, Linux will give us control-key, Windows will give
// us the actual key. My opinion is that windows is right, because under DOS the keys worked the same, anyway
// we support the other case as well
if ((modifiers & Common::KBD_SHIFT) && input.character > 0 && input.character < 27)
if ((modifiers & Common::KBD_ALT) && input.character > 0 && input.character < 27)
input.character += 96; // 0x01 -> 'a'

if (getSciVersion() <= SCI_VERSION_1_MIDDLE) {
Expand Down
6 changes: 6 additions & 0 deletions engines/sci/parser/vocabulary.cpp
Expand Up @@ -398,6 +398,12 @@ void Vocabulary::lookupWord(ResultWordList& retval, const char *word, int word_l
if (getSciVersion() < SCI_VERSION_01)
return;

// WORKAROUND:
// This is a hack to temporarily fix bug #3288328.
// On the master branch this return is unconditional.
if (g_sci->getGameId() == GID_QFG2 && strcmp(word, "healing") == 0)
return;

}

// Now try all suffixes
Expand Down
18 changes: 15 additions & 3 deletions engines/scumm/actor.cpp
Expand Up @@ -177,9 +177,21 @@ void Actor::setBox(int box) {
}

void Actor_v3::setupActorScale() {
// TODO: The following could probably be removed
_scalex = 0xFF;
_scaley = 0xFF;
// WORKAROUND bug #1463598: Under certain circumstances, it is possible
// for Henry Sr. to reach the front side of Castle Brunwald (following
// Indy there). But it seems the game has no small costume for Henry,
// hence he is shown as a giant, triple in size compared to Indy.
// To workaround this, we override the scale of Henry. Since V3 games
// like Indy3 don't use the costume scale otherwise, this works fine.
// The scale factor 0x50 was determined by some guess work.
if (_number == 2 && _costume == 7 && _vm->_game.id == GID_INDY3 && _vm->_currentRoom == 12) {
_scalex = 0x50;
_scaley = 0x50;
} else {
// TODO: The following could probably be removed
_scalex = 0xFF;
_scaley = 0xFF;
}
}

void Actor::setupActorScale() {
Expand Down

0 comments on commit 92d0216

Please sign in to comment.