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

dreammaster paulfgilbert at gmail.com
Thu Dec 3 03:13:18 UTC 2020


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:
2b65096d63 GLK: COMPREHEND: Fix showing OO-Topos dark rooms as black


Commit: 2b65096d63e7e4ab175fdaae85f2d04b4514506e
    https://github.com/scummvm/scummvm/commit/2b65096d63e7e4ab175fdaae85f2d04b4514506e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-12-02T19:13:06-08:00

Commit Message:
GLK: COMPREHEND: Fix showing OO-Topos dark rooms as black

Changed paths:
    engines/glk/comprehend/game.cpp
    engines/glk/comprehend/game.h
    engines/glk/comprehend/game_oo.cpp
    engines/glk/comprehend/game_oo.h


diff --git a/engines/glk/comprehend/game.cpp b/engines/glk/comprehend/game.cpp
index 83555b661a..67f0df825b 100644
--- a/engines/glk/comprehend/game.cpp
+++ b/engines/glk/comprehend/game.cpp
@@ -116,7 +116,7 @@ void Sentence::format() {
 
 
 ComprehendGame::ComprehendGame() : _gameStrings(nullptr), _ended(false),
-		_nounState(NOUNSTATE_INITIAL), _inputLineIndex(0) {
+		_nounState(NOUNSTATE_INITIAL), _inputLineIndex(0), _currentRoomCopy(-1) {
 	Common::fill(&_inputLine[0], &_inputLine[INPUT_LINE_SIZE], 0);
 }
 
@@ -389,7 +389,7 @@ void ComprehendGame::update_graphics() {
 	if (!g_comprehend->isGraphicsEnabled())
 		return;
 
-	type = roomIsSpecial(_currentRoom, NULL);
+	type = roomIsSpecial(_currentRoomCopy, NULL);
 
 	switch (type) {
 	case ROOM_IS_DARK:
@@ -790,6 +790,9 @@ void ComprehendGame::parse_sentence_word_pairs(Sentence *sentence) {
 }
 
 void ComprehendGame::doBeforeTurn() {
+	// Make  a copy of the current room
+	_currentRoomCopy = _currentRoom;
+
 	beforeTurn();
 
 	if (!_ended)
diff --git a/engines/glk/comprehend/game.h b/engines/glk/comprehend/game.h
index 8bb824d221..a8b96d15d1 100644
--- a/engines/glk/comprehend/game.h
+++ b/engines/glk/comprehend/game.h
@@ -79,6 +79,7 @@ protected:
 	Sentence _sentence;
 	char _inputLine[INPUT_LINE_SIZE];
 	int _inputLineIndex;
+	int _currentRoomCopy;
 public:
 	const GameStrings *_gameStrings;
 
diff --git a/engines/glk/comprehend/game_oo.cpp b/engines/glk/comprehend/game_oo.cpp
index 7df35ef6f9..7807454ed9 100644
--- a/engines/glk/comprehend/game_oo.cpp
+++ b/engines/glk/comprehend/game_oo.cpp
@@ -44,7 +44,7 @@ enum OOToposFlag {
 	OO_FLAG_44 = 44,
 	OO_FLAG_SUFFICIENT_FUEL = 51,
 	OO_FLAG_REVERSE_VIDEO = 53,	// Effect of wearing goggles
-	OO_FLAG_55 = 55,
+	OO_FLAG_TOO_DARK = 55,
 	OO_FLAG_TOO_BRIGHT = 56,
 	OO_FLAG_58 = 58,
 	OO_FLAG_59 = 59,
@@ -62,7 +62,7 @@ static const GameStrings OO_STRINGS = {
 
 OOToposGame::OOToposGame() : ComprehendGameV2(), _restartMode(RESTART_IMMEDIATE),
 		_noFloodfill(UNSET), _lightOn(UNSET), _stringVal1(0), _stringVal2(0),
-		_printComputerMsg(true), _shipNotWorking(false), _currentRoomCopy(-1) {
+		_printComputerMsg(true), _shipNotWorking(false) {
 	_gameDataFile = "g0";
 
 	// Extra strings are (annoyingly) stored in the game binary
@@ -123,10 +123,8 @@ int OOToposGame::roomIsSpecial(unsigned room_index, unsigned *roomDescString) {
 void OOToposGame::beforeTurn() {
 	ComprehendGameV2::beforeTurn();
 
-	// Make  a copy of the current room
-	_currentRoomCopy = _currentRoom;
-
-	if (_flags[OO_FLAG_55]) {
+	if (_flags[OO_FLAG_TOO_DARK]) {
+		// Show placeholder room if room is too dark
 		_currentRoom = 55;
 		_updateFlags |= UPDATE_GRAPHICS;
 	} else if (_flags[OO_FLAG_TOO_BRIGHT]) {
diff --git a/engines/glk/comprehend/game_oo.h b/engines/glk/comprehend/game_oo.h
index a7f67a1376..fe2fe1091a 100644
--- a/engines/glk/comprehend/game_oo.h
+++ b/engines/glk/comprehend/game_oo.h
@@ -38,7 +38,6 @@ private:
 	YesNo _noFloodfill, _lightOn;
 	int _stringVal1, _stringVal2;
 	bool _printComputerMsg, _shipNotWorking;
-	int _currentRoomCopy;
 
 	/**
 	 * Randomizes a guard to different locations




More information about the Scummvm-git-logs mailing list