[Scummvm-git-logs] scummvm master -> fb21c8ce21de94d495d6267db62d7c5b0a496ee7

bluegr noreply at scummvm.org
Sun Aug 27 06:40:44 UTC 2023


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:
8cb4047e32 BURIED: Fix incorrect flag for an 8bpp demo version
d589a51ae8 BURIED: Correctly handle paths for the North American demo
ffd5f4909a BURIED: Add the Skip support option for the demo versions
fb21c8ce21 BURIED: Implement the button pressed graphics in the demo menu


Commit: 8cb4047e32c98083faea4e4daeae7c31c7238329
    https://github.com/scummvm/scummvm/commit/8cb4047e32c98083faea4e4daeae7c31c7238329
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2023-08-27T09:40:38+03:00

Commit Message:
BURIED: Fix incorrect flag for an 8bpp demo version

Changed paths:
    engines/buried/detection_tables.h


diff --git a/engines/buried/detection_tables.h b/engines/buried/detection_tables.h
index 456b4c7a115..dcf2cba7d73 100644
--- a/engines/buried/detection_tables.h
+++ b/engines/buried/detection_tables.h
@@ -383,7 +383,7 @@ static const ADGameDescription gameDescriptions[] = {
 		AD_ENTRY1s("BIT816.EXE", "30bbd89d7df8cb319e654a441efce877", 1259072),
 		Common::EN_ANY,
 		Common::kPlatformWindows,
-		ADGF_DEMO | GF_TRUECOLOR,
+		ADGF_DEMO,
 		GUIO_GAME_DEMO
 	},
 


Commit: d589a51ae897491d044e7a359342b8dd9f740392
    https://github.com/scummvm/scummvm/commit/d589a51ae897491d044e7a359342b8dd9f740392
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2023-08-27T09:40:38+03:00

Commit Message:
BURIED: Correctly handle paths for the North American demo

Changed paths:
    engines/buried/buried.cpp


