aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sherlock/objects.cpp4
-rw-r--r--engines/sherlock/objects.h5
-rw-r--r--engines/sherlock/people.cpp4
-rw-r--r--engines/sherlock/people.h6
-rw-r--r--engines/sherlock/screen.cpp12
-rw-r--r--engines/sherlock/screen.h5
-rw-r--r--engines/sherlock/sherlock.cpp1
-rw-r--r--engines/sherlock/sherlock.h1
-rw-r--r--engines/sherlock/tattoo/tattoo.cpp4
-rw-r--r--engines/sherlock/tattoo/tattoo.h5
-rw-r--r--engines/sherlock/tattoo/tattoo_scene.cpp105
-rw-r--r--engines/sherlock/tattoo/tattoo_scene.h2
-rw-r--r--engines/sherlock/tattoo/tattoo_user_interface.cpp1
-rw-r--r--engines/sherlock/tattoo/tattoo_user_interface.h1
14 files changed, 150 insertions, 6 deletions
diff --git a/engines/sherlock/objects.cpp b/engines/sherlock/objects.cpp
index 8818f805a5..4527c4e92a 100644
--- a/engines/sherlock/objects.cpp
+++ b/engines/sherlock/objects.cpp
@@ -364,6 +364,10 @@ void Sprite::checkSprite() {
}
}
+const Common::Rect Sprite::getOldBounds() const {
+ return Common::Rect(_oldPosition.x, _oldPosition.y, _oldPosition.x + _oldSize.x, _oldPosition.y + _oldSize.y);
+}
+
/*----------------------------------------------------------------*/
void WalkSequence::load(Common::SeekableReadStream &s) {
diff --git a/engines/sherlock/objects.h b/engines/sherlock/objects.h
index d671066a23..54cea69d5a 100644
--- a/engines/sherlock/objects.h
+++ b/engines/sherlock/objects.h
@@ -242,6 +242,11 @@ public:
* Return frame height
*/
int frameHeight() const { return _imageFrame ? _imageFrame->_frame.h : 0; }
+
+ /**
+ * Returns the old bounsd for the sprite from the previous frame
+ */
+ const Common::Rect getOldBounds() const;
};
enum { OBJ_BEHIND = 1, OBJ_FLIPPED = 2, OBJ_FORWARD = 4, TURNON_OBJ = 0x20, TURNOFF_OBJ = 0x40 };
diff --git a/engines/sherlock/people.cpp b/engines/sherlock/people.cpp
index 0ef49ffefb..7686d52572 100644
--- a/engines/sherlock/people.cpp
+++ b/engines/sherlock/people.cpp
@@ -79,6 +79,10 @@ void Person::clearNPC() {
_npcName = "";
}
+void Person::updateNPC() {
+ // TODO
+}
+
/*----------------------------------------------------------------*/
People::People(SherlockEngine *vm) : _vm(vm), _player(_data[0]) {
diff --git a/engines/sherlock/people.h b/engines/sherlock/people.h
index 013727d8ba..32faee5f07 100644
--- a/engines/sherlock/people.h
+++ b/engines/sherlock/people.h
@@ -76,6 +76,7 @@ public:
Common::String _npcName;
int _tempX;
int _tempScaleVal;
+ bool _updateNPCPath;
// Rose Tattoo fields
Common::String _walkVGSName; // Name of walk library person is using
@@ -86,6 +87,11 @@ public:
* Clear the NPC related data
*/
void clearNPC();
+
+ /**
+ * Update the NPC
+ */
+ void updateNPC();
};
class SherlockEngine;
diff --git a/engines/sherlock/screen.cpp b/engines/sherlock/screen.cpp
index 708493cd30..6c59c3b873 100644
--- a/engines/sherlock/screen.cpp
+++ b/engines/sherlock/screen.cpp
@@ -306,6 +306,18 @@ void Screen::flushScaleImage(ImageFrame *frame, const Common::Point &pt, int16 *
*height = newBounds.height();
}
+void Screen::flushImage(ImageFrame *frame, const Common::Point &pt, Common::Rect &newBounds, int scaleVal) {
+ Common::Point newPos, newSize;
+
+ if (scaleVal == 256)
+ flushImage(frame, pt, &newPos.x, &newPos.y, &newSize.x, &newSize.y);
+ else
+ flushScaleImage(frame, pt, &newPos.x, &newPos.y, &newSize.x, &newSize.y, scaleVal);
+
+ // Transfer the pos and size amounts into a single bounds rect
+ newBounds = Common::Rect(newPos.x, newPos.y, newPos.x + newSize.x, newPos.y + newSize.y);
+}
+
void Screen::blockMove(const Common::Rect &r, const Common::Point &scrollPos) {
Common::Rect bounds = r;
bounds.translate(scrollPos.x, scrollPos.y);
diff --git a/engines/sherlock/screen.h b/engines/sherlock/screen.h
index 27746731e8..7d49c52def 100644
--- a/engines/sherlock/screen.h
+++ b/engines/sherlock/screen.h
@@ -190,6 +190,11 @@ public:
int16 *width, int16 *height, int scaleVal);
/**
+ * Variation of flushImage/flushScaleImage that takes in and updates a rect
+ */
+ void flushImage(ImageFrame *frame, const Common::Point &pt, Common::Rect &newBounds, int scaleVal);
+
+ /**
* Copies data from the back buffer to the screen, taking into account scrolling position
*/
void blockMove(const Common::Rect &r, const Common::Point &scrollPos);
diff --git a/engines/sherlock/sherlock.cpp b/engines/sherlock/sherlock.cpp
index 5ebf9e5166..67a1552f6c 100644
--- a/engines/sherlock/sherlock.cpp
+++ b/engines/sherlock/sherlock.cpp
@@ -50,6 +50,7 @@ SherlockEngine::SherlockEngine(OSystem *syst, const SherlockGameDescription *gam
_canLoadSave = false;
_showOriginalSavesDialog = false;
_interactiveFl = true;
+ _fastMode = false;
}
SherlockEngine::~SherlockEngine() {
diff --git a/engines/sherlock/sherlock.h b/engines/sherlock/sherlock.h
index 16dacd30f3..c233373dbc 100644
--- a/engines/sherlock/sherlock.h
+++ b/engines/sherlock/sherlock.h
@@ -123,6 +123,7 @@ public:
bool _canLoadSave;
bool _showOriginalSavesDialog;
bool _interactiveFl;
+ bool _fastMode;
public:
SherlockEngine(OSystem *syst, const SherlockGameDescription *gameDesc);
virtual ~SherlockEngine();
diff --git a/engines/sherlock/tattoo/tattoo.cpp b/engines/sherlock/tattoo/tattoo.cpp
index 368b24bfcd..765016ba49 100644
--- a/engines/sherlock/tattoo/tattoo.cpp
+++ b/engines/sherlock/tattoo/tattoo.cpp
@@ -72,6 +72,10 @@ void TattooEngine::drawCredits() {
// TODO
}
+void TattooEngine::blitCredits() {
+ // TODO
+}
+
void TattooEngine::eraseCredits() {
// TODO
}
diff --git a/engines/sherlock/tattoo/tattoo.h b/engines/sherlock/tattoo/tattoo.h
index bb6310dbe3..28fa77f409 100644
--- a/engines/sherlock/tattoo/tattoo.h
+++ b/engines/sherlock/tattoo/tattoo.h
@@ -59,6 +59,11 @@ public:
void drawCredits();
/**
+ * Blit the drawn credits to the screen
+ */
+ void blitCredits();
+
+ /**
* Erase any area of the screen covered by credits
*/
void eraseCredits();
diff --git a/engines/sherlock/tattoo/tattoo_scene.cpp b/engines/sherlock/tattoo/tattoo_scene.cpp
index cd86a58d1a..8a3c5864b7 100644
--- a/engines/sherlock/tattoo/tattoo_scene.cpp
+++ b/engines/sherlock/tattoo/tattoo_scene.cpp
@@ -196,15 +196,15 @@ void TattooScene::doBgAnimEraseBackground() {
}
void TattooScene::doBgAnim() {
+ TattooEngine &vm = *(TattooEngine *)_vm;
+ Events &events = *_vm->_events;
+ People &people = *_vm->_people;
+ Screen &screen = *_vm->_screen;
+ Talk &talk = *_vm->_talk;
TattooUserInterface &ui = *((TattooUserInterface *)_vm->_ui);
doBgAnimCheckCursor();
-// Events &events = *_vm->_events;
- People &people = *_vm->_people;
-// Scene &scene = *_vm->_scene;
- Screen &screen = *_vm->_screen;
- Talk &talk = *_vm->_talk;
screen.setDisplayBounds(Common::Rect(0, 0, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCENE_HEIGHT));
talk._talkToAbort = false;
@@ -226,6 +226,23 @@ void TattooScene::doBgAnim() {
doBgAnimUpdateBgObjectsAndAnim();
ui.drawInterface();
+
+ doBgAnimDrawSprites();
+
+ if (vm._creditsActive)
+ vm.blitCredits();
+
+ if (!vm._fastMode)
+ events.wait(3);
+
+ screen._flushScreen = false;
+ _doBgAnimDone = false;
+ ui._drawMenu = false;
+
+ for (uint idx = 1; idx < MAX_CHARACTERS; ++idx) {
+ if (people[idx]._updateNPCPath)
+ people[idx].updateNPC();
+ }
}
void TattooScene::doBgAnimUpdateBgObjectsAndAnim() {
@@ -288,7 +305,6 @@ void TattooScene::doBgAnimUpdateBgObjectsAndAnim() {
}
}
-
void TattooScene::updateBackground() {
People &people = *_vm->_people;
Screen &screen = *_vm->_screen;
@@ -397,6 +413,83 @@ void TattooScene::updateBackground() {
screen._flushScreen = false;
}
+void TattooScene::doBgAnimDrawSprites() {
+ People &people = *_vm->_people;
+ Screen &screen = *_vm->_screen;
+ TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui;
+
+ for (uint idx = 0; idx < MAX_CHARACTERS; ++idx) {
+ Person &person = people[idx];
+
+ if (person._type != INVALID) {
+ if (_goToScene == -1 || _cAnim.size() == 0) {
+ if (person._type == REMOVE) {
+ screen.slamRect(person.getOldBounds());
+ person._type = INVALID;
+ } else {
+ if (person._tempScaleVal == 256) {
+ screen.flushImage(person._imageFrame, Common::Point(person._tempX, person._position.y / FIXED_INT_MULTIPLIER
+ - person.frameHeight()), &person._oldPosition.x, &person._oldPosition.y, &person._oldSize.x, &person._oldSize.y);
+ } else {
+ int ts = person._imageFrame->sDrawYSize(person._tempScaleVal);
+ int ty = person._position.y / FIXED_INT_MULTIPLIER - ts;
+ screen.flushScaleImage(person._imageFrame, Common::Point(person._tempX, ty),
+ &person._oldPosition.x, &person._oldPosition.y, &person._oldSize.x, &person._oldSize.y, person._tempScaleVal);
+ }
+ }
+ }
+ }
+ }
+
+ for (uint idx = 0; idx < _bgShapes.size(); ++idx) {
+ Object &obj = _bgShapes[idx];
+
+ if (obj._type == ACTIVE_BG_SHAPE || obj._type == REMOVE) {
+ if (_goToScene == -1) {
+ if (obj._scaleVal == 256)
+ screen.flushImage(obj._imageFrame, obj._position, &obj._oldPosition.x, &obj._oldPosition.y,
+ &obj._oldSize.x, &obj._oldSize.y);
+ else
+ screen.flushScaleImage(obj._imageFrame, obj._position, &obj._oldPosition.x, &obj._oldPosition.y,
+ &obj._oldSize.x, &obj._oldSize.y, obj._scaleVal);
+
+ if (obj._type == REMOVE)
+ obj._type = INVALID;
+ }
+ }
+ }
+
+ for (uint idx = 0; idx < _bgShapes.size(); ++idx) {
+ Object &obj = _bgShapes[idx];
+
+ if (_goToScene == -1) {
+ if (obj._type == NO_SHAPE && (obj._flags & 1) == 0) {
+ screen.slamRect(obj.getNoShapeBounds());
+ screen.slamRect(obj.getOldBounds());
+ } else if (obj._type == HIDE_SHAPE) {
+ if (obj._scaleVal == 256)
+ screen.flushImage(obj._imageFrame, obj._position, &obj._oldPosition.x, &obj._oldPosition.y,
+ &obj._oldSize.x, &obj._oldSize.y);
+ else
+ screen.flushScaleImage(obj._imageFrame, obj._position, &obj._oldPosition.x, &obj._oldPosition.y,
+ &obj._oldSize.x, &obj._oldSize.y, obj._scaleVal);
+ obj._type = HIDDEN;
+ }
+ }
+ }
+
+ if (_activeCAnim._images != nullptr || _activeCAnim._zPlacement == REMOVE) {
+ if (_activeCAnim._zPlacement != REMOVE) {
+ screen.flushImage(_activeCAnim._imageFrame, _activeCAnim._position, _activeCAnim._oldBounds, _activeCAnim._scaleVal);
+ } else {
+ screen.slamArea(_activeCAnim._removeBounds.left - ui._currentScroll.x, _activeCAnim._removeBounds.top,
+ _activeCAnim._removeBounds.width(), _activeCAnim._removeBounds.height());
+ _activeCAnim._removeBounds.left = _activeCAnim._removeBounds.top = 0;
+ _activeCAnim._removeBounds.right = _activeCAnim._removeBounds.bottom = 0;
+ _activeCAnim._zPlacement = -1; // Reset _zPlacement so we don't REMOVE again
+ }
+ }
+}
} // End of namespace Tattoo
diff --git a/engines/sherlock/tattoo/tattoo_scene.h b/engines/sherlock/tattoo/tattoo_scene.h
index de28306c1b..91e7ad4665 100644
--- a/engines/sherlock/tattoo/tattoo_scene.h
+++ b/engines/sherlock/tattoo/tattoo_scene.h
@@ -44,6 +44,8 @@ private:
* Update the background objects and canimations as part of doBgAnim
*/
void doBgAnimUpdateBgObjectsAndAnim();
+
+ void doBgAnimDrawSprites();
protected:
/**
* Checks all the background shapes. If a background shape is animating,
diff --git a/engines/sherlock/tattoo/tattoo_user_interface.cpp b/engines/sherlock/tattoo/tattoo_user_interface.cpp
index e1568b4394..6779cc48ae 100644
--- a/engines/sherlock/tattoo/tattoo_user_interface.cpp
+++ b/engines/sherlock/tattoo/tattoo_user_interface.cpp
@@ -34,6 +34,7 @@ TattooUserInterface::TattooUserInterface(SherlockEngine *vm): UserInterface(vm)
_tagBuffer = nullptr;
_invGraphic = nullptr;
_scrollSize = _scrollSpeed = 0;
+ _drawMenu = false;
}
void TattooUserInterface::initScrollVars() {
diff --git a/engines/sherlock/tattoo/tattoo_user_interface.h b/engines/sherlock/tattoo/tattoo_user_interface.h
index fea9ca8442..db6a04f75c 100644
--- a/engines/sherlock/tattoo/tattoo_user_interface.h
+++ b/engines/sherlock/tattoo/tattoo_user_interface.h
@@ -53,6 +53,7 @@ private:
public:
Common::Point _currentScroll, _targetScroll;
int _scrollSize, _scrollSpeed;
+ bool _drawMenu;
public:
TattooUserInterface(SherlockEngine *vm);