diff options
author | Max Horn | 2004-03-21 18:49:04 +0000 |
---|---|---|
committer | Max Horn | 2004-03-21 18:49:04 +0000 |
commit | b94448514efbed2a126c93a5a5d5f08c6a7fc697 (patch) | |
tree | 9888764a1fe171ce223cea5cb869befe73723048 /sword1/animation.cpp | |
parent | 3f997234230a0c960015b8e3a1cefb2e6c1674f4 (diff) | |
download | scummvm-rg350-b94448514efbed2a126c93a5a5d5f08c6a7fc697.tar.gz scummvm-rg350-b94448514efbed2a126c93a5a5d5f08c6a7fc697.tar.bz2 scummvm-rg350-b94448514efbed2a126c93a5a5d5f08c6a7fc697.zip |
Unify a bit more...
svn-id: r13354
Diffstat (limited to 'sword1/animation.cpp')
-rw-r--r-- | sword1/animation.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/sword1/animation.cpp b/sword1/animation.cpp index 74f9494d7f..f8e5d16fd6 100644 --- a/sword1/animation.cpp +++ b/sword1/animation.cpp @@ -104,7 +104,7 @@ bool AnimationState::init(const char *name) { palnum = 0; maxPalnum = p; - _sys->setPalette(palettes[palnum].pal, 0, 256); + setPalette(palettes[palnum].pal); lut = lut2 = lookup[0]; curpal = -1; cr = 0; @@ -140,6 +140,7 @@ bool AnimationState::init(const char *name) { /* Play audio - TODO: Sync with video?*/ sndfile = new File(); bgSoundStream = AudioStream::openStreamFile(name, sndfile); + if (bgSoundStream != NULL) { _snd->playInputStream(&bgSound, bgSoundStream, false, 255, 0, -1, false); } else { @@ -209,7 +210,7 @@ bool AnimationState::checkPaletteSwitch() { if (framenum == palettes[palnum].end) { unsigned char *l = lut2; palnum++; - _sys->setPalette(palettes[palnum].pal, 0, 256); + setPalette(palettes[palnum].pal); lutcalcnum = (BITDEPTH + palettes[palnum].end - (framenum + 1) + 2) / (palettes[palnum].end - (framenum + 1) + 2); lut2 = lut; lut = l; @@ -219,6 +220,10 @@ bool AnimationState::checkPaletteSwitch() { return false; } +void AnimationState::setPalette(byte *pal) { + _sys->setPalette(pal, 0, 256); +} + #else OverlayColor *AnimationState::lookup = 0; @@ -268,9 +273,9 @@ void AnimationState::plotYUV(OverlayColor *lut, int width, int height, byte *con int i = ((((dat[2][cpos] + ROUNDADD) >> SHIFT) * (BITDEPTH+1)) + ((dat[1][cpos] + ROUNDADD)>>SHIFT)) * 256; cpos++; - ptr[linepos ] = lut[i + dat[0][ ypos ]]; + ptr[linepos ] = lut[i + dat[0][ ypos ]]; ptr[MOVIE_WIDTH + linepos++] = lut[i + dat[0][width + ypos++]]; - ptr[linepos ] = lut[i + dat[0][ ypos ]]; + ptr[linepos ] = lut[i + dat[0][ ypos ]]; ptr[MOVIE_WIDTH + linepos++] = lut[i + dat[0][width + ypos++]]; } @@ -376,6 +381,10 @@ bool AnimationState::decodeFrame() { return false; } +MoviePlayer::MoviePlayer(Screen *scr, SoundMixer *snd, OSystem *sys) + : _scr(scr), _snd(snd), _sys(sys) { +} + /** * Plays an animated cutscene. * @param filename the file name of the cutscene file |