2005-01-17 10:57:15 +00:00
|
|
|
/* Copyright (C) 1994-1998 Revolution Software Ltd.
|
|
|
|
* Copyright (C) 2003-2005 The ScummVM project
|
2004-01-13 01:26:18 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* $Header$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2004-01-12 11:11:19 +00:00
|
|
|
#include "common/stdafx.h"
|
2004-02-21 20:00:51 +00:00
|
|
|
#include "common/file.h"
|
2004-12-21 02:12:58 +00:00
|
|
|
#include "common/config-manager.h"
|
2005-01-10 22:06:49 +00:00
|
|
|
#include "common/system.h"
|
2004-02-21 20:00:51 +00:00
|
|
|
#include "sound/vorbis.h"
|
|
|
|
#include "sound/mp3.h"
|
|
|
|
|
2004-01-12 11:11:19 +00:00
|
|
|
#include "sword2/sword2.h"
|
2005-02-27 16:11:19 +00:00
|
|
|
#include "sword2/defs.h"
|
2004-02-05 14:19:07 +00:00
|
|
|
#include "sword2/maketext.h"
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
#include "sword2/resman.h"
|
|
|
|
#include "sword2/sound.h"
|
2004-01-13 14:22:29 +00:00
|
|
|
#include "sword2/driver/animation.h"
|
2004-01-12 11:11:19 +00:00
|
|
|
|
|
|
|
namespace Sword2 {
|
|
|
|
|
2004-01-13 14:16:40 +00:00
|
|
|
AnimationState::AnimationState(Sword2Engine *vm)
|
2004-03-22 15:57:51 +00:00
|
|
|
: BaseAnimationState(vm->_mixer, vm->_system, 640, 480), _vm(vm) {
|
2004-01-13 14:16:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
AnimationState::~AnimationState() {
|
|
|
|
}
|
|
|
|
|
2004-01-17 14:20:32 +00:00
|
|
|
#ifdef BACKEND_8BIT
|
|
|
|
|
2004-03-21 18:49:04 +00:00
|
|
|
void AnimationState::setPalette(byte *pal) {
|
2005-02-19 14:02:16 +00:00
|
|
|
_vm->_screen->setPalette(0, 256, pal, RDPAL_INSTANT);
|
2004-03-21 18:49:04 +00:00
|
|
|
}
|
|
|
|
|
2004-01-17 14:20:32 +00:00
|
|
|
#else
|
|
|
|
|
2004-04-23 07:02:11 +00:00
|
|
|
void AnimationState::drawTextObject(SpriteInfo *s, byte *src) {
|
2005-03-11 15:30:28 +00:00
|
|
|
OverlayColor *dst = _overlay + RENDERWIDE * s->y + s->x;
|
2004-01-18 21:09:57 +00:00
|
|
|
|
|
|
|
// FIXME: These aren't the "right" colours, but look good to me.
|
|
|
|
|
2004-03-21 18:49:04 +00:00
|
|
|
OverlayColor pen = _sys->RGBToColor(255, 255, 255);
|
|
|
|
OverlayColor border = _sys->RGBToColor(0, 0, 0);
|
2004-01-18 21:09:57 +00:00
|
|
|
|
|
|
|
for (int y = 0; y < s->h; y++) {
|
|
|
|
for (int x = 0; x < s->w; x++) {
|
|
|
|
switch (src[x]) {
|
|
|
|
case 1:
|
|
|
|
dst[x] = border;
|
|
|
|
break;
|
|
|
|
case 255:
|
|
|
|
dst[x] = pen;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dst += RENDERWIDE;
|
|
|
|
src += s->w;
|
|
|
|
}
|
|
|
|
}
|
2004-01-17 14:20:32 +00:00
|
|
|
|
2004-03-24 07:29:59 +00:00
|
|
|
#endif
|
|
|
|
|
2005-03-11 15:30:28 +00:00
|
|
|
void AnimationState::clearScreen() {
|
2004-03-24 07:29:59 +00:00
|
|
|
#ifdef BACKEND_8BIT
|
2005-03-11 15:30:28 +00:00
|
|
|
memset(_vm->_screen->getScreen(), 0, _movieWidth * _movieHeight);
|
2004-03-24 07:29:59 +00:00
|
|
|
#else
|
2004-03-21 18:49:04 +00:00
|
|
|
OverlayColor black = _sys->RGBToColor(0, 0, 0);
|
2004-02-14 10:37:21 +00:00
|
|
|
|
2005-03-11 15:30:28 +00:00
|
|
|
for (int i = 0; i < _movieWidth * _movieHeight; i++)
|
|
|
|
_overlay[i] = black;
|
2004-03-24 07:29:59 +00:00
|
|
|
#endif
|
2004-02-14 10:37:21 +00:00
|
|
|
}
|
|
|
|
|
2005-03-11 15:30:28 +00:00
|
|
|
void AnimationState::updateScreen() {
|
2004-03-24 07:29:59 +00:00
|
|
|
#ifdef BACKEND_8BIT
|
2005-03-11 15:30:28 +00:00
|
|
|
byte *buf = _vm->_screen->getScreen() + ((480 - _movieHeight) / 2) * RENDERWIDE + (640 - _movieWidth) / 2;
|
2004-01-13 14:16:40 +00:00
|
|
|
|
2005-03-11 15:30:28 +00:00
|
|
|
_vm->_system->copyRectToScreen(buf, _movieWidth, (640 - _movieWidth) / 2, (480 - _movieHeight) / 2, _movieWidth, _movieHeight);
|
2004-03-24 07:29:59 +00:00
|
|
|
#else
|
2005-03-11 15:30:28 +00:00
|
|
|
_sys->copyRectToOverlay(_overlay, _movieWidth, 0, 0, _movieWidth, _movieHeight);
|
2004-01-17 14:20:32 +00:00
|
|
|
#endif
|
2004-03-24 07:29:59 +00:00
|
|
|
_vm->_system->updateScreen();
|
|
|
|
}
|
2004-01-17 14:20:32 +00:00
|
|
|
|
2004-03-23 00:10:18 +00:00
|
|
|
void AnimationState::drawYUV(int width, int height, byte *const *dat) {
|
2004-03-22 01:40:24 +00:00
|
|
|
#ifdef BACKEND_8BIT
|
2005-03-11 15:30:28 +00:00
|
|
|
_vm->_screen->plotYUV(_lut, width, height, dat);
|
2004-03-22 01:40:24 +00:00
|
|
|
#else
|
2005-03-06 14:12:40 +00:00
|
|
|
plotYUV(width, height, dat);
|
2004-03-22 01:40:24 +00:00
|
|
|
#endif
|
2004-01-13 14:16:40 +00:00
|
|
|
}
|
|
|
|
|
2004-02-15 14:22:54 +00:00
|
|
|
MovieInfo MoviePlayer::_movies[] = {
|
2005-04-25 05:23:21 +00:00
|
|
|
{ "carib", 222, false },
|
|
|
|
{ "escape", 187, false },
|
|
|
|
{ "eye", 248, false },
|
|
|
|
{ "finale", 1485, false },
|
|
|
|
{ "guard", 75, false },
|
|
|
|
{ "intro", 1800, false },
|
|
|
|
{ "jungle", 186, false },
|
|
|
|
{ "museum", 167, false },
|
|
|
|
{ "pablo", 75, false },
|
|
|
|
{ "pyramid", 60, false },
|
|
|
|
{ "quaram", 184, false },
|
|
|
|
{ "river", 656, false },
|
|
|
|
{ "sailing", 138, false },
|
|
|
|
{ "shaman", 788, true },
|
|
|
|
{ "stone1", 34, false },
|
|
|
|
{ "stone2", 282, false },
|
|
|
|
{ "stone3", 65, false },
|
|
|
|
{ "demo", 60, false },
|
|
|
|
{ "enddemo", 110, false }
|
2004-02-15 14:22:54 +00:00
|
|
|
};
|
|
|
|
|
2004-03-21 18:49:04 +00:00
|
|
|
MoviePlayer::MoviePlayer(Sword2Engine *vm)
|
|
|
|
: _vm(vm), _snd(_vm->_mixer), _sys(_vm->_system), _textSurface(NULL) {
|
|
|
|
}
|
|
|
|
|
2004-01-13 10:09:53 +00:00
|
|
|
void MoviePlayer::openTextObject(MovieTextObject *obj) {
|
|
|
|
if (obj->textSprite)
|
2005-02-19 14:02:16 +00:00
|
|
|
_vm->_screen->createSurface(obj->textSprite, &_textSurface);
|
2004-01-13 10:09:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void MoviePlayer::closeTextObject(MovieTextObject *obj) {
|
|
|
|
if (_textSurface) {
|
2005-02-19 14:02:16 +00:00
|
|
|
_vm->_screen->deleteSurface(_textSurface);
|
2004-01-13 10:09:53 +00:00
|
|
|
_textSurface = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-01-18 21:09:57 +00:00
|
|
|
void MoviePlayer::drawTextObject(AnimationState *anim, MovieTextObject *obj) {
|
|
|
|
if (obj->textSprite && _textSurface) {
|
|
|
|
#ifdef BACKEND_8BIT
|
2005-02-19 14:02:16 +00:00
|
|
|
_vm->_screen->drawSurface(obj->textSprite, _textSurface);
|
2004-01-18 21:09:57 +00:00
|
|
|
#else
|
|
|
|
if (anim)
|
|
|
|
anim->drawTextObject(obj->textSprite, _textSurface);
|
|
|
|
else
|
2005-02-19 14:02:16 +00:00
|
|
|
_vm->_screen->drawSurface(obj->textSprite, _textSurface);
|
2004-01-18 21:09:57 +00:00
|
|
|
#endif
|
|
|
|
}
|
2004-01-13 10:09:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Plays an animated cutscene.
|
|
|
|
* @param filename the file name of the cutscene file
|
|
|
|
* @param text the subtitles and voiceovers for the cutscene
|
2005-05-08 17:13:08 +00:00
|
|
|
* @param leadInRes lead-in music resource id
|
|
|
|
* @param leadOutRes lead-out music resource id
|
2004-01-13 10:09:53 +00:00
|
|
|
*/
|
|
|
|
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
int32 MoviePlayer::play(const char *filename, MovieTextObject *text[], int32 leadInRes, int32 leadOutRes) {
|
2005-05-11 00:01:44 +00:00
|
|
|
Audio::SoundHandle leadInHandle;
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
|
2004-03-24 07:29:59 +00:00
|
|
|
// This happens if the user quits during the "eye" smacker
|
|
|
|
if (_vm->_quit)
|
|
|
|
return RD_OK;
|
|
|
|
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
if (leadInRes) {
|
|
|
|
byte *leadIn = _vm->_resman->openResource(leadInRes);
|
|
|
|
uint32 leadInLen = _vm->_resman->fetchLen(leadInRes) - sizeof(StandardHeader);
|
2005-05-12 13:12:15 +00:00
|
|
|
StandardHeader *header = (StandardHeader *)leadIn;
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
|
|
|
|
assert(header->fileType == WAV_FILE);
|
|
|
|
|
|
|
|
leadIn += sizeof(StandardHeader);
|
|
|
|
|
2005-05-10 23:48:48 +00:00
|
|
|
_vm->_sound->playFx(&leadInHandle, leadIn, leadInLen, Audio::Mixer::kMaxChannelVolume, 0, false, Audio::Mixer::kMusicSoundType);
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
byte *leadOut = NULL;
|
|
|
|
uint32 leadOutLen = 0;
|
|
|
|
|
|
|
|
if (leadOutRes) {
|
|
|
|
leadOut = _vm->_resman->openResource(leadOutRes);
|
|
|
|
leadOutLen = _vm->_resman->fetchLen(leadOutRes) - sizeof(StandardHeader);
|
2005-05-12 13:12:15 +00:00
|
|
|
StandardHeader *header = (StandardHeader *)leadOut;
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
|
|
|
|
assert(header->fileType == WAV_FILE);
|
|
|
|
|
|
|
|
leadOut += sizeof(StandardHeader);
|
|
|
|
}
|
|
|
|
|
2005-04-25 05:23:21 +00:00
|
|
|
_leadOutFrame = (uint) -1;
|
|
|
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAYSIZE(_movies); i++) {
|
|
|
|
if (scumm_stricmp(filename, _movies[i].name) == 0) {
|
|
|
|
_seamless = _movies[i].seamless;
|
|
|
|
if (_movies[i].frames > 60)
|
|
|
|
_leadOutFrame = _movies[i].frames - 60;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (i == ARRAYSIZE(_movies))
|
|
|
|
warning("Unknown movie, '%s'", filename);
|
|
|
|
|
2004-01-13 10:09:53 +00:00
|
|
|
#ifdef USE_MPEG2
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
playMPEG(filename, text, leadOut, leadOutLen);
|
|
|
|
#else
|
|
|
|
// No MPEG2? Use the old 'Narration Only' hack
|
2005-01-28 22:10:56 +00:00
|
|
|
playDummy(filename, text, leadOut, leadOutLen);
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
#endif
|
|
|
|
|
2005-03-12 18:56:09 +00:00
|
|
|
_snd->stopHandle(leadInHandle);
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
|
2005-04-24 15:38:53 +00:00
|
|
|
// Wait for the lead-out to stop, if there is any. Though don't do it
|
2005-04-25 05:23:21 +00:00
|
|
|
// for seamless movies, since they are meant to blend into the rest of
|
|
|
|
// the game.
|
2005-04-24 15:38:53 +00:00
|
|
|
|
2005-04-25 05:23:21 +00:00
|
|
|
if (!_seamless) {
|
2005-04-24 15:38:53 +00:00
|
|
|
while (_vm->_mixer->isSoundHandleActive(_leadOutHandle)) {
|
|
|
|
_vm->_screen->updateDisplay();
|
|
|
|
_vm->_system->delayMillis(30);
|
|
|
|
}
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (leadInRes)
|
|
|
|
_vm->_resman->closeResource(leadInRes);
|
|
|
|
|
|
|
|
if (leadOutRes)
|
|
|
|
_vm->_resman->closeResource(leadOutRes);
|
|
|
|
|
|
|
|
return RD_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
void MoviePlayer::playMPEG(const char *filename, MovieTextObject *text[], byte *leadOut, uint32 leadOutLen) {
|
2004-02-15 14:22:54 +00:00
|
|
|
uint frameCounter = 0, textCounter = 0;
|
2005-05-11 00:01:44 +00:00
|
|
|
Audio::SoundHandle handle;
|
2004-01-13 10:09:53 +00:00
|
|
|
bool skipCutscene = false, textVisible = false;
|
2005-05-10 23:48:48 +00:00
|
|
|
uint32 flags = Audio::Mixer::FLAG_16BITS;
|
2004-01-18 19:50:59 +00:00
|
|
|
bool startNextText = false;
|
2004-01-13 10:09:53 +00:00
|
|
|
|
2004-06-09 06:33:29 +00:00
|
|
|
byte oldPal[256 * 4];
|
2005-02-19 14:02:16 +00:00
|
|
|
memcpy(oldPal, _vm->_screen->getPalette(), sizeof(oldPal));
|
2004-01-13 10:09:53 +00:00
|
|
|
|
2004-01-13 14:16:40 +00:00
|
|
|
AnimationState *anim = new AnimationState(_vm);
|
2004-02-15 14:22:54 +00:00
|
|
|
|
2004-01-13 14:16:40 +00:00
|
|
|
if (!anim->init(filename)) {
|
|
|
|
delete anim;
|
2004-01-13 10:09:53 +00:00
|
|
|
// Missing Files? Use the old 'Narration Only' hack
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
playDummy(filename, text, leadOut, leadOutLen);
|
|
|
|
return;
|
2004-01-13 10:09:53 +00:00
|
|
|
}
|
|
|
|
|
2004-03-28 13:10:52 +00:00
|
|
|
// Clear the screen, because whatever is on it will be visible when the
|
2005-03-11 15:30:28 +00:00
|
|
|
// overlay is removed. And if there isn't an overlay, we don't want it
|
|
|
|
// to be visible during the cutscene. (Not all cutscenes cover the
|
|
|
|
// entire screen.)
|
2005-02-19 14:02:16 +00:00
|
|
|
_vm->_screen->clearScene();
|
|
|
|
_vm->_screen->updateDisplay();
|
2004-01-13 10:09:53 +00:00
|
|
|
|
|
|
|
#ifndef SCUMM_BIG_ENDIAN
|
2005-05-10 23:48:48 +00:00
|
|
|
flags |= Audio::Mixer::FLAG_LITTLE_ENDIAN;
|
2004-01-13 10:09:53 +00:00
|
|
|
#endif
|
|
|
|
|
2004-03-24 07:29:59 +00:00
|
|
|
while (!skipCutscene && anim->decodeFrame()) {
|
|
|
|
// The frame has been drawn. Now draw the subtitles, if any,
|
|
|
|
// before updating the screen.
|
|
|
|
|
2004-01-22 21:02:29 +00:00
|
|
|
if (text && text[textCounter]) {
|
2004-01-13 10:09:53 +00:00
|
|
|
if (frameCounter == text[textCounter]->startFrame) {
|
|
|
|
openTextObject(text[textCounter]);
|
|
|
|
textVisible = true;
|
2004-01-18 12:07:21 +00:00
|
|
|
|
2004-01-18 19:50:59 +00:00
|
|
|
if (text[textCounter]->speech) {
|
|
|
|
startNextText = true;
|
2004-01-13 10:09:53 +00:00
|
|
|
}
|
2004-01-18 19:50:59 +00:00
|
|
|
}
|
2004-01-18 12:07:21 +00:00
|
|
|
|
2005-03-12 18:56:09 +00:00
|
|
|
if (startNextText && !_snd->isSoundHandleActive(handle)) {
|
2004-03-21 18:49:04 +00:00
|
|
|
_snd->playRaw(&handle, text[textCounter]->speech, text[textCounter]->speechBufferSize, 22050, flags);
|
2004-01-18 19:50:59 +00:00
|
|
|
startNextText = false;
|
|
|
|
}
|
2004-01-13 10:09:53 +00:00
|
|
|
|
|
|
|
if (frameCounter == text[textCounter]->endFrame) {
|
|
|
|
closeTextObject(text[textCounter]);
|
|
|
|
textCounter++;
|
|
|
|
textVisible = false;
|
|
|
|
}
|
2004-03-24 07:29:59 +00:00
|
|
|
|
2004-01-13 10:09:53 +00:00
|
|
|
if (textVisible)
|
2004-01-18 21:09:57 +00:00
|
|
|
drawTextObject(anim, text[textCounter]);
|
2004-01-13 10:09:53 +00:00
|
|
|
}
|
|
|
|
|
2004-03-24 07:29:59 +00:00
|
|
|
anim->updateScreen();
|
2004-01-13 10:09:53 +00:00
|
|
|
frameCounter++;
|
|
|
|
|
2005-04-25 05:23:21 +00:00
|
|
|
if (frameCounter == _leadOutFrame && leadOut)
|
2005-05-10 23:48:48 +00:00
|
|
|
_vm->_sound->playFx(&_leadOutHandle, leadOut, leadOutLen, Audio::Mixer::kMaxChannelVolume, 0, false, Audio::Mixer::kMusicSoundType);
|
2004-02-15 14:22:54 +00:00
|
|
|
|
2004-03-24 07:29:59 +00:00
|
|
|
OSystem::Event event;
|
2004-09-28 20:19:37 +00:00
|
|
|
while (_sys->pollEvent(event)) {
|
2004-12-05 17:42:20 +00:00
|
|
|
switch (event.type) {
|
2004-03-24 07:29:59 +00:00
|
|
|
#ifndef BACKEND_8BIT
|
|
|
|
case OSystem::EVENT_SCREEN_CHANGED:
|
2005-03-06 14:12:40 +00:00
|
|
|
anim->buildLookup();
|
2004-03-24 07:29:59 +00:00
|
|
|
break;
|
2004-01-17 14:20:32 +00:00
|
|
|
#endif
|
2004-03-24 07:29:59 +00:00
|
|
|
case OSystem::EVENT_KEYDOWN:
|
|
|
|
if (event.kbd.keycode == 27)
|
|
|
|
skipCutscene = true;
|
|
|
|
break;
|
|
|
|
case OSystem::EVENT_QUIT:
|
|
|
|
_vm->closeGame();
|
|
|
|
skipCutscene = true;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2004-01-13 10:09:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-02-15 14:22:54 +00:00
|
|
|
if (!skipCutscene) {
|
|
|
|
// Sleep for one frame so that the last frame is displayed.
|
2004-09-28 20:19:37 +00:00
|
|
|
_sys->delayMillis(1000 / 12);
|
2004-02-15 14:22:54 +00:00
|
|
|
}
|
|
|
|
|
2005-04-25 05:23:21 +00:00
|
|
|
if (!_seamless) {
|
|
|
|
// Most movies fade to black on their own, but not all of them.
|
|
|
|
// Since we may be hanging around in the cutscene player for a
|
|
|
|
// while longer, waiting for the lead-out sound to finish,
|
|
|
|
// paint the overlay black.
|
2004-02-15 14:22:54 +00:00
|
|
|
|
2005-04-25 05:23:21 +00:00
|
|
|
anim->clearScreen();
|
|
|
|
}
|
2004-02-15 14:22:54 +00:00
|
|
|
|
|
|
|
// If the speech is still playing, redraw the subtitles. At least in
|
|
|
|
// the English version this is most noticeable in the "carib" cutscene.
|
|
|
|
|
2005-03-12 18:56:09 +00:00
|
|
|
if (textVisible && _snd->isSoundHandleActive(handle))
|
2004-02-15 14:22:54 +00:00
|
|
|
drawTextObject(anim, text[textCounter]);
|
|
|
|
|
|
|
|
if (text)
|
|
|
|
closeTextObject(text[textCounter]);
|
|
|
|
|
2004-03-24 07:29:59 +00:00
|
|
|
anim->updateScreen();
|
2004-02-15 14:22:54 +00:00
|
|
|
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
// Wait for the voice to stop playing. This is to make sure that we
|
|
|
|
// don't cut off the speech in mid-sentence, and - even more
|
|
|
|
// importantly - that we don't free the sound buffer while it's in use.
|
2004-01-13 10:09:53 +00:00
|
|
|
|
2004-03-24 07:29:59 +00:00
|
|
|
if (skipCutscene)
|
|
|
|
_snd->stopHandle(handle);
|
|
|
|
|
2005-03-12 18:56:09 +00:00
|
|
|
while (_snd->isSoundHandleActive(handle)) {
|
2005-02-19 14:02:16 +00:00
|
|
|
_vm->_screen->updateDisplay(false);
|
2004-09-28 20:19:37 +00:00
|
|
|
_sys->delayMillis(100);
|
2004-01-13 10:09:53 +00:00
|
|
|
}
|
|
|
|
|
2005-04-25 05:23:21 +00:00
|
|
|
if (!_seamless) {
|
|
|
|
// Clear the screen again
|
|
|
|
anim->clearScreen();
|
|
|
|
anim->updateScreen();
|
|
|
|
}
|
2004-01-13 10:09:53 +00:00
|
|
|
|
2005-02-19 14:02:16 +00:00
|
|
|
_vm->_screen->setPalette(0, 256, oldPal, RDPAL_INSTANT);
|
2004-01-13 10:09:53 +00:00
|
|
|
|
2004-01-13 14:16:40 +00:00
|
|
|
delete anim;
|
2004-01-13 10:09:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This just plays the cutscene with voiceovers / subtitles, in case the files
|
|
|
|
* are missing.
|
|
|
|
*/
|
|
|
|
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
void MoviePlayer::playDummy(const char *filename, MovieTextObject *text[], byte *leadOut, uint32 leadOutLen) {
|
|
|
|
if (!text)
|
|
|
|
return;
|
|
|
|
|
2004-01-13 10:09:53 +00:00
|
|
|
int frameCounter = 0, textCounter = 0;
|
|
|
|
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
byte oldPal[256 * 4];
|
|
|
|
byte tmpPal[256 * 4];
|
|
|
|
|
2005-02-19 14:02:16 +00:00
|
|
|
_vm->_screen->clearScene();
|
2004-01-13 10:09:53 +00:00
|
|
|
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
// HACK: Draw instructions
|
|
|
|
//
|
|
|
|
// I'm using the the menu area, because that's unlikely to be touched
|
|
|
|
// by anything else during the cutscene.
|
2004-01-13 10:09:53 +00:00
|
|
|
|
2005-02-19 14:02:16 +00:00
|
|
|
memset(_vm->_screen->getScreen(), 0, _vm->_screen->getScreenWide() * MENUDEEP);
|
2004-01-13 10:09:53 +00:00
|
|
|
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
byte *data;
|
2004-12-21 02:12:58 +00:00
|
|
|
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
// Russian version substituted latin characters with cyrillic. That's
|
|
|
|
// why it renders completely unreadable with default message
|
|
|
|
if (Common::parseLanguage(ConfMan.get("language")) == Common::RU_RUS) {
|
|
|
|
byte msg[] = "Po\344uk - to\344\345ko pev\345: hagmute k\344abuwy Ucke\343n, u\344u nocetute ca\343t npoekta u ckava\343te budeo po\344uku";
|
|
|
|
data = _vm->_fontRenderer->makeTextSprite(msg, RENDERWIDE, 255, _vm->_speechFontId);
|
|
|
|
} else {
|
|
|
|
// TODO: Translate message to other languages?
|
2005-01-04 15:31:30 +00:00
|
|
|
#ifdef USE_MPEG2
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
byte msg[] = "Cutscene - Narration Only: Press ESC to exit, or visit www.scummvm.org to download cutscene videos";
|
2005-01-04 15:31:30 +00:00
|
|
|
#else
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
byte msg[] = "Cutscene - Narration Only: Press ESC to exit, or recompile ScummVM with MPEG2 support";
|
2005-01-04 15:31:30 +00:00
|
|
|
#endif
|
2004-12-21 02:12:58 +00:00
|
|
|
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
data = _vm->_fontRenderer->makeTextSprite(msg, RENDERWIDE, 255, _vm->_speechFontId);
|
|
|
|
}
|
|
|
|
|
2005-05-12 13:12:15 +00:00
|
|
|
FrameHeader *frame = (FrameHeader *)data;
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
SpriteInfo msgSprite;
|
|
|
|
byte *msgSurface;
|
2004-01-13 10:09:53 +00:00
|
|
|
|
2005-02-19 14:02:16 +00:00
|
|
|
msgSprite.x = _vm->_screen->getScreenWide() / 2 - frame->width / 2;
|
2005-02-27 16:11:19 +00:00
|
|
|
msgSprite.y = MENUDEEP / 2 - frame->height / 2;
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
msgSprite.w = frame->width;
|
|
|
|
msgSprite.h = frame->height;
|
|
|
|
msgSprite.type = RDSPR_NOCOMPRESSION;
|
|
|
|
msgSprite.data = data + sizeof(FrameHeader);
|
2004-01-13 10:09:53 +00:00
|
|
|
|
2005-02-19 14:02:16 +00:00
|
|
|
_vm->_screen->createSurface(&msgSprite, &msgSurface);
|
|
|
|
_vm->_screen->drawSurface(&msgSprite, msgSurface);
|
|
|
|
_vm->_screen->deleteSurface(msgSurface);
|
2004-01-13 10:09:53 +00:00
|
|
|
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
free(data);
|
2004-01-13 10:09:53 +00:00
|
|
|
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
// In case the cutscene has a long lead-in, start just before the first
|
|
|
|
// line of text.
|
2004-01-13 10:09:53 +00:00
|
|
|
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
frameCounter = text[0]->startFrame - 12;
|
2004-01-13 10:09:53 +00:00
|
|
|
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
// Fake a palette that will hopefully make the text visible. In the
|
|
|
|
// opening cutscene it seems to use colours 1 (black) and 255 (white).
|
2004-01-13 10:09:53 +00:00
|
|
|
|
2005-02-19 14:02:16 +00:00
|
|
|
memcpy(oldPal, _vm->_screen->getPalette(), sizeof(oldPal));
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
memset(tmpPal, 0, sizeof(tmpPal));
|
|
|
|
tmpPal[255 * 4 + 0] = 255;
|
|
|
|
tmpPal[255 * 4 + 1] = 255;
|
|
|
|
tmpPal[255 * 4 + 2] = 255;
|
2005-02-19 14:02:16 +00:00
|
|
|
_vm->_screen->setPalette(0, 256, tmpPal, RDPAL_INSTANT);
|
2004-01-13 10:09:53 +00:00
|
|
|
|
2005-05-11 00:01:44 +00:00
|
|
|
Audio::SoundHandle handle;
|
2004-01-13 10:09:53 +00:00
|
|
|
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
bool skipCutscene = false;
|
|
|
|
|
2005-05-10 23:48:48 +00:00
|
|
|
uint32 flags = Audio::Mixer::FLAG_16BITS;
|
2004-01-13 10:09:53 +00:00
|
|
|
|
|
|
|
#ifndef SCUMM_BIG_ENDIAN
|
2005-05-10 23:48:48 +00:00
|
|
|
flags |= Audio::Mixer::FLAG_LITTLE_ENDIAN;
|
2004-01-13 10:09:53 +00:00
|
|
|
#endif
|
|
|
|
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
while (1) {
|
|
|
|
if (!text[textCounter])
|
|
|
|
break;
|
2004-01-13 10:09:53 +00:00
|
|
|
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
if (frameCounter == text[textCounter]->startFrame) {
|
2005-02-19 14:02:16 +00:00
|
|
|
_vm->_screen->clearScene();
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
openTextObject(text[textCounter]);
|
|
|
|
drawTextObject(NULL, text[textCounter]);
|
|
|
|
if (text[textCounter]->speech) {
|
|
|
|
_snd->playRaw(&handle, text[textCounter]->speech, text[textCounter]->speechBufferSize, 22050, flags);
|
2004-01-13 10:09:53 +00:00
|
|
|
}
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
}
|
2004-01-13 10:09:53 +00:00
|
|
|
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
if (frameCounter == text[textCounter]->endFrame) {
|
|
|
|
closeTextObject(text[textCounter]);
|
2005-02-19 14:02:16 +00:00
|
|
|
_vm->_screen->clearScene();
|
|
|
|
_vm->_screen->setNeedFullRedraw();
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
textCounter++;
|
|
|
|
}
|
2004-01-13 10:09:53 +00:00
|
|
|
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
frameCounter++;
|
2005-02-19 14:02:16 +00:00
|
|
|
_vm->_screen->updateDisplay();
|
2004-01-13 10:09:53 +00:00
|
|
|
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
KeyboardEvent *ke = _vm->keyboardEvent();
|
2004-01-13 10:09:53 +00:00
|
|
|
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
if ((ke && ke->keycode == 27) || _vm->_quit) {
|
|
|
|
_snd->stopHandle(handle);
|
|
|
|
skipCutscene = true;
|
|
|
|
break;
|
2004-01-13 10:09:53 +00:00
|
|
|
}
|
|
|
|
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
// Simulate ~12 frames per second. I don't know what frame rate
|
|
|
|
// the original movies had, or even if it was constant, but
|
|
|
|
// this seems to work reasonably.
|
2004-01-13 10:09:53 +00:00
|
|
|
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
_sys->delayMillis(90);
|
|
|
|
}
|
2004-01-13 10:09:53 +00:00
|
|
|
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
// Wait for the voice to stop playing. This is to make sure that we
|
|
|
|
// don't cut off the speech in mid-sentence, and - even more
|
|
|
|
// importantly - that we don't free the sound buffer while it's in use.
|
2004-01-13 10:09:53 +00:00
|
|
|
|
2005-03-12 18:56:09 +00:00
|
|
|
while (_snd->isSoundHandleActive(handle)) {
|
2005-02-19 14:02:16 +00:00
|
|
|
_vm->_screen->updateDisplay(false);
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
_sys->delayMillis(100);
|
|
|
|
}
|
2004-01-13 10:09:53 +00:00
|
|
|
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
closeTextObject(text[textCounter]);
|
2004-01-13 10:09:53 +00:00
|
|
|
|
2005-02-19 14:02:16 +00:00
|
|
|
_vm->_screen->clearScene();
|
|
|
|
_vm->_screen->setNeedFullRedraw();
|
2004-01-13 10:09:53 +00:00
|
|
|
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
// HACK: Remove the instructions created above
|
|
|
|
Common::Rect r;
|
2004-01-13 10:09:53 +00:00
|
|
|
|
2005-02-19 14:02:16 +00:00
|
|
|
memset(_vm->_screen->getScreen(), 0, _vm->_screen->getScreenWide() * MENUDEEP);
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
r.left = r.top = 0;
|
2005-02-19 14:02:16 +00:00
|
|
|
r.right = _vm->_screen->getScreenWide();
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
r.bottom = MENUDEEP;
|
2005-02-19 14:02:16 +00:00
|
|
|
_vm->_screen->updateRect(&r);
|
2004-01-13 10:09:53 +00:00
|
|
|
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
// FIXME: For now, only play the lead-out music for cutscenes that have
|
|
|
|
// subtitles.
|
2004-01-13 10:09:53 +00:00
|
|
|
|
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp,
instead of having them scattered all over the place.
To get things to compile again, I had to rewrite the overly complicated
sound effects handling. It's much simpler now.
The next step will be to move any non-trivial code out of the opcode
functions and into the appropriate object. This, I hope, will make it
easier to create well-separated objects, instead of the current mess.
I also want to tear down the artificial boundary between the main directory
and the "driver" directory. We already have a cross-platform layer; there's
no need to have yet another one. (Actually, the rewriting of the sound
effects code took one first step in this direction.)
At the final stage, I'd like to get rid of the "drivers" directory
completely, but I'll probably need some help with that if I want to
preserve the CVS history of the code.
Things will probably be a bit bumpy along the way, but I seem to have
reached a point of relative stability again, which is why I'm commiting
this now.
svn-id: r16668
2005-01-28 16:33:14 +00:00
|
|
|
if (!skipCutscene && leadOut)
|
2005-05-10 23:48:48 +00:00
|
|
|
_vm->_sound->playFx(&_leadOutHandle, leadOut, leadOutLen, Audio::Mixer::kMaxChannelVolume, 0, false, Audio::Mixer::kMusicSoundType);
|
2004-01-13 10:09:53 +00:00
|
|
|
|
2005-02-19 14:02:16 +00:00
|
|
|
_vm->_screen->setPalette(0, 256, oldPal, RDPAL_INSTANT);
|
2004-01-13 10:09:53 +00:00
|
|
|
}
|
|
|
|
|
2004-01-12 11:11:19 +00:00
|
|
|
} // End of namespace Sword2
|