diff options
author | Peter Kohaut | 2019-10-13 14:08:49 +0200 |
---|---|---|
committer | Peter Kohaut | 2019-10-13 14:09:47 +0200 |
commit | cd7e44f9f92c3aee7b99ecf44e8dbfbb252904d0 (patch) | |
tree | 2fb470e0166eaf4f125778b1675b4a49c20232e4 /engines/bladerunner/ui/kia_section_suspects.cpp | |
parent | 2b0bce60908ec7fb2d1e2c950d4a967bc16e158a (diff) | |
download | scummvm-rg350-cd7e44f9f92c3aee7b99ecf44e8dbfbb252904d0.tar.gz scummvm-rg350-cd7e44f9f92c3aee7b99ecf44e8dbfbb252904d0.tar.bz2 scummvm-rg350-cd7e44f9f92c3aee7b99ecf44e8dbfbb252904d0.zip |
BLADERUNNER: Group shapes loading
Diffstat (limited to 'engines/bladerunner/ui/kia_section_suspects.cpp')
-rw-r--r-- | engines/bladerunner/ui/kia_section_suspects.cpp | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/engines/bladerunner/ui/kia_section_suspects.cpp b/engines/bladerunner/ui/kia_section_suspects.cpp index 93895a7d5b..abc8961572 100644 --- a/engines/bladerunner/ui/kia_section_suspects.cpp +++ b/engines/bladerunner/ui/kia_section_suspects.cpp @@ -35,7 +35,6 @@ #include "bladerunner/text_resource.h" #include "bladerunner/ui/kia.h" #include "bladerunner/ui/kia_log.h" -#include "bladerunner/ui/kia_shapes.h" #include "bladerunner/ui/ui_check_box.h" #include "bladerunner/ui/ui_container.h" #include "bladerunner/ui/ui_image_picker.h" @@ -87,14 +86,14 @@ KIASectionSuspects::KIASectionSuspects(BladeRunnerEngine *vm, ActorClues *clues) _suspectSelected = -1; _suspectPhotoShapeId = -1; _suspectPhotoNotUsed = -1; - _suspectPhotoShape = nullptr; + _suspectPhotoShapes = new Shapes(vm); _suspectsFoundCount = 0; _suspectsFound.resize(_vm->_gameInfo->getSuspectCount()); _suspectsWithIdentity.resize(_vm->_gameInfo->getSuspectCount()); } KIASectionSuspects::~KIASectionSuspects() { - delete _suspectPhotoShape; + delete _suspectPhotoShapes; _uiContainer->clear(); @@ -128,6 +127,8 @@ void KIASectionSuspects::reset() { void KIASectionSuspects::open() { _scheduledSwitch = false; + _suspectPhotoShapes->load("photos.shp"); + _buttons->resetImages(); _buttons->defineImage(0, Common::Rect(142, 380, 191, 395), _vm->_kia->_shapes->get(79), _vm->_kia->_shapes->get(80), _vm->_kia->_shapes->get(81), _vm->_textKIA->getText(30)); _buttons->defineImage(1, Common::Rect(193, 380, 242, 395), _vm->_kia->_shapes->get(76), _vm->_kia->_shapes->get(77), _vm->_kia->_shapes->get(77), _vm->_textKIA->getText(31)); @@ -161,17 +162,14 @@ void KIASectionSuspects::close() { _isOpen = false; _buttons->deactivate(); _cluesScrollBox->hide(); - if (_suspectPhotoShapeId != -1) { - delete _suspectPhotoShape; - _suspectPhotoShape = nullptr; - _suspectPhotoShapeId = -1; - } + + _suspectPhotoShapes->unload(); } void KIASectionSuspects::draw(Graphics::Surface &surface) { const char *text = nullptr; if (_suspectPhotoShapeId != -1) { - _suspectPhotoShape->draw(surface, 142, 150); + _suspectPhotoShapes->get(_suspectPhotoShapeId)->draw(surface, 142, 150); } if (_suspectPhotoShapeId == 14 || _suspectPhotoShapeId == 13) { text = _vm->_textKIA->getText(49); @@ -459,11 +457,6 @@ void KIASectionSuspects::populateVisibleClues() { } void KIASectionSuspects::updateSuspectPhoto() { - if (_suspectPhotoShapeId != -1) { - delete _suspectPhotoShape; - _suspectPhotoShape = nullptr; - } - if (_suspectSelected == -1) { _suspectPhotoShapeId = -1; return; @@ -492,11 +485,6 @@ void KIASectionSuspects::updateSuspectPhoto() { _suspectPhotoShapeId = 13; } } - - if (_suspectPhotoShapeId != -1) { - _suspectPhotoShape = new Shape(_vm); - _suspectPhotoShape->open("photos.shp", _suspectPhotoShapeId); - } } void KIASectionSuspects::nextSuspect() { |