diff options
author | Nicola Mettifogo | 2008-02-02 21:22:05 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2008-02-02 21:22:05 +0000 |
commit | d8349d66ff6199dcbd6c2412dcdc90a98380ffb4 (patch) | |
tree | 7acbc91265563975a1f7a59ed433d344e0faf154 /engines | |
parent | 22ead25049f7c6a9af627ee1763851cfd7b9e03d (diff) | |
download | scummvm-rg350-d8349d66ff6199dcbd6c2412dcdc90a98380ffb4.tar.gz scummvm-rg350-d8349d66ff6199dcbd6c2412dcdc90a98380ffb4.tar.bz2 scummvm-rg350-d8349d66ff6199dcbd6c2412dcdc90a98380ffb4.zip |
Subtitles are now displayed in the intro for BRA, though in wrong color (and I don't know why).
svn-id: r30747
Diffstat (limited to 'engines')
-rw-r--r-- | engines/parallaction/exec_br.cpp | 81 | ||||
-rw-r--r-- | engines/parallaction/exec_ns.cpp | 5 | ||||
-rw-r--r-- | engines/parallaction/parallaction.h | 5 | ||||
-rw-r--r-- | engines/parallaction/parallaction_br.cpp | 8 | ||||
-rw-r--r-- | engines/parallaction/parser_br.cpp | 9 |
5 files changed, 41 insertions, 67 deletions
diff --git a/engines/parallaction/exec_br.cpp b/engines/parallaction/exec_br.cpp index 8f9c6907ad..69e64f6e5d 100644 --- a/engines/parallaction/exec_br.cpp +++ b/engines/parallaction/exec_br.cpp @@ -70,47 +70,29 @@ typedef OpcodeImpl<Parallaction_br> OpcodeV2; #define DECLARE_INSTRUCTION_OPCODE(op) void Parallaction_br::instOp_##op() void Parallaction_br::setupSubtitles(char *s, char *s2, int y) { -#if 0 debugC(5, kDebugExec, "setupSubtitles(%s, %s, %i)", s, s2, y); - if (!scumm_stricmp("clear", s)) { - - removeJob(_jDisplaySubtitle); - addJob(kJobWaitRemoveSubtitleJob, _jEraseSubtitle, 15); - _jDisplaySubtitle = 0; + _gfx->freeLabels(); + _subtitle[0] = _subtitle[1] = -1; - _subtitle0.free(); - _subtitle1.free(); + if (!scumm_stricmp("clear", s)) { return; } - _subtitle0.free(); - _subtitle1.free(); - - renderLabel(&_subtitle0._cnv, s); - _subtitle0._text = strdup(s); + if (y != -1) { + _subtitleY = y; + } + _subtitle[0] = _gfx->createLabel(_labelFont, s, 0); + _gfx->showLabel(_subtitle[0], CENTER_LABEL_HORIZONTAL, _subtitleY); if (s2) { - renderLabel(&_subtitle1._cnv, s2); - _subtitle1._text = strdup(s2); + _subtitle[1] = _gfx->createLabel(_labelFont, s2, 0); + _gfx->showLabel(_subtitle[1], CENTER_LABEL_HORIZONTAL, _subtitleY + 5 + _labelFont->height()); + } else { + _subtitle[1] = -1; } _subtitleLipSync = 0; - - if (y != -1) { - _subtitle0._pos.y = y; - _subtitle1._pos.y = y + 5 + _labelFont->height(); - } - - _subtitle0._pos.x = (_gfx->_screenX << 2) + ((640 - _subtitle0._cnv.w) >> 1); - if (_subtitle1._text) - _subtitle1._pos.x = (_gfx->_screenX << 2) + ((640 - _subtitle1._cnv.w) >> 1); - - if (_jDisplaySubtitle == 0) { - _jDisplaySubtitle = addJob(kJobDisplaySubtitle, 0, 1); - _jEraseSubtitle = addJob(kJobEraseSubtitle, 0, 20); - } -#endif } @@ -155,7 +137,7 @@ DECLARE_COMMAND_OPCODE(move) { } DECLARE_COMMAND_OPCODE(start) { - warning("Parallaction_br::cmdOp_start not yet implemented"); + _cmdRunCtxt.cmd->u._animation->_flags |= kFlagsActing; } DECLARE_COMMAND_OPCODE(stop) { @@ -425,35 +407,6 @@ DECLARE_INSTRUCTION_OPCODE(print) { warning("Parallaction_br::instOp_print not yet implemented"); } - -#if 0 -void Parallaction_br::jobDisplaySubtitle(void *parm, Job *job) { -// _gfx->drawLabel(_subtitle0); -// _gfx->drawLabel(_subtitle1); -} - -void Parallaction_br::jobEraseSubtitle(void *parm, Job *job) { - Common::Rect r; - - if (_subtitle0._old.x != -1000) { - _subtitle0.getRect(r); - -// printf("sub0: (%i, %i, %i, %i)\n", r.left, r.top, r.right, r.bottom); - - _gfx->restoreBackground(r); - } - _subtitle0._old = _subtitle0._pos; - - if (_subtitle1._old.x != -1000) { - _subtitle0.getRect(r); - -// printf("sub1: (%i, %i, %i, %i)\n", r.left, r.top, r.right, r.bottom); - - _gfx->restoreBackground(r); - } - _subtitle1._old = _subtitle1._pos; -} -#endif DECLARE_INSTRUCTION_OPCODE(text) { Instruction *inst = (*_instRunCtxt.inst); setupSubtitles(inst->_text, inst->_text2, inst->_y); @@ -485,7 +438,13 @@ DECLARE_INSTRUCTION_OPCODE(stop) { } DECLARE_INSTRUCTION_OPCODE(endscript) { - warning("Parallaction_br::instOp_endscript not yet implemented"); + if ((_instRunCtxt.a->_flags & kFlagsLooping) == 0) { + _instRunCtxt.a->_flags &= ~kFlagsActing; + runCommands(_instRunCtxt.a->_commands, _instRunCtxt.a); + } + _instRunCtxt.a->_program->_ip = _instRunCtxt.a->_program->_instructions.begin(); + + _instRunCtxt.suspend = true; } void Parallaction_br::initOpcodes() { diff --git a/engines/parallaction/exec_ns.cpp b/engines/parallaction/exec_ns.cpp index 0c04f566fc..bfe65d4054 100644 --- a/engines/parallaction/exec_ns.cpp +++ b/engines/parallaction/exec_ns.cpp @@ -364,12 +364,13 @@ void Parallaction_ns::drawAnimations() { void Parallaction_ns::runScripts() { - debugC(9, kDebugExec, "runScripts"); - if (_engineFlags & kEnginePauseJobs) { return; } + debugC(9, kDebugExec, "runScripts"); + + static uint16 modCounter = 0; for (AnimationList::iterator it = _animations.begin(); it != _animations.end(); it++) { diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index 6f0d085185..9f775b5a63 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -873,9 +873,8 @@ public: int16 _lipSyncVal; uint _subtitleLipSync; - - Label _subtitle0; - Label _subtitle1; + int _subtitleY; + int _subtitle[2]; Zone *_activeZone2; diff --git a/engines/parallaction/parallaction_br.cpp b/engines/parallaction/parallaction_br.cpp index f8ba6e7e07..01b3815e6d 100644 --- a/engines/parallaction/parallaction_br.cpp +++ b/engines/parallaction/parallaction_br.cpp @@ -183,10 +183,18 @@ void Parallaction_br::startPart() { parseLocation("common"); parseLocation(_location._name); + changeLocation(_location._name); + } void Parallaction_br::changeLocation(char *location) { + runCommands(_location._commands); + +// doLocationEnterTransition(); + + runCommands(_location._aCommands); + } void Parallaction_br::changeCharacter(const char *name) { diff --git a/engines/parallaction/parser_br.cpp b/engines/parallaction/parser_br.cpp index c0d218b010..7f53ee2918 100644 --- a/engines/parallaction/parser_br.cpp +++ b/engines/parallaction/parser_br.cpp @@ -494,7 +494,7 @@ DECLARE_COMMAND_PARSER(text) { _locParseCtxt.cmd->u._zeta0 = atoi(_tokens[1]); _locParseCtxt.nextToken++; } else { - _locParseCtxt.cmd->u._zeta0 = 0; + _locParseCtxt.cmd->u._zeta0 = -1; } _locParseCtxt.cmd->u._string = strdup(_tokens[_locParseCtxt.nextToken]); @@ -947,6 +947,13 @@ void Parallaction_br::parseLocation(const char* filename) { free(_locParseCtxt.maskName); free(_locParseCtxt.pathName); + AnimationList::iterator it = _animations.begin(); + for ( ; it != _animations.end(); it++) { + if (((*it)->_scriptName) && ((*it)->_program == 0)) { + loadProgram(*it, (*it)->_scriptName); + } + } + // drawZones(); return; |