diff options
author | Joseph-Eugene Winzer | 2017-08-25 16:15:55 +0200 |
---|---|---|
committer | Thierry Crozat | 2018-01-23 01:47:01 +0000 |
commit | 714b38dde4e016f5b474d6fc4846008b13579162 (patch) | |
tree | c8c85cc50fce08f964c1dbbb905ec3f4ea3b3e4b /engines | |
parent | 3284fbc657700bd557d8f8023f9e6cc8bb173812 (diff) | |
download | scummvm-rg350-714b38dde4e016f5b474d6fc4846008b13579162.tar.gz scummvm-rg350-714b38dde4e016f5b474d6fc4846008b13579162.tar.bz2 scummvm-rg350-714b38dde4e016f5b474d6fc4846008b13579162.zip |
SUPERNOVA: Fixes dimming when ship energy low
roomBrightness() saw the greatest change by ripping out dimColors().
I compared the result with the original game and I cannot see any
difference by just reducing the palette brightness to 60%.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/supernova/state.cpp | 89 |
1 files changed, 12 insertions, 77 deletions
diff --git a/engines/supernova/state.cpp b/engines/supernova/state.cpp index d4611f2c86..d236019adf 100644 --- a/engines/supernova/state.cpp +++ b/engines/supernova/state.cpp @@ -21,6 +21,7 @@ */ #include "common/system.h" +#include "graphics/palette.h" #include "supernova/supernova.h" #include "supernova/state.h" @@ -690,24 +691,19 @@ int GameManager::dialog(int num, byte *rowLength[], const char **text[6], int nu } void GameManager::turnOff() { - if (_state._powerOff) - return; - _state._powerOff = true; - roomBrightness(); - } + void GameManager::turnOn() { if (!_state._powerOff) return; _state._powerOff = false; - _vm->paletteBrightness(); - Room *room = _rooms[SLEEP]; - room->setSectionVisible(1, false); - room->setSectionVisible(2, false); - room = _rooms[COCKPIT]; - room->setSectionVisible(22, false); + _vm->_brightness = 255; +// _vm->paletteBrightness(); + _rooms[SLEEP]->setSectionVisible(1, false); + _rooms[SLEEP]->setSectionVisible(2, false); + _rooms[COCKPIT]->setSectionVisible(22, false); } void GameManager::takeObject(Object &obj) { @@ -815,70 +811,13 @@ void GameManager::mouseWait(int delay) { // STUB } -static void dimColor(SupernovaEngine *vm, int color) { - color -= 16; - color *= 3; - // TODO: alters palette image data permanently (get system palette instead?) - vm->_currentImage->_palette[color + 0] = vm->_currentImage->_palette[color + 0] * 3 / 5; - vm->_currentImage->_palette[color + 1] = vm->_currentImage->_palette[color + 1] * 3 / 5; - vm->_currentImage->_palette[color + 2] = vm->_currentImage->_palette[color + 2] * 3 / 5; -} - void GameManager::roomBrightness() { - const byte specialColors[2][18] = { - {0x42, 0x49, 0x55, 0x68, 0x50, 0x5d, 0x3c, 1}, - {0x85, 0x91, 0x99, 0x92, 0x9b, 0x96, 0x9a, 0xa6, - 0xb0, 0xb4, 0xb5, 0xc2, 0xd1, 0xbe, 0xb6, 0xa8, - 0x6b, 1} - }; - char sf; - int i; - if ((_currentRoom == _rooms[HOLD]) && (_state._benOverlay == 1)) { - if (_state._powerOff) { - for (int f = 16; f < 255; f++) { - i = 0; - do { - sf = specialColors[0][i] - 1; - i++; - } while (sf && (sf != f)); - if (!sf) - dimColor(_vm, f); - } - } - if (!(_state._landingModuleEnergyDaysLeft && _rooms[LANDINGMODULE]->isSectionVisible(7))) { - i = 0; - while (sf = specialColors[0][i] - 1) { - dimColor(_vm, sf); - i++; - }; - } - } else if ((_currentRoom == _rooms[LANDINGMODULE]) && (_state._benOverlay == 1)) { - if (!(_state._landingModuleEnergyDaysLeft && _rooms[LANDINGMODULE]->isSectionVisible(7))) { - for (int f = 16; f < 255; f++) { - i=0; - do { - sf = specialColors[1][i] - 1; - i++; - } while (sf && (sf != f)); - if (!sf) - dimColor(_vm, f); - } - } - if (_state._powerOff) { - i=0; - while (sf = specialColors[1][i] - 1) { - dimColor(_vm, sf); - i++; - }; - } - } else if ((_currentRoom == _rooms[CAVE]) && (_state._benOverlay == 1)) { - _vm->_brightness = 0; - } else if ((_currentRoom != _rooms[OUTSIDE]) && - (_currentRoom < _rooms[ROCKS]) && (_state._benOverlay == 1)) { + if ((_currentRoom != _rooms[OUTSIDE]) && (_currentRoom < _rooms[ROCKS]) ) { if (_state._powerOff) - for (int f = 16; f < 255; f++) - dimColor(_vm, f); - } else if ((_currentRoom == _rooms[GUARD3]) && (_state._benOverlay == 2)) { + _vm->_brightness = 153; + } else if ((_currentRoom == _rooms[CAVE])) { + _vm->_brightness = 0; + } else if ((_currentRoom == _rooms[GUARD3])) { if (_state._powerOff) _vm->_brightness = 0; } @@ -1559,10 +1498,6 @@ void GameManager::executeRoom() { drawCommandBox(); } roomBrightness(); - if (_vm->_brightness == 0) - _vm->paletteFadeIn(); - else - _vm->paletteBrightness(); if (!_currentRoom->hasSeen()) _currentRoom->onEntrance(); } |