diff options
26 files changed, 1532 insertions, 363 deletions
diff --git a/.gitignore b/.gitignore index 99902064ea..80adcb7551 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,7 @@ lib*.a /build /staging +/portdist /backends/platform/dc/gui /backends/platform/dc/graphics @@ -164,3 +165,6 @@ ScummVM.config ScummVM.creator ScummVM.files ScummVM.includes + +#Ignore Komodo IDE/Edit project files +*.komodoproject @@ -45,9 +45,11 @@ For a more comprehensive changelog of the latest experimental code, see: SDL ports: - Added support for OpenGL (GSoC Task). - TINSEL: + Tinsel: - Fixed deleting saved games from the list of saved games (from the launcher and the in-game ScummVM menu). + - The US version of Discworld II now shows the correct title screen and + language flag. 1.3.1 (2011-07-12) General: @@ -61,8 +63,6 @@ For a more comprehensive changelog of the latest experimental code, see: Tinsel: - Fixed a regression that made Discworld uncompletable. - - The US version of Discworld II now shows the correct title screen and - language flag. SAGA: - Fixed a regression in Inherit the Earth's dragon walk code which diff --git a/backends/events/webossdl/webossdl-events.cpp b/backends/events/webossdl/webossdl-events.cpp index a6a2ed3644..d01e51fafe 100644 --- a/backends/events/webossdl/webossdl-events.cpp +++ b/backends/events/webossdl/webossdl-events.cpp @@ -22,55 +22,17 @@ #ifdef WEBOS -// Allow use of stuff in <time.h> -#define FORBIDDEN_SYMBOL_EXCEPTION_time_h - #include "common/scummsys.h" #include "common/system.h" -#include "sys/time.h" -#include "time.h" +#include "common/str.h" +#include "common/translation.h" #include "backends/events/webossdl/webossdl-events.h" #include "gui/message.h" +#include "engines/engine.h" -// Inidicates if gesture area is pressed down or not. -static bool gestureDown = false; - -// The timestamp when screen was pressed down. -static int screenDownTime = 0; - -// The timestamp when a possible drag operation was triggered. -static int dragStartTime = 0; - -// The index of the motion pointer. -static int motionPtrIndex = -1; - -// The maximum horizontal motion during dragging (For tap recognition). -static int dragDiffX = 0; - -// The maximum vertical motion during dragging (For tap recognition). -static int dragDiffY = 0; - -// Indicates if we are in drag mode. -static bool dragging = false; - -// The current mouse position on the screen. -static int curX = 0, curY = 0; - -// The time (seconds after 1/1/1970) when program started. -static time_t programStartTime = time(0); - -/** - * Returns the number of passed milliseconds since program start. - * - * @return The number of passed milliseconds. - */ -static time_t getMillis() -{ - struct timeval tv; - gettimeofday(&tv, NULL); - return (time(0) - programStartTime) * 1000 + tv.tv_usec / 1000; -} +// PDL.h provided by the official Palm WebOS PDK. +#include <PDL.h> /** * WebOS devices only have a Shift key and a CTRL key. There is also an Alt @@ -91,7 +53,7 @@ void WebOSSdlEventSource::SDLModToOSystemKeyFlags(SDLMod mod, event.kbd.flags |= Common::KBD_CTRL; // Holding down the gesture area emulates the ALT key - if (gestureDown) + if (_gestureDown) event.kbd.flags |= Common::KBD_ALT; } @@ -106,7 +68,7 @@ void WebOSSdlEventSource::SDLModToOSystemKeyFlags(SDLMod mod, bool WebOSSdlEventSource::handleKeyDown(SDL_Event &ev, Common::Event &event) { // Handle gesture area tap. if (ev.key.keysym.sym == SDLK_WORLD_71) { - gestureDown = true; + _gestureDown = true; return true; } @@ -115,7 +77,18 @@ bool WebOSSdlEventSource::handleKeyDown(SDL_Event &ev, Common::Event &event) { // gesture tap AFTER the backward gesture event and not BEFORE (Like // WebOS 2). if (ev.key.keysym.sym == 27 || ev.key.keysym.sym == 229) { - gestureDown = false; + _gestureDown = false; + } + + // handle virtual keyboard dismiss key + if (ev.key.keysym.sym == 24) { + int gblPDKVersion = PDL_GetPDKVersion(); + // check for correct PDK Version, as this determines whether an + // OS-supplied virtual keyboard is available on this device. + if (gblPDKVersion >= 300) { + PDL_SetKeyboardState(PDL_FALSE); + return true; + } } // Call original SDL key handler. @@ -133,10 +106,21 @@ bool WebOSSdlEventSource::handleKeyDown(SDL_Event &ev, Common::Event &event) { bool WebOSSdlEventSource::handleKeyUp(SDL_Event &ev, Common::Event &event) { // Handle gesture area tap. if (ev.key.keysym.sym == SDLK_WORLD_71) { - gestureDown = false; + _gestureDown = false; return true; } + // handle virtual keyboard dismiss key + if (ev.key.keysym.sym == 24) { + int gblPDKVersion = PDL_GetPDKVersion(); + // check for correct PDK Version, as this determines whether an + // OS-supplied virtual keyboard is available on this device. + if (gblPDKVersion >= 300) { + PDL_SetKeyboardState(PDL_FALSE); + return true; + } + } + // Call original SDL key handler. return SdlEventSource::handleKeyUp(ev, event); } @@ -148,19 +132,45 @@ bool WebOSSdlEventSource::handleKeyUp(SDL_Event &ev, Common::Event &event) { * @param event The ScummVM event. * @return True if event was processed, false if not. */ -bool WebOSSdlEventSource::handleMouseButtonDown(SDL_Event &ev, Common::Event &event) { - if (motionPtrIndex == -1) { - motionPtrIndex = ev.button.which; - dragDiffX = 0; - dragDiffY = 0; - screenDownTime = getMillis(); - - // Start dragging when pressing the screen shortly after a tap. - if (getMillis() - dragStartTime < 250) { - dragging = true; +bool WebOSSdlEventSource::handleMouseButtonDown(SDL_Event &ev, + Common::Event &event) { + _dragDiffX[ev.button.which] = 0; + _dragDiffY[ev.button.which] = 0; + _fingerDown[ev.button.which] = true; + _screenDownTime[ev.button.which] = g_system->getMillis(); + + if (ev.button.which == 0) { + // Do a click when the finger lifts unless we leave the range + _doClick = true; + // Queue up dragging if auto-drag mode is on + if (_autoDragMode) + _queuedDragTime = g_system->getMillis() + QUEUED_DRAG_DELAY; + // Turn drag mode on instantly for a double-tap + else if (g_system->getMillis() - _dragStartTime < DOUBLETAP_LIMIT) { + _dragging = true; event.type = Common::EVENT_LBUTTONDOWN; - processMouseEvent(event, curX, curY); + processMouseEvent(event, _curX, _curY); } + // If we're not in touchpad mode, move the cursor to the tap + if (!_touchpadMode) { + _curX = MIN(_screenX, MAX(0, 0 + ev.motion.x)); + _curY = MIN(_screenY, MAX(0, 0 + ev.motion.y)); + // If we're already clicking, hold it until after the move. + if (event.type == Common::EVENT_LBUTTONDOWN) { + processMouseEvent(event, _curX, _curY); + g_system->getEventManager()->pushEvent(event); + } + // Move the mouse + event.type = Common::EVENT_MOUSEMOVE; + processMouseEvent(event, _curX, _curY); + } + // Watch for a double-tap-triggered drag + _dragStartTime = g_system->getMillis(); + } else if (ev.button.which == 1) { + // Kill any queued drag event if a second finger goes down + if (_queuedDragTime > 0) + _queuedDragTime = 0; + _doClick = false; } return true; } @@ -172,54 +182,48 @@ bool WebOSSdlEventSource::handleMouseButtonDown(SDL_Event &ev, Common::Event &ev * @param event The ScummVM event. * @return True if event was processed, false if not. */ -bool WebOSSdlEventSource::handleMouseButtonUp(SDL_Event &ev, Common::Event &event) { - if (motionPtrIndex == ev.button.which) { - motionPtrIndex = -1; - - // When drag mode was active then simply send a mouse up event - if (dragging) - { +bool WebOSSdlEventSource::handleMouseButtonUp(SDL_Event &ev, + Common::Event &event) { + // Only react if the finger hasn't been virtually lifted already + if (_fingerDown[ev.button.which]) { + // No matter what, if it's the first finger that's lifted when + // we're dragging, just lift the mouse button. + if (ev.button.which == 0 && _dragging) { event.type = Common::EVENT_LBUTTONUP; - processMouseEvent(event, curX, curY); - dragging = false; - return true; - } - - // When mouse was moved 5 pixels or less then emulate a mouse button - // click. - if (ABS(dragDiffX) < 6 && ABS(dragDiffY) < 6) - { - int duration = getMillis() - screenDownTime; - - // When screen was pressed for less than 500ms then emulate a - // left mouse click. - if (duration < 500) { + processMouseEvent(event, _curX, _curY); + _dragging = false; + } else { + // If it was the first finger and the click hasn't been + // canceled, it's a click. + if (ev.button.which == 0 && _doClick && + !_fingerDown[1] && !_fingerDown[2]) { event.type = Common::EVENT_LBUTTONUP; - processMouseEvent(event, curX, curY); + processMouseEvent(event, _curX, _curY); g_system->getEventManager()->pushEvent(event); event.type = Common::EVENT_LBUTTONDOWN; - dragStartTime = getMillis(); - } - - // When screen was pressed for less than 1000ms then emulate a - // right mouse click. - else if (duration < 1000) { - event.type = Common::EVENT_RBUTTONUP; - processMouseEvent(event, curX, curY); - g_system->getEventManager()->pushEvent(event); + if (_queuedDragTime > 0) + _queuedDragTime = 0; + } else if (ev.button.which == 1 && + _fingerDown[0] && _fingerDown[1] && !_fingerDown[2]) { + // If the first finger's down and the second taps, it's a + // right mouse click. event.type = Common::EVENT_RBUTTONDOWN; - } - - // When screen was pressed for more than 1000ms then emulate a - // middle mouse click. - else { + processMouseEvent(event, _curX, _curY); + _queuedRUpTime = g_system->getMillis() + QUEUED_RUP_DELAY; + } else if (ev.button.which == 2 && + _fingerDown[0] && _fingerDown[1]) { + // If two fingers are down and a third taps, it's a middle + // click -- but lift the second finger so it doesn't register + // as a right click. event.type = Common::EVENT_MBUTTONUP; - processMouseEvent(event, curX, curY); + processMouseEvent(event, _curX, _curY); g_system->getEventManager()->pushEvent(event); event.type = Common::EVENT_MBUTTONDOWN; + _fingerDown[1] = false; } - } + // Officially lift the finger that was raised. + _fingerDown[ev.button.which] = false; } return true; } @@ -231,18 +235,200 @@ bool WebOSSdlEventSource::handleMouseButtonUp(SDL_Event &ev, Common::Event &even * @param event The ScummVM event. * @return True if event was processed, false if not. */ -bool WebOSSdlEventSource::handleMouseMotion(SDL_Event &ev, Common::Event &event) { - if (ev.motion.which == motionPtrIndex) { - int screenX = g_system->getWidth(); - int screenY = g_system->getHeight(); - curX = MIN(screenX, MAX(0, curX + ev.motion.xrel)); - curY = MIN(screenY, MAX(0, curY + ev.motion.yrel)); - dragDiffX += ev.motion.xrel; - dragDiffY += ev.motion.yrel; - event.type = Common::EVENT_MOUSEMOVE; - processMouseEvent(event, curX, curY); +bool WebOSSdlEventSource::handleMouseMotion(SDL_Event &ev, + Common::Event &event) { + if (_fingerDown[ev.motion.which]) { + _dragDiffX[ev.motion.which] += ev.motion.xrel; + _dragDiffY[ev.motion.which] += ev.motion.yrel; + + switch (ev.motion.which) { + case 0: + // If our dragDiff goes too many pixels in either direction, + // kill the future click and any queued drag event. + if (_doClick && (ABS(_dragDiffX[0]) > MOUSE_DEADZONE_PIXELS || + ABS(_dragDiffY[0]) > MOUSE_DEADZONE_PIXELS)) { + _doClick = false; + if (_queuedDragTime > 0) + _queuedDragTime = 0; + } + // If only one finger is on the screen and moving, that's + // the mouse pointer. + if (!_fingerDown[1] && !_fingerDown[2]) { + if (_touchpadMode) { + _curX = MIN(_screenX, MAX(0, _curX + ev.motion.xrel)); + _curY = MIN(_screenY, MAX(0, _curY + ev.motion.yrel)); + } else { + _curX = MIN(_screenX, MAX(0, 0 + ev.motion.x)); + _curY = MIN(_screenY, MAX(0, 0 + ev.motion.y)); + } + event.type = Common::EVENT_MOUSEMOVE; + processMouseEvent(event, _curX, _curY); + } + break; + case 1: + // Check for a two-finger swipe + if (_fingerDown[0] && !_fingerDown[2]) { + // Check for a vertical swipe + if (ABS(_dragDiffY[0]) > _swipeDistY && + ABS(_dragDiffY[1]) > _swipeDistY) { + // Virtually lift fingers to prevent repeat triggers + _fingerDown[0] = _fingerDown[1] = false; + if (_dragDiffY[0] < 0 && _dragDiffY[1] < 0) { + // A swipe up triggers the keyboard, if it exists. We + // test for existance of a virtual OS keyboard by + // checking for the version of the linked PDK libs. + int gblPDKVersion = PDL_GetPDKVersion(); + if (gblPDKVersion >= 300) + PDL_SetKeyboardState(PDL_TRUE); + } else if (_dragDiffY[0] > 0 && _dragDiffY[1] > 0) { + // A swipe down triggers the menu + if (g_engine && !g_engine->isPaused()) + g_engine->openMainMenuDialog(); + } + return true; + } + // Check for a horizontal swipe + if (ABS(_dragDiffX[0]) > _swipeDistX && + ABS(_dragDiffX[1]) > _swipeDistX) { + // Virtually lift fingers to prevent repeat triggers + _fingerDown[0] = _fingerDown[1] = false; + if (_dragDiffX[0] < 0 && _dragDiffX[1] < 0) { + // A swipe left presses escape + event.type = Common::EVENT_KEYDOWN; + event.kbd.flags = 0; + event.kbd.keycode = Common::KEYCODE_ESCAPE; + event.kbd.ascii = Common::ASCII_ESCAPE; + _queuedEscapeUpTime = g_system->getMillis() + + QUEUED_KEY_DELAY; + } else if (_dragDiffX[0] > 0 && _dragDiffX[1] > 0) { + // A swipe right toggles touchpad mode + _touchpadMode = !_touchpadMode; + g_system->showMouse(_touchpadMode); + // I18N: Touchpad mode toggle status. + Common::String dialogMsg(_("Touchpad mode is now")); + dialogMsg += " "; + // I18N: Touchpad mode on or off. + dialogMsg += (_touchpadMode ? _("ON") : _("OFF")); + dialogMsg += ".\n"; + // I18N: Instructions to toggle Touchpad mode. + dialogMsg += + _("Swipe two fingers to the right to toggle."); + GUI::TimedMessageDialog dialog(dialogMsg, 1500); + dialog.runModal(); + } + return true; + } + } + break; + case 2: + // Check for a three-finger swipe + if (_fingerDown[0] && _fingerDown[1]) { + // Swipe to the right toggles Auto-drag + if (_dragDiffX[0] > _swipeDistX && + _dragDiffX[1] > _swipeDistX && + _dragDiffX[2] > _swipeDistX) { + // Virtually lift fingers to prevent repeat triggers + _fingerDown[0] = _fingerDown[1] = _fingerDown[2] = false; + // Toggle Auto-drag mode + _autoDragMode = !_autoDragMode; + // I18N: Auto-drag toggle status. + Common::String dialogMsg(_("Auto-drag mode is now")); + dialogMsg += " "; + // I18N: Auto-drag on or off. + dialogMsg += (_autoDragMode ? _("ON") : _("OFF")); + dialogMsg += ".\n"; + // I18N: Instructions to toggle auto-drag. + dialogMsg += _( + "Swipe three fingers to the right to toggle."); + GUI::TimedMessageDialog dialog(dialogMsg, 1500); + dialog.runModal(); + return true; + } else if (_dragDiffY[0] > _swipeDistY && + _dragDiffY[1] > _swipeDistY && + _dragDiffY[2] > _swipeDistY ) { + // Swipe down to emulate spacebar (pause) + // Virtually lift fingers to prevent repeat triggers + _fingerDown[0] = _fingerDown[1] = _fingerDown[2] = false; + // Press space + event.type = Common::EVENT_KEYDOWN; + event.kbd.flags = 0; + event.kbd.keycode = Common::KEYCODE_SPACE; + event.kbd.ascii = Common::ASCII_SPACE; + _queuedSpaceUpTime = g_system->getMillis() + + QUEUED_KEY_DELAY; + } + } + } } return true; } +/** + * Before calling the original SDL implementation, this method loads in + * queued events. + * + * @param event The ScummVM event + */ +bool WebOSSdlEventSource::pollEvent(Common::Event &event) { + uint32 curTime = g_system->getMillis(); + + // Event-dependent nitializations for when SDL runs its first poll. + if (_firstPoll) { + // Set the initial dimensions + calculateDimensions(); + + // Having a mouse pointer on screen when not in Touchpad mode is poor + // interface design, because the user won't know whether to tap buttons + // or drag the pointer to them. On the first poll, set the appropriate + // pointer visibility. + g_system->showMouse(_touchpadMode); + _firstPoll = false; + } + + // Run down the priority list for queued events. The built-in + // event queue runs events on the next poll, which causes many + // WebOS devices (and a few game engines) to ignore certain inputs. + // Allowing keys and clicks to stay "down" longer is enough to register + // the press. + if (_queuedEscapeUpTime != 0 && curTime >= _queuedEscapeUpTime) { + event.type = Common::EVENT_KEYUP; + event.kbd.flags = 0; + event.kbd.keycode = Common::KEYCODE_ESCAPE; + event.kbd.ascii = Common::ASCII_ESCAPE; + _queuedEscapeUpTime = 0; + return true; + } else if (_queuedSpaceUpTime != 0 && curTime >= _queuedSpaceUpTime) { + event.type = Common::EVENT_KEYUP; + event.kbd.flags = 0; + event.kbd.keycode = Common::KEYCODE_SPACE; + event.kbd.ascii = Common::ASCII_SPACE; + _queuedSpaceUpTime = 0; + return true; + } else if (_queuedRUpTime != 0 && curTime >= _queuedRUpTime) { + event.type = Common::EVENT_RBUTTONUP; + processMouseEvent(event, _curX, _curY); + _queuedRUpTime = 0; + return true; + } else if (_queuedDragTime != 0 && curTime >= _queuedDragTime) { + event.type = Common::EVENT_LBUTTONDOWN; + _dragging = true; + processMouseEvent(event, _curX, _curY); + _queuedDragTime = 0; + return true; + } + + return SdlEventSource::pollEvent(event); +} + +/** + * Sets the _screenX and _screenY variables to the effective screen dimensions, + * and alters _swipeDistX and _swipeDistY to the correct relative values. + */ +void WebOSSdlEventSource::calculateDimensions() { + _screenX = g_system->getOverlayWidth(); + _screenY = g_system->getOverlayHeight(); + _swipeDistX = _screenX * SWIPE_PERCENT_HORIZ / 100; + _swipeDistY = _screenY * SWIPE_PERCENT_VERT / 100; +} + #endif diff --git a/backends/events/webossdl/webossdl-events.h b/backends/events/webossdl/webossdl-events.h index c925132d92..a36ee535a3 100644 --- a/backends/events/webossdl/webossdl-events.h +++ b/backends/events/webossdl/webossdl-events.h @@ -29,13 +29,87 @@ * SDL events manager for WebOS */ class WebOSSdlEventSource : public SdlEventSource { +public: + enum { + DOUBLETAP_LIMIT = 400, + MAX_FINGERS = 3, + MOUSE_DEADZONE_PIXELS = 5, + QUEUED_DRAG_DELAY = 500, + QUEUED_KEY_DELAY = 250, + QUEUED_RUP_DELAY = 50, + SWIPE_PERCENT_HORIZ = 15, + SWIPE_PERCENT_VERT = 20 + }; + WebOSSdlEventSource() : + _gestureDown(false), + _dragStartTime(0), _dragging(false), + _curX(0), _curY(0), + _screenX(0), _screenY(0), + _touchpadMode(false), _autoDragMode(true), + _doClick(true), + _queuedDragTime(0), _queuedEscapeUpTime(0), _queuedSpaceUpTime(0), + _queuedRUpTime(0), + _firstPoll(true) { + for (int i = 0; i < MAX_FINGERS; i++) { + _fingerDown[i] = false; + _screenDownTime[i] = _dragDiffX[i] = _dragDiffY[i] = 0; + } + }; protected: + // Inidicates if gesture area is pressed down or not. + bool _gestureDown; + + // The timestamp when screen was pressed down for each finger. + uint32 _screenDownTime[MAX_FINGERS]; + + // The timestamp when a possible drag operation was triggered. + uint32 _dragStartTime; + + // The distance each finger traveled from touch to release. + int _dragDiffX[MAX_FINGERS], _dragDiffY[MAX_FINGERS]; + + // Indicates if we are in drag mode. + bool _dragging; + + // The current mouse position on the screen. + int _curX, _curY; + + // The current screen dimensions + int _screenX, _screenY; + + // The drag distance for linear gestures + int _swipeDistX, _swipeDistY; + + // Indicates if we're in touchpad mode or tap-to-move mode. + bool _touchpadMode; + + // Indicates if we're in automatic drag mode. + bool _autoDragMode; + + // Tracks which fingers are currently touching the screen. + bool _fingerDown[MAX_FINGERS]; + + // Indicates if a click should be executed when the first finger is lifted + bool _doClick; + + // Indicates whether the event poll has been run before + bool _firstPoll; + + // Event queues + uint32 _queuedDragTime, _queuedEscapeUpTime, _queuedSpaceUpTime, + _queuedRUpTime; + + // SDL overrides virtual void SDLModToOSystemKeyFlags(SDLMod mod, Common::Event &event); virtual bool handleKeyDown(SDL_Event &ev, Common::Event &event); virtual bool handleKeyUp(SDL_Event &ev, Common::Event &event); virtual bool handleMouseButtonDown(SDL_Event &ev, Common::Event &event); virtual bool handleMouseButtonUp(SDL_Event &ev, Common::Event &event); virtual bool handleMouseMotion(SDL_Event &ev, Common::Event &event); + virtual bool pollEvent(Common::Event &event); + + // Utility functions + void calculateDimensions(); }; #endif diff --git a/backends/platform/webos/webos.mk b/backends/platform/webos/webos.mk index 37223ac56c..804b56de35 100644 --- a/backends/platform/webos/webos.mk +++ b/backends/platform/webos/webos.mk @@ -51,8 +51,8 @@ # Increment this number when the packaging of the app has been changed while # ScummVM itself has the same version as before. The number can be reset to -# 1 when the ScummVM version is increased. -VER_PACKAGE = 5 +# 0 when the ScummVM version is increased. +VER_PACKAGE = 0 PATH_DIST = $(srcdir)/dists/webos PATH_MOJO = $(PATH_DIST)/mojo @@ -60,10 +60,19 @@ APP_ID = $(shell basename $(prefix)) APP_VERSION = $(shell printf "%d.%d.%02d%02d" $(VER_MAJOR) $(VER_MINOR) $(VER_PATCH) $(VER_PACKAGE)) DESTDIR ?= staging PORTDISTDIR ?= portdist +ifeq ($(HOST_COMPILER),Darwin) + SED_DASH_I = "-i \"\"" +else + SED_DASH_I = "-i" +endif install: all $(QUIET)$(INSTALL) -d "$(DESTDIR)$(prefix)" +ifeq ($(HOST_COMPILER),Darwin) + $(QUIET)$(INSTALL) -m 0644 "$(PATH_MOJO)/"* "$(DESTDIR)$(prefix)/" +else $(QUIET)$(INSTALL) -m 0644 -t "$(DESTDIR)$(prefix)/" "$(PATH_MOJO)/"* +endif $(QUIET)$(INSTALL) -m 0755 "$(PATH_MOJO)/start" "$(DESTDIR)$(prefix)/" $(QUIET)$(INSTALL) -d "$(DESTDIR)$(bindir)" $(QUIET)$(INSTALL) -c -m 755 "./$(EXECUTABLE)" "$(DESTDIR)$(bindir)/$(EXECUTABLE)" @@ -77,12 +86,12 @@ ifdef DYNAMIC_MODULES $(QUIET)$(INSTALL) -c -m 644 $(PLUGINS) "$(DESTDIR)$(libdir)/" $(QUIET)$(STRIP) "$(DESTDIR)$(libdir)/"* endif - $(QUIET)sed -i s/'APP_VERSION'/'$(APP_VERSION)'/ "$(DESTDIR)$(prefix)/appinfo.json" - $(QUIET)sed -i s/'APP_ID'/'$(APP_ID)'/ "$(DESTDIR)$(prefix)/appinfo.json" + $(QUIET)sed $(SED_DASH_I) s/'APP_VERSION'/'$(APP_VERSION)'/ "$(DESTDIR)$(prefix)/appinfo.json" + $(QUIET)sed $(SED_DASH_I) s/'APP_ID'/'$(APP_ID)'/ "$(DESTDIR)$(prefix)/appinfo.json" ifneq (,$(findstring -beta,$(APP_ID))) - $(QUIET)sed -i s/'APP_TITLE'/'ScummVM Beta'/ "$(DESTDIR)$(prefix)/appinfo.json" + $(QUIET)sed $(SED_DASH_I) s/'APP_TITLE'/'ScummVM Beta'/ "$(DESTDIR)$(prefix)/appinfo.json" else - $(QUIET)sed -i s/'APP_TITLE'/'ScummVM'/ "$(DESTDIR)$(prefix)/appinfo.json" + $(QUIET)sed $(SED_DASH_I) s/'APP_TITLE'/'ScummVM'/ "$(DESTDIR)$(prefix)/appinfo.json" endif uninstall: diff --git a/backends/platform/wince/README-WinCE.txt b/backends/platform/wince/README-WinCE.txt index 60bcf710bb..429168c293 100644 --- a/backends/platform/wince/README-WinCE.txt +++ b/backends/platform/wince/README-WinCE.txt @@ -1,18 +1,23 @@ ScummVM Windows CE FAQ -Last updated: 2011-07-20 -Release version: x.x.x +Last updated: 2011-10-15 +Release version: 1.4.0 ------------------------------------------------------------------------ New in this version ------------------- -x.x.x: -- Changed default values for "high_sample_rate" & "FM_high_quality" to "true" as - most devices today are fast enough to handle this. It's still possible to set - this to "false" if you have a slower device. +1.4.0: +- Changed the memory management so that it is finally possible to break the + 32MB per process barrier on Windows CE. It should be possible now (finally) + to play nearly every game with the "big" binary (scummvm.exe, which includes + all game engines). +- Changed default values for "high_sample_rate" & "FM_high_quality" to "true" + as most devices today are fast enough to handle this. It's still possible to + set this to "false" if you have a slower device. - Fix for TeenAgent & Hugo engines (both weren't running at all, crashed right at the beginning) -- Replaced the game mass-adding functionality with the functionality used on all - other platforms. It now shows progress while searching for games. +- Discworld 2 is now playable (works now because of the new memory management) +- Replaced the game mass-adding functionality with the functionality used on + all other platforms. It now shows progress while searching for games. 1.3.1: - Fix for Normal2xAspect scaler which was causing screen update issues in some diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp index 1abc3cb350..4e17827e5c 100644 --- a/backends/platform/wince/wince-sdl.cpp +++ b/backends/platform/wince/wince-sdl.cpp @@ -72,6 +72,50 @@ extern "C" _CRTIMP FILE *__cdecl _wfreopen(const wchar_t *, const wchar_t *, FILE *); #endif +#ifdef WRAP_MALLOC + +extern "C" void *__real_malloc(size_t size); +extern "C" void __real_free(void *ptr); + +extern "C" void *__wrap_malloc(size_t size) { +/* + void *ptr = __real_malloc(size); + printf("malloc(%d) = %p\n", size, ptr); + return ptr; +*/ + if (size < 64 * 1024) { + void *ptr = __real_malloc(size+4); +// printf("malloc(%d) = %p\n", size, ptr); + if (ptr != NULL) { + *((HANDLE*)ptr) = 0; + return 4+(char*)ptr; + } + return NULL; + } + HANDLE H = CreateFileMapping((HANDLE)INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, 0, size+4, 0); + void *ptr = MapViewOfFile(H, FILE_MAP_ALL_ACCESS, 0, 0, 0); + *((HANDLE*)ptr) = H; + return 4+(char*)ptr; +} + +extern "C" void __wrap_free(void *ptr) { +/* + __real_free(ptr); + printf("free(%p)\n", ptr); +*/ + if (ptr != NULL) { + HANDLE H = *(HANDLE*)((char *)ptr-4); + if (H == 0) { + __real_free((char*)ptr-4); + return; + } + UnmapViewOfFile((char *)ptr-4); + CloseHandle(H); + } +} + +#endif + using namespace CEGUI; // ******************************************************************************************** diff --git a/backends/platform/wince/wince.mk b/backends/platform/wince/wince.mk index cac3ad4e8f..c5f3274747 100644 --- a/backends/platform/wince/wince.mk +++ b/backends/platform/wince/wince.mk @@ -1,3 +1,7 @@ +ifdef WRAP_MALLOC + LDFLAGS += -Wl,--wrap,malloc -Wl,--wrap,free +endif + backends/platform/wince/PocketSCUMM.o: $(srcdir)/backends/platform/wince/PocketSCUMM.rc $(QUIET)$(MKDIR) $(*D) $(WINDRES) $(WINDRESFLAGS) -I$(srcdir)/backends/platform/wince $< $@ @@ -2066,9 +2066,11 @@ case $_host_os in DEFINES="$DEFINES -DUNICODE" DEFINES="$DEFINES -DFPM_DEFAULT" DEFINES="$DEFINES -DNONSTANDARD_PORT" + DEFINES="$DEFINES -DWRAP_MALLOC" DEFINES="$DEFINES -DWIN32" DEFINES="$DEFINES -Dcdecl=" DEFINES="$DEFINES -D__cdecl__=" + add_line_to_config_mk "WRAP_MALLOC = 1" ;; esac @@ -2420,12 +2422,14 @@ if test -n "$_host"; then webos) _backend="webos" _port_mk="backends/platform/webos/webos.mk" - _build_scalers=no + _build_scalers=yes + _build_hq_scalers=no _timidity=no _mt32emu=no _seq_midi=no _vkeybd=no _keymapper=yes + add_line_to_config_mk "HOST_COMPILER = `uname`" ;; wii) _backend="wii" @@ -2572,7 +2576,8 @@ case $_backend in ;; webos) # There is no sdl-config in the WebOS PDK so we don't use find_sdlconfig here. - LIBS="$LIBS -lSDL" + # The PDL library acts as the WebOS device toolchain, and is required to control the virtual keyboard among other OS-level events. + LIBS="$LIBS -lSDL -lpdl" DEFINES="$DEFINES -DWEBOS" DEFINES="$DEFINES -DSDL_BACKEND" add_line_to_config_mk "SDL_BACKEND = 1" diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index 2f69d5caa1..a44c661561 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -1498,10 +1498,22 @@ bool Console::cmdDrawPic(int argc, const char **argv) { return true; } - uint16 resourceId = atoi(argv[1]); +#ifndef USE_TEXT_CONSOLE_FOR_DEBUGGER + // If a graphical debugger overlay is used, hide it here, so that the + // results can be drawn. + g_system->hideOverlay(); +#endif + uint16 resourceId = atoi(argv[1]); _engine->_gfxPaint->kernelDrawPicture(resourceId, 100, false, false, false, 0); _engine->_gfxScreen->copyToScreen(); + _engine->sleep(2000); + +#ifndef USE_TEXT_CONSOLE_FOR_DEBUGGER + // Show the graphical debugger overlay + g_system->showOverlay(); +#endif + return true; } diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp index 1c85ecddcf..bb326b1d2f 100644 --- a/engines/sci/graphics/picture.cpp +++ b/engines/sci/graphics/picture.cpp @@ -77,7 +77,7 @@ void GfxPicture::draw(int16 animationNr, bool mirroredFlag, bool addToFlag, int1 #ifdef ENABLE_SCI32 case 0x0e: // SCI32 VGA picture _resourceType = SCI_PICTURE_TYPE_SCI32; - //drawSci32Vga(); + drawSci32Vga(0, 0, 0, 0, 0, false); break; #endif default: diff --git a/engines/tsage/blue_force/blueforce_logic.cpp b/engines/tsage/blue_force/blueforce_logic.cpp index e6cc01fe14..b8895add0a 100644 --- a/engines/tsage/blue_force/blueforce_logic.cpp +++ b/engines/tsage/blue_force/blueforce_logic.cpp @@ -75,8 +75,14 @@ Scene *BlueForceGame::createScene(int sceneNumber) { // Inside Tony's Bar return new Scene115(); case 125: + // Intro - Chase in the city + return new Scene125(); case 140: + // Intro - Burglar near the House + return new Scene140(); case 150: + // Intro - Burglar inside the house + return new Scene150(); case 160: error("Scene group 1 not implemented"); case 180: diff --git a/engines/tsage/blue_force/blueforce_scenes1.cpp b/engines/tsage/blue_force/blueforce_scenes1.cpp index 3586be5dfd..7206974a24 100644 --- a/engines/tsage/blue_force/blueforce_scenes1.cpp +++ b/engines/tsage/blue_force/blueforce_scenes1.cpp @@ -1438,6 +1438,7 @@ void Scene115::Action2::signal() { scene->_stripManager.start(1152, this); } } + break; case 2: if (BF_GLOBALS._v4CEAA == 3) scene->_object2.setAction(&scene->_sequenceManager3, NULL, 3119, &scene->_object2, NULL); @@ -1603,6 +1604,7 @@ void Scene115::Action8::signal() { scene->_object1.setStrip(1); scene->_object1.setFrame(1); scene->_object1.setPosition(Common::Point(122, 97)); + BF_GLOBALS._player.enableControl(); remove(); break; default: @@ -1834,6 +1836,703 @@ void Scene115::synchronize(Serializer &s) { } /*-------------------------------------------------------------------------- + * Scene 125 - Intro - Chase in the city + * + *--------------------------------------------------------------------------*/ +void Scene125::Action1::signal() { + Scene125 *scene = (Scene125 *)BF_GLOBALS._sceneManager._scene; + SceneObject *owner = static_cast<SceneObject *>(this->_owner); + + switch (_actionIndex++) { + case 1: { + Common::Point destPos(214, 105); + NpcMover *mover = new NpcMover(); + owner->addMover(mover, &destPos, this); + break; + } + case 2: + owner->animate(ANIM_MODE_4, 4, 1, this); + break; + case 3: + owner->setFrame(5); + scene->_object2.show(); + setDelay(180); + break; + case 4: { + Common::Point destPos(311, 85); + NpcMover *mover = new NpcMover(); + owner->addMover(mover, &destPos, this); + break; + } + case 5: + owner->remove(); + break; + case 0: + // No break on purpose + default: + break; + } +} + +void Scene125::Action2::signal() { + Scene125 *scene = (Scene125 *)BF_GLOBALS._sceneManager._scene; + + switch (_actionIndex++) { + case 0: + setDelay(30); + break; + case 1: + scene->_action1.signal(); + setDelay(20); + break; + case 2: { + BF_GLOBALS._v501FA = 10; + BF_GLOBALS._v51C44 = 1; + Common::Point destPos(202, 94); + NpcMover *mover = new NpcMover(); + BF_GLOBALS._player.addMover(mover, &destPos, this); + break; + } + case 3: { + scene->_action3.signal(); + Common::Point destPos(280, 84); + NpcMover *mover = new NpcMover(); + BF_GLOBALS._player.addMover(mover, &destPos, this); + break; + } + case 4: + BF_GLOBALS._player.animate(ANIM_MODE_5, this); + break; + case 5: { + Common::Point destPos(375, 111); + NpcMover *mover = new NpcMover(); + BF_GLOBALS._player.addMover(mover, &destPos, this); + break; + } + case 6: + BF_GLOBALS._player.setStrip(2); + BF_GLOBALS._player.setFrame(1); + BF_GLOBALS._player.animate(ANIM_MODE_5, this); + break; + case 7: { + Common::Point destPos(347, 139); + NpcMover *mover = new NpcMover(); + BF_GLOBALS._player.addMover(mover, &destPos, this); + break; + } + case 8: + BF_GLOBALS._player.setStrip(3); + BF_GLOBALS._player.setFrame(1); + BF_GLOBALS._player.animate(ANIM_MODE_5, this); + break; + case 9: { + Common::Point destPos(107, 75); + NpcMover *mover = new NpcMover(); + BF_GLOBALS._player.addMover(mover, &destPos, this); + BF_GLOBALS._player.setPriority(80); + break; + } + case 10: + BF_GLOBALS._player.setStrip(4); + BF_GLOBALS._player.setFrame(1); + BF_GLOBALS._player.animate(ANIM_MODE_5, this); + break; + case 11: { + BF_GLOBALS._player.setPriority(64); + Common::Point destPos(229, 61); + NpcMover *mover = new NpcMover(); + BF_GLOBALS._player.addMover(mover, &destPos, this); + break; + } + case 12: + scene->_action3.signal(); + BF_GLOBALS._player.remove(); + default: + break; + } +} + +void Scene125::Action2::dispatch() { + Action::dispatch(); + + if ((_actionIndex == 10) && (BF_GLOBALS._player._percent > 80)) + BF_GLOBALS._player.changeZoom(BF_GLOBALS._player._percent - 1); + + if ((_actionIndex == 12) && (BF_GLOBALS._player._percent > 50)) + BF_GLOBALS._player.changeZoom(BF_GLOBALS._player._percent - 1); +} + +void Scene125::Action3::signal() { + Scene125 *scene = (Scene125 *)BF_GLOBALS._sceneManager._scene; + SceneObject *owner = static_cast<SceneObject *>(this->_owner); + + switch (_actionIndex++) { + case 0: + break; + case 1: { + Common::Point destPos(202, 94); + NpcMover *mover = new NpcMover(); + owner->addMover(mover, &destPos, this); + break; + } + case 2: { + Common::Point destPos(275, 84); + NpcMover *mover = new NpcMover(); + owner->addMover(mover, &destPos, this); + break; + } + case 3: + scene->_soundExt2.fadeSound(20); + owner->fixPriority(70); + owner->animate(ANIM_MODE_5, this); + break; + case 4: { + Common::Point destPos(375, 111); + NpcMover *mover = new NpcMover(); + owner->addMover(mover, &destPos, this); + break; + } + case 5: + owner->setStrip(2); + owner->setFrame(1); + owner->animate(ANIM_MODE_5, this); + break; + case 6: { + Common::Point destPos(347, 145); + NpcMover *mover = new NpcMover(); + owner->addMover(mover, &destPos, this); + break; + } + case 7: + owner->setStrip(3); + owner->setFrame(1); + owner->animate(ANIM_MODE_5, this); + break; + case 8: { + Common::Point destPos(96, 71); + NpcMover *mover = new NpcMover(); + owner->addMover(mover, &destPos, this); + owner->_moveDiff.x = 6; + owner->_moveDiff.y = 6; + owner->setPriority(80); + break; + } + case 9: + owner->setPosition(Common::Point(85, 76)); + owner->setStrip(4); + owner->setFrame(1); + owner->changeZoom(100); + owner->animate(ANIM_MODE_5, this); + break; + case 10: { + scene->_action5.signal(); + scene->_soundExt1.play(25); + Common::Point destPos(154, 94); + NpcMover *mover = new NpcMover(); + owner->addMover(mover, &destPos, this); + break; + } + case 11: + break; + case 12: + scene->_object1.setPosition(owner->_position); + scene->_object1.changeZoom(2); + scene->_object1.show(); + setDelay(1); + case 13: + BF_GLOBALS._sound1.play(6); + scene->_object1.changeZoom(4); + scene->_object1.setPosition(Common::Point(148, 88)); + setDelay(1); + break; + case 14: + scene->_object1.changeZoom(8); + scene->_object1.setPosition(Common::Point(167, 97)); + setDelay(1); + break; + case 15: + scene->_object1.changeZoom(16); + scene->_object1.setPosition(Common::Point(197, 104)); + scene->_object4.show(); + scene->_object3.show(); + scene->_object4.changeZoom(16); + scene->_object4.setPosition(Common::Point(scene->_object1._position.x - 9, scene->_object1._position.y - 8)); + scene->_object3.changeZoom(16); + scene->_object3.setPosition(Common::Point(scene->_object1._position.x + 5, scene->_object1._position.y - 8)); + setDelay(1); + break; + case 16: + scene->_object1.changeZoom(32); + scene->_object1.setPosition(Common::Point(197, 104)); + scene->_object4.changeZoom(32); + scene->_object4.setPosition(Common::Point(scene->_object1._position.x - 17, scene->_object1._position.y - 15)); + scene->_object3.changeZoom(32); + scene->_object3.setPosition(Common::Point(scene->_object1._position.x + 12, scene->_object1._position.y - 15)); + setDelay(1); + break; + case 17: + scene->_object1.changeZoom(64); + scene->_object1.setPosition(Common::Point(198, 114)); + scene->_object4.changeZoom(64); + scene->_object4.setPosition(Common::Point(scene->_object1._position.x - 34, scene->_object1._position.y - 29)); + scene->_object3.changeZoom(64); + scene->_object3.setPosition(Common::Point(scene->_object1._position.x + 23, scene->_object1._position.y - 29)); + setDelay(1); + break; + case 18: + scene->_object1.changeZoom(100); + scene->_object1.setPosition(Common::Point(160, 112)); + scene->_object4.changeZoom(100); + scene->_object4.setPosition(Common::Point(scene->_object1._position.x - 51, scene->_object1._position.y - 45)); + scene->_object3.changeZoom(100); + scene->_object3.setPosition(Common::Point(scene->_object1._position.x + 42, scene->_object1._position.y - 45)); + scene->_object4.animate(ANIM_MODE_5, this); + scene->_object3.animate(ANIM_MODE_5, this); + setDelay(1); + break; + case 19: + break; + case 20: + setDelay(30); + break; + case 21: + BF_GLOBALS._sceneManager.changeScene(140); + break; + default: + break; + } +} + +void Scene125::Action3::dispatch() { + SceneObject *owner = static_cast<SceneObject *>(this->_owner); + + Action::dispatch(); + + if ((_actionIndex == 9) && (owner->_percent > 70)) + owner->changeZoom(owner->_percent - 1); +} + +void Scene125::Action4::signal() { + Scene125 *scene = (Scene125 *)BF_GLOBALS._sceneManager._scene; + SceneObject *owner = static_cast<SceneObject *>(this->_owner); + + switch (_actionIndex++) { + case 0: + setDelay(180); + break; + case 1: { + owner->setPriority(scene->_object2._priority - 1); + Common::Point destPos(66, 168); + NpcMover *mover = new NpcMover(); + owner->addMover(mover, &destPos, this); + break; + } + case 2: + owner->animate(ANIM_MODE_5, this); + break; + case 3: { + Common::Point destPos(307, 106); + NpcMover *mover = new NpcMover(); + owner->addMover(mover, &destPos, this); + break; + } + case 4: + owner->remove(); + break; + default: + break; + } +} + +void Scene125::Action4::dispatch() { + SceneObject *owner = static_cast<SceneObject *>(this->_owner); + + Action::dispatch(); + + if ((_actionIndex == 4) && (owner->_percent > 80)) + owner->changeZoom(owner->_percent - 1); +} + +void Scene125::Action5::signal() { + SceneObject *owner = static_cast<SceneObject *>(this->_owner); + + if (_actionIndex++ == 1) { + Common::Point destPos(162, 103); + NpcMover *mover = new NpcMover(); + owner->addMover(mover, &destPos, this); + } +} + +void Scene125::Action6::signal() { + SceneObject *owner = static_cast<SceneObject *>(this->_owner); + + switch (_actionIndex++) { + case 0: + setDelay(60); + break; + case 1: { + Common::Point destPos(410, 181); + NpcMover *mover = new NpcMover(); + owner->addMover(mover, &destPos, this); + break; + } + case 2: + owner->remove(); + default: + break; + } +} + +void Scene125::Action6::dispatch() { + SceneObject *owner = static_cast<SceneObject *>(this->_owner); + + Action::dispatch(); + + if ((_actionIndex == 2) && (owner->_percent < 100)) + owner->changeZoom(owner->_percent + 1); +} + +void Scene125::postInit(SceneObjectList *OwnerList) { + SceneExt::postInit(); + loadScene(120); + + _object4.postInit(); + _object4.setVisage(124); + _object4.setPosition(Common::Point(0, 0)); + _object4.setStrip(1); + _object4.setFrame(1); + _object4.fixPriority(251); + _object4.hide(); + + _object3.postInit(); + _object3.setVisage(124); + _object3.setPosition(Common::Point(0, 0)); + _object3.setStrip(2); + _object3.setFrame(1); + _object3.fixPriority(251); + _object3.hide(); + + BF_GLOBALS._player.postInit(); + BF_GLOBALS._player.setVisage(127); + BF_GLOBALS._player.setPosition(Common::Point(160, 110)); + BF_GLOBALS._player.setStrip(1); + BF_GLOBALS._player.setFrame(1); + BF_GLOBALS._player.changeZoom(100); + BF_GLOBALS._player.fixPriority(68); + BF_GLOBALS._player._moveDiff.x = 6; + BF_GLOBALS._player._moveDiff.y = 6; + BF_GLOBALS._player.disableControl(); + + _object5.postInit(); + _object5.setVisage(128); + _object5.setPosition(Common::Point(150, 117)); + _object5.fixPriority(68); + _object5._moveDiff.x = 6; + _object5._moveDiff.y = 6; + + _object9.postInit(); + _object9.setVisage(126); + _object9.setPosition(Common::Point(124, 106)); + _object9.setStrip(4); + _object9.fixPriority(90); + _object9._moveDiff.x = 3; + _object9._moveDiff.y = 3; + + _object1.postInit(); + _object1.setVisage(130); + _object1.setPosition(Common::Point(139, 88)); + _object1.setStrip(1); + _object1.setFrame(1); + _object1.changeZoom(100); + _object1.fixPriority(250); + _object1.hide(); + + _object8.postInit(); + _object8.setVisage(126); + _object8.setPosition(Common::Point(89, 181)); + _object8.setStrip(3); + _object8._moveDiff.x = 6; + _object8._moveDiff.y = 6; + + _object6.postInit(); + _object6.setVisage(126); + _object6.setPosition(Common::Point(289, 128)); + _object6.fixPriority(69); + _object6._moveDiff.x = 6; + _object6._moveDiff.y = 6; + _object6.setAction(&_action1); + + _object2.postInit(); + _object2.setVisage(126); + _object2.setPosition(Common::Point(214, 105)); + _object2.setStrip(2); + _object2.setFrame(1); + _object2.changeZoom(100); + _object2.fixPriority(63); + _object2.hide(); + + _object7.postInit(); + _object7.setVisage(126); + _object7.setPosition(Common::Point(87, 76)); + _object7.setStrip(6); + _object7.setFrame(6); + _object7.changeZoom(80); + _object7._moveDiff.x = 4; + _object7._moveDiff.y = 4; + _object7.setAction(&_action6); + + BF_GLOBALS._sound1.play(5); + setAction(&_action2); + _object5.setAction(&_action3); + _object8.setAction(&_action4); + _object9.setAction(&_action5); +} + +/*-------------------------------------------------------------------------- + * Scene 140 - Intro - Near the house + * + *--------------------------------------------------------------------------*/ + +void Scene140::Action1::signal() { + Scene140 *scene = (Scene140 *)BF_GLOBALS._sceneManager._scene; + SceneObject *owner = static_cast<SceneObject *>(this->_owner); + + switch (_actionIndex++) { + case 0: + scene->loadScene(999); + setDelay(2); + break; + case 1: + BF_GLOBALS._scenePalette.loadPalette(2); + BF_GLOBALS._scenePalette.refresh(); + scene->_text.setup(BF_19840518, this); + break; + case 2: + scene->_object1.show(); + scene->loadScene(140); + setDelay(1); + break; + case 3: { + Common::Point destPos(236, 144); + NpcMover *mover = new NpcMover(); + owner->addMover(mover, &destPos, this); + owner->_numFrames = 7; + break; + } + case 4: + owner->setStrip(3); + owner->setFrame(1); + owner->_numFrames = 5; + owner->setPosition(Common::Point(226, 143)); + owner->animate(ANIM_MODE_5, this); + break; + case 5: + owner->setStrip(4); + owner->setFrame(1); + owner->animate(ANIM_MODE_5, this); + break; + case 6: + scene->_object1.animate(ANIM_MODE_5, this); + owner->setStrip(1); + owner->setFrame(1); + break; + case 7: + owner->setFrame(1); + owner->setPosition(Common::Point(owner->_position.x, owner->_position.y + 1)); + owner->animate(ANIM_MODE_5, this); + break; + case 8: + owner->animate(ANIM_MODE_6, this); + owner->_numFrames = 10; + break; + case 9: + owner->_numFrames = 5; + owner->setPosition(Common::Point(217, 117)); + owner->setStrip(2); + owner->animate(ANIM_MODE_5, this); + break; + case 10: + owner->setPosition(Common::Point(212, 117)); + setDelay(10); + // No break on purpose + case 11: + owner->setPosition(owner->_position, 1000); + setDelay(60); + break; + case 12: + BF_GLOBALS._sound1.play(8); + setDelay(60); + // No break on purpose + case 13: + BF_GLOBALS._v51C44 = 1; + BF_GLOBALS._sceneManager.changeScene(150); + default: + break; + } +} + +Scene140::Text::Text(): SceneText() { + _action = NULL; + _frameNumber = 0; + _diff = 0; +} + +void Scene140::Text::setup(const Common::String &msg, Action *action) { + _frameNumber = BF_GLOBALS._events.getFrameNumber(); + _diff = 180; + _action = action; + _fontNumber = 4; + _width = 300; + _textMode = ALIGN_CENTER; + _color1 = BF_GLOBALS._scenePalette._colors.background; + _color2 = _color3 = 0; + + SceneText::setup(msg); + + // Center the text on-screen + reposition(); + _bounds.center(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2); + + // Set the new position + _position.x = _bounds.left; + _position.y = _bounds.top; +} + +void Scene140::Text::synchronize(Serializer &s) { + SceneText::synchronize(s); + SYNC_POINTER(_action); + s.syncAsUint32LE(_frameNumber); + s.syncAsSint16LE(_diff); +} + +void Scene140::Text::dispatch() { + if (_diff) { + uint32 frameNumber = BF_GLOBALS._events.getFrameNumber(); + if (_frameNumber < frameNumber) { + _diff -= frameNumber - _frameNumber; + _frameNumber = frameNumber; + + if (_diff <= 0) { + // Time has expired, so remove the text and signal the designated action + remove(); + if (_action) + _action->signal(); + } + } + } +} + +void Scene140::postInit(SceneObjectList *OwnerList) { + SceneExt::postInit(); + loadScene(999); + + _object2.postInit(); + _object2.setVisage(141); + _object2.setPosition(Common::Point(333, 149)); + _object2.setStrip(5); + _object2.animate(ANIM_MODE_1, NULL); + _object2._moveDiff.x = 3; + + _object1.postInit(); + _object1.setVisage(141); + _object1.setPosition(Common::Point(202, 115)); + _object1.setFrame(1); + _object1.setStrip(6); + _object1.changeZoom(100); + _object1.hide(); + + BF_GLOBALS._v5020C = 0; + BF_GLOBALS._v501F8 = 300; + BF_GLOBALS._v501FC = 90; + BF_GLOBALS._sound1.play(7); + + _object2.setAction(&_action1); +} + +/*-------------------------------------------------------------------------- + * Scene 150 - Intro - Burglar inside the house + * + *--------------------------------------------------------------------------*/ +void Scene150::Action1::signal() { + SceneObject *owner = static_cast<SceneObject *>(this->_owner); + static uint32 v50B96 = 0; + + switch (_actionIndex++) { + case 0: + _actionIndex = 5; + _object2.postInit(); + _object2.setVisage(150); + _object2.setStrip(3); + _object2._frame = 1; + _object2.setPosition(Common::Point(148, 126)); + _object2.changeZoom(100); + setDelay(10); + break; + case 1: + owner->animate(ANIM_MODE_5, this); + break; + case 2: + owner->_frame = 1; + owner->setStrip(4); + owner->animate(ANIM_MODE_4, 3, 1, this); + break; + case 3: + owner->animate(ANIM_MODE_5, this); + _object2.animate(ANIM_MODE_5, this); + break; + case 4: + _object2.remove(); + break; + case 5: + owner->_numFrames = 8; + owner->_frame = 1; + owner->setStrip(2); + owner->animate(ANIM_MODE_4, 14, 1, this); + break; + case 6: + owner->fixPriority(119); + owner->animate(ANIM_MODE_5, this); + break; + case 7: + setDelay(60); + break; + case 8: + BF_GLOBALS._sound1.stop(); + // No break on purpose + case 9: + _sound1.play(8); + setDelay(30); + break; + case 10: + BF_GLOBALS._scenePalette.addFader((const byte *)&v50B96, 1, 2, this); + break; + case 11: + BF_GLOBALS._sound1.play(9); + BF_GLOBALS._sceneManager.changeScene(160); + break; + default: + break; + } +} + +void Scene150::postInit(SceneObjectList *OwnerList) { + SceneExt::postInit(); + loadScene(150); + + BF_GLOBALS._player.postInit(); + BF_GLOBALS._player.setPosition(Common::Point(160, 100)); + BF_GLOBALS._player._moveDiff.x = 15; + BF_GLOBALS._player.hide(); + + _object1.postInit(); + _object1.setVisage(150); + _object1.setPosition(Common::Point(158, 119)); + _object1._numFrames = 5; + _object1.fixPriority(121); + _object1.setAction(&_action1); +} + +/*-------------------------------------------------------------------------- * Scene 180 - Front of Home * *--------------------------------------------------------------------------*/ @@ -2115,6 +2814,8 @@ void Scene180::signal() { BF_INVENTORY.setObjectScene(INV_9MM_BULLETS, 0); BF_INVENTORY.setObjectScene(INV_SCHEDULE, 0); BF_INVENTORY.setObjectScene(INV_PRINT_OUT, 0); + + BF_GLOBALS._sceneManager.changeScene(180); break; case 8: if (BF_GLOBALS.getFlag(fLeftTraceIn900) || BF_GLOBALS.getFlag(fGotPointsForSearchingDA) || diff --git a/engines/tsage/blue_force/blueforce_scenes1.h b/engines/tsage/blue_force/blueforce_scenes1.h index 8e6b684632..be82adf25c 100644 --- a/engines/tsage/blue_force/blueforce_scenes1.h +++ b/engines/tsage/blue_force/blueforce_scenes1.h @@ -311,6 +311,94 @@ public: virtual void process(Event &event); }; +class Scene125: public SceneExt { + class Action1: public Action { + public: + virtual void signal(); + }; + class Action2: public Action { + public: + virtual void signal(); + virtual void dispatch(); + }; + class Action3: public Action { + public: + virtual void signal(); + virtual void dispatch(); + }; + class Action4: public Action { + public: + virtual void signal(); + virtual void dispatch(); + }; + class Action5: public Action { + public: + virtual void signal(); + }; + class Action6: public Action { + public: + virtual void signal(); + virtual void dispatch(); + }; + +public: + Action1 _action1; + Action2 _action2; + Action3 _action3; + Action4 _action4; + Action5 _action5; + Action6 _action6; + NamedObject _object1, _object2, _object3, _object4, _object5; + NamedObject _object6, _object7, _object8, _object9; + ASoundExt _soundExt1; + ASoundExt _soundExt2; + + void postInit(SceneObjectList *OwnerList); +}; + +class Scene140: public SceneExt { + class Action1: public Action { + public: + virtual void signal(); + }; + /* Texts */ + class Text: public SceneText { + public: + Action *_action; + uint32 _frameNumber; + int _diff; + public: + Text(); + void setup(const Common::String &msg, Action *action); + + virtual Common::String getClassName() { return "BF140Text"; } + virtual void synchronize(Serializer &s); + virtual void dispatch(); + }; +public: + Action1 _action1; + ASoundExt _soundExt1; + NamedObject _object1; + NamedObject _object2; + Text _text; + + void postInit(SceneObjectList *OwnerList); +}; + +class Scene150: public SceneExt { + class Action1: public Action { + NamedObject _object2; + ASound _sound1; + public: + virtual void signal(); + }; +public: + NamedObject _object1; + Action1 _action1; + + void postInit(SceneObjectList *OwnerList); +}; + class Scene180: public SceneExt { /* Objects */ class Vechile: public NamedObject { diff --git a/engines/tsage/blue_force/blueforce_scenes3.cpp b/engines/tsage/blue_force/blueforce_scenes3.cpp index 5017b970a1..12076cb9bd 100644 --- a/engines/tsage/blue_force/blueforce_scenes3.cpp +++ b/engines/tsage/blue_force/blueforce_scenes3.cpp @@ -2484,7 +2484,7 @@ void Scene342::dispatch() { * *--------------------------------------------------------------------------*/ -bool Scene350::Item5::startAction(CursorType action, Event &event) { +bool Scene350::FireBox::startAction(CursorType action, Event &event) { Scene350 *scene = (Scene350 *)BF_GLOBALS._sceneManager._scene; switch (action) { @@ -2571,7 +2571,7 @@ bool Scene350::Hook::startAction(CursorType action, Event &event) { } } -bool Scene350::Object5::startAction(CursorType action, Event &event) { +bool Scene350::FireboxInset::startAction(CursorType action, Event &event) { Scene350 *scene = (Scene350 *)BF_GLOBALS._sceneManager._scene; switch (action) { @@ -2579,7 +2579,7 @@ bool Scene350::Object5::startAction(CursorType action, Event &event) { SceneItem::display2(350, BF_INVENTORY.getObjectScene(INV_HOOK) ? 29 : 28); return true; case CURSOR_USE: - scene->_object5.remove(); + scene->_fireBoxInset.remove(); return true; case INV_HOOK: BF_INVENTORY.setObjectScene(INV_HOOK, 350); @@ -2592,7 +2592,7 @@ bool Scene350::Object5::startAction(CursorType action, Event &event) { BF_GLOBALS._sceneItems.push_front(&scene->_hook); return true; default: - return NamedObject::startAction(action, event); + return FocusObject::startAction(action, event); } } @@ -2672,8 +2672,8 @@ void Scene350::postInit(SceneObjectList *OwnerList) { } } - _item5._sceneRegionId = 5; - BF_GLOBALS._sceneItems.push_back(&_item5); + _fireBox._sceneRegionId = 5; + BF_GLOBALS._sceneItems.push_back(&_fireBox); _item4.setDetails(15, 350, 0, 1, 2, 1); BF_GLOBALS._sceneItems.push_back(&_yacht); @@ -2729,12 +2729,12 @@ void Scene350::signal() { case 3: BF_GLOBALS._player.setStrip(8); - _object5.postInit(); - _object5.setVisage(350); - _object5.setStrip(4); - _object5.fixPriority(200); - _object5.setPosition(Common::Point(85, 166)); - BF_GLOBALS._sceneItems.push_front(&_object5); + _fireBoxInset.postInit(); + _fireBoxInset.setVisage(350); + _fireBoxInset.setStrip(4); + _fireBoxInset.fixPriority(200); + _fireBoxInset.setPosition(Common::Point(85, 166)); + BF_GLOBALS._sceneItems.push_front(&_fireBoxInset); if (BF_INVENTORY.getObjectScene(INV_HOOK) == 350) { _hook.postInit(); @@ -3140,7 +3140,7 @@ bool Scene355::Object8::startAction(CursorType action, Event &event) { scene->_sceneMode = 9997; scene->_stripManager.start(3561, scene); } else { - SceneItem::display(1, 4); + SceneItem::display2(1, 4); } return true; default: @@ -3741,7 +3741,7 @@ void Scene355::signal() { BF_GLOBALS._uiElements.addScore(10); } - SceneItem::display(355, !_doorway._v3 ? 24 : 25); + SceneItem::display2(355, !_doorway._v3 ? 24 : 25); BF_GLOBALS._player.enableControl(); break; case 4550: diff --git a/engines/tsage/blue_force/blueforce_scenes3.h b/engines/tsage/blue_force/blueforce_scenes3.h index 86150433fd..f01c011233 100644 --- a/engines/tsage/blue_force/blueforce_scenes3.h +++ b/engines/tsage/blue_force/blueforce_scenes3.h @@ -432,7 +432,7 @@ public: class Scene350: public SceneExt { /* Items */ - class Item5: public NamedHotspot { + class FireBox: public NamedHotspot { public: virtual bool startAction(CursorType action, Event &event); }; @@ -454,7 +454,7 @@ class Scene350: public SceneExt { public: virtual bool startAction(CursorType action, Event &event); }; - class Object5: public NamedObject { + class FireboxInset: public FocusObject { public: virtual bool startAction(CursorType action, Event &event); }; @@ -470,9 +470,9 @@ public: SceneObject _yachtDoor; BackgroundSceneObject _yachtBody; Hook _hook; - Object5 _object5; + FireboxInset _fireBoxInset; NamedHotspot _item1, _item2, _item3, _item4; - Item5 _item5; + FireBox _fireBox; Yacht _yacht; SouthWestExit _swExit; SpeakerGameText _gameTextSpeaker; diff --git a/engines/tsage/blue_force/blueforce_scenes4.cpp b/engines/tsage/blue_force/blueforce_scenes4.cpp index fadddb531e..338b180c2c 100644 --- a/engines/tsage/blue_force/blueforce_scenes4.cpp +++ b/engines/tsage/blue_force/blueforce_scenes4.cpp @@ -1326,7 +1326,7 @@ void Scene440::signal() { * *--------------------------------------------------------------------------*/ -bool Scene450::Object1::startAction(CursorType action, Event &event) { +bool Scene450::Weasel::startAction(CursorType action, Event &event) { Scene450 *scene = (Scene450 *)BF_GLOBALS._sceneManager._scene; switch (action) { @@ -1361,7 +1361,7 @@ bool Scene450::Object1::startAction(CursorType action, Event &event) { } } -bool Scene450::Object3::startAction(CursorType action, Event &event) { +bool Scene450::PinBoy::startAction(CursorType action, Event &event) { Scene450 *scene = (Scene450 *)BF_GLOBALS._sceneManager._scene; switch (action) { @@ -1390,7 +1390,7 @@ bool Scene450::Object3::startAction(CursorType action, Event &event) { } } -bool Scene450::Object4::startAction(CursorType action, Event &event) { +bool Scene450::Manager::startAction(CursorType action, Event &event) { Scene450 *scene = (Scene450 *)BF_GLOBALS._sceneManager._scene; switch (action) { @@ -1546,26 +1546,27 @@ void Scene450::postInit(SceneObjectList *OwnerList) { _counterDoor.setDetails(450, 12, -1, 13, 1, NULL); if (BF_GLOBALS._dayNumber != 3) { - _object3.postInit(); - _object3.setVisage(463); - _object3.setPosition(Common::Point(138, 121)); - _object3.fixPriority(100); - _object3.setFrame(_object3.getFrameCount()); - BF_GLOBALS._sceneItems.push_back(&_object3); + _pinBoy.postInit(); + _pinBoy.setVisage(463); + _pinBoy.setPosition(Common::Point(138, 121)); + _pinBoy.fixPriority(100); + _pinBoy.setFrame(_pinBoy.getFrameCount()); + BF_GLOBALS._sceneItems.push_back(&_pinBoy); } else if (!BF_GLOBALS.getFlag(fWithLyle) || !BF_GLOBALS.getFlag(fGivenNapkin) || - (BF_INVENTORY.getObjectScene(BF_ITEM_67) == 1)) { - _object3.postInit(); - _object3.setVisage(463); - _object3.setPosition(Common::Point(138, 121)); - _object3.fixPriority(100); - _object3.setFrame(_object3.getFrameCount()); - BF_GLOBALS._sceneItems.push_back(&_object3); + (BF_INVENTORY.getObjectScene(INV_CARAVAN_KEY) == 1)) { + _pinBoy.postInit(); + _pinBoy.setVisage(463); + _pinBoy.setPosition(Common::Point(138, 121)); + _pinBoy.fixPriority(100); + _pinBoy.setFrame(_pinBoy.getFrameCount()); + BF_GLOBALS._sceneItems.push_back(&_pinBoy); } else { - _object4.postInit(); - _object4.setVisage(467); - _object4.setPosition(Common::Point(138, 121)); - _object4.changeZoom(-1); - BF_GLOBALS._sceneItems.push_back(&_object4); + _manager.postInit(); + _manager.setVisage(467); + _manager.setPosition(Common::Point(138, 121)); + _manager.changeZoom(-1); + _manager.fixPriority(100); + BF_GLOBALS._sceneItems.push_back(&_manager); if (!BF_GLOBALS.getFlag(takenWeasel)) { _object2.postInit(); @@ -1579,16 +1580,16 @@ void Scene450::postInit(SceneObjectList *OwnerList) { BF_GLOBALS._walkRegions.proc1(4); - _object1.postInit(); - _object1.setVisage(466); - _object1.animate(ANIM_MODE_1, NULL); - _object1.setObjectWrapper(new SceneObjectWrapper()); - _object1.setPosition(Common::Point(70, 80)); - _object1.setStrip(5); - _object1.changeZoom(90); - _object1.fixPriority(65); - _object1._flag = 0; - BF_GLOBALS._sceneItems.push_back(&_object1); + _weasel.postInit(); + _weasel.setVisage(466); + _weasel.animate(ANIM_MODE_1, NULL); + _weasel.setObjectWrapper(new SceneObjectWrapper()); + _weasel.setPosition(Common::Point(70, 80)); + _weasel.setStrip(5); + _weasel.changeZoom(90); + _weasel.fixPriority(65); + _weasel._flag = 0; + BF_GLOBALS._sceneItems.push_back(&_weasel); } } @@ -1617,12 +1618,12 @@ void Scene450::signal() { } break; case 4503: - _object1.fixPriority(100); + _weasel.fixPriority(100); BF_GLOBALS._player.enableControl(); break; case 4505: BF_GLOBALS.setFlag(takenWeasel); - _object1.remove(); + _weasel.remove(); _object2.remove(); BF_GLOBALS._walkRegions.proc2(4); BF_GLOBALS._player.enableControl(); @@ -1633,18 +1634,18 @@ void Scene450::signal() { BF_GLOBALS.setFlag(fMgrCallsWeasel); _field19AC = 1; _sceneMode = 4503; - setAction(&_sequenceManager, this, 4503, &_object1, &_door, &_object4, NULL); + setAction(&_sequenceManager, this, 4503, &_weasel, &_door, &_manager, NULL); break; case 4508: - _object4.remove(); + _manager.remove(); BF_GLOBALS._player.enableControl(); BF_GLOBALS._player.setObjectWrapper(new SceneObjectWrapper()); break; case 4517: BF_GLOBALS.setFlag(gotTrailer450); - BF_INVENTORY.setObjectScene(BF_ITEM_67, 1); + BF_INVENTORY.setObjectScene(INV_CARAVAN_KEY, 1); _sceneMode = 4508; - setAction(&_sequenceManager, this, 4508, &BF_GLOBALS._player, &_object4, &_door, NULL); + setAction(&_sequenceManager, this, 4508, &BF_GLOBALS._player, &_manager, &_door, NULL); break; default: BF_GLOBALS._player.enableControl(); diff --git a/engines/tsage/blue_force/blueforce_scenes4.h b/engines/tsage/blue_force/blueforce_scenes4.h index 43225cfc41..6c40211f28 100644 --- a/engines/tsage/blue_force/blueforce_scenes4.h +++ b/engines/tsage/blue_force/blueforce_scenes4.h @@ -214,7 +214,7 @@ public: class Scene450: public SceneExt { /* Objects */ - class Object1: public NamedObjectExt { + class Weasel: public NamedObjectExt { public: virtual bool startAction(CursorType action, Event &event); }; @@ -222,11 +222,11 @@ class Scene450: public SceneExt { public: virtual bool startAction(CursorType action, Event &event); }; - class Object3: public NamedObject { + class PinBoy: public NamedObject { public: virtual bool startAction(CursorType action, Event &event); }; - class Object4: public NamedObject { + class Manager: public NamedObject { public: virtual bool startAction(CursorType action, Event &event); }; @@ -245,10 +245,10 @@ public: SpeakerEugene _eugeneSpeaker; SpeakerWeasel _weaselSpeaker; SpeakerBilly _billySpeaker; - Object1 _object1; + Weasel _weasel; NamedObject _object2; - Object3 _object3; - Object4 _object4; + PinBoy _pinBoy; + Manager _manager; NamedObject _door, _counterDoor; Exit _exit; NamedHotspot _interior, _shelf, _counter; diff --git a/engines/tsage/blue_force/blueforce_scenes5.cpp b/engines/tsage/blue_force/blueforce_scenes5.cpp index bc73dd2eb3..d89dd24ecb 100644 --- a/engines/tsage/blue_force/blueforce_scenes5.cpp +++ b/engines/tsage/blue_force/blueforce_scenes5.cpp @@ -76,7 +76,7 @@ bool Scene550::Lyle::startAction(CursorType action, Event &event) { scene->_sceneMode = 5512; scene->setAction(&scene->_action1); } else { - scene->_sceneMode = BF_INVENTORY.getObjectScene(BF_ITEM_67) == 1 ? 5513 : 5512; + scene->_sceneMode = BF_INVENTORY.getObjectScene(INV_CARAVAN_KEY) == 1 ? 5513 : 5512; scene->setAction(&scene->_action1); } return true; @@ -101,8 +101,8 @@ bool Scene550::CaravanDoor::startAction(CursorType action, Event &event) { case CURSOR_USE: SceneItem::display2(550, 7); return true; - case BF_ITEM_67: - if ((BF_GLOBALS._dayNumber == 3) || !BF_GLOBALS.getFlag(fWithLyle)) + case INV_CARAVAN_KEY: + if ((BF_GLOBALS._dayNumber != 3) || !BF_GLOBALS.getFlag(fWithLyle)) SceneItem::display2(550, 33); else { BF_GLOBALS._player.disableControl(); diff --git a/engines/tsage/blue_force/blueforce_scenes8.cpp b/engines/tsage/blue_force/blueforce_scenes8.cpp index 1f8d40c392..04998389bd 100644 --- a/engines/tsage/blue_force/blueforce_scenes8.cpp +++ b/engines/tsage/blue_force/blueforce_scenes8.cpp @@ -69,7 +69,7 @@ bool Scene800::Doorway::startAction(CursorType action, Event &event) { SceneItem::display2(800, BF_GLOBALS.getFlag(onDuty) ? 6 : 15); else if (((BF_INVENTORY.getObjectScene(INV_SCHEDULE) == 1) && (BF_GLOBALS._dayNumber == 3)) || (BF_GLOBALS._bookmark == bDoneWithIsland)) - SceneItem::display(800, 5); + SceneItem::display2(800, 5); else { if (BF_GLOBALS.getFlag(fWithLyle)) { ADD_PLAYER_MOVER_NULL(scene->_lyle, 277, 145); @@ -305,7 +305,7 @@ void Scene800::postInit(SceneObjectList *OwnerList) { _sceneMode = 8001; setAction(&_sequenceManager, this, 8001, &BF_GLOBALS._player, &_doorway, NULL); } - } else if ((BF_INVENTORY.getObjectScene(INV_SCHEDULE) == 1) && (BF_GLOBALS._bookmark == bFlashBackThree)) { + } else if ((BF_INVENTORY.getObjectScene(INV_SCHEDULE) == 1) && (BF_GLOBALS._bookmark < bFlashBackThree)) { BF_GLOBALS._bookmark = bFlashBackThree; BF_GLOBALS._player.disableControl(); BF_GLOBALS._player.setPosition(Common::Point(231, 150)); @@ -314,7 +314,7 @@ void Scene800::postInit(SceneObjectList *OwnerList) { _lyle.setPosition(Common::Point(244, 162)); _lyle.setStrip(4); _sceneMode = 8004; - setAction(&_sequenceManager, this, 8001, &_lyle, &_doorway, NULL); + setAction(&_sequenceManager, this, 8004, &_lyle, &_doorway, NULL); } else { BF_GLOBALS._player.updateAngle(_motorcycle._position); BF_GLOBALS._player.enableControl(); @@ -344,6 +344,8 @@ void Scene800::signal() { case 8004: BF_GLOBALS.clearFlag(fWithLyle); _lyle.remove(); + BF_GLOBALS._player.enableControl(); + break; } } @@ -1545,7 +1547,7 @@ bool Scene830::Door::startAction(CursorType action, Event &event) { return NamedObject::startAction(action, event); } -bool Scene830::Object4::startAction(CursorType action, Event &event) { +bool Scene830::RentalBoat::startAction(CursorType action, Event &event) { Scene830 *scene = (Scene830 *)BF_GLOBALS._sceneManager._scene; if (action == INV_RENTAL_KEYS) { @@ -1555,7 +1557,7 @@ bool Scene830::Object4::startAction(CursorType action, Event &event) { scene->setAction(&scene->_sequenceManager, scene, 8300, &BF_GLOBALS._player, &scene->_lyle, NULL); } else { scene->_sceneMode = 834; - scene->setAction(&scene->_sequenceManager, scene, 8300, &BF_GLOBALS._player, &scene->_object4, NULL); + scene->setAction(&scene->_sequenceManager, scene, 834, &BF_GLOBALS._player, &scene->_rentalBoat, NULL); } return true; } else { @@ -1653,12 +1655,12 @@ void Scene830::postInit(SceneObjectList *OwnerList) { BF_GLOBALS._player.disableControl(); if (_field18A8) { - _object4.postInit(); - _object4.setVisage(830); - _object4.setStrip(1); - _object4.setPosition(Common::Point(271, 146)); - _object4.fixPriority(90); - _object4.setDetails(830, 0, 1, 2, 1, NULL); + _rentalBoat.postInit(); + _rentalBoat.setVisage(830); + _rentalBoat.setStrip(1); + _rentalBoat.setPosition(Common::Point(271, 146)); + _rentalBoat.fixPriority(90); + _rentalBoat.setDetails(830, 0, 1, 2, 1, NULL); } _door.postInit(); @@ -1926,7 +1928,7 @@ void Scene830::dispatch() { * *--------------------------------------------------------------------------*/ -void Scene840::Object2::postInit(SceneObjectList *OwnerList) { +void Scene840::BoatKeysInset::postInit(SceneObjectList *OwnerList) { FocusObject::postInit(OwnerList); if (BF_INVENTORY.getObjectScene(INV_RENTAL_KEYS) != 1) { @@ -1952,18 +1954,19 @@ void Scene840::Object2::postInit(SceneObjectList *OwnerList) { _v1B4 = _v1B6 = 0; } -void Scene840::Object2::remove() { +void Scene840::BoatKeysInset::remove() { Scene840 *scene = (Scene840 *)BF_GLOBALS._sceneManager._scene; _rentalKeys.remove(); _waveKeys.remove(); + FocusObject::remove(); BF_GLOBALS._player.disableControl(); scene->_sceneMode = 8412; scene->setAction(&scene->_sequenceManager1, scene, 8412, &BF_GLOBALS._player, NULL); } -void Scene840::Object2::process(Event &event) { +void Scene840::BoatKeysInset::process(Event &event) { if (BF_GLOBALS._player._enabled) { if (_bounds.contains(event.mousePos)) { CursorType cursorId = BF_GLOBALS._events.getCursor(); @@ -1985,7 +1988,7 @@ void Scene840::Object2::process(Event &event) { FocusObject::process(event); } -bool Scene840::Object2::startAction(CursorType action, Event &event) { +bool Scene840::BoatKeysInset::startAction(CursorType action, Event &event) { switch (action) { case CURSOR_LOOK: if ((event.mousePos.y > 43) && (event.mousePos.y < 92)) { @@ -2008,7 +2011,7 @@ bool Scene840::Object2::startAction(CursorType action, Event &event) { break; case INV_WAVE_KEYS: if ((BF_GLOBALS._dayNumber != 4) || (BF_GLOBALS._bookmark != bEndDayThree)) - SceneItem::display(840, 47); + SceneItem::display2(840, 47); else { BF_GLOBALS._uiElements.addScore(50); @@ -2045,7 +2048,7 @@ bool Scene840::Object2::startAction(CursorType action, Event &event) { return FocusObject::startAction(action, event); } -bool Scene840::Object2::RentalKeys::startAction(CursorType action, Event &event) { +bool Scene840::BoatKeysInset::RentalKeys::startAction(CursorType action, Event &event) { Scene840 *scene = (Scene840 *)BF_GLOBALS._sceneManager._scene; switch (action) { @@ -2057,7 +2060,7 @@ bool Scene840::Object2::RentalKeys::startAction(CursorType action, Event &event) BF_INVENTORY.setObjectScene(INV_RENTAL_KEYS, 1); BF_GLOBALS._uiElements.addScore(30); - scene->_object2._v1B4 = 1; + scene->_boatKeysInset._v1B4 = 1; remove(); } return true; @@ -2066,16 +2069,16 @@ bool Scene840::Object2::RentalKeys::startAction(CursorType action, Event &event) } } -bool Scene840::Object2::WaveKeys::startAction(CursorType action, Event &event) { +bool Scene840::BoatKeysInset::WaveKeys::startAction(CursorType action, Event &event) { Scene840 *scene = (Scene840 *)BF_GLOBALS._sceneManager._scene; switch (action) { case CURSOR_USE: if (scene->_field1AC2) { - SceneItem::display(840, 56); + SceneItem::display2(840, 56); BF_INVENTORY.setObjectScene(INV_WAVE_KEYS, 1); BF_GLOBALS._uiElements.addScore(50); - scene->_object2._v1B6 = 1; + scene->_boatKeysInset._v1B6 = 1; remove(); } else { SceneItem::display2(840, 9); @@ -2086,7 +2089,7 @@ bool Scene840::Object2::WaveKeys::startAction(CursorType action, Event &event) { } } -bool Scene840::Object6::startAction(CursorType action, Event &event) { +bool Scene840::BoatKeys::startAction(CursorType action, Event &event) { Scene840 *scene = (Scene840 *)BF_GLOBALS._sceneManager._scene; switch (action) { @@ -2274,13 +2277,13 @@ void Scene840::postInit(SceneObjectList *OwnerList) { _item13.setDetails(Rect(0, 0, SCREEN_WIDTH - 1, BF_INTERFACE_Y), 840, 41, 42, 43, 1, NULL); if (BF_INVENTORY.getObjectScene(INV_RENTAL_KEYS) == 1) { - _object6.postInit(); - _object6.setVisage(840); - _object6.setStrip(4); - _object6.setFrame(1); - _object6.setPosition(Common::Point(250, 83)); - _object6.fixPriority(120); - _object6.setDetails(840, -1, 8, 9, 2, NULL); + _boatKeys.postInit(); + _boatKeys.setVisage(840); + _boatKeys.setStrip(4); + _boatKeys.setFrame(1); + _boatKeys.setPosition(Common::Point(250, 83)); + _boatKeys.fixPriority(120); + _boatKeys.setDetails(840, -1, 8, 9, 2, NULL); _field1AC0 = 1; } @@ -2371,9 +2374,9 @@ void Scene840::signal() { break; case 4: _sceneMode = 8403; - _object6.postInit(); - _object6.setDetails(840, -1, 8, 9, 2, NULL); - setAction(&_sequenceManager1, this, 8403, &_carter, &_object6, NULL); + _boatKeys.postInit(); + _boatKeys.setDetails(840, -1, 8, 9, 2, NULL); + setAction(&_sequenceManager1, this, 8403, &_carter, &_boatKeys, NULL); break; case 5: _sceneMode = 8408; @@ -2387,7 +2390,7 @@ void Scene840::signal() { if ((BF_GLOBALS._dayNumber == 4) && (BF_GLOBALS._bookmark >= bEndDayThree)) { _stripManager.start(8440, this); _sceneMode = 3; - } else if (BF_GLOBALS._sceneObjects->contains(&_object6)) { + } else if (BF_GLOBALS._sceneObjects->contains(&_boatKeys)) { _stripManager.start(8442, this); _sceneMode = 3; } else if (_field1AC6) { @@ -2449,18 +2452,18 @@ void Scene840::signal() { break; case 8411: BF_GLOBALS._player.enableControl(); - _object2.postInit(); - _object2.setVisage(840); - _object2.setStrip(2); - _object2.setPosition(Common::Point(160, 140)); - _object2.fixPriority(254); - _object2.setDetails(840, 50, 8, 51); + _boatKeysInset.postInit(); + _boatKeysInset.setVisage(840); + _boatKeysInset.setStrip(2); + _boatKeysInset.setPosition(Common::Point(160, 140)); + _boatKeysInset.fixPriority(254); + _boatKeysInset.setDetails(840, 50, 8, 51); break; case 8412: - if (_object2._v1B6) { + if (_boatKeysInset._v1B6) { _sceneMode = 8409; setAction(&_sequenceManager1, this, 8409, &BF_GLOBALS._player, &_carter, &_doors, NULL); - } else if (!_object2._v1B4) { + } else if (!_boatKeysInset._v1B4) { BF_GLOBALS._player.enableControl(); } else { _sceneMode = 3; diff --git a/engines/tsage/blue_force/blueforce_scenes8.h b/engines/tsage/blue_force/blueforce_scenes8.h index ad223fef02..ef5ef81563 100644 --- a/engines/tsage/blue_force/blueforce_scenes8.h +++ b/engines/tsage/blue_force/blueforce_scenes8.h @@ -290,7 +290,7 @@ class Scene830: public PalettedScene { public: virtual bool startAction(CursorType action, Event &event); }; - class Object4: public NamedObject { + class RentalBoat: public NamedObject { public: virtual bool startAction(CursorType action, Event &event); }; @@ -306,7 +306,7 @@ public: SpeakerLyleHat _lyleHatSpeaker; NamedObject _object1, _lyle, _object6; Door _door; - Object4 _object4; + RentalBoat _rentalBoat; Object5 _object5; SouthEastExit _seExit; NoteBoard _noteBoard; @@ -336,7 +336,7 @@ class Scene840: public PalettedScene { }; /* Objects */ - class Object2: public FocusObject { + class BoatKeysInset: public FocusObject { class RentalKeys: public NamedObject { public: virtual bool startAction(CursorType action, Event &event); @@ -355,7 +355,7 @@ class Scene840: public PalettedScene { virtual void process(Event &event); virtual bool startAction(CursorType action, Event &event); }; - class Object6: public NamedObject { + class BoatKeys: public NamedObject { public: virtual bool startAction(CursorType action, Event &event); }; @@ -367,9 +367,9 @@ class Scene840: public PalettedScene { public: SequenceManager _sequenceManager1, _sequenceManager2; NamedObject _object1; - Object2 _object2; + BoatKeysInset _boatKeysInset; NamedObject _doors; - Object6 _object6; + BoatKeys _boatKeys; Carter _carter; NamedObject _lyle; Coins _coins; diff --git a/engines/tsage/blue_force/blueforce_scenes9.cpp b/engines/tsage/blue_force/blueforce_scenes9.cpp index a7f58acc62..f918508a4b 100644 --- a/engines/tsage/blue_force/blueforce_scenes9.cpp +++ b/engines/tsage/blue_force/blueforce_scenes9.cpp @@ -57,7 +57,7 @@ bool Scene900::Item4::startAction(CursorType action, Event &event) { } /*--------------------------------------------------------------------------*/ -bool Scene900::Object1::startAction(CursorType action, Event &event) { +bool Scene900::Gate::startAction(CursorType action, Event &event) { Scene900 *scene = (Scene900 *)BF_GLOBALS._sceneManager._scene; switch (action) { @@ -72,7 +72,7 @@ bool Scene900::Object1::startAction(CursorType action, Event &event) { scene->setAction(&scene->_sequenceManager1, scene, 9006, &BF_GLOBALS._player, this, NULL); } else { BF_GLOBALS._v4CEC0 = 2; - if (scene->_object3._flag == false) { + if (scene->_dog._flag == false) { BF_GLOBALS._player.setAction(&scene->_action4); } else { scene->_sceneMode = 9005; @@ -143,7 +143,7 @@ bool Scene900::Object2::startAction(CursorType action, Event &event) { } } -bool Scene900::Object3::startAction(CursorType action, Event &event) { +bool Scene900::Dog::startAction(CursorType action, Event &event) { Scene900 *scene = (Scene900 *)BF_GLOBALS._sceneManager._scene; switch (action) { @@ -180,7 +180,7 @@ bool Scene900::Object6::startAction(CursorType action, Event &event) { if (action == CURSOR_TALK) { if (BF_GLOBALS._sceneManager._sceneLoadCount == 0) { if (!_action) { - if (scene->_object3._flag) { + if (scene->_dog._flag) { if (BF_GLOBALS._v4CEC0 == 0) scene->_stripManager.start(9004, &BF_GLOBALS._stripProxy); else { @@ -225,25 +225,25 @@ void Scene900::Action1::signal() { switch (_actionIndex++) { case 0: - if (scene->_object3._flag == 0) { - scene->_object3.setStrip(3); + if (scene->_dog._flag == 0) { + scene->_dog.setStrip(3); if ((BF_GLOBALS._randomSource.getRandomNumber(3) == 1) || (BF_GLOBALS._player._position.x > 790) || (scene->_field1976 != 0)) { Common::Point pt(864, 130); NpcMover *mover = new NpcMover(); - scene->_object3.addMover(mover, &pt, this); + scene->_dog.addMover(mover, &pt, this); } else { _actionIndex = 4; Common::Point pt(775, 107); NpcMover *mover = new NpcMover(); - scene->_object3.addMover(mover, &pt, this); + scene->_dog.addMover(mover, &pt, this); } } break; case 1: - scene->_object3.setPosition(Common::Point(864, 117)); - scene->_object3.setStrip(7); - scene->_object3.setFrame(1); - scene->_object3.animate(ANIM_MODE_5, this); + scene->_dog.setPosition(Common::Point(864, 117)); + scene->_dog.setStrip(7); + scene->_dog.setFrame(1); + scene->_dog.animate(ANIM_MODE_5, this); if (BF_GLOBALS._randomSource.getRandomNumber(3) == 1) scene->_sound1.play(92); else @@ -252,16 +252,16 @@ void Scene900::Action1::signal() { _actionIndex = 7; break; case 2: - scene->_object3.animate(ANIM_MODE_6, this); + scene->_dog.animate(ANIM_MODE_6, this); break; case 3: { - scene->_object3.setStrip(3); - scene->_object3.setPosition(Common::Point(864, 130)); - scene->_object3.fixPriority(122); - scene->_object3.animate(ANIM_MODE_1, NULL); + scene->_dog.setStrip(3); + scene->_dog.setPosition(Common::Point(864, 130)); + scene->_dog.fixPriority(122); + scene->_dog.animate(ANIM_MODE_1, NULL); Common::Point pt(775, 107); NpcMover *mover = new NpcMover(); - scene->_object3.addMover(mover, &pt, this); + scene->_dog.addMover(mover, &pt, this); break; } case 6: @@ -271,10 +271,10 @@ void Scene900::Action1::signal() { setDelay(30); break; case 5: { - scene->_object3.setStrip(4); + scene->_dog.setStrip(4); Common::Point pt(940, 145); NpcMover *mover = new NpcMover(); - scene->_object3.addMover(mover, &pt, this); + scene->_dog.addMover(mover, &pt, this); break; } case 7: @@ -286,17 +286,17 @@ void Scene900::Action1::signal() { _actionIndex = 8; break; case 8: - scene->_object3.setStrip(1); - scene->_object3.setFrame(7); - scene->_object3.animate(ANIM_MODE_6, NULL); + scene->_dog.setStrip(1); + scene->_dog.setFrame(7); + scene->_dog.animate(ANIM_MODE_6, NULL); break; case 9: scene->_field1976 = 0; - scene->_object3._flag = 0; + scene->_dog._flag = 0; _actionIndex = 7; - scene->_object3.setStrip(1); - scene->_object3.setFrame(1); - scene->_object3.animate(ANIM_MODE_5, this); + scene->_dog.setStrip(1); + scene->_dog.setFrame(1); + scene->_dog.animate(ANIM_MODE_5, this); break; default: break; @@ -309,7 +309,7 @@ void Scene900::Action2::signal() { switch (_actionIndex++) { case 0: scene->_field1976 = 1; - if (scene->_object3._action->getActionIndex() == 8) + if (scene->_dog._action->getActionIndex() != 8) _actionIndex = 0; setDelay(5); break; @@ -319,7 +319,7 @@ void Scene900::Action2::signal() { scene->_object5.setStrip(2); scene->_object5.setPosition(Common::Point(-20, -20)); scene->_object5._moveDiff.y = 10; - setAction(&scene->_sequenceManager1, this, 9009, &BF_GLOBALS._player, &scene->_object5, &scene->_object3, NULL); + setAction(&scene->_sequenceManager1, this, 9009, &BF_GLOBALS._player, &scene->_object5, &scene->_dog, NULL); BF_INVENTORY.setObjectScene(INV_FISHING_NET, 900); break; case 2: @@ -329,8 +329,8 @@ void Scene900::Action2::signal() { BF_GLOBALS._uiElements.addScore(50); } SceneItem::display2(900, 10); - scene->_object3._flag = 1; - scene->_object3.fixPriority(130); + scene->_dog._flag = 1; + scene->_dog.fixPriority(130); BF_GLOBALS._player.enableControl(); remove(); break; @@ -349,33 +349,33 @@ void Scene900::Action3::signal() { PlayerMover *mover = new PlayerMover(); BF_GLOBALS._player.addMover(mover, &pt, 0); } - if (scene->_object3._action->getActionIndex() != 7) { + if (scene->_dog._action->getActionIndex() != 7) { _actionIndex = 0; } setDelay(5); break; case 1: - if (scene->_object3._strip == 3) { + if (scene->_dog._strip == 3) { _actionIndex = 3; Common::Point pt(775, 107); NpcMover *mover = new NpcMover(); - scene->_object3.addMover(mover, &pt, this); + scene->_dog.addMover(mover, &pt, this); } else - scene->_object3.animate(ANIM_MODE_6, this); + scene->_dog.animate(ANIM_MODE_6, this); break; case 2: { - scene->_object3.setStrip(3); - scene->_object3.setPosition(Common::Point(864, 130)); - scene->_object3.fixPriority(122); - scene->_object3.animate(ANIM_MODE_1, NULL); + scene->_dog.setStrip(3); + scene->_dog.setPosition(Common::Point(864, 130)); + scene->_dog.fixPriority(122); + scene->_dog.animate(ANIM_MODE_1, NULL); Common::Point pt(775, 107); NpcMover *mover = new NpcMover(); - scene->_object3.addMover(mover, &pt, this); + scene->_dog.addMover(mover, &pt, this); break; } case 3: - scene->_object3.remove(); - scene->_object3._flag = 1; + scene->_dog.remove(); + scene->_dog._flag = 1; SceneItem::display2(900, 24); if (!BF_GLOBALS.getFlag(fGotPointsForLockWarehouse)) { BF_GLOBALS.setFlag(fGotPointsForLockWarehouse); @@ -386,7 +386,7 @@ void Scene900::Action3::signal() { break; default: break; - } + } } void Scene900::Action4::signal() { @@ -395,15 +395,15 @@ void Scene900::Action4::signal() { switch (_actionIndex++) { case 0: scene->_field1976 = 1; - if (scene->_object3._action->getActionIndex() != 8) + if (scene->_dog._action->getActionIndex() != 8) _actionIndex = 0; setDelay(5); break; case 1: - scene->setAction(&scene->_sequenceManager1, scene, 9005, &BF_GLOBALS._player, &scene->_object1, NULL); + scene->setAction(&scene->_sequenceManager1, this, 9005, &BF_GLOBALS._player, &scene->_gate, NULL); break; case 2: - scene->setAction(&scene->_sequenceManager1, scene, 9008, &BF_GLOBALS._player, &scene->_object3, NULL); + scene->setAction(&scene->_sequenceManager1, this, 9008, &BF_GLOBALS._player, &scene->_dog, NULL); break; case 3: BF_GLOBALS._deathReason = 5; @@ -436,7 +436,7 @@ void Scene900::postInit(SceneObjectList *OwnerList) { BF_INVENTORY.setObjectScene(INV_FISHING_NET, 1); BF_INVENTORY.setObjectScene(INV_HOOK, 1); } - _object3._flag = 0; + _dog._flag = 0; if (BF_GLOBALS._bookmark >= bFinishedWGreen) { _object7.postInit(); _object7.fixPriority(120); @@ -448,10 +448,10 @@ void Scene900::postInit(SceneObjectList *OwnerList) { _sceneBounds.moveTo(640, 0); BF_GLOBALS._v4CEC0 = 2; BF_INVENTORY.setObjectScene(INV_FISHING_NET, 900); - _object3._flag = 1; + _dog._flag = 1; } if (BF_INVENTORY.getObjectScene(INV_FISHING_NET) == 900) - _object3._flag = 1; + _dog._flag = 1; _stripManager.addSpeaker(&_gameTextSpeaker); _stripManager.addSpeaker(&_jakeJacketSpeaker); @@ -460,37 +460,37 @@ void Scene900::postInit(SceneObjectList *OwnerList) { _item4.setDetails(Rect(0, 85, 20, 130), 900, -1, -1, -1, 1, 0); BF_GLOBALS._player.postInit(); - _object3.postInit(); - _object3.setVisage(902); - _object3.setPosition(Common::Point(845, 135)); - _object3.fixPriority(122); - _object3.setDetails(900, 8, -1, 9, 1, NULL); - - if (_object3._flag == 0) { - _object3.animate(ANIM_MODE_1, NULL); - _object3.setAction(&_action1); + _dog.postInit(); + _dog.setVisage(902); + _dog.setPosition(Common::Point(845, 135)); + _dog.fixPriority(122); + _dog.setDetails(900, 8, -1, 9, 1, NULL); + + if (_dog._flag == 0) { + _dog.animate(ANIM_MODE_1, NULL); + _dog.setAction(&_action1); } else { - _object3.setAction(&_action1); - _object3.fixPriority(130); + _dog.setAction(&_action1); + _dog.fixPriority(130); if (BF_GLOBALS._dayNumber == 4) { - _object3.setPosition(Common::Point(879, 120)); - _object3.setStrip(2); + _dog.setPosition(Common::Point(879, 120)); + _dog.setStrip(2); } else { - _object3.setPosition(Common::Point(864, 117)); - _object3.setStrip(6); - _object3.setFrame(6); + _dog.setPosition(Common::Point(864, 117)); + _dog.setStrip(6); + _dog.setFrame(6); } } - _object1.postInit(); - _object1.setVisage(900); - _object1.setStrip(2); + _gate.postInit(); + _gate.setVisage(900); + _gate.setStrip(2); if (BF_GLOBALS._v4CEC0 == 2) - _object1.setPosition(Common::Point(758, 127)); + _gate.setPosition(Common::Point(758, 127)); else { BF_GLOBALS._walkRegions.proc1(24); - _object1.setPosition(Common::Point(804, 132)); + _gate.setPosition(Common::Point(804, 132)); } if (BF_GLOBALS._dayNumber == 5) @@ -555,7 +555,7 @@ void Scene900::postInit(SceneObjectList *OwnerList) { setAction(&_sequenceManager1, this, 9002, &BF_GLOBALS._player, &_object2, NULL); } - _object1.setDetails(900, 0, -1, 1, 1, 0); + _gate.setDetails(900, 0, -1, 1, 1, 0); _object2.setDetails(900, 2, -1, 5, 1, 0); _item2.setDetails(Rect(0, 0, 225, 21), 666, 25, -1, -1, 1, NULL); _item3.setDetails(Rect(37, 21, 324, 50), 666, 26, -1, -1, 1, NULL); @@ -572,7 +572,7 @@ void Scene900::signal() { case 3: BF_GLOBALS._walkRegions.proc1(24); _sceneMode = 9004; - setAction(&_sequenceManager1, this, 9006, &BF_GLOBALS._player, &_object1, NULL); + setAction(&_sequenceManager1, this, 9006, &BF_GLOBALS._player, &_gate, NULL); break; case 9000: BF_GLOBALS._player.enableControl(); @@ -598,7 +598,7 @@ void Scene900::signal() { BF_GLOBALS._player.enableControl(); break; case 9005: - if (_object3._flag == 0) + if (_dog._flag == 0) BF_GLOBALS._player.setAction(&_action4); else BF_GLOBALS._player.enableControl(); @@ -625,11 +625,11 @@ void Scene900::signal() { _sound1.play(92); if (BF_GLOBALS._v4CEC0 == 2) { _sceneMode = 9008; - setAction(&_sequenceManager1, this, 9008, &BF_GLOBALS._player, &_object3, NULL); + setAction(&_sequenceManager1, this, 9008, &BF_GLOBALS._player, &_dog, NULL); } else { BF_GLOBALS._player._strip = 7; _action1.setActionIndex(9); - _object3.signal(); + _dog.signal(); if ((!BF_GLOBALS.getFlag(fGotPointsForFreeDog)) && (BF_GLOBALS._bookmark == bEndDayThree)) { BF_GLOBALS.setFlag(fGotPointsForFreeDog); BF_GLOBALS._uiElements.addScore(50); @@ -3164,6 +3164,16 @@ bool Scene930::Object4::startAction(CursorType action, Event &event) { } } +void Scene930::Object4::remove() { + Scene930 *scene = (Scene930 *)BF_GLOBALS._sceneManager._scene; + + if (scene->_v141C && !BF_GLOBALS._sceneObjects->contains(&scene->_object5)) { + scene->_boots.setAction(&scene->_action3); + } + + FocusObject::remove(); +} + bool Scene930::Object5::startAction(CursorType action, Event &event) { Scene930 *scene = (Scene930 *)BF_GLOBALS._sceneManager._scene; @@ -3191,6 +3201,14 @@ bool Scene930::Object5::startAction(CursorType action, Event &event) { break; } } + +void Scene930::Object5::remove() { + Scene930 *scene = (Scene930 *)BF_GLOBALS._sceneManager._scene; + scene->_boots.setAction(&scene->_action3); + + FocusObject::remove(); +} + /* Items */ bool Scene930::Item1::startAction(CursorType action, Event &event) { Scene930 *scene = (Scene930 *)BF_GLOBALS._sceneManager._scene; @@ -3440,7 +3458,7 @@ void Scene930::subF3D6F() { _object5.postInit(); _object5.setVisage(930); _object5.setStrip(3); - if (BF_INVENTORY.getObjectScene(55) == 1) { + if (BF_INVENTORY.getObjectScene(INV_SCHEDULE) == 1) { _object5.setFrame(_object5.getFrameCount()); _object5.setDetails(930, 92, 77, -1); } else if (_v141A == 0) { diff --git a/engines/tsage/blue_force/blueforce_scenes9.h b/engines/tsage/blue_force/blueforce_scenes9.h index 32bb71d021..8fa6009c8c 100644 --- a/engines/tsage/blue_force/blueforce_scenes9.h +++ b/engines/tsage/blue_force/blueforce_scenes9.h @@ -43,50 +43,50 @@ class Scene900: public PalettedScene { /* Items */ class Item1: public NamedHotspot { public: - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); }; class Item4: public NamedHotspot { public: - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); }; /* Objects */ - class Object1: public NamedObject { + class Gate: public NamedObject { public: - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); }; class Object2: public NamedObjectExt { public: - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); }; - class Object3: public NamedObjectExt { + class Dog: public NamedObjectExt { public: - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); }; class Object6: public NamedObject { public: - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); }; class Object7: public NamedObject { public: - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); }; /* Actions */ class Action1 : public Action { public: - void signal(); + virtual void signal(); }; class Action2 : public Action { public: - void signal(); + virtual void signal(); }; class Action3 : public Action { public: - void signal(); + virtual void signal(); }; class Action4 : public Action { public: - void signal(); + virtual void signal(); }; public: @@ -95,9 +95,9 @@ public: SpeakerJakeJacket _jakeJacketSpeaker; SpeakerLyleHat _lyleHatSpeaker; Item1 _item1; - Object1 _object1; + Gate _gate; Object2 _object2; - Object3 _object3; + Dog _dog; NamedHotspot _item2; NamedHotspot _item3; NamedObject _object4; @@ -125,44 +125,44 @@ class Scene910: public PalettedScene { /* Actions */ class Action1 : public Action { public: - void signal(); + virtual void signal(); }; class Action2 : public Action { public: - void signal(); + virtual void signal(); }; /* Objects */ class Object1: public NamedObject { public: int _field90; - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); }; class Object2: public NamedObject { public: - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); }; class Object3: public NamedObject { public: - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); }; class Object4: public NamedObject { public: - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); }; class Object8: public NamedObject { public: int _field90, _field92; - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); void init(int val); }; class Object10: public NamedObject { public: - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); }; class Object11: public NamedObject { public: - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); }; class Object13: public NamedObject { @@ -177,7 +177,7 @@ class Scene910: public PalettedScene { class Object28: public Object13 { public: void subEBD26(int x, int y, int arg8, int8 argA); - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); void remove(); }; @@ -185,7 +185,7 @@ class Scene910: public PalettedScene { int _field90, _field92; public: void subEBBDC(int x, int y, int arg8, int argA); - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); void remove(); }; @@ -205,7 +205,7 @@ class Scene910: public PalettedScene { public: NamedObject _object32; void remove(); - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); void subED6EA(int frame); }; @@ -221,31 +221,31 @@ class Scene910: public PalettedScene { /* Items */ class Item1: public NamedHotspot { public: - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); }; class Item2: public NamedHotspot { public: - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); }; class Item3: public NamedHotspot { public: - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); }; class Item9: public NamedHotspot { public: - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); }; class Item15: public NamedHotspot { public: - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); }; class Item16: public NamedHotspot { public: - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); }; class Item17: public NamedHotspot { public: - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); }; int _field2DDA, _field2DDC, _field2DDE, _field2DD8, _field2DE0, _field2DE2, _field2DE4; @@ -296,11 +296,11 @@ class Scene920: public SceneExt { /* Items */ class Item1: public NamedHotspot { public: - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); }; class Item8: public NamedHotspot { public: - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); }; public: @@ -332,41 +332,43 @@ class Scene930: public PalettedScene { /* Objects */ class Object1: public NamedObject { public: - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); }; class Object2: public FocusObject { public: - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); }; class Object3: public NamedObject { public: - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); }; class Object4: public FocusObject { public: - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); + virtual void remove(); }; class Object5: public FocusObject { public: - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); + virtual void remove(); }; /* Items */ class Item1: public NamedHotspot { public: - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); }; /* Actions */ class Action1 : public Action { public: - void signal(); + virtual void signal(); }; class Action2 : public Action { public: - void signal(); + virtual void signal(); }; class Action3 : public Action { public: - void signal(); + virtual void signal(); }; void showBootWindow(); @@ -421,7 +423,7 @@ class Scene935: public PalettedScene { /* Actions */ class Action1 : public Action { public: - void signal(); + virtual void signal(); }; public: @@ -442,12 +444,12 @@ class Scene940: public SceneExt { /* Items */ class Item1: public NamedHotspot { public: - bool startAction(CursorType action, Event &event); + virtual bool startAction(CursorType action, Event &event); }; /* Actions */ class Action1 : public Action { public: - void signal(); + virtual void signal(); }; public: diff --git a/engines/tsage/events.h b/engines/tsage/events.h index 0195b2fc7b..7e1b745521 100644 --- a/engines/tsage/events.h +++ b/engines/tsage/events.h @@ -80,7 +80,7 @@ enum CursorType { INV_9MM_BULLETS = 54, INV_SCHEDULE = 55, INV_GRENADES = 56, INV_YELLOW_CORD = 57, INV_HALF_YELLOW_CORD = 58, INV_BLACK_CORD = 59, INV_HALF_BLACK_CORD = 61, INV_WARRANT = 62, INV_JACKET = 63, INV_GREENS_KNIFE = 64, INV_DOG_WHISTLE = 65, INV_AMMO_BELT = 66, - BF_ITEM_67 = 67, BF_LAST_INVENT = 68, + INV_CARAVAN_KEY = 67, BF_LAST_INVENT = 68, // Cursors CURSOR_WALK = 0x100, CURSOR_LOOK = 0x200, CURSOR_700 = 700, CURSOR_USE = 0x400, CURSOR_TALK = 0x800, diff --git a/engines/tsage/globals.cpp b/engines/tsage/globals.cpp index 9eec41d62f..4c129f9274 100644 --- a/engines/tsage/globals.cpp +++ b/engines/tsage/globals.cpp @@ -213,8 +213,10 @@ void BlueForceGlobals::synchronize(Serializer &s) { s.syncAsSint16LE(_deathReason); s.syncAsSint16LE(_driveFromScene); s.syncAsSint16LE(_driveToScene); + s.syncAsSint16LE(_v501F8); s.syncAsSint16LE(_v501FA); s.syncAsSint16LE(_v501FC); + s.syncAsSint16LE(_v5020C); s.syncAsSint16LE(_v50696); s.syncAsSint16LE(_v5098C); s.syncAsSint16LE(_v5098D); @@ -287,7 +289,10 @@ void BlueForceGlobals::reset() { _v4CEE8 = 0; _deziTopic = 0; _deathReason = 0; + _v501F8 = 0; + _v501FA = 0; _v501FC = 0; + _v5020C = 0; _v50696 = 0; _v5098C = 0; _v5098D = 0; diff --git a/engines/tsage/globals.h b/engines/tsage/globals.h index 40893e752b..8edb082163 100644 --- a/engines/tsage/globals.h +++ b/engines/tsage/globals.h @@ -190,8 +190,10 @@ public: int _deathReason; int _driveFromScene; int _driveToScene; + int _v501F8; int _v501FA; int _v501FC; + int _v5020C; int _v50696; uint8 _v5098C; uint8 _v5098D; |