diff options
author | Torbjörn Andersson | 2007-02-08 21:55:37 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2007-02-08 21:55:37 +0000 |
commit | 98a8e88f61e871096fe979c2d9a27c2053aa38ca (patch) | |
tree | c480e85462867cc355066e9d6b2e696ef8b23e9d /engines/sword2/function.cpp | |
parent | 65dfc335ef134c4ff7a6d50ddab38c0565611f3b (diff) | |
download | scummvm-rg350-98a8e88f61e871096fe979c2d9a27c2053aa38ca.tar.gz scummvm-rg350-98a8e88f61e871096fe979c2d9a27c2053aa38ca.tar.bz2 scummvm-rg350-98a8e88f61e871096fe979c2d9a27c2053aa38ca.zip |
Instead of pre-rendering all subtitles and pre-loading all sounds for a movie
cutscene, render the text and play the speech when needed. It probably won't
play as nicely from CD now, but using less memory seems more important to me.
svn-id: r25428
Diffstat (limited to 'engines/sword2/function.cpp')
-rw-r--r-- | engines/sword2/function.cpp | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/engines/sword2/function.cpp b/engines/sword2/function.cpp index 3812a4f5a3..ea7629ce4c 100644 --- a/engines/sword2/function.cpp +++ b/engines/sword2/function.cpp @@ -2102,7 +2102,6 @@ int32 Logic::fnPlaySequence(int32 *params) { // 1 number of frames in the sequence, used for PSX. char filename[30]; - MovieTextObject *sequenceSpeechArray[MAX_SEQUENCE_TEXT_LINES + 1]; // The original code had some #ifdef blocks for skipping or muting the // cutscenes - fondly described as "the biggest fudge in the history @@ -2118,12 +2117,7 @@ int32 Logic::fnPlaySequence(int32 *params) { // Write to walkthrough file (zebug0.txt) debug(5, "PLAYING SEQUENCE \"%s\"", filename); - // now create the text sprites, if any - - if (_sequenceTextLines) - createSequenceSpeech(sequenceSpeechArray); - - // don't want to carry on streaming game music when smacker starts! + // don't want to carry on streaming game music when cutscene starts! fnStopMusic(NULL); // pause sfx during sequence @@ -2131,10 +2125,12 @@ int32 Logic::fnPlaySequence(int32 *params) { MoviePlayer *player = makeMoviePlayer(_vm, filename); - if (player->load(filename, (_sequenceTextLines && !readVar(DEMO)) ? sequenceSpeechArray : NULL)) { - player->play(_smackerLeadIn, _smackerLeadOut); + if (player->load()) { + player->play(_sequenceTextList, _sequenceTextLines, _smackerLeadIn, _smackerLeadOut); } + _sequenceTextLines = 0; + delete player; // unpause sound fx again, in case we're staying in same location @@ -2143,11 +2139,6 @@ int32 Logic::fnPlaySequence(int32 *params) { _smackerLeadIn = 0; _smackerLeadOut = 0; - // now clear the text sprites, if any - - if (_sequenceTextLines) - clearSequenceSpeech(sequenceSpeechArray); - // now clear the screen in case the Sequence was quitted (using ESC) // rather than fading down to black @@ -2219,12 +2210,15 @@ int32 Logic::fnAddSequenceText(int32 *params) { // 1 frame number to start the text displaying // 2 frame number to stop the text dispalying - assert(_sequenceTextLines < MAX_SEQUENCE_TEXT_LINES); + if (!readVar(DEMO)) { + assert(_sequenceTextLines < MAX_SEQUENCE_TEXT_LINES); + + _sequenceTextList[_sequenceTextLines].textNumber = params[0]; + _sequenceTextList[_sequenceTextLines].startFrame = params[1]; + _sequenceTextList[_sequenceTextLines].endFrame = params[2]; + _sequenceTextLines++; + } - _sequenceTextList[_sequenceTextLines].textNumber = params[0]; - _sequenceTextList[_sequenceTextLines].startFrame = params[1]; - _sequenceTextList[_sequenceTextLines].endFrame = params[2]; - _sequenceTextLines++; return IR_CONT; } |