diff options
Diffstat (limited to 'engines/bladerunner/ui')
-rw-r--r-- | engines/bladerunner/ui/esper.cpp | 163 | ||||
-rw-r--r-- | engines/bladerunner/ui/kia.cpp | 1004 | ||||
-rw-r--r-- | engines/bladerunner/ui/kia_section_base.h | 1 | ||||
-rw-r--r-- | engines/bladerunner/ui/kia_section_clues.cpp | 1 | ||||
-rw-r--r-- | engines/bladerunner/ui/kia_section_crimes.cpp | 35 | ||||
-rw-r--r-- | engines/bladerunner/ui/kia_section_settings.cpp | 54 | ||||
-rw-r--r-- | engines/bladerunner/ui/kia_section_suspects.cpp | 26 | ||||
-rw-r--r-- | engines/bladerunner/ui/ui_image_picker.cpp | 1 |
8 files changed, 640 insertions, 645 deletions
diff --git a/engines/bladerunner/ui/esper.cpp b/engines/bladerunner/ui/esper.cpp index 3efbcf4832..3df6f7d11b 100644 --- a/engines/bladerunner/ui/esper.cpp +++ b/engines/bladerunner/ui/esper.cpp @@ -29,7 +29,6 @@ #include "bladerunner/decompress_lcw.h" #include "bladerunner/font.h" #include "bladerunner/game_info.h" -#include "bladerunner/game_constants.h" #include "bladerunner/mouse.h" #include "bladerunner/shape.h" #include "bladerunner/script/esper.h" @@ -568,92 +567,92 @@ void ESPER::draw(Graphics::Surface &surface) { } _vqaMainPlayer->update(false); switch (_stateMain) { - case kEsperMainStateOpening: - case kEsperMainStateList: - return; - case kEsperMainStatePhotoOpening: - drawPhotoOpening(surface); - break; - case kEsperMainStateClear: - surface.fillRect(_screen, 0x0000); - break; - case kEsperMainStatePhoto: - if (_isScrolling) { - tickScroll(); + case kEsperMainStateOpening: + case kEsperMainStateList: + return; + case kEsperMainStatePhotoOpening: + drawPhotoOpening(surface); + break; + case kEsperMainStateClear: + surface.fillRect(_screen, 0x0000); + break; + case kEsperMainStatePhoto: + if (_isScrolling) { + tickScroll(); + } + switch (_statePhoto) { + case kEsperPhotoStateShow: + drawPhotoWithGrid(surface); + if (_isDrawingSelection) { + drawSelection(surface, true, 1); } - switch (_statePhoto) { - case kEsperPhotoStateShow: - drawPhotoWithGrid(surface); - if (_isDrawingSelection) { - drawSelection(surface, true, 1); - } #if BLADERUNNER_DEBUG_RENDERING - for (int i = 0; i < kRegionCount; ++i) { - if (_regions[i].isPresent) { - surface.frameRect( - Common::Rect( - viewportXToScreenX(_regions[i].rectInner.left), - viewportYToScreenY(_regions[i].rectInner.top), - viewportXToScreenX(_regions[i].rectInner.right), - viewportYToScreenY(_regions[i].rectInner.bottom) - ), - 0x7FE0 - ); - surface.frameRect( - Common::Rect( - viewportXToScreenX(_regions[i].rectOuter.left), - viewportYToScreenY(_regions[i].rectOuter.top), - viewportXToScreenX(_regions[i].rectOuter.right), - viewportYToScreenY(_regions[i].rectOuter.bottom) - ), - 0x7FE0 - ); - } - } + for (int i = 0; i < kRegionCount; ++i) { + if (_regions[i].isPresent) { + surface.frameRect( + Common::Rect( + viewportXToScreenX(_regions[i].rectInner.left), + viewportYToScreenY(_regions[i].rectInner.top), + viewportXToScreenX(_regions[i].rectInner.right), + viewportYToScreenY(_regions[i].rectInner.bottom) + ), + 0x7FE0 + ); + surface.frameRect( + Common::Rect( + viewportXToScreenX(_regions[i].rectOuter.left), + viewportYToScreenY(_regions[i].rectOuter.top), + viewportXToScreenX(_regions[i].rectOuter.right), + viewportYToScreenY(_regions[i].rectOuter.bottom) + ), + 0x7FE0 + ); + } + } #endif - break; - case kEsperPhotoStateScrolling: - scrollUpdate(); - drawPhotoWithGrid(surface); - break; - case kEsperPhotoStateSelectionZooming: - drawPhotoWithGrid(surface); - if (!drawSelectionZooming(surface)) { - setStatePhoto(kEsperPhotoStateSelectionBlinking); - playSound(418, 25); - } - break; - case kEsperPhotoStateSelectionBlinking: - drawPhotoWithGrid(surface); - if (!drawSelectionBlinking(surface)) { - setStatePhoto(kEsperPhotoStatePhotoZooming); - } - break; - case kEsperPhotoStatePhotoZooming: - drawPhotoZooming(surface); - break; - case kEsperPhotoStatePhotoSharpening: - drawPhotoSharpening(surface); - break; - case kEsperPhotoStatePhotoZoomOut: - drawPhotoZoomOut(surface); - break; - case kEsperPhotoStateVideoZooming: - drawVideoZooming(surface); - break; - case kEsperPhotoStateVideoShow: - drawVideoFrame(surface); - drawGrid(surface); - break; - case kEsperPhotoStateVideoZoomOut: - drawVideoZoomOut(surface); - break; - default: - break; + break; + case kEsperPhotoStateScrolling: + scrollUpdate(); + drawPhotoWithGrid(surface); + break; + case kEsperPhotoStateSelectionZooming: + drawPhotoWithGrid(surface); + if (!drawSelectionZooming(surface)) { + setStatePhoto(kEsperPhotoStateSelectionBlinking); + playSound(418, 25); } - drawTextCoords(surface); - break; + case kEsperPhotoStateSelectionBlinking: + drawPhotoWithGrid(surface); + if (!drawSelectionBlinking(surface)) { + setStatePhoto(kEsperPhotoStatePhotoZooming); + } + break; + case kEsperPhotoStatePhotoZooming: + drawPhotoZooming(surface); + break; + case kEsperPhotoStatePhotoSharpening: + drawPhotoSharpening(surface); + break; + case kEsperPhotoStatePhotoZoomOut: + drawPhotoZoomOut(surface); + break; + case kEsperPhotoStateVideoZooming: + drawVideoZooming(surface); + break; + case kEsperPhotoStateVideoShow: + drawVideoFrame(surface); + drawGrid(surface); + break; + case kEsperPhotoStateVideoZoomOut: + drawVideoZoomOut(surface); + break; + default: + break; + } + drawTextCoords(surface); + + break; } } diff --git a/engines/bladerunner/ui/kia.cpp b/engines/bladerunner/ui/kia.cpp index 7563816f0f..729bec8d84 100644 --- a/engines/bladerunner/ui/kia.cpp +++ b/engines/bladerunner/ui/kia.cpp @@ -138,17 +138,17 @@ void KIA::open(KIASections sectionId) { } switch (_currentSectionId) { - case kKIASectionCrimes: - _crimesSection->saveToLog(); - break; - case kKIASectionSuspects: - _suspectsSection->saveToLog(); - break; - case kKIASectionClues: - _cluesSection->saveToLog(); - break; - default: - break; + case kKIASectionCrimes: + _crimesSection->saveToLog(); + break; + case kKIASectionSuspects: + _suspectsSection->saveToLog(); + break; + case kKIASectionClues: + _cluesSection->saveToLog(); + break; + default: + break; } if (sectionId != kKIASectionCrimes && sectionId != kKIASectionSuspects && sectionId != kKIASectionClues) { @@ -443,52 +443,52 @@ void KIA::handleKeyDown(const Common::KeyState &kbd) { return; } switch (kbd.keycode) { - case Common::KEYCODE_F1: - open(kKIASectionHelp); - break; - case Common::KEYCODE_F2: + case Common::KEYCODE_F1: + open(kKIASectionHelp); + break; + case Common::KEYCODE_F2: + if (!_forceOpen) { + open(kKIASectionSave); + } + break; + case Common::KEYCODE_F3: + open(kKIASectionLoad); + break; + case Common::KEYCODE_F10: + open(kKIASectionQuit); + break; + case Common::KEYCODE_F4: + if (_currentSectionId != kKIASectionCrimes) { if (!_forceOpen) { - open(kKIASectionSave); - } - break; - case Common::KEYCODE_F3: - open(kKIASectionLoad); - break; - case Common::KEYCODE_F10: - open(kKIASectionQuit); - break; - case Common::KEYCODE_F4: - if (_currentSectionId != kKIASectionCrimes) { - if (!_forceOpen) { - open(kKIASectionCrimes); - _log->next(); - _log->clearFuture(); - } - } - break; - case Common::KEYCODE_F5: - if (_currentSectionId != kKIASectionSuspects) { - if (_forceOpen) { - open(kKIASectionSuspects); - _log->next(); - _log->clearFuture(); - } + open(kKIASectionCrimes); + _log->next(); + _log->clearFuture(); } - break; - case Common::KEYCODE_F6: - if (_currentSectionId != kKIASectionClues) { - if (!_forceOpen) { - open(kKIASectionClues); - _log->next(); - _log->clearFuture(); - } + } + break; + case Common::KEYCODE_F5: + if (_currentSectionId != kKIASectionSuspects) { + if (_forceOpen) { + open(kKIASectionSuspects); + _log->next(); + _log->clearFuture(); } - break; - default: - if (_currentSection) { - _currentSection->handleKeyDown(kbd); + } + break; + case Common::KEYCODE_F6: + if (_currentSectionId != kKIASectionClues) { + if (!_forceOpen) { + open(kKIASectionClues); + _log->next(); + _log->clearFuture(); } - break; + } + break; + default: + if (_currentSection) { + _currentSection->handleKeyDown(kbd); + } + break; } if (_currentSection && _currentSection->_scheduledSwitch) { open(kKIASectionNone); @@ -548,61 +548,63 @@ void KIA::playPhotograph(int photographId) { void KIA::mouseDownCallback(int buttonId, void *callbackData) { KIA *self = (KIA *)callbackData; switch (buttonId) { - case 0: - case 6: - self->_vm->_audioPlayer->playAud(self->_vm->_gameInfo->getSfxTrack(503), 100, -65, -65, 50, 0); - break; - case 1: - case 2: - case 3: - case 4: - case 5: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - self->_vm->_audioPlayer->playAud(self->_vm->_gameInfo->getSfxTrack(505), 70, 0, 0, 50, 0); - if (buttonId == 12){ - self->_vm->_audioPlayer->playAud(self->_vm->_gameInfo->getSfxTrack(596), 70, 0, 0, 50, 0); - } - break; - case 15: - self->_vm->_audioPlayer->playAud(self->_vm->_gameInfo->getSfxTrack(503), 70, 0, 0, 50, 0); - break; + case 0: + case 6: + self->_vm->_audioPlayer->playAud(self->_vm->_gameInfo->getSfxTrack(503), 100, -65, -65, 50, 0); + break; + case 1: + case 2: + case 3: + case 4: + case 5: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + self->_vm->_audioPlayer->playAud(self->_vm->_gameInfo->getSfxTrack(505), 70, 0, 0, 50, 0); + if (buttonId == 12){ + self->_vm->_audioPlayer->playAud(self->_vm->_gameInfo->getSfxTrack(596), 70, 0, 0, 50, 0); + } + break; + case 15: + self->_vm->_audioPlayer->playAud(self->_vm->_gameInfo->getSfxTrack(503), 70, 0, 0, 50, 0); + break; + default: + break; } } void KIA::mouseUpCallback(int buttonId, void *callbackData) { KIA *self = (KIA *)callbackData; switch (buttonId) { - case 0: - case 6: - self->_vm->_audioPlayer->playAud(self->_vm->_gameInfo->getSfxTrack(504), 100, -65, -65, 50, 0); - break; - case 1: - case 2: - case 3: - case 4: - case 5: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - self->_vm->_audioPlayer->playAud(self->_vm->_gameInfo->getSfxTrack(506), 70, 0, 0, 50, 0); - break; - case 15: - self->_vm->_audioPlayer->playAud(self->_vm->_gameInfo->getSfxTrack(504), 100, 0, 0, 50, 0); - break; - default: - break; + case 0: + case 6: + self->_vm->_audioPlayer->playAud(self->_vm->_gameInfo->getSfxTrack(504), 100, -65, -65, 50, 0); + break; + case 1: + case 2: + case 3: + case 4: + case 5: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + self->_vm->_audioPlayer->playAud(self->_vm->_gameInfo->getSfxTrack(506), 70, 0, 0, 50, 0); + break; + case 15: + self->_vm->_audioPlayer->playAud(self->_vm->_gameInfo->getSfxTrack(504), 100, 0, 0, 50, 0); + break; + default: + break; } self->buttonClicked(buttonId); } @@ -705,112 +707,112 @@ void KIA::createButtons(int sectionId) { const Shape *shapeDown = nullptr; switch (sectionId) { - case kKIASectionCrimes: - case kKIASectionSuspects: - case kKIASectionClues: - _buttons->defineImage(0, kiaButton6, nullptr, nullptr, _shapes->get(1), _vm->_textKIA->getText(23)); + case kKIASectionCrimes: + case kKIASectionSuspects: + case kKIASectionClues: + _buttons->defineImage(0, kiaButton6, nullptr, nullptr, _shapes->get(1), _vm->_textKIA->getText(23)); + + if (sectionId == kKIASectionCrimes) { + shapeUp = _shapes->get(2); + shapeHovered = _shapes->get(2); + shapeDown = _shapes->get(10); + } else { + shapeUp = nullptr; + shapeHovered = nullptr; + shapeDown = _shapes->get(18); + } + _buttons->defineImage(1, kiaButton7, shapeUp, shapeHovered, shapeDown, _vm->_textKIA->getText(24)); - if (sectionId == kKIASectionCrimes) { - shapeUp = _shapes->get(2); - shapeHovered = _shapes->get(2); - shapeDown = _shapes->get(10); - } else { - shapeUp = nullptr; - shapeHovered = nullptr; - shapeDown = _shapes->get(18); - } - _buttons->defineImage(1, kiaButton7, shapeUp, shapeHovered, shapeDown, _vm->_textKIA->getText(24)); + if (sectionId == kKIASectionSuspects) { + shapeUp = _shapes->get(3); + shapeHovered = _shapes->get(3); + shapeDown = _shapes->get(11); + } else { + shapeUp = nullptr; + shapeHovered = nullptr; + shapeDown = _shapes->get(19); + } + _buttons->defineImage(2, kiaButton8, shapeUp, shapeHovered, shapeDown, _vm->_textKIA->getText(25)); - if (sectionId == kKIASectionSuspects) { - shapeUp = _shapes->get(3); - shapeHovered = _shapes->get(3); - shapeDown = _shapes->get(11); - } else { - shapeUp = nullptr; - shapeHovered = nullptr; - shapeDown = _shapes->get(19); - } - _buttons->defineImage(2, kiaButton8, shapeUp, shapeHovered, shapeDown, _vm->_textKIA->getText(25)); + if (sectionId == kKIASectionClues) { + shapeUp = _shapes->get(4); + shapeHovered = _shapes->get(4); + shapeDown = _shapes->get(12); + } else { + shapeUp = nullptr; + shapeHovered = nullptr; + shapeDown = _shapes->get(20); + } + _buttons->defineImage(3, kiaButton9, shapeUp, shapeHovered, shapeDown, _vm->_textKIA->getText(26)); - if (sectionId == kKIASectionClues) { - shapeUp = _shapes->get(4); - shapeHovered = _shapes->get(4); - shapeDown = _shapes->get(12); - } else { - shapeUp = nullptr; - shapeHovered = nullptr; - shapeDown = _shapes->get(20); - } - _buttons->defineImage(3, kiaButton9, shapeUp, shapeHovered, shapeDown, _vm->_textKIA->getText(26)); + _buttons->defineImage(4, kiaButton10, nullptr, nullptr, _shapes->get(21), _vm->_textKIA->getText(27)); - _buttons->defineImage(4, kiaButton10, nullptr, nullptr, _shapes->get(21), _vm->_textKIA->getText(27)); + _buttons->defineImage(5, kiaButton11, nullptr, nullptr, _shapes->get(22), _vm->_textKIA->getText(28)); - _buttons->defineImage(5, kiaButton11, nullptr, nullptr, _shapes->get(22), _vm->_textKIA->getText(28)); + _buttons->defineImage(14, kiaButton14, nullptr, nullptr, _shapes->get(23), _vm->_textKIA->getText(29)); - _buttons->defineImage(14, kiaButton14, nullptr, nullptr, _shapes->get(23), _vm->_textKIA->getText(29)); + break; + case kKIASectionSettings: + case kKIASectionHelp: + case kKIASectionSave: + case kKIASectionLoad: + case kKIASectionDiagnostic: + case kKIASectionPogo: + _buttons->defineImage(6, kiaButton6, nullptr, nullptr, _shapes->get(0), _vm->_textKIA->getText(37)); - break; - case kKIASectionSettings: - case kKIASectionHelp: - case kKIASectionSave: - case kKIASectionLoad: - case kKIASectionDiagnostic: - case kKIASectionPogo: - _buttons->defineImage(6, kiaButton6, nullptr, nullptr, _shapes->get(0), _vm->_textKIA->getText(37)); - - if (sectionId == kKIASectionSettings) { - shapeUp = _shapes->get(5); - shapeHovered = _shapes->get(5); - shapeDown = _shapes->get(13); - } else { - shapeUp = nullptr; - shapeHovered = nullptr; - shapeDown = _shapes->get(24); - } - _buttons->defineImage(7, kiaButton7, shapeUp, shapeHovered, shapeDown, _vm->_textKIA->getText(38)); + if (sectionId == kKIASectionSettings) { + shapeUp = _shapes->get(5); + shapeHovered = _shapes->get(5); + shapeDown = _shapes->get(13); + } else { + shapeUp = nullptr; + shapeHovered = nullptr; + shapeDown = _shapes->get(24); + } + _buttons->defineImage(7, kiaButton7, shapeUp, shapeHovered, shapeDown, _vm->_textKIA->getText(38)); - if (sectionId == kKIASectionHelp) { - shapeUp = _shapes->get(6); - shapeHovered = _shapes->get(6); - shapeDown = _shapes->get(14); - } else { - shapeUp = nullptr; - shapeHovered = nullptr; - shapeDown = _shapes->get(25); - } - _buttons->defineImage(8, kiaButton8, shapeUp, shapeHovered, shapeDown, _vm->_textKIA->getText(41)); + if (sectionId == kKIASectionHelp) { + shapeUp = _shapes->get(6); + shapeHovered = _shapes->get(6); + shapeDown = _shapes->get(14); + } else { + shapeUp = nullptr; + shapeHovered = nullptr; + shapeDown = _shapes->get(25); + } + _buttons->defineImage(8, kiaButton8, shapeUp, shapeHovered, shapeDown, _vm->_textKIA->getText(41)); - if (sectionId == kKIASectionSave) { - shapeUp = _shapes->get(7); - shapeHovered = _shapes->get(7); - shapeDown = _shapes->get(15); - } else { - shapeUp = nullptr; - shapeHovered = nullptr; - shapeDown = _shapes->get(26); - } - _buttons->defineImage(9, kiaButton9, shapeUp, shapeHovered, shapeDown, _vm->_textKIA->getText(39)); + if (sectionId == kKIASectionSave) { + shapeUp = _shapes->get(7); + shapeHovered = _shapes->get(7); + shapeDown = _shapes->get(15); + } else { + shapeUp = nullptr; + shapeHovered = nullptr; + shapeDown = _shapes->get(26); + } + _buttons->defineImage(9, kiaButton9, shapeUp, shapeHovered, shapeDown, _vm->_textKIA->getText(39)); - if (sectionId == kKIASectionLoad) { - shapeUp = _shapes->get(8); - shapeHovered = _shapes->get(8); - shapeDown = _shapes->get(16); - } else { - shapeUp = nullptr; - shapeHovered = nullptr; - shapeDown = _shapes->get(27); - } - _buttons->defineImage(10, kiaButton10, shapeUp, shapeHovered, shapeDown, _vm->_textKIA->getText(40)); + if (sectionId == kKIASectionLoad) { + shapeUp = _shapes->get(8); + shapeHovered = _shapes->get(8); + shapeDown = _shapes->get(16); + } else { + shapeUp = nullptr; + shapeHovered = nullptr; + shapeDown = _shapes->get(27); + } + _buttons->defineImage(10, kiaButton10, shapeUp, shapeHovered, shapeDown, _vm->_textKIA->getText(40)); - _buttons->defineImage(11, kiaButton11, nullptr, nullptr, _shapes->get(28), _vm->_textKIA->getText(42)); + _buttons->defineImage(11, kiaButton11, nullptr, nullptr, _shapes->get(28), _vm->_textKIA->getText(42)); - _buttons->defineImage(14, kiaButton14, nullptr, nullptr, _shapes->get(29), _vm->_textKIA->getText(29)); + _buttons->defineImage(14, kiaButton14, nullptr, nullptr, _shapes->get(29), _vm->_textKIA->getText(29)); - break; - case 8: - _buttons->defineImage(12, kiaButton12, _shapes->get(124), _shapes->get(124), _shapes->get(48), _vm->_textKIA->getText(42)); + break; + case kKIASectionQuit: + _buttons->defineImage(12, kiaButton12, _shapes->get(124), _shapes->get(124), _shapes->get(48), _vm->_textKIA->getText(42)); - _buttons->defineImage(13, kiaButton13, _shapes->get(125), _shapes->get(125), _shapes->get(49), _vm->_textKIA->getText(29)); + _buttons->defineImage(13, kiaButton13, _shapes->get(125), _shapes->get(125), _shapes->get(49), _vm->_textKIA->getText(29)); break; } @@ -852,146 +854,146 @@ void KIA::buttonClicked(int buttonId) { return; } switch (buttonId) { - case 0: - open(kKIASectionSettings); - break; - case 1: - if (_currentSectionId != kKIASectionCrimes) { + case 0: + open(kKIASectionSettings); + break; + case 1: + if (_currentSectionId != kKIASectionCrimes) { + open(kKIASectionCrimes); + _log->next(); + _log->clearFuture(); + } + break; + case 2: + if (_currentSectionId != kKIASectionSuspects) { + open(kKIASectionSuspects); + _log->next(); + _log->clearFuture(); + } + break; + case 3: + if (_currentSectionId != kKIASectionClues) { + open(kKIASectionClues); + _log->next(); + _log->clearFuture(); + } + break; + case 4: + if (_log->hasPrev()) { + int kiaLogPrevType = _log->getPrevType(); + switch (kiaLogPrevType) { + case 2: open(kKIASectionCrimes); - _log->next(); - _log->clearFuture(); + _log->prev(); + _crimesSection->loadFromLog(); + break; + case 1: + open(kKIASectionSuspects); + _log->prev(); + _suspectsSection->loadFromLog(); + break; + case 0: + open(kKIASectionClues); + _log->prev(); + _cluesSection->loadFromLog(); + break; } - break; - case 2: - if (_currentSectionId != kKIASectionSuspects) { + } + break; + case 5: + if (_log->hasNext()) { + int kiaLogNextType = _log->getNextType(); + switch (kiaLogNextType) { + case 2: + open(kKIASectionCrimes); + _log->next(); + _crimesSection->loadFromLog(); + break; + case 1: open(kKIASectionSuspects); _log->next(); - _log->clearFuture(); - } - break; - case 3: - if (_currentSectionId != kKIASectionClues) { + _suspectsSection->loadFromLog(); + break; + case 0: open(kKIASectionClues); _log->next(); - _log->clearFuture(); - } - break; - case 4: - if (_log->hasPrev()) { - int kiaLogPrevType = _log->getPrevType(); - switch (kiaLogPrevType) { - case 2: - open(kKIASectionCrimes); - _log->prev(); - _crimesSection->loadFromLog(); - break; - case 1: - open(kKIASectionSuspects); - _log->prev(); - _suspectsSection->loadFromLog(); - break; - case 0: - open(kKIASectionClues); - _log->prev(); - _cluesSection->loadFromLog(); - break; - } + _cluesSection->loadFromLog(); + break; } - break; - case 5: - if (_log->hasNext()) { - int kiaLogNextType = _log->getNextType(); - switch (kiaLogNextType) { - case 2: - open(kKIASectionCrimes); - _log->next(); - _crimesSection->loadFromLog(); - break; - case 1: - open(kKIASectionSuspects); - _log->next(); - _suspectsSection->loadFromLog(); - break; - case 0: - open(kKIASectionClues); - _log->next(); - _cluesSection->loadFromLog(); - break; - } - } - break; - case 6: - if (!_forceOpen) { - open(_lastSectionIdKIA); - } - break; - case 7: - open(kKIASectionSettings); - break; - case 8: - open(kKIASectionHelp); - break; - case 9: - if (!_forceOpen) { - open(kKIASectionSave); - } - break; - case 10: - open(kKIASectionLoad); - break; - case 11: - open(kKIASectionQuit); - break; - case 12: - _vm->_gameIsRunning = false; + } + break; + case 6: + if (!_forceOpen) { + open(_lastSectionIdKIA); + } + break; + case 7: + open(kKIASectionSettings); + break; + case 8: + open(kKIASectionHelp); + break; + case 9: + if (!_forceOpen) { + open(kKIASectionSave); + } + break; + case 10: + open(kKIASectionLoad); + break; + case 11: + open(kKIASectionQuit); + break; + case 12: + _vm->_gameIsRunning = false; + open(kKIASectionNone); + break; + case 13: + open(_lastSectionIdOptions); + break; + case 14: + if (!_forceOpen) { open(kKIASectionNone); - break; - case 13: - open(_lastSectionIdOptions); - break; - case 14: - if (!_forceOpen) { - open(kKIASectionNone); - } - break; - case 15: - open(kKIASectionDiagnostic); - break; - case 16: - _vm->_settings->setAmmoType(0); - if (_vm->_rnd.getRandomNumber(1)) { - soundId = _vm->_combat->getHitSound(); - } else { - soundId = _vm->_combat->getMissSound(); - } - _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(soundId), 70, 0, 0, 50, 0); - break; - case 17: - _vm->_settings->setAmmoType(1); - if (_vm->_rnd.getRandomNumber(1)) { - soundId = _vm->_combat->getHitSound(); - } else { - soundId = _vm->_combat->getMissSound(); - } - _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(soundId), 70, 0, 0, 50, 0); - break; - case 18: - _vm->_settings->setAmmoType(2); - if (_vm->_rnd.getRandomNumber(1)) { - soundId = _vm->_combat->getHitSound(); - } else { - soundId = _vm->_combat->getMissSound(); - } - _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(soundId), 70, 0, 0, 50, 0); - break; - case 19: - return; - case 20: - playerReset(); - break; - case 21: - playPrivateAddon(); - break; + } + break; + case 15: + open(kKIASectionDiagnostic); + break; + case 16: + _vm->_settings->setAmmoType(0); + if (_vm->_rnd.getRandomNumber(1)) { + soundId = _vm->_combat->getHitSound(); + } else { + soundId = _vm->_combat->getMissSound(); + } + _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(soundId), 70, 0, 0, 50, 0); + break; + case 17: + _vm->_settings->setAmmoType(1); + if (_vm->_rnd.getRandomNumber(1)) { + soundId = _vm->_combat->getHitSound(); + } else { + soundId = _vm->_combat->getMissSound(); + } + _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(soundId), 70, 0, 0, 50, 0); + break; + case 18: + _vm->_settings->setAmmoType(2); + if (_vm->_rnd.getRandomNumber(1)) { + soundId = _vm->_combat->getHitSound(); + } else { + soundId = _vm->_combat->getMissSound(); + } + _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(soundId), 70, 0, 0, 50, 0); + break; + case 19: + return; + case 20: + playerReset(); + break; + case 21: + playPrivateAddon(); + break; } } @@ -1000,39 +1002,39 @@ void KIA::switchSection(int sectionId) { _currentSection->close(); } switch (sectionId) { - case kKIASectionCrimes: - _currentSection = _crimesSection; - break; - case kKIASectionSuspects: - _currentSection = _suspectsSection; - break; - case kKIASectionClues: - _currentSection = _cluesSection; - break; - case kKIASectionSettings: - _currentSection = _settingsSection; - break; - case kKIASectionHelp: - _currentSection = _helpSection; - break; - case kKIASectionSave: - _currentSection = _saveSection; - break; - case kKIASectionLoad: - _currentSection = _loadSection; - break; - case kKIASectionQuit: - _currentSection = nullptr; - break; - case kKIASectionDiagnostic: - _currentSection = _diagnosticSection; - break; - case kKIASectionPogo: - _currentSection = _pogoSection; - break; - default: - _currentSection = nullptr; - break; + case kKIASectionCrimes: + _currentSection = _crimesSection; + break; + case kKIASectionSuspects: + _currentSection = _suspectsSection; + break; + case kKIASectionClues: + _currentSection = _cluesSection; + break; + case kKIASectionSettings: + _currentSection = _settingsSection; + break; + case kKIASectionHelp: + _currentSection = _helpSection; + break; + case kKIASectionSave: + _currentSection = _saveSection; + break; + case kKIASectionLoad: + _currentSection = _loadSection; + break; + case kKIASectionQuit: + _currentSection = nullptr; + break; + case kKIASectionDiagnostic: + _currentSection = _diagnosticSection; + break; + case kKIASectionPogo: + _currentSection = _pogoSection; + break; + default: + _currentSection = nullptr; + break; } if (_currentSection) { _currentSection->open(); @@ -1041,186 +1043,186 @@ void KIA::switchSection(int sectionId) { const char *KIA::getSectionVqaName(int sectionId) { switch (sectionId) { + case kKIASectionCrimes: + return "kia_crim.vqa"; + case kKIASectionSuspects: + return "kia_susp.vqa"; + case kKIASectionClues: + return "kia_clue.vqa"; + case kKIASectionSettings: + case kKIASectionHelp: + case kKIASectionSave: + case kKIASectionLoad: + case kKIASectionQuit: + case kKIASectionDiagnostic: + case kKIASectionPogo: + return "kia_ingm.vqa"; + default: + return nullptr; + } +} + +int KIA::getVqaLoopMain(int sectionId) { + switch (sectionId) { + case kKIASectionCrimes: + case kKIASectionSuspects: + case kKIASectionClues: + return 3; + case kKIASectionSettings: + case kKIASectionHelp: + case kKIASectionSave: + case kKIASectionLoad: + case kKIASectionDiagnostic: + case kKIASectionPogo: + return 4; + case kKIASectionQuit: + return 7; + default: + return 0; + } +} + +int KIA::getVqaLoopTransition(int transitionId) { + switch (transitionId) { + case 0: + case 2: + case 7: + case 8: + return 0; + case 1: + case 4: + case 5: + case 9: + return 1; + case 3: + case 10: + case 11: + case 12: + return 2; + case 6: + return 3; + case 13: + return 6; + default: + return 0; + } +} + +int KIA::getTransitionId(int oldSectionId, int newSectionId) { + switch (oldSectionId) { + case kKIASectionNone: + return 0; + case kKIASectionCrimes: + switch (newSectionId) { case kKIASectionCrimes: - return "kia_crim.vqa"; + return 0; case kKIASectionSuspects: - return "kia_susp.vqa"; + return 1; case kKIASectionClues: - return "kia_clue.vqa"; + return 2; case kKIASectionSettings: case kKIASectionHelp: case kKIASectionSave: case kKIASectionLoad: - case kKIASectionQuit: case kKIASectionDiagnostic: case kKIASectionPogo: - return "kia_ingm.vqa"; - default: - return nullptr; - } -} - -int KIA::getVqaLoopMain(int sectionId) { - switch (sectionId) { + return 3; + case kKIASectionQuit: + return 13; + } + return 0; + case kKIASectionSuspects: + switch (newSectionId) { case kKIASectionCrimes: + return 4; case kKIASectionSuspects: + return 0; case kKIASectionClues: - return 3; + return 5; case kKIASectionSettings: case kKIASectionHelp: case kKIASectionSave: case kKIASectionLoad: case kKIASectionDiagnostic: case kKIASectionPogo: - return 4; + return 6; case kKIASectionQuit: + return 13; + } + return 0; + case kKIASectionClues: + switch (newSectionId) { + case kKIASectionCrimes: return 7; - default: - return 0; - } -} - -int KIA::getVqaLoopTransition(int transitionId) { - switch (transitionId) { - case 0: - case 2: - case 7: - case 8: - return 0; - case 1: - case 4: - case 5: - case 9: - return 1; - case 3: - case 10: - case 11: - case 12: - return 2; - case 6: - return 3; - case 13: - return 6; - default: - return 0; - } -} - -int KIA::getTransitionId(int oldSectionId, int newSectionId) { - switch (oldSectionId) { - case kKIASectionNone: + case kKIASectionSuspects: + return 8; + case kKIASectionClues: return 0; + case kKIASectionSettings: + case kKIASectionHelp: + case kKIASectionSave: + case kKIASectionLoad: + case kKIASectionDiagnostic: + case kKIASectionPogo: + return 9; + case kKIASectionQuit: + return 13; + } + return 0; + case kKIASectionSettings: + case kKIASectionHelp: + case kKIASectionSave: + case kKIASectionLoad: + case kKIASectionDiagnostic: + case kKIASectionPogo: + switch (newSectionId) { case kKIASectionCrimes: - switch (newSectionId) { - case kKIASectionCrimes: - return 0; - case kKIASectionSuspects: - return 1; - case kKIASectionClues: - return 2; - case kKIASectionSettings: - case kKIASectionHelp: - case kKIASectionSave: - case kKIASectionLoad: - case kKIASectionDiagnostic: - case kKIASectionPogo: - return 3; - case kKIASectionQuit: - return 13; - } - return 0; + return 10; case kKIASectionSuspects: - switch (newSectionId) { - case kKIASectionCrimes: - return 4; - case kKIASectionSuspects: - return 0; - case kKIASectionClues: - return 5; - case kKIASectionSettings: - case kKIASectionHelp: - case kKIASectionSave: - case kKIASectionLoad: - case kKIASectionDiagnostic: - case kKIASectionPogo: - return 6; - case kKIASectionQuit: - return 13; - } - return 0; + return 11; case kKIASectionClues: - switch (newSectionId) { - case kKIASectionCrimes: - return 7; - case kKIASectionSuspects: - return 8; - case kKIASectionClues: - return 0; - case kKIASectionSettings: - case kKIASectionHelp: - case kKIASectionSave: - case kKIASectionLoad: - case kKIASectionDiagnostic: - case kKIASectionPogo: - return 9; - case kKIASectionQuit: - return 13; - } - return 0; + return 12; case kKIASectionSettings: case kKIASectionHelp: case kKIASectionSave: case kKIASectionLoad: case kKIASectionDiagnostic: case kKIASectionPogo: - switch (newSectionId) { - case kKIASectionCrimes: - return 10; - case kKIASectionSuspects: - return 11; - case kKIASectionClues: - return 12; - case kKIASectionSettings: - case kKIASectionHelp: - case kKIASectionSave: - case kKIASectionLoad: - case kKIASectionDiagnostic: - case kKIASectionPogo: - return 0; - case kKIASectionQuit: - return 13; - } return 0; case kKIASectionQuit: - if (newSectionId != kKIASectionQuit) { - return 14; - } + return 13; + } + return 0; + case kKIASectionQuit: + if (newSectionId != kKIASectionQuit) { + return 14; + } } return 0; } void KIA::playTransitionSound(int transitionId) { switch (transitionId) { - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(498), 100, 0, 0, 50, 0); - break; - case 13: - _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(499), 100, 0, 0, 50, 0); - break; - case 14: - _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(500), 100, 0, 0, 50, 0); - break; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(498), 100, 0, 0, 50, 0); + break; + case 13: + _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(499), 100, 0, 0, 50, 0); + break; + case 14: + _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(500), 100, 0, 0, 50, 0); + break; } } diff --git a/engines/bladerunner/ui/kia_section_base.h b/engines/bladerunner/ui/kia_section_base.h index ea69d89768..988d223105 100644 --- a/engines/bladerunner/ui/kia_section_base.h +++ b/engines/bladerunner/ui/kia_section_base.h @@ -23,7 +23,6 @@ #ifndef BLADERUNNER_KIA_SECTION_BASE_H #define BLADERUNNER_KIA_SECTION_BASE_H - namespace Common { struct KeyState; } diff --git a/engines/bladerunner/ui/kia_section_clues.cpp b/engines/bladerunner/ui/kia_section_clues.cpp index 25ff27ba8d..fc6270b938 100644 --- a/engines/bladerunner/ui/kia_section_clues.cpp +++ b/engines/bladerunner/ui/kia_section_clues.cpp @@ -26,7 +26,6 @@ #include "bladerunner/audio_player.h" #include "bladerunner/bladerunner.h" #include "bladerunner/crimes_database.h" -#include "bladerunner/game_constants.h" #include "bladerunner/game_flags.h" #include "bladerunner/game_info.h" #include "bladerunner/font.h" diff --git a/engines/bladerunner/ui/kia_section_crimes.cpp b/engines/bladerunner/ui/kia_section_crimes.cpp index a5ff221250..b70f790659 100644 --- a/engines/bladerunner/ui/kia_section_crimes.cpp +++ b/engines/bladerunner/ui/kia_section_crimes.cpp @@ -27,7 +27,6 @@ #include "bladerunner/bladerunner.h" #include "bladerunner/crimes_database.h" #include "bladerunner/font.h" -#include "bladerunner/game_constants.h" #include "bladerunner/game_flags.h" #include "bladerunner/game_info.h" #include "bladerunner/shape.h" @@ -245,23 +244,23 @@ void KIASectionCrimes::mouseUpCallback(int buttonId, void *callbackData) { void KIASectionCrimes::onButtonPressed(int buttonId) { switch (buttonId) { - case 0: - prevSuspect(); - break; - case 1: - nextSuspect(); - break; - case 2: - prevCrime(); - break; - case 3: - nextCrime(); - break; - case 4: - if (_suspectSelected != -1) { - _scheduledSwitch = true; - } - break; + case 0: + prevSuspect(); + break; + case 1: + nextSuspect(); + break; + case 2: + prevCrime(); + break; + case 3: + nextCrime(); + break; + case 4: + if (_suspectSelected != -1) { + _scheduledSwitch = true; + } + break; } } diff --git a/engines/bladerunner/ui/kia_section_settings.cpp b/engines/bladerunner/ui/kia_section_settings.cpp index 7f2db4ae12..b557a04877 100644 --- a/engines/bladerunner/ui/kia_section_settings.cpp +++ b/engines/bladerunner/ui/kia_section_settings.cpp @@ -241,33 +241,33 @@ void KIASectionSettings::mouseUpCallback(int buttonId, void *callbackData) { void KIASectionSettings::onButtonPressed(int buttonId) { switch (buttonId) { - case 0: - _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(513), 90, -30, -30, 50, 0); - _vm->_settings->setPlayerAgenda(0); - initConversationChoices(); - break; - case 1: - _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(513), 90, -15, -15, 50, 0); - _vm->_settings->setPlayerAgenda(1); - initConversationChoices(); - break; - case 2: - _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(513), 90, 0, 0, 50, 0); - _vm->_settings->setPlayerAgenda(2); - initConversationChoices(); - break; - case 3: - _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(513), 90, 15, 15, 50, 0); - _vm->_settings->setPlayerAgenda(3); - initConversationChoices(); - break; - case 4: - _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(513), 90, 30, 30, 50, 0); - _vm->_settings->setPlayerAgenda(4); - initConversationChoices(); - break; - default: - return; + case 0: + _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(513), 90, -30, -30, 50, 0); + _vm->_settings->setPlayerAgenda(0); + initConversationChoices(); + break; + case 1: + _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(513), 90, -15, -15, 50, 0); + _vm->_settings->setPlayerAgenda(1); + initConversationChoices(); + break; + case 2: + _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(513), 90, 0, 0, 50, 0); + _vm->_settings->setPlayerAgenda(2); + initConversationChoices(); + break; + case 3: + _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(513), 90, 15, 15, 50, 0); + _vm->_settings->setPlayerAgenda(3); + initConversationChoices(); + break; + case 4: + _vm->_audioPlayer->playAud(_vm->_gameInfo->getSfxTrack(513), 90, 30, 30, 50, 0); + _vm->_settings->setPlayerAgenda(4); + initConversationChoices(); + break; + default: + return; } } diff --git a/engines/bladerunner/ui/kia_section_suspects.cpp b/engines/bladerunner/ui/kia_section_suspects.cpp index 053705c9da..0cad1123d7 100644 --- a/engines/bladerunner/ui/kia_section_suspects.cpp +++ b/engines/bladerunner/ui/kia_section_suspects.cpp @@ -27,7 +27,6 @@ #include "bladerunner/bladerunner.h" #include "bladerunner/crimes_database.h" #include "bladerunner/font.h" -#include "bladerunner/game_constants.h" #include "bladerunner/game_flags.h" #include "bladerunner/game_info.h" #include "bladerunner/shape.h" @@ -42,7 +41,6 @@ #include "bladerunner/ui/ui_image_picker.h" #include "bladerunner/ui/ui_scroll_box.h" - #include "graphics/surface.h" namespace BladeRunner { @@ -340,18 +338,18 @@ void KIASectionSuspects::mouseUpCallback(int buttonId, void *callbackData) { void KIASectionSuspects::onButtonPressed(int buttonId) { switch (buttonId) { - case 0: - enableAllFilters(); - break; - case 1: - disableAllFilters(); - break; - case 2: - prevSuspect(); - break; - case 3: - nextSuspect(); - break; + case 0: + enableAllFilters(); + break; + case 1: + disableAllFilters(); + break; + case 2: + prevSuspect(); + break; + case 3: + nextSuspect(); + break; } } diff --git a/engines/bladerunner/ui/ui_image_picker.cpp b/engines/bladerunner/ui/ui_image_picker.cpp index ca61a4d989..c0015f1721 100644 --- a/engines/bladerunner/ui/ui_image_picker.cpp +++ b/engines/bladerunner/ui/ui_image_picker.cpp @@ -24,7 +24,6 @@ #include "bladerunner/bladerunner.h" #include "bladerunner/font.h" -#include "bladerunner/game_constants.h" #include "bladerunner/mouse.h" #include "bladerunner/shape.h" |