aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2018-03-26 00:53:54 +0200
committerEugene Sandulenko2018-03-26 00:54:31 +0200
commit168ef838662fc21b563b48b941338e60902a9db8 (patch)
tree884256c6dd711931ad6672ed0f3e515ffa5cd2ba
parent9d984549d3276af2bbf79e9c054dd0cc22d7239b (diff)
downloadscummvm-rg350-168ef838662fc21b563b48b941338e60902a9db8.tar.gz
scummvm-rg350-168ef838662fc21b563b48b941338e60902a9db8.tar.bz2
scummvm-rg350-168ef838662fc21b563b48b941338e60902a9db8.zip
BLADERUNNER: Implemented Scores closing
-rw-r--r--engines/bladerunner/ui/scores.cpp28
1 files changed, 24 insertions, 4 deletions
diff --git a/engines/bladerunner/ui/scores.cpp b/engines/bladerunner/ui/scores.cpp
index 83460b1b75..55d3111af4 100644
--- a/engines/bladerunner/ui/scores.cpp
+++ b/engines/bladerunner/ui/scores.cpp
@@ -25,6 +25,7 @@
#include "bladerunner/bladerunner.h"
#include "bladerunner/font.h"
#include "bladerunner/savefile.h"
+#include "bladerunner/scene.h"
#include "bladerunner/text_resource.h"
#include "bladerunner/vqa_player.h"
@@ -35,15 +36,13 @@ namespace BladeRunner {
Scores::Scores(BladeRunnerEngine *vm) {
_vm = vm;
- _txtScorers = new TextResource(_vm);
- _font = new Font(_vm);
+ _font = nullptr;
+ _txtScorers = nullptr;
reset();
}
Scores::~Scores() {
- delete _font;
- delete _txtScorers;
}
void Scores::open() {
@@ -61,7 +60,10 @@ void Scores::open() {
// TODO: Freeze game time
+ _txtScorers = new TextResource(_vm);
_txtScorers->open("SCORERS");
+
+ _font = new Font(_vm);
_font->open("TAHOMA24.FON", 640, 480, -1, 0, 0);
_font->setSpacing(1, 0);
@@ -76,6 +78,24 @@ bool Scores::isOpen() const {
}
void Scores::close() {
+ _isOpen = false;
+
+ delete _font;
+ _font = nullptr;
+
+ delete _txtScorers;
+ _txtScorers = nullptr;
+
+ if (_vqaPlayer) {
+ _vqaPlayer->close();
+ delete _vqaPlayer;
+ _vqaPlayer = nullptr;
+ }
+
+ _vm->closeArchive("MODE.MIX");
+
+ // TODO: Unfreeze game time
+ _vm->_scene->resume();
}
void Scores::set(int index, int value) {