[Scummvm-git-logs] scummvm master -> 3d434eea34cbbe9c45d8bcc15a8a4de42e25f970

bluegr noreply at scummvm.org
Sun Nov 15 18:47:42 UTC 2026


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

Summary:
67450a1200 BURIED: Use enum instead of raw ints for overview state management
3d434eea34 BURIED: Generalize Arial font height-to-point mapping


Commit: 67450a12007c74c0fa6f123e3f7685df1d172aaf
    https://github.com/scummvm/scummvm/commit/67450a12007c74c0fa6f123e3f7685df1d172aaf
Author: Kevin Howald (kevin.howald at gmail.com)
Date: 2026-11-15T20:47:37+02:00

Commit Message:
BURIED: Use enum instead of raw ints for overview state management

The game's tutorial runs a multi-phase overview of the game's UI.
This is managed as a state machine with several states. The code
previously tracked those states with raw ints. This refactoring
instead uses enums for clarity. This is pre-factoring for more
work in this file to add subtitle support.

Changed paths:
    engines/buried/overview.cpp


diff --git a/engines/buried/overview.cpp b/engines/buried/overview.cpp
index fb89cd0ea0c..e788078602b 100644
--- a/engines/buried/overview.cpp
+++ b/engines/buried/overview.cpp
@@ -33,9 +33,19 @@
 
 namespace Buried {
 
+enum OverviewState {
+	kOverviewStateNotStarted = -1,
+	kOverviewStateNavigation = 0,
+	kOverviewStateInventory = 1,
+	kOverviewStateBiochip = 2,
+	kOverviewStateMessages = 3,
+	kOverviewStateConclusion = 4,
+	kOverviewStateExit = 5
+};
+
 OverviewWindow::OverviewWindow(BuriedEngine *vm, Window *parent) : Window(vm, parent) {
 	_currentImage = nullptr;
-	_currentStatus = -1;
+	_currentStatus = kOverviewStateNotStarted;
 	_timer = 0xFFFFFFFF;
 
 	Common::Rect parentRect = _parent->getClientRect();
@@ -78,19 +88,25 @@ void OverviewWindow::onPaint() {
 
 	if (_currentImage) {
 		switch (_currentStatus) {
-		case 0: // Navigational buttons
+		case kOverviewStateNavigation:
+			// Navigational buttons
 			_vm->_gfx->blit(_currentImage, 498, 274);
 			break;
-		case 1: // Inventory buttons
+		case kOverviewStateInventory:
+			// Inventory buttons
 			_vm->_gfx->blit(_currentImage, 163, 352);
 			break;
-		case 2: // BioChip buttons
+		case kOverviewStateBiochip:
+			// BioChip buttons
 			_vm->_gfx->blit(_currentImage, 509, 89);
 			break;
-		case 3: // Message buttons
+		case kOverviewStateMessages:
+			// Message buttons
 			_vm->_gfx->blit(_currentImage, 93, 0);
 			break;
-		case 4: // Final info - no image to render to the screen
+		case kOverviewStateConclusion:
+			// Final info
+			// No image to render to the screen
 			break;
 		}
 	}
@@ -116,7 +132,7 @@ void OverviewWindow::onActionEnd(const Common::CustomEventType &action, uint fla
 void OverviewWindow::onTimer(uint timer) {
 	_vm->_sound->timerCallback();
 
-	if (_currentStatus >= 0 && _vm->_sound->isInterfaceSoundPlaying())
+	if (_currentStatus > kOverviewStateNotStarted && _vm->_sound->isInterfaceSoundPlaying())
 		return;
 
 	if (_currentImage) {
@@ -127,8 +143,8 @@ void OverviewWindow::onTimer(uint timer) {
 
 	// Switch on the current status in order to determine which action to take next
 	switch (_currentStatus) {
-	case -1: // Starting value - kick things off
-		_currentStatus = 0;
+	case kOverviewStateNotStarted: // Starting value - kick things off
+		_currentStatus = kOverviewStateNavigation;
 		_currentImage = _vm->_gfx->getBitmap(_vm->getFilePath(IDS_IF_OV_NAV_ARROWS_DIB));
 		invalidateRect(Common::Rect(498, 274, 640, 433), false);
 
@@ -136,8 +152,8 @@ void OverviewWindow::onTimer(uint timer) {
 		_vm->_sound->timerCallback();
 		_vm->_sound->playInterfaceSound(_vm->getFilePath(IDS_IF_OV_NAV_ARROWS_AUDIO));
 		break;
-	case 0: // Played initial stuff
-		_currentStatus = 1;
+	case kOverviewStateNavigation: // Played initial stuff
+		_currentStatus = kOverviewStateInventory;
 		_currentImage = _vm->_gfx->getBitmap(_vm->getFilePath(IDS_IF_OV_INVENTORY_DIB));
 		invalidateRect(Common::Rect(498, 274, 640, 433), false);
 		invalidateRect(Common::Rect(163, 352, 472, 472), false);
@@ -146,8 +162,8 @@ void OverviewWindow::onTimer(uint timer) {
 		_vm->_sound->timerCallback();
 		_vm->_sound->playInterfaceSound(_vm->getFilePath(IDS_IF_OV_INVENTORY_AUDIO));
 		break;
-	case 1:
-		_currentStatus = 2;
+	case kOverviewStateInventory:
+		_currentStatus = kOverviewStateBiochip;
 		_currentImage = _vm->_gfx->getBitmap(_vm->getFilePath(IDS_IF_OV_BIOCHIPS_DIB));
 		invalidateRect(Common::Rect(163, 352, 472, 472), false);
 		invalidateRect(Common::Rect(509, 89, 640, 275), false);
@@ -156,8 +172,8 @@ void OverviewWindow::onTimer(uint timer) {
 		_vm->_sound->timerCallback();
 		_vm->_sound->playInterfaceSound(_vm->getFilePath(IDS_IF_OV_BIOCHIPS_AUDIO));
 		break;
-	case 2:
-		_currentStatus = 3;
+	case kOverviewStateBiochip:
+		_currentStatus = kOverviewStateMessages;
 		_currentImage = _vm->_gfx->getBitmap(_vm->getFilePath(IDS_IF_OV_MESSAGE_BOX_DIB));
 		invalidateRect(Common::Rect(509, 89, 640, 275), false);
 		invalidateRect(Common::Rect(93, 0, 482, 108), false);
@@ -166,16 +182,16 @@ void OverviewWindow::onTimer(uint timer) {
 		_vm->_sound->timerCallback();
 		_vm->_sound->playInterfaceSound(_vm->getFilePath(IDS_IF_OV_MESSAGE_BOX_AUDIO));
 		break;
-	case 3:
-		_currentStatus = 4;
+	case kOverviewStateMessages:
+		_currentStatus = kOverviewStateConclusion;
 		invalidateRect(Common::Rect(93, 0, 482, 108), false);
 
 		_vm->_sound->stopInterfaceSound();
 		_vm->_sound->timerCallback();
 		_vm->_sound->playInterfaceSound(_vm->getFilePath(IDS_IF_OV_FURTHER_INFO_AUDIO));
 		break;
-	case 4:
-		_currentStatus = 5;
+	case kOverviewStateConclusion:
+		_currentStatus = kOverviewStateExit;
 		((FrameWindow *)_parent)->returnToMainMenu();
 		break;
 	}


Commit: 3d434eea34cbbe9c45d8bcc15a8a4de42e25f970
    https://github.com/scummvm/scummvm/commit/3d434eea34cbbe9c45d8bcc15a8a4de42e25f970
Author: Kevin Howald (kevin.howald at gmail.com)
Date: 2026-11-15T20:47:37+02:00

Commit Message:
BURIED: Generalize Arial font height-to-point mapping

Allow createArialFont() to compute point sizes for arbitrary pixel heights and bold variants instead of calling error(), and remove unused includes.

Changed paths:
    engines/buried/graphics.cpp


diff --git a/engines/buried/graphics.cpp b/engines/buried/graphics.cpp
index 9513ed0fc1d..95eda8900fc 100644
--- a/engines/buried/graphics.cpp
+++ b/engines/buried/graphics.cpp
@@ -26,7 +26,6 @@
 #include "common/fs.h"
 #include "common/str-array.h"
 #include "common/system.h"
-#include "common/compression/unzip.h"
 #include "graphics/cursorman.h"
 #include "graphics/font.h"
 #include "graphics/paletteman.h"
@@ -85,24 +84,22 @@ Graphics::Font *GraphicsManager::createArialFont(int size, bool bold) const {
 
 	Common::SeekableReadStream *stream = SearchMan.createReadStreamForMember(defaultBaseName);
 
-	// Map the heights needed to point sizes
-	if (bold) {
-		if (size != 20)
-			error("Unhandled Arial Bold height %d", size);
-
+	// Map requested pixel height to point size
+	switch (size) {
+	case 12:
+	case 13:
+		size = 7;
+		break;
+	case 14:
+		size = 8;
+		break;
+	case 20:
 		size = 12;
-	} else {
-		switch (size) {
-		case 12:
-		case 13:
-			size = 7;
-			break;
-		case 14:
-			size = 8;
-			break;
-		default:
-			error("Unhandled Arial height %d", size);
-		}
+		break;
+	default:
+		size = size * 8 / 14;
+		size = MAX(size, 6);
+		break;
 	}
 
 	// TODO: Make the monochrome mode optional




More information about the Scummvm-git-logs mailing list