[Scummvm-cvs-logs] scummvm master -> 41575ad74e60308034f76907736cd6530a23579f

bluegr bluegr at gmail.com
Tue Jun 16 09:57:08 CEST 2015


This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
bd75fc1d11 SHERLOCK: Properly implement stopMusic() and freeSong()
25e729efe0 SHERLOCK: Introduce a IS_3DO define
7e6539f400 SHERLOCK: Use IS_3DO in more places
41575ad74e SHERLOCK: SS: Fix the position of the user interface in the 3DO version


Commit: bd75fc1d118b96a4951b69b0a06a1f2e3e47d4b8
    https://github.com/scummvm/scummvm/commit/bd75fc1d118b96a4951b69b0a06a1f2e3e47d4b8
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-06-16T09:55:50+03:00

Commit Message:
SHERLOCK: Properly implement stopMusic() and freeSong()

Fixes the crashes when changing scenes

Changed paths:
    engines/sherlock/music.cpp



diff --git a/engines/sherlock/music.cpp b/engines/sherlock/music.cpp
index 39bbd59..9682714 100644
--- a/engines/sherlock/music.cpp
+++ b/engines/sherlock/music.cpp
@@ -322,22 +322,22 @@ bool Music::loadSong(int songNumber) {
 	Common::String songName = Common::String(SONG_NAMES[songNumber - 1]);
 
 	freeSong();  // free any song that is currently loaded
-	
+	stopMusic();
+
 	if (!playMusic(songName))
 		return false;
 
-	stopMusic();
 	startSong();
 	return true;
 }
 
 bool Music::loadSong(const Common::String &songName) {
 	freeSong();  // free any song that is currently loaded
-	
+	stopMusic();
+
 	if (!playMusic(songName))
 		return false;
 
-	stopMusic();
 	startSong();
 	return true;
 }