diff --git a/engines/buried/buried.cpp b/engines/buried/buried.cpp
index 9ce151789a9..ffeb8c36533 100644
--- a/engines/buried/buried.cpp
+++ b/engines/buried/buried.cpp
@@ -211,10 +211,16 @@ Common::String BuriedEngine::getFilePath(uint32 stringID) {
 	// We ignore this.
 	// In the demo, we remove the "BITDATA" prefix because the
 	// binaries are in the same directory.
-	if (isDemo())
-		i += 8;
-	else
+	// The North American demo also has paths that start with
+	// a backslash, while other demos don't.
+	if (isDemo()) {
+		if (path[0] == '\\')
+			i += 9;
+		else
+			i += 8;
+	} else {
 		i += 2;
+	}
 
 	for (; i < path.size(); i++) {
 		if (path[i] == '\\')


Commit: ffd5f4909abc74d5835ef5e7cf700917046e8a2a
    https://github.com/scummvm/scummvm/commit/ffd5f4909abc74d5835ef5e7cf700917046e8a2a
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2023-08-27T09:40:38+03:00

Commit Message:
BURIED: Add the Skip support option for the demo versions

Also marked the engine as not using MIDI.

Changed paths:
    engines/buried/detection.cpp
    engines/buried/detection.h


diff --git a/engines/buried/detection.cpp b/engines/buried/detection.cpp
index fe6b78cde0f..c4d9b6535f7 100644
--- a/engines/buried/detection.cpp
+++ b/engines/buried/detection.cpp
@@ -54,6 +54,7 @@ public:
 		Buried::gameDescriptions,
 		sizeof(ADGameDescription),
 		buriedGames) {
+		_guiOptions = GUIO2(GUIO_NOMIDI, GAMEOPTION_ALLOW_SKIP);
 		_flags = kADFlagUseExtraAsHint;
 		_maxScanDepth = 3;
 		_directoryGlobs = Buried::directoryGlobs;
diff --git a/engines/buried/detection.h b/engines/buried/detection.h
index d03311d2ebb..5c0e20b15fb 100644
--- a/engines/buried/detection.h
+++ b/engines/buried/detection.h
@@ -23,7 +23,7 @@
 #define BURIED_DETECTION_H
 
 #define GAMEOPTION_ALLOW_SKIP	GUIO_GAMEOPTIONS1
-#define GUIO_FULL_GAME			GUIO1(GAMEOPTION_ALLOW_SKIP)
+#define GUIO_FULL_GAME			GUIO0()
 #define GUIO_GAME_DEMO			GUIO1(GUIO_NOLAUNCHLOAD)
 
 #endif


Commit: fb21c8ce21de94d495d6267db62d7c5b0a496ee7
    https://github.com/scummvm/scummvm/commit/fb21c8ce21de94d495d6267db62d7c5b0a496ee7
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2023-08-27T09:40:38+03:00

Commit Message:
BURIED: Implement the button pressed graphics in the demo menu

Changed paths:
    engines/buried/demo/demo_menu.cpp
    engines/buried/demo/demo_menu.h
    engines/buried/graphics.cpp
    engines/buried/graphics.h


diff --git a/engines/buried/demo/demo_menu.cpp b/engines/buried/demo/demo_menu.cpp
index 6d08213e5c3..0424ecf6c8f 100644
--- a/engines/buried/demo/demo_menu.cpp
+++ b/engines/buried/demo/demo_menu.cpp
@@ -57,11 +57,20 @@ DemoMainMenuWindow::DemoMainMenuWindow(BuriedEngine *vm, Window *parent) : Windo
 	_gallery = Common::Rect(471, 155, 610, 325);
 	_quit = Common::Rect(552, 439, 640, 480);
 
-	if (_vm->isTrueColor())
+	if (_vm->isTrueColor()) {
 		_background = _vm->_gfx->getBitmap("MISC/24BPP/MAINMENU.BMP");
-	else
+
+		// These files don't exist in all demo versions
+		_mmbsel = _vm->_gfx->getBitmap("MISC/24BPP/MMB_SEL.BMP", false);
+		_mmbquit = _vm->_gfx->getBitmap("MISC/24BPP/MMB_QUIT.BMP", false);
+	} else {
 		_background = _vm->_gfx->getBitmap("MISC/8BPP/MAINMENU.BMP");
 
+		// These files don't exist in all demo versions
+		_mmbsel = _vm->_gfx->getBitmap("MISC/8BPP/MMB_SEL.BMP", false);
+		_mmbquit = _vm->_gfx->getBitmap("MISC/8BPP/MMB_QUIT.BMP", false);
+	}
+
 	_vm->_sound->setAmbientSound("MISC/MENULOOP.WAV");
 }
 
@@ -100,6 +109,33 @@ void DemoMainMenuWindow::showWithSplash() {
 
 void DemoMainMenuWindow::onPaint() {
 	_vm->_gfx->blit(_background, 0, 0);
+
+	switch (_curButton) {
+	case BUTTON_OVERVIEW:
+		if (_mmbsel)
+			_vm->_gfx->blit(_mmbsel, Common::Rect(0, 0, 139, 171), _overview);
+		break;
+
+	case BUTTON_TRAILER:
+		if (_mmbsel)
+			_vm->_gfx->blit(_mmbsel, Common::Rect(148, 0, 287, 171), _trailer);
+		break;
+
+	case BUTTON_INTERACTIVE:
+		if (_mmbsel)
+			_vm->_gfx->blit(_mmbsel, Common::Rect(295, 0, 434, 171), _interactive);
+		break;
+
+	case BUTTON_GALLERY:
+		if (_mmbsel)
+			_vm->_gfx->blit(_mmbsel, Common::Rect(442, 0, 610, 581), _gallery);
+		break;
+
+	case BUTTON_QUIT:
+		if (_mmbquit)
+			_vm->_gfx->blit(_mmbquit, 552, 439);
+		break;
+	}
 }
 
 bool DemoMainMenuWindow::onEraseBackground() {
@@ -108,28 +144,22 @@ bool DemoMainMenuWindow::onEraseBackground() {
 }
 
 void DemoMainMenuWindow::onLButtonDown(const Common::Point &point, uint flags) {
+	int lastButton = _curButton;
+
 	if (_overview.contains(point)) {
 		_curButton = BUTTON_OVERVIEW;
-		return;
-	}
-
-	if (_trailer.contains(point)) {
+	} else if (_trailer.contains(point)) {
 		_curButton = BUTTON_TRAILER;
-		return;
-	}
-
-	if (_interactive.contains(point)) {
+	} else if (_interactive.contains(point)) {
 		_curButton = BUTTON_INTERACTIVE;
-		return;
-	}
-
-	if (_gallery.contains(point)) {
+	} else if (_gallery.contains(point)) {
 		_curButton = BUTTON_GALLERY;
-		return;
+	} else if (_quit.contains(point)) {
+		_curButton = BUTTON_QUIT;
 	}
 
-	if (_quit.contains(point))
-		_curButton = BUTTON_QUIT;
+	if (_curButton != lastButton)
+		invalidateWindow(false);
 }
 
 void DemoMainMenuWindow::onLButtonUp(const Common::Point &point, uint flags) {
@@ -141,14 +171,16 @@ void DemoMainMenuWindow::onLButtonUp(const Common::Point &point, uint flags) {
 		if (_overview.contains(point)) {
 			_vm->_sound->setAmbientSound();
 			((FrameWindow *)_parent)->playMovie(_vm->isTrueColor() ? "MISC/24BPP/OVERVIEW.BMP" : "MISC/8BPP/OVERVIEW.BMP", "MISC/OVERVIEW.AVI", 160, 112);
+			return;
 		}
-		return;
+		break;
 	case BUTTON_TRAILER:
 		if (_trailer.contains(point)) {
 			_vm->_sound->setAmbientSound();
 			((FrameWindow *)_parent)->playMovie(_vm->isTrueColor() ? "MISC/24BPP/TRAILER.BMP" : "MISC/8BPP/TRAILER.BMP", "MISC/TRAILER.AVI", 104, 136);
+			return;
 		}
-		return;
+		break;
 	case BUTTON_INTERACTIVE:
 		if (_interactive.contains(point)) {
 			_vm->_sound->setAmbientSound();
@@ -158,18 +190,22 @@ void DemoMainMenuWindow::onLButtonUp(const Common::Point &point, uint flags) {
 				((FrameWindow *)_parent)->_reviewerMode = true;
 
 			((FrameWindow *)_parent)->startNewGame();
+			return;
 		}
-		return;
+		break;
 	case BUTTON_GALLERY:
 		if (_gallery.contains(point)) {
 			_vm->_sound->setAmbientSound();
 			((FrameWindow *)_parent)->playMovie(_vm->isTrueColor() ? "MISC/24BPP/GALLERY.BMP" : "MISC/8BPP/GALLERY.BMP", "MISC/GALLERY.AVI", 104, 136);
+			return;
 		}
-		return;
+		break;
 	case BUTTON_QUIT:
-		if (_quit.contains(point))
+		if (_quit.contains(point)) {
 			((FrameWindow *)_parent)->showFeaturesScreen();
-		return;
+			return;
+		}
+		break;
 	}
 
 	_curButton = 0;
diff --git a/engines/buried/demo/demo_menu.h b/engines/buried/demo/demo_menu.h
index 673a8de01fd..9f7cb9990c0 100644
--- a/engines/buried/demo/demo_menu.h
+++ b/engines/buried/demo/demo_menu.h
@@ -54,6 +54,8 @@ private:
 	int _curButton;
 	//bool _buttonDrawnDown;
 	Graphics::Surface *_background;
+	Graphics::Surface *_mmbsel;
+	Graphics::Surface *_mmbquit;
 };
 
 } // End of namespace Buried
diff --git a/engines/buried/graphics.cpp b/engines/buried/graphics.cpp
index bc8c545d42c..e8d0d69af8e 100644
--- a/engines/buried/graphics.cpp
+++ b/engines/buried/graphics.cpp
@@ -185,15 +185,21 @@ Graphics::Surface *GraphicsManager::getBitmap(uint32 bitmapID) {
 	return surface;
 }
 
-Graphics::Surface *GraphicsManager::getBitmap(const Common::String &fileName) {
+Graphics::Surface *GraphicsManager::getBitmap(const Common::String &fileName, bool required) {
 	Common::SeekableReadStream *stream = SearchMan.createReadStreamForMember(fileName);
 
-	if (!stream)
-		error("Could not find bitmap '%s'", fileName.c_str());
+	if (!stream) {
+		if (required)
+			error("Could not find bitmap '%s'", fileName.c_str());
+		return nullptr;
+	}
 
 	Graphics::Surface *surface = getBitmap(stream);
-	if (!surface)
-		error("Failed to decode bitmap '%s'", fileName.c_str());
+	if (!surface) {
+		if (required)
+			error("Failed to decode bitmap '%s'", fileName.c_str());
+		return nullptr;
+	}
 
 	return surface;
 }
diff --git a/engines/buried/graphics.h b/engines/buried/graphics.h
index 96ec573304c..fb79e248147 100644
--- a/engines/buried/graphics.h
+++ b/engines/buried/graphics.h
@@ -83,7 +83,7 @@ public:
 	Cursor setCursor(Cursor newCursor);
 	void toggleCursor(bool show);
 	Graphics::Surface *getBitmap(uint32 bitmapID);
-	Graphics::Surface *getBitmap(const Common::String &fileName);
+	Graphics::Surface *getBitmap(const Common::String &fileName, bool required = true);
 	uint32 getColor(byte r, byte g, byte b);
 
 	void invalidateRect(const Common::Rect &rect, bool erase = true);




More information about the Scummvm-git-logs mailing list