diff options
author | Eugene Sandulenko | 2018-03-26 00:38:58 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2018-03-26 00:54:17 +0200 |
commit | 9d984549d3276af2bbf79e9c054dd0cc22d7239b (patch) | |
tree | 91d5ba179167ab080d9c972d37108919bfe45e62 /engines/bladerunner/ui/scores.cpp | |
parent | cdad8a2e6bcb2a729fc93f3c0e7f2d8787f79e2f (diff) | |
download | scummvm-rg350-9d984549d3276af2bbf79e9c054dd0cc22d7239b.tar.gz scummvm-rg350-9d984549d3276af2bbf79e9c054dd0cc22d7239b.tar.bz2 scummvm-rg350-9d984549d3276af2bbf79e9c054dd0cc22d7239b.zip |
BLADERUNNER: Implemented Scores::open()
Diffstat (limited to 'engines/bladerunner/ui/scores.cpp')
-rw-r--r-- | engines/bladerunner/ui/scores.cpp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/engines/bladerunner/ui/scores.cpp b/engines/bladerunner/ui/scores.cpp index 067c90a15a..83460b1b75 100644 --- a/engines/bladerunner/ui/scores.cpp +++ b/engines/bladerunner/ui/scores.cpp @@ -23,26 +23,61 @@ #include "bladerunner/ui/scores.h" #include "bladerunner/bladerunner.h" +#include "bladerunner/font.h" #include "bladerunner/savefile.h" +#include "bladerunner/text_resource.h" #include "bladerunner/vqa_player.h" +#include "common/keyboard.h" + namespace BladeRunner { Scores::Scores(BladeRunnerEngine *vm) { _vm = vm; + + _txtScorers = new TextResource(_vm); + _font = new Font(_vm); + reset(); } Scores::~Scores() { + delete _font; + delete _txtScorers; } void Scores::open() { + if (!_vm->openArchive("MODE.MIX")) { + return; + } + + _vqaPlayer = new VQAPlayer(_vm, &_vm->_surfaceBack); + + if (!_vqaPlayer->open("SCORE.VQA")) { + return; + } + + _vqaPlayer->setLoop(1, -1, 0, nullptr, nullptr); + + // TODO: Freeze game time + + _txtScorers->open("SCORERS"); + _font->open("TAHOMA24.FON", 640, 480, -1, 0, 0); + _font->setSpacing(1, 0); + + fill(); + + _isOpen = true; + _isLoaded = false; } bool Scores::isOpen() const { return _isOpen; } +void Scores::close() { +} + void Scores::set(int index, int value) { if (value > _scores[index]) { _scores[index] = value; @@ -52,17 +87,32 @@ void Scores::set(int index, int value) { _lastScoreValue = value; } +void Scores::handleKeyDown(const Common::KeyState &kbd) { + close(); +} + int Scores::handleMouseUp(int x, int y) { + if (_isLoaded) { + close(); + } + + _isLoaded = false; + return false; } int Scores::handleMouseDown(int x, int y) { + _isLoaded = true; + return false; } void Scores::tick() { } +void Scores::fill() { +} + void Scores::reset() { _isOpen = false; _isLoaded = false; |