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
|
|
|
#ifndef ANIMATION_H
|
|
|
|
#define ANIMATION_H
|
|
|
|
|
2004-03-21 21:20:25 +00:00
|
|
|
#include "graphics/animation.h"
|
|
|
|
#include "sound/mixer.h"
|
2004-01-14 08:14:25 +00:00
|
|
|
|
2004-01-12 11:11:19 +00:00
|
|
|
namespace Sword2 {
|
|
|
|
|
2005-02-19 14:02:16 +00:00
|
|
|
struct SpriteInfo;
|
|
|
|
|
|
|
|
// This is the structure which is passed to the sequence player. It includes
|
|
|
|
// the smack to play, and any text lines which are to be displayed over the top
|
|
|
|
// of the sequence.
|
|
|
|
|
|
|
|
struct MovieTextObject {
|
|
|
|
uint16 startFrame;
|
|
|
|
uint16 endFrame;
|
|
|
|
SpriteInfo *textSprite;
|
|
|
|
uint32 speechBufferSize;
|
|
|
|
uint16 *speech;
|
|
|
|
};
|
|
|
|
|
2004-03-22 01:28:45 +00:00
|
|
|
class AnimationState : public ::Graphics::BaseAnimationState {
|
2004-01-13 14:16:40 +00:00
|
|
|
private:
|
|
|
|
Sword2Engine *_vm;
|
2004-01-12 11:11:19 +00:00
|
|
|
|
2004-01-13 01:26:18 +00:00
|
|
|
public:
|
2004-01-13 14:16:40 +00:00
|
|
|
AnimationState(Sword2Engine *vm);
|
|
|
|
~AnimationState();
|
|
|
|
|
2004-01-18 21:09:57 +00:00
|
|
|
#ifndef BACKEND_8BIT
|
2004-04-23 07:02:11 +00:00
|
|
|
void drawTextObject(SpriteInfo *s, byte *src);
|
2004-01-18 21:09:57 +00:00
|
|
|
#endif
|
|
|
|
|
2004-03-24 07:29:59 +00:00
|
|
|
void clearScreen();
|
2005-05-02 05:41:01 +00:00
|
|
|
void updateScreen();
|
2004-03-24 07:29:59 +00:00
|
|
|
|
2004-01-13 14:16:40 +00:00
|
|
|
private:
|
2004-03-23 00:10:18 +00:00
|
|
|
void drawYUV(int width, int height, byte *const *dat);
|
2004-01-17 14:20:32 +00:00
|
|
|
|
|
|
|
#ifdef BACKEND_8BIT
|
2004-03-21 18:49:04 +00:00
|
|
|
void setPalette(byte *pal);
|
2004-01-17 14:20:32 +00:00
|
|
|
#endif
|
2004-01-13 10:09:53 +00:00
|
|
|
};
|
2004-01-13 01:26:18 +00:00
|
|
|
|
2004-02-15 14:22:54 +00:00
|
|
|
struct MovieInfo {
|
|
|
|
char name[9];
|
|
|
|
uint frames;
|
2005-04-25 05:23:21 +00:00
|
|
|
bool seamless;
|
2004-02-15 14:22:54 +00:00
|
|
|
};
|
|
|
|
|
2004-01-13 10:09:53 +00:00
|
|
|
class MoviePlayer {
|
|
|
|
private:
|
|
|
|
Sword2Engine *_vm;
|
2005-05-10 23:48:48 +00:00
|
|
|
Audio::Mixer *_snd;
|
2004-03-21 18:49:04 +00:00
|
|
|
OSystem *_sys;
|
|
|
|
|
2004-04-23 07:02:11 +00:00
|
|
|
byte *_textSurface;
|
2004-01-13 10:09:53 +00:00
|
|
|
|
2005-05-11 00:01:44 +00:00
|
|
|
Audio::SoundHandle _leadOutHandle;
|
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-25 05:23:21 +00:00
|
|
|
uint _leadOutFrame;
|
|
|
|
bool _seamless;
|
|
|
|
|
2004-02-15 14:22:54 +00:00
|
|
|
static struct MovieInfo _movies[];
|
|
|
|
|
2004-01-13 10:09:53 +00:00
|
|
|
void openTextObject(MovieTextObject *obj);
|
|
|
|
void closeTextObject(MovieTextObject *obj);
|
2004-01-18 21:09:57 +00:00
|
|
|
void drawTextObject(AnimationState *anim, MovieTextObject *obj);
|
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
|
|
|
void playMPEG(const char *filename, MovieTextObject *text[], byte *leadOut, uint32 leadOutLen);
|
|
|
|
void playDummy(const char *filename, MovieTextObject *text[], byte *leadOut, uint32 leadOutLen);
|
2004-01-13 14:22:29 +00:00
|
|
|
|
2004-01-13 10:09:53 +00:00
|
|
|
public:
|
2004-03-21 18:49:04 +00:00
|
|
|
MoviePlayer(Sword2Engine *vm);
|
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 play(const char *filename, MovieTextObject *text[], int32 leadInRes, int32 leadOutRes);
|
2004-01-13 01:26:18 +00:00
|
|
|
};
|
2004-01-12 11:11:19 +00:00
|
|
|
|
|
|
|
} // End of namespace Sword2
|
|
|
|
|
|
|
|
#endif
|