aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sherlock/map.cpp33
-rw-r--r--engines/sherlock/map.h3
-rw-r--r--engines/sherlock/scalpel/scalpel.cpp11
3 files changed, 32 insertions, 15 deletions
diff --git a/engines/sherlock/map.cpp b/engines/sherlock/map.cpp
index 6fff48a1d3..e07dedf7dd 100644
--- a/engines/sherlock/map.cpp
+++ b/engines/sherlock/map.cpp
@@ -34,7 +34,7 @@ Map::Map(SherlockEngine *vm): _vm(vm), _topLine(SHERLOCK_SCREEN_WIDTH, 12) {
_charPoint = _oldCharPoint = -1;
_cursorIndex = -1;
_drawMap = false;
- for (int idx = 0; idx < 3; ++idx)
+ for (int idx = 0; idx < MAX_HOLMES_SEQUENCE; ++idx)
Common::fill(&_sequences[idx][0], &_sequences[idx][MAX_FRAME], 0);
loadData();
@@ -50,6 +50,15 @@ void Map::loadPoints(int count, const int *xList, const int *yList, const int *t
}
/**
+ * Load the sequence data for player icon animations
+ */
+void Map::loadSequences(int count, const byte *seq) {
+ for (int idx = 0; idx < count; ++idx, seq += MAX_FRAME)
+ Common::copy(seq, seq + MAX_FRAME, &_sequences[idx][0]);
+}
+
+
+/**
* Load data needed for the map
*/
void Map::loadData() {
@@ -108,10 +117,10 @@ int Map::show() {
// Load need sprites
setupSprites();
- screen._backBuffer1.blitFrom(bigMap[1], Common::Point(-_bigPos.x, -_bigPos.y));
- screen._backBuffer1.blitFrom(bigMap[2], Common::Point(-_bigPos.x, SHERLOCK_SCREEN_HEIGHT - _bigPos.y));
- screen._backBuffer1.blitFrom(bigMap[3], Common::Point(SHERLOCK_SCREEN_WIDTH - _bigPos.x, -_bigPos.y));
- screen._backBuffer1.blitFrom(bigMap[4], Common::Point(SHERLOCK_SCREEN_WIDTH - _bigPos.x, SHERLOCK_SCREEN_HEIGHT - _bigPos.y));
+ screen._backBuffer1.blitFrom(bigMap[0], Common::Point(-_bigPos.x, -_bigPos.y));
+ screen._backBuffer1.blitFrom(bigMap[1], Common::Point(-_bigPos.x, SHERLOCK_SCREEN_HEIGHT - _bigPos.y));
+ screen._backBuffer1.blitFrom(bigMap[2], Common::Point(SHERLOCK_SCREEN_WIDTH - _bigPos.x, -_bigPos.y));
+ screen._backBuffer1.blitFrom(bigMap[3], Common::Point(SHERLOCK_SCREEN_WIDTH - _bigPos.x, SHERLOCK_SCREEN_HEIGHT - _bigPos.y));
_drawMap = true;
_point = -1;
@@ -168,10 +177,10 @@ int Map::show() {
// Map has scrolled, so redraw new map view
changed = false;
- screen._backBuffer1.blitFrom(bigMap[1], Common::Point(-_bigPos.x, -_bigPos.y));
- screen._backBuffer1.blitFrom(bigMap[2], Common::Point(-_bigPos.x, SHERLOCK_SCREEN_HEIGHT - _bigPos.y));
- screen._backBuffer1.blitFrom(bigMap[3], Common::Point(SHERLOCK_SCREEN_WIDTH - _bigPos.x, -_bigPos.y));
- screen._backBuffer1.blitFrom(bigMap[4], Common::Point(SHERLOCK_SCREEN_WIDTH - _bigPos.x, SHERLOCK_SCREEN_HEIGHT - _bigPos.y));
+ screen._backBuffer1.blitFrom(bigMap[0], Common::Point(-_bigPos.x, -_bigPos.y));
+ screen._backBuffer1.blitFrom(bigMap[1], Common::Point(-_bigPos.x, SHERLOCK_SCREEN_HEIGHT - _bigPos.y));
+ screen._backBuffer1.blitFrom(bigMap[2], Common::Point(SHERLOCK_SCREEN_WIDTH - _bigPos.x, -_bigPos.y));
+ screen._backBuffer1.blitFrom(bigMap[3], Common::Point(SHERLOCK_SCREEN_WIDTH - _bigPos.x, SHERLOCK_SCREEN_HEIGHT - _bigPos.y));
showPlaces();
_placesShown = false;
@@ -249,7 +258,7 @@ void Map::setupSprites() {
p._type = CHARACTER;
p._position = Common::Point(12400, 5000);
p._sequenceNumber = 0;
- p._sequences = (Sequences *)&_sequences;
+ p._sequences = &_sequences;
p._images = _shapes;
p._imageFrame = nullptr;
p._frameNumber = 0;
@@ -283,13 +292,13 @@ void Map::showPlaces() {
Screen &screen = *_vm->_screen;
for (uint idx = 0; idx < _points.size(); ++idx) {
- const Common::Point &pt = _points[idx];
+ const MapEntry &pt = _points[idx];
if (pt.x != 0 && pt.y != 0) {
if (pt.x >= _bigPos.x && (pt.x - _bigPos.x) < SHERLOCK_SCREEN_WIDTH
&& pt.y >= _bigPos.y && (pt.y - _bigPos.y) < SHERLOCK_SCREEN_HEIGHT) {
if (_vm->readFlags(idx)) {
- screen._backBuffer1.transBlitFrom((*_iconShapes)[idx],
+ screen._backBuffer1.transBlitFrom((*_iconShapes)[pt._translate],
Common::Point(pt.x - _bigPos.x - 6, pt.y - _bigPos.y - 12));
}
}
diff --git a/engines/sherlock/map.h b/engines/sherlock/map.h
index f324160bce..5b63fe768c 100644
--- a/engines/sherlock/map.h
+++ b/engines/sherlock/map.h
@@ -56,7 +56,7 @@ private:
ImageFile *_mapCursors;
ImageFile *_shapes;
ImageFile *_iconShapes;
- byte _sequences[3][MAX_FRAME];
+ byte _sequences[MAX_HOLMES_SEQUENCE][MAX_FRAME];
Common::Point _bigPos;
Common::Point _overPos;
Common::Point _lDrawnPos;
@@ -89,6 +89,7 @@ public:
const MapEntry &operator[](int idx) { return _points[idx]; }
void loadPoints(int count, const int *xList, const int *yList, const int *transList);
+ void loadSequences(int count, const byte *seq);
int show();
};
diff --git a/engines/sherlock/scalpel/scalpel.cpp b/engines/sherlock/scalpel/scalpel.cpp
index 4e49a6b4d3..2ca9f80c42 100644
--- a/engines/sherlock/scalpel/scalpel.cpp
+++ b/engines/sherlock/scalpel/scalpel.cpp
@@ -39,12 +39,18 @@ const int MAP_Y[NUM_PLACES] = {
37, 0, 70, 0, 116, 0, 0, 0, 50, 21, 0, 303, 0, 0, 229, 0, 0
};
-int MAP_TRANSLATE[NUM_PLACES] = {
+const int MAP_TRANSLATE[NUM_PLACES] = {
0, 0, 0, 1, 0, 2, 0, 3, 4, 0, 4, 6, 0, 0, 0, 8, 9, 10, 11, 0, 12, 13, 14, 7,
15, 16, 17, 18, 19, 0, 20, 21, 22, 23, 0, 24, 0, 25, 0, 26, 0, 0, 0, 27,
28, 0, 29, 0, 0, 30, 0
};
+const byte MAP_SEQUENCES[3][MAX_FRAME] = {
+ { 1, 1, 2, 3, 4, 0 }, // Overview Still
+ { 5, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 0 },
+ { 5, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 0 }
+};
+
#define MAX_PEOPLE 66
const byte STILL_SEQUENCES[MAX_PEOPLE][MAX_TALK_SEQUENCES] = {
@@ -209,8 +215,9 @@ void ScalpelEngine::initialize() {
_flags[3] = true; // Turn on Alley
_flags[39] = true; // Turn on Baker Street
- // Load the map co-ordinates for each scene
+ // Load the map co-ordinates for each scene and sequence data
_map->loadPoints(NUM_PLACES, &MAP_X[0], &MAP_Y[0], &MAP_TRANSLATE[0]);
+ _map->loadSequences(3, &MAP_SEQUENCES[0][0]);
// Load the inventory
loadInventory();