@@ -449,16 +449,11 @@ bool Music::playMusic(const Common::String &name) {
 }
 
 void Music::stopMusic() {
-	// TODO
-	warning("TODO: Sound::stopMusic");
-
-	if (_vm->getPlatform() != Common::kPlatform3DO) {
-		// TODO
-	} else {
-		// 3DO
-		if (isPlaying()) {
+	if (isPlaying()) {
+		if (_vm->getPlatform() != Common::kPlatform3DO)
+			_midiParser->stopPlaying();
+		else
 			_mixer->stopHandle(_digitalMusicHandle);
-		}
 	}
 
 	_musicPlaying = false;
@@ -474,10 +469,11 @@ void Music::startSong() {
 }
 
 void Music::freeSong() {
-	// TODO
-	warning("TODO: Sound::freeSong");
 	if (_midiMusicData) {
-		// free midi data buffer
+		if (_midiParser->isPlaying())
+			_midiParser->stopPlaying();
+
+		// Free the MIDI data buffer
 		delete[] _midiMusicData;
 		_midiMusicData = NULL;
 		_midiMusicDataSize = 0;


Commit: 25e729efe0dc9cedf31bbedc12c393de756ed9d7
    https://github.com/scummvm/scummvm/commit/25e729efe0dc9cedf31bbedc12c393de756ed9d7
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-06-16T09:59:27+03:00

Commit Message:
SHERLOCK: Introduce a IS_3DO define

This is similar to IS_SERRATED_SCALPEL and IS_ROSE_TATTOO, and makes
the code a bit easier to read

Changed paths:
    engines/sherlock/journal.cpp
    engines/sherlock/music.cpp
    engines/sherlock/objects.cpp
    engines/sherlock/sherlock.h
    engines/sherlock/sound.cpp



diff --git a/engines/sherlock/journal.cpp b/engines/sherlock/journal.cpp
index 98ac320..0fd0947 100644
--- a/engines/sherlock/journal.cpp
+++ b/engines/sherlock/journal.cpp
@@ -71,7 +71,7 @@ void Journal::record(int converseNum, int statementNum, bool replyOnly) {
 	int saveIndex = _index;
 	int saveSub = _sub;
 
-	if (_vm->getPlatform() == Common::kPlatform3DO) {
+	if (IS_3DO) {
 		// there seems to be no journal in the 3DO version
 		return;
 	}
@@ -123,7 +123,7 @@ void Journal::loadJournalLocations() {
 
 	_locations.clear();
 
-	if (_vm->getPlatform() == Common::kPlatform3DO) {
+	if (IS_3DO) {
 		// 3DO: storage of locations is currently unknown TODO
 		return;
 	}
diff --git a/engines/sherlock/music.cpp b/engines/sherlock/music.cpp
index 9682714..1c92682 100644
--- a/engines/sherlock/music.cpp
+++ b/engines/sherlock/music.cpp
@@ -209,7 +209,7 @@ Music::Music(SherlockEngine *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer) {
 	_midiMusicData = NULL;
 	_midiMusicDataSize = 0;
 
-	if (_vm->getPlatform() == Common::kPlatform3DO) {
+	if (IS_3DO) {
 		// 3DO - uses digital samples for music
 		_musicOn = true;
 		return;
diff --git a/engines/sherlock/objects.cpp b/engines/sherlock/objects.cpp
index 6113571..d838f32 100644
--- a/engines/sherlock/objects.cpp
+++ b/engines/sherlock/objects.cpp
@@ -597,7 +597,7 @@ void Sprite::setImageFrame() {
 	ImageFile *images = _altSeq ? _altImages : _images;
 	assert(images);
 
-	if (_vm->getPlatform() == Common::kPlatform3DO) {
+	if (IS_3DO) {
 		// only do this to the image-array with 110 entries
 		// map uses another image-array and this code
 		if (images->size() == 110) {
diff --git a/engines/sherlock/sherlock.h b/engines/sherlock/sherlock.h
index f06ee5e..d0e7bf2 100644
--- a/engines/sherlock/sherlock.h
+++ b/engines/sherlock/sherlock.h
@@ -219,6 +219,7 @@ public:
 
 #define IS_ROSE_TATTOO (_vm->getGameID() == GType_RoseTattoo)
 #define IS_SERRATED_SCALPEL (_vm->getGameID() == GType_SerratedScalpel)
+#define IS_3DO (_vm->getPlatform() == Common::kPlatform3DO)
 
 } // End of namespace Sherlock
 
diff --git a/engines/sherlock/sound.cpp b/engines/sherlock/sound.cpp
index 70d42a7..32fa99b 100644
--- a/engines/sherlock/sound.cpp
+++ b/engines/sherlock/sound.cpp
@@ -64,7 +64,7 @@ Sound::Sound(SherlockEngine *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer) {
 	_soundOn = true;
 	_speechOn = true;
 
-	if (_vm->getPlatform() == Common::kPlatform3DO) {
+	if (IS_3DO) {
 		// 3DO: we don't need to prepare anything for sound
 		return;
 	}


Commit: 7e6539f400f0607e35b269dfb9e33459dc2e85cf
    https://github.com/scummvm/scummvm/commit/7e6539f400f0607e35b269dfb9e33459dc2e85cf
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-06-16T10:02:32+03:00

Commit Message:
SHERLOCK: Use IS_3DO in more places

Changed paths:
    engines/sherlock/events.cpp
    engines/sherlock/inventory.cpp
    engines/sherlock/music.cpp
    engines/sherlock/resources.cpp
    engines/sherlock/saveload.cpp
    engines/sherlock/scalpel/scalpel_map.cpp
    engines/sherlock/scalpel/scalpel_people.cpp
    engines/sherlock/scalpel/scalpel_scene.cpp
    engines/sherlock/scalpel/scalpel_talk.cpp
    engines/sherlock/scalpel/scalpel_user_interface.cpp
    engines/sherlock/scene.cpp
    engines/sherlock/sound.cpp



diff --git a/engines/sherlock/events.cpp b/engines/sherlock/events.cpp
index 297437e..ff928d8 100644
--- a/engines/sherlock/events.cpp
+++ b/engines/sherlock/events.cpp
@@ -54,7 +54,7 @@ void Events::loadCursors(const Common::String &filename) {
 	hideCursor();
 	delete _cursorImages;
 
-	if (_vm->getPlatform() != Common::kPlatform3DO) {
+	if (!IS_3DO) {
 		// PC
 		_cursorImages = new ImageFile(filename);
 	} else {
@@ -88,7 +88,7 @@ void Events::setCursor(CursorId cursorId) {
 
 void Events::setCursor(const Graphics::Surface &src, int hotspotX, int hotspotY) {
 	_cursorId = INVALID_CURSOR;
-	if (_vm->getPlatform() != Common::kPlatform3DO) {
+	if (!IS_3DO) {
 		// PC 8-bit palettized
 		CursorMan.replaceCursor(src.getPixels(), src.w, src.h, hotspotX, hotspotY, 0xff);
 	} else {
diff --git a/engines/sherlock/inventory.cpp b/engines/sherlock/inventory.cpp
index 7973579..692b057 100644
--- a/engines/sherlock/inventory.cpp
+++ b/engines/sherlock/inventory.cpp
@@ -107,7 +107,7 @@ void Inventory::loadGraphics() {
 		int invNum = findInv((*this)[idx]._name);
 		Common::String filename = Common::String::format("item%02d.vgs", invNum + 1);
 
-		if (_vm->getPlatform() != Common::kPlatform3DO) {
+		if (!IS_3DO) {
 			// PC
 			_invShapes[idx - _invIndex] = new ImageFile(filename);
 		} else {
diff --git a/engines/sherlock/music.cpp b/engines/sherlock/music.cpp
index 1c92682..37b0417 100644
--- a/engines/sherlock/music.cpp
+++ b/engines/sherlock/music.cpp
@@ -352,7 +352,7 @@ bool Music::playMusic(const Common::String &name) {
 
 	debugC(kDebugLevelMusic, "Music: playMusic('%s')", name.c_str());
 
-	if (_vm->getPlatform() != Common::kPlatform3DO) {
+	if (!IS_3DO) {
 		// MIDI based
 		if (!_midiDriver)
 			return false;
@@ -450,7 +450,7 @@ bool Music::playMusic(const Common::String &name) {
 
 void Music::stopMusic() {
 	if (isPlaying()) {
-		if (_vm->getPlatform() != Common::kPlatform3DO)
+		if (!IS_3DO)
 			_midiParser->stopPlaying();
 		else
 			_mixer->stopHandle(_digitalMusicHandle);
@@ -486,7 +486,7 @@ void Music::waitTimerRoland(uint time) {
 }
 
 bool Music::isPlaying() {
-	if (_vm->getPlatform() != Common::kPlatform3DO) {
+	if (!IS_3DO) {
 		// MIDI based
 		return _midiParser->isPlaying();
 	} else {
@@ -497,7 +497,7 @@ bool Music::isPlaying() {
 
 // Returns the current music position in milliseconds
 uint32 Music::getCurrentPosition() {
-	if (_vm->getPlatform() != Common::kPlatform3DO) {
+	if (!IS_3DO) {
 		// MIDI based
 		return (_midiParser->getTick() * 1000) / 60; // translate tick to millisecond
 	} else {
diff --git a/engines/sherlock/resources.cpp b/engines/sherlock/resources.cpp
index 32b0743..5aea8cc 100644
--- a/engines/sherlock/resources.cpp
+++ b/engines/sherlock/resources.cpp
@@ -89,7 +89,7 @@ Resources::Resources(SherlockEngine *vm) : _vm(vm), _cache(vm) {
 	_resourceIndex = -1;
 
 	if (_vm->_interactiveFl) {
-		if (_vm->getPlatform() != Common::kPlatform3DO) {
+		if (!IS_3DO) {
 			addToCache("vgs.lib");
 			addToCache("talk.lib");
 			addToCache("journal.txt");
@@ -226,7 +226,7 @@ void Resources::loadLibraryIndex(const Common::String &libFilename,
 	stream->seek(4);
 	int count = 0;
 
-	if (_vm->getPlatform() != Common::kPlatform3DO) {
+	if (!IS_3DO) {
 		// PC
 		count = stream->readUint16LE();
 
diff --git a/engines/sherlock/saveload.cpp b/engines/sherlock/saveload.cpp
index f009205..c863f8c 100644
--- a/engines/sherlock/saveload.cpp
+++ b/engines/sherlock/saveload.cpp
@@ -240,7 +240,7 @@ void SaveManager::createThumbnail() {
 
 	_saveThumb = new Graphics::Surface();
 
-	if (_vm->getPlatform() != Common::kPlatform3DO) {
+	if (!IS_3DO) {
 		uint8 thumbPalette[PALETTE_SIZE];
 		_vm->_screen->getPalette(thumbPalette);
 		::createThumbnail(_saveThumb, (const byte *)_vm->_screen->getPixels(), SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT, thumbPalette);
diff --git a/engines/sherlock/scalpel/scalpel_map.cpp b/engines/sherlock/scalpel/scalpel_map.cpp
index bde56c8..2177fc5 100644
--- a/engines/sherlock/scalpel/scalpel_map.cpp
+++ b/engines/sherlock/scalpel/scalpel_map.cpp
@@ -142,7 +142,7 @@ int ScalpelMap::show() {
 
 	// Load the entire map
 	ImageFile *bigMap = NULL;
-	if (_vm->getPlatform() != Common::kPlatform3DO) {
+	if (!IS_3DO) {
 		// PC
 		bigMap = new ImageFile("bigmap.vgs");
 		screen.setPalette(bigMap->_palette);
@@ -154,7 +154,7 @@ int ScalpelMap::show() {
 	// Load need sprites
 	setupSprites();
 
-	if (_vm->getPlatform() != Common::kPlatform3DO) {
+	if (!IS_3DO) {
 		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));
@@ -220,7 +220,7 @@ int ScalpelMap::show() {
 			// Map has scrolled, so redraw new map view
 			changed = false;
 
-			if (_vm->getPlatform() != Common::kPlatform3DO) {
+			if (!IS_3DO) {
 				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));
@@ -300,7 +300,7 @@ void ScalpelMap::setupSprites() {
 	Scene &scene = *_vm->_scene;
 	_savedPos.x = -1;
 
-	if (_vm->getPlatform() != Common::kPlatform3DO) {
+	if (!IS_3DO) {
 		// PC
 		_mapCursors = new ImageFile("omouse.vgs");
 		_shapes = new ImageFile("mapicon.vgs");
diff --git a/engines/sherlock/scalpel/scalpel_people.cpp b/engines/sherlock/scalpel/scalpel_people.cpp
index 3c02eb4..af2bdc0 100644
--- a/engines/sherlock/scalpel/scalpel_people.cpp
+++ b/engines/sherlock/scalpel/scalpel_people.cpp
@@ -452,7 +452,7 @@ bool ScalpelPeople::loadWalk() {
 	if (_data[HOLMES]->_walkLoaded) {
 		return false;
 	} else {
-		if (_vm->getPlatform() != Common::kPlatform3DO) {
+		if (!IS_3DO) {
 			_data[HOLMES]->_images = new ImageFile("walk.vgs");
 		} else {
 			// Load walk.anim on 3DO, which is a cel animation file
diff --git a/engines/sherlock/scalpel/scalpel_scene.cpp b/engines/sherlock/scalpel/scalpel_scene.cpp
index af70903..1bda827 100644
--- a/engines/sherlock/scalpel/scalpel_scene.cpp
+++ b/engines/sherlock/scalpel/scalpel_scene.cpp
@@ -582,7 +582,7 @@ int ScalpelScene::startCAnim(int cAnimNum, int playRate) {
 		}
 
 		// Now load the resource as an image
-		if (_vm->getPlatform() != Common::kPlatform3DO) {
+		if (!IS_3DO) {
 			cObj._images = new ImageFile(fname);
 		} else {
 			cObj._images = new ImageFile3DO(fname, kImageFile3DOType_RoomFormat);
diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp
index 64904e0..5a2427c 100644
--- a/engines/sherlock/scalpel/scalpel_talk.cpp
+++ b/engines/sherlock/scalpel/scalpel_talk.cpp
@@ -543,7 +543,7 @@ void ScalpelTalk::talkWait(const byte *&str) {
 }
 
 void ScalpelTalk::talk3DOMovieTrigger(int subIndex) {
-	if (_vm->getPlatform() != Common::kPlatform3DO) {
+	if (!IS_3DO) {
 		// No 3DO? No movie!
 		return;
 	}
diff --git a/engines/sherlock/scalpel/scalpel_user_interface.cpp b/engines/sherlock/scalpel/scalpel_user_interface.cpp
index 14461cf..a4a898d 100644
--- a/engines/sherlock/scalpel/scalpel_user_interface.cpp
+++ b/engines/sherlock/scalpel/scalpel_user_interface.cpp
@@ -67,7 +67,7 @@ const char *const PRESS_KEY_TO_CONTINUE = "Press any Key to Continue.";
 
 ScalpelUserInterface::ScalpelUserInterface(SherlockEngine *vm): UserInterface(vm) {
 	if (_vm->_interactiveFl) {
-		if (_vm->getPlatform() != Common::kPlatform3DO) {
+		if (!IS_3DO) {
 			// PC
 			_controls = new ImageFile("menu.all");
 			_controlPanel = new ImageFile("controls.vgs");
diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp
index 633792a..3edac3c 100644
--- a/engines/sherlock/scene.cpp
+++ b/engines/sherlock/scene.cpp
@@ -337,7 +337,7 @@ bool Scene::loadScene(const Common::String &filename) {
 	// Load the room resource file for the scene
 	//
 
-	if (_vm->getPlatform() != Common::kPlatform3DO) {
+	if (!IS_3DO) {
 		// PC version
 		Common::String roomFilename = filename + ".rrm";
 		_roomFilename = roomFilename;
@@ -1262,7 +1262,7 @@ void Scene::transitionToScene() {
 
 	// Actually do the transition
 	if (screen._fadeStyle) {
-		if (_vm->getPlatform() != Common::kPlatform3DO) {
+		if (!IS_3DO) {
 			// do pixel-transition for PC
 			screen.randomTransition();
 		} else {
diff --git a/engines/sherlock/sound.cpp b/engines/sherlock/sound.cpp
index 32fa99b..b46eb67 100644
--- a/engines/sherlock/sound.cpp
+++ b/engines/sherlock/sound.cpp
@@ -126,7 +126,7 @@ bool Sound::playSound(const Common::String &name, WaitType waitType, int priorit
 
 	Common::String filename = name;
 	if (!filename.contains('.')) {
-		if (_vm->getPlatform() != Common::kPlatform3DO) {
+		if (!IS_3DO) {
 			if (IS_SERRATED_SCALPEL) {
 				filename += ".SND";
 			} else {
@@ -147,7 +147,7 @@ bool Sound::playSound(const Common::String &name, WaitType waitType, int priorit
 
 	Audio::AudioStream *audioStream;
 
-	if (_vm->getPlatform() != Common::kPlatform3DO) {
+	if (!IS_3DO) {
 		if (IS_SERRATED_SCALPEL) {
 			stream->skip(2);
 			int size = stream->readUint32BE();


Commit: 41575ad74e60308034f76907736cd6530a23579f
    https://github.com/scummvm/scummvm/commit/41575ad74e60308034f76907736cd6530a23579f
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2015-06-16T10:55:48+03:00

Commit Message:
SHERLOCK: SS: Fix the position of the user interface in the 3DO version

Changed paths:
    engines/sherlock/scalpel/scalpel_user_interface.cpp
    engines/sherlock/scalpel/scalpel_user_interface.h



diff --git a/engines/sherlock/scalpel/scalpel_user_interface.cpp b/engines/sherlock/scalpel/scalpel_user_interface.cpp
index a4a898d..4f3622b 100644
--- a/engines/sherlock/scalpel/scalpel_user_interface.cpp
+++ b/engines/sherlock/scalpel/scalpel_user_interface.cpp
@@ -61,6 +61,7 @@ const char COMMANDS[13] = "LMTPOCIUGJFS";
 const char INVENTORY_COMMANDS[9] = { "ELUG-+,." };
 const char *const PRESS_KEY_FOR_MORE = "Press any Key for More.";
 const char *const PRESS_KEY_TO_CONTINUE = "Press any Key to Continue.";
+const int UI_OFFSET_3DO = 16;	// (320 - 288) / 2
 
 /*----------------------------------------------------------------*/
 
@@ -110,10 +111,13 @@ void ScalpelUserInterface::reset() {
 void ScalpelUserInterface::drawInterface(int bufferNum) {
 	Screen &screen = *_vm->_screen;
 
+	const ImageFrame &src = (*_controlPanel)[0];
+	int16 x = (!IS_3DO) ? 0 : UI_OFFSET_3DO;
+
 	if (bufferNum & 1)
-		screen._backBuffer1.transBlitFrom((*_controlPanel)[0], Common::Point(0, CONTROLS_Y));
+		screen._backBuffer1.transBlitFrom(src, Common::Point(x, CONTROLS_Y));
 	if (bufferNum & 2)
-		screen._backBuffer2.transBlitFrom((*_controlPanel)[0], Common::Point(0, CONTROLS_Y));
+		screen._backBuffer2.transBlitFrom(src, Common::Point(x, CONTROLS_Y));
 	if (bufferNum == 3)
 		screen._backBuffer2.fillRect(0, INFO_LINE, SHERLOCK_SCREEN_WIDTH, INFO_LINE + 10, INFO_BLACK);
 }
@@ -374,6 +378,7 @@ void ScalpelUserInterface::handleInput() {
 void ScalpelUserInterface::depressButton(int num) {
 	Screen &screen = *_vm->_screen;
 	Common::Point pt(MENU_POINTS[num][0], MENU_POINTS[num][1]);
+	offsetButton3DO(pt, num);
 
 	ImageFrame &frame = (*_controls)[num];
 	screen._backBuffer1.transBlitFrom(frame, pt);
@@ -384,6 +389,8 @@ void ScalpelUserInterface::restoreButton(int num) {
 	Events &events = *_vm->_events;
 	Screen &screen = *_vm->_screen;
 	Common::Point pt(MENU_POINTS[num][0], MENU_POINTS[num][1]);
+	offsetButton3DO(pt, num);
+
 	Graphics::Surface &frame = (*_controls)[num]._frame;
 
 	// Reset the cursor
@@ -435,6 +442,7 @@ void ScalpelUserInterface::toggleButton(int num) {
 
 			ImageFrame &frame = (*_controls)[num];
 			Common::Point pt(MENU_POINTS[num][0], MENU_POINTS[num][1]);
+			offsetButton3DO(pt, num);
 			screen._backBuffer1.transBlitFrom(frame, pt);
 			screen.slamArea(pt.x, pt.y, pt.x + frame._width, pt.y + frame._height);
 		}
@@ -1206,6 +1214,7 @@ void ScalpelUserInterface::doLookControl() {
 			} else if (!_lookHelp) {
 				// Need to close the window and depress the Look button
 				Common::Point pt(MENU_POINTS[0][0], MENU_POINTS[0][1]);
+				offsetButton3DO(pt, 0);
 				screen._backBuffer2.blitFrom((*_controls)[0], pt);
 				banishWindow(true);
 
@@ -1264,6 +1273,10 @@ void ScalpelUserInterface::doMainControl() {
 		for (_temp = 0; (_temp < 12) && (_key == -1); ++_temp) {
 			Common::Rect r(MENU_POINTS[_temp][0], MENU_POINTS[_temp][1],
 				MENU_POINTS[_temp][2], MENU_POINTS[_temp][3]);
+			if (IS_3DO && _temp >= 0 && _temp <= 2) {
+				r.left += UI_OFFSET_3DO - 1;
+				r.right += UI_OFFSET_3DO - 1;
+			}
 			if (r.contains(pt))
 				_key = COMMANDS[_temp];
 		}
@@ -1795,6 +1808,7 @@ void ScalpelUserInterface::printObjectDesc(const Common::String &str, bool first
 				// menu area, and draw the controls onto it
 				Surface tempSurface((*_controls)[0]._frame.w, (*_controls)[0]._frame.h, _vm->getPlatform());
 				Common::Point pt(MENU_POINTS[0][0], MENU_POINTS[0][1]);
+				offsetButton3DO(pt, 0);
 
 				tempSurface.blitFrom(screen._backBuffer2, Common::Point(0, 0),
 					Common::Rect(pt.x, pt.y, pt.x + tempSurface.w(), pt.y + tempSurface.h()));
@@ -2157,6 +2171,17 @@ void ScalpelUserInterface::checkUseAction(const UseType *use, const Common::Stri
 	events.setCursor(ARROW);
 }
 
+void ScalpelUserInterface::offsetButton3DO(Common::Point &pt, int num) {
+	if (IS_3DO) {
+		if (num >= 0 && num <= 2)
+			pt.x += 15;
+		else if (num >= 6 && num <= 8)
+			pt.x -= 4;
+		else if (num >= 9 && num <= 11)
+			pt.x -= 8;
+	}
+}
+
 } // End of namespace Scalpel
 
 } // End of namespace Sherlock
diff --git a/engines/sherlock/scalpel/scalpel_user_interface.h b/engines/sherlock/scalpel/scalpel_user_interface.h
index 605bf48..224b2f8 100644
--- a/engines/sherlock/scalpel/scalpel_user_interface.h
+++ b/engines/sherlock/scalpel/scalpel_user_interface.h
@@ -167,6 +167,8 @@ public:
 	 * of the highlighted object
 	 */
 	void examine();
+
+	void offsetButton3DO(Common::Point &pt, int num);
 public:
 	/**
 	 * Resets the user interface






More information about the Scummvm-git-logs mailing list