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

This commit is contained in:
Paul Gilbert 2020-12-02 19:12:54 -08:00
parent 6563c9fbac
commit 2b65096d63
4 changed files with 10 additions and 9 deletions

View File

@ -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)

View File

@ -79,6 +79,7 @@ protected:
Sentence _sentence;
char _inputLine[INPUT_LINE_SIZE];
int _inputLineIndex;
int _currentRoomCopy;
public:
const GameStrings *_gameStrings;

View File

@ -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]) {

View File

@ -38,7 +38,6 @@ private:
YesNo _noFloodfill, _lightOn;
int _stringVal1, _stringVal2;
bool _printComputerMsg, _shipNotWorking;
int _currentRoomCopy;
/**
* Randomizes a guard to different locations