[Scummvm-git-logs] scummvm master -> 2e68e44af5945da1d37f0debfa928c0aa845e831

neuromancer noreply at scummvm.org
Fri Dec 23 00:56:56 UTC 2022


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

Summary:
2e68e44af5 FREESCAPE: allow user to select different options in the drawInfoMenu implementation for Driller


Commit: 2e68e44af5945da1d37f0debfa928c0aa845e831
    https://github.com/scummvm/scummvm/commit/2e68e44af5945da1d37f0debfa928c0aa845e831
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2022-12-22T21:55:29-03:00

Commit Message:
FREESCAPE: allow user to select different options in the drawInfoMenu implementation for Driller

Changed paths:
    engines/freescape/games/driller.cpp


diff --git a/engines/freescape/games/driller.cpp b/engines/freescape/games/driller.cpp
index a72ff4d7743..cc6aea9d61a 100644
--- a/engines/freescape/games/driller.cpp
+++ b/engines/freescape/games/driller.cpp
@@ -688,6 +688,7 @@ void DrillerEngine::drawAmigaAtariSTUI(Graphics::Surface *surface) {
 }
 
 void DrillerEngine::drawInfoMenu() {
+	_savedScreen = _gfx->getScreenshot();
 
 	uint32 color = _gfx->_texturePixelFormat.ARGBToColor(0x00, 0x00, 0x00, 0x00);
 	Graphics::Surface *surface = new Graphics::Surface();
@@ -742,9 +743,10 @@ void DrillerEngine::drawInfoMenu() {
 	drawStringInSurface(Common::String::format("%13s : %d", "total sectors", 18), 84, 73, front, black, surface);
 	drawStringInSurface(Common::String::format("%13s : %d", "safe sectors", _gameStateVars[32]), 84, 81, front, black, surface);
 
-	_uiTexture->update(surface);
-
+	drawStringInSurface("l-load s-save esc-terminate", 53, 97, front, black, surface);
+	drawStringInSurface("t-toggle sound on/off", 76, 105, front, black, surface);
 
+	_uiTexture->update(surface);
 	_gfx->setViewport(_fullscreenViewArea);
 	_gfx->drawTexturedRect2D(_fullscreenViewArea, _fullscreenViewArea, _uiTexture);
 	_gfx->setViewport(_viewArea);
@@ -752,8 +754,41 @@ void DrillerEngine::drawInfoMenu() {
 	_gfx->flipBuffer();
 	g_system->updateScreen();
 
-	g_system->delayMillis(10000);
+	Common::Event event;
+	bool cont = true;
+	while (!shouldQuit() && cont) {
+		while (g_system->getEventManager()->pollEvent(event)) {
+
+			// Events
+			switch (event.type) {
+			case Common::EVENT_KEYDOWN:
+				if (event.kbd.keycode == Common::KEYCODE_l) {
+					_gfx->setViewport(_fullscreenViewArea);
+					loadGameDialog();
+					_gfx->setViewport(_viewArea);
+				} else if (event.kbd.keycode == Common::KEYCODE_s) {
+					_gfx->setViewport(_fullscreenViewArea);
+					saveGameDialog();
+					_gfx->setViewport(_viewArea);
+				} else if (event.kbd.keycode == Common::KEYCODE_t) {
+					// TODO
+				} else
+					cont = false;
+				break;
+			case Common::EVENT_SCREEN_CHANGED:
+				_gfx->computeScreenViewport();
+				// TODO: properly refresh screen
+				break;
+
+			default:
+				break;
+			}
+		}
+		g_system->delayMillis(10);
+	}
 
+	_savedScreen->free();
+	delete _savedScreen;
 	surface->free();
 	delete surface;
 }




More information about the Scummvm-git-logs mailing list