From 975cc8075d89f91309c35adf778bb286ccc7d84e Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 20 Jun 2013 22:08:01 -0400 Subject: VOYEUR: Fixed colours of lock screen text display --- engines/voyeur/utils.cpp | 2 +- engines/voyeur/voyeur.cpp | 40 ++++++++++++++++++++++++---------------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/engines/voyeur/utils.cpp b/engines/voyeur/utils.cpp index a5745e67cb..5c861389d9 100644 --- a/engines/voyeur/utils.cpp +++ b/engines/voyeur/utils.cpp @@ -49,7 +49,7 @@ void LockClass::saveThePassword() { } Common::String LockClass::getDateString() { - return Common::String(); + return Common::String("ScummVM"); } } // End of namespace Voyeur diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp index 5afc46152e..c969acd7c2 100644 --- a/engines/voyeur/voyeur.cpp +++ b/engines/voyeur/voyeur.cpp @@ -208,7 +208,6 @@ bool VoyeurEngine::doLock() { PictureResource *cursorPic; byte *keyData; int keyCount; - Common::String msg; int key; if (_bVoy->getBoltGroup(0x10700)) { @@ -239,10 +238,10 @@ bool VoyeurEngine::doLock() { _eventsManager.delay(1); _eventsManager.setCursorTo(127, 0); - _graphicsManager.setColor(1, 0x40, 0x40, 0x40); - _graphicsManager.setColor(2, 0x60, 0x60, 0x60); - _graphicsManager.setColor(3, 0x0A, 0xA0, 0x0A); - _graphicsManager.setColor(4, 0x0E, 0xE0, 0x0E); + _graphicsManager.setColor(1, 64, 64, 64); + _graphicsManager.setColor(2, 96, 96, 96); + _graphicsManager.setColor(3, 160, 160, 160); + _graphicsManager.setColor(4, 224, 224, 224); _eventsManager._intPtr. field38 = 1; _eventsManager._intPtr._hasPalette = true; @@ -252,9 +251,9 @@ bool VoyeurEngine::doLock() { _graphicsManager._fontPtr->_fontFlags = 0; Common::String dateString = lock.getDateString(); - msg = "16:49 8/12"; - Common::String playString = Common::String::format("Last Play %s", msg.c_str()); + Common::String displayString = Common::String::format("Last Play %s", dateString.c_str()); + bool firstLoop = true; bool breakFlag = false; while (!breakFlag && !shouldQuit()) { (*_graphicsManager._vPort)->setupViewPort(); @@ -268,11 +267,16 @@ bool VoyeurEngine::doLock() { _graphicsManager._fontPtr->_justifyWidth = 384; _graphicsManager._fontPtr->_justifyHeight = 97; - (*_graphicsManager._vPort)->drawText(playString); + (*_graphicsManager._vPort)->drawText(displayString); (*_graphicsManager._vPort)->_parent->_flags |= DISPFLAG_8; _graphicsManager.flipPage(); _eventsManager.sWaitFlip(); + if (firstLoop) { + firstLoop = false; + displayString = ""; + } + // Loop for getting key presses do { do { @@ -319,32 +323,36 @@ bool VoyeurEngine::doLock() { // Process the key if (key < 10) { - if (playString.size() < 10) { - playString += '0' + key; + // Numeric key + if (displayString.size() < 10) { + displayString += '0' + key; continue; } } else if (key == 10) { + // Accept key if (!flag) { - if ((password.size() == 0 && !playString.size()) || (password == playString)) { + if ((password.empty() && displayString.empty()) || (password == displayString)) { breakFlag = true; result = true; break; } } else { - if (playString.size() > 0) { - result = 1; + if (displayString.size() > 0) { + result = true; breakFlag = true; break; } } } else if (key == 11) { - if ((password.size() == 0 && !playString.size()) || (password != playString)) { + // New code + if ((password.empty() && displayString.empty()) || (password != displayString)) { (*_graphicsManager._vPort)->setupViewPort(); flag = true; - playString = ""; + displayString = ""; continue; } } else if (key == 12) { + // Exit keyword breakFlag = true; result = false; break; @@ -362,7 +370,7 @@ bool VoyeurEngine::doLock() { _graphicsManager.resetPalette(); if (flag && result) - lock._password = msg; + lock._password = displayString; lock.saveThePassword(); _voy._eventTable[999]._data = NULL; -- cgit v1.2.3