[Scummvm-cvs-logs] SF.net SVN: scummvm: [30747] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sat Feb 2 22:22:06 CET 2008


Revision: 30747
          http://scummvm.svn.sourceforge.net/scummvm/?rev=30747&view=rev
Author:   peres001
Date:     2008-02-02 13:22:05 -0800 (Sat, 02 Feb 2008)

Log Message:
-----------
Subtitles are now displayed in the intro for BRA, though in wrong color (and I don't know why).

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/exec_br.cpp
    scummvm/trunk/engines/parallaction/exec_ns.cpp
    scummvm/trunk/engines/parallaction/parallaction.h
    scummvm/trunk/engines/parallaction/parallaction_br.cpp
    scummvm/trunk/engines/parallaction/parser_br.cpp

Modified: scummvm/trunk/engines/parallaction/exec_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/exec_br.cpp	2008-02-02 20:32:52 UTC (rev 30746)
+++ scummvm/trunk/engines/parallaction/exec_br.cpp	2008-02-02 21:22:05 UTC (rev 30747)
@@ -70,47 +70,29 @@
 #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)) {
+	_gfx->freeLabels();
+	_subtitle[0] = _subtitle[1] = -1;
 
-		removeJob(_jDisplaySubtitle);
-		addJob(kJobWaitRemoveSubtitleJob, _jEraseSubtitle, 15);
-		_jDisplaySubtitle = 0;
-
-		_subtitle0.free();
-		_subtitle1.free();
+	if (!scumm_stricmp("clear", s)) {
 		return;
 	}
 
-	_subtitle0.free();
-	_subtitle1.free();
+	if (y != -1) {
+		_subtitleY = y;
+	}
 
-	renderLabel(&_subtitle0._cnv, s);
-	_subtitle0._text = strdup(s);
-
+	_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(start) {
-	warning("Parallaction_br::cmdOp_start not yet implemented");
+	_cmdRunCtxt.cmd->u._animation->_flags |= kFlagsActing;
 }
 
 DECLARE_COMMAND_OPCODE(stop) {
@@ -425,35 +407,6 @@
 	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(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() {

Modified: scummvm/trunk/engines/parallaction/exec_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/exec_ns.cpp	2008-02-02 20:32:52 UTC (rev 30746)
+++ scummvm/trunk/engines/parallaction/exec_ns.cpp	2008-02-02 21:22:05 UTC (rev 30747)
@@ -364,12 +364,13 @@
 
 
 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++) {

Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h	2008-02-02 20:32:52 UTC (rev 30746)
+++ scummvm/trunk/engines/parallaction/parallaction.h	2008-02-02 21:22:05 UTC (rev 30747)
@@ -873,10 +873,9 @@
 
 	int16		_lipSyncVal;
 	uint		_subtitleLipSync;
+	int			_subtitleY;
+	int			_subtitle[2];
 
-	Label		_subtitle0;
-	Label		_subtitle1;
-
 	Zone		*_activeZone2;
 
 	int32		_counters[32];

Modified: scummvm/trunk/engines/parallaction/parallaction_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_br.cpp	2008-02-02 20:32:52 UTC (rev 30746)
+++ scummvm/trunk/engines/parallaction/parallaction_br.cpp	2008-02-02 21:22:05 UTC (rev 30747)
@@ -183,10 +183,18 @@
 	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) {

Modified: scummvm/trunk/engines/parallaction/parser_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parser_br.cpp	2008-02-02 20:32:52 UTC (rev 30746)
+++ scummvm/trunk/engines/parallaction/parser_br.cpp	2008-02-02 21:22:05 UTC (rev 30747)
@@ -494,7 +494,7 @@
 		_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 @@
 	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;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list