2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
2006-04-17 04:02:48 +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* $URL$
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2009-08-12 00:53:35 +00:00
|
|
|
#ifdef ENABLE_AGOS2
|
|
|
|
|
2007-02-19 20:55:16 +00:00
|
|
|
#ifndef AGOS_ANIMATION_H
|
|
|
|
#define AGOS_ANIMATION_H
|
2006-04-17 04:02:48 +00:00
|
|
|
|
2009-05-21 13:02:56 +00:00
|
|
|
#include "graphics/video/dxa_decoder.h"
|
|
|
|
#include "graphics/video/smk_decoder.h"
|
2006-04-17 12:05:45 +00:00
|
|
|
#include "sound/mixer.h"
|
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
namespace AGOS {
|
2006-04-17 12:05:45 +00:00
|
|
|
|
2009-05-16 05:34:16 +00:00
|
|
|
class AGOSEngine_Feeble;
|
2006-04-17 12:05:45 +00:00
|
|
|
|
2008-12-21 04:36:11 +00:00
|
|
|
class MoviePlayer {
|
|
|
|
friend class MoviePlayerDXA;
|
|
|
|
friend class MoviePlayerSMK;
|
|
|
|
|
2009-05-16 05:34:16 +00:00
|
|
|
AGOSEngine_Feeble *_vm;
|
2006-04-17 12:05:45 +00:00
|
|
|
|
|
|
|
Audio::Mixer *_mixer;
|
2006-04-17 04:02:48 +00:00
|
|
|
|
2006-04-23 02:11:49 +00:00
|
|
|
Audio::SoundHandle _bgSound;
|
2006-04-29 22:33:31 +00:00
|
|
|
Audio::AudioStream *_bgSoundStream;
|
2006-04-23 02:11:49 +00:00
|
|
|
|
2006-04-17 04:02:48 +00:00
|
|
|
bool _leftButtonDown;
|
|
|
|
bool _rightButtonDown;
|
2008-12-21 04:36:11 +00:00
|
|
|
bool _skipMovie;
|
2006-04-23 02:11:49 +00:00
|
|
|
uint32 _ticks;
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2006-06-02 11:33:11 +00:00
|
|
|
char baseName[40];
|
2008-12-21 04:36:11 +00:00
|
|
|
public:
|
2009-05-16 05:34:16 +00:00
|
|
|
enum VideoFlags {
|
|
|
|
TYPE_OMNITV = 1,
|
|
|
|
TYPE_LOOPING = 2
|
|
|
|
};
|
|
|
|
|
|
|
|
MoviePlayer(AGOSEngine_Feeble *vm);
|
2008-12-21 04:36:11 +00:00
|
|
|
virtual ~MoviePlayer();
|
|
|
|
|
|
|
|
virtual bool load() = 0;
|
|
|
|
virtual void play();
|
2009-03-09 03:45:23 +00:00
|
|
|
virtual void playVideo() = 0;
|
|
|
|
virtual void nextFrame() = 0;
|
|
|
|
virtual void stopVideo() = 0;
|
2008-12-21 04:36:11 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
virtual void handleNextFrame();
|
|
|
|
virtual bool processFrame() = 0;
|
|
|
|
virtual void startSound() {};
|
|
|
|
};
|
|
|
|
|
2009-03-09 03:45:23 +00:00
|
|
|
class MoviePlayerDXA : public MoviePlayer, ::Graphics::DXADecoder {
|
2006-05-06 08:21:57 +00:00
|
|
|
static const char *_sequenceList[90];
|
|
|
|
uint8 _sequenceNum;
|
2006-04-17 12:05:45 +00:00
|
|
|
public:
|
2009-05-16 05:34:16 +00:00
|
|
|
MoviePlayerDXA(AGOSEngine_Feeble *vm, const char *name);
|
2006-04-17 12:05:45 +00:00
|
|
|
|
2008-12-21 04:36:11 +00:00
|
|
|
bool load();
|
|
|
|
void playVideo();
|
2006-04-24 10:24:56 +00:00
|
|
|
void nextFrame();
|
2008-12-21 04:36:11 +00:00
|
|
|
virtual void stopVideo();
|
2006-06-28 14:06:54 +00:00
|
|
|
protected:
|
2008-12-21 04:36:11 +00:00
|
|
|
void setPalette(byte *pal);
|
|
|
|
|
2006-04-17 13:19:36 +00:00
|
|
|
private:
|
2008-12-21 04:36:11 +00:00
|
|
|
void handleNextFrame();
|
|
|
|
bool processFrame();
|
|
|
|
void startSound();
|
|
|
|
};
|
|
|
|
|
2009-03-09 03:45:23 +00:00
|
|
|
class MoviePlayerSMK : public MoviePlayer, ::Graphics::SmackerDecoder {
|
2008-12-21 04:36:11 +00:00
|
|
|
public:
|
2009-05-16 05:34:16 +00:00
|
|
|
MoviePlayerSMK(AGOSEngine_Feeble *vm, const char *name);
|
2006-04-17 04:02:48 +00:00
|
|
|
|
2008-12-21 04:36:11 +00:00
|
|
|
bool load();
|
|
|
|
void playVideo();
|
|
|
|
void nextFrame();
|
|
|
|
virtual void stopVideo();
|
|
|
|
protected:
|
|
|
|
void setPalette(byte *pal);
|
|
|
|
private:
|
2006-04-24 10:24:56 +00:00
|
|
|
void handleNextFrame();
|
2007-06-02 15:20:43 +00:00
|
|
|
bool processFrame();
|
2006-04-24 10:24:56 +00:00
|
|
|
void startSound();
|
2006-04-17 04:02:48 +00:00
|
|
|
};
|
|
|
|
|
2009-05-16 05:34:16 +00:00
|
|
|
MoviePlayer *makeMoviePlayer(AGOSEngine_Feeble *vm, const char *name);
|
2008-12-21 04:36:11 +00:00
|
|
|
|
2006-09-29 09:44:30 +00:00
|
|
|
} // End of namespace AGOS
|
2006-04-17 12:05:45 +00:00
|
|
|
|
2006-04-17 05:01:29 +00:00
|
|
|
#endif
|
2009-08-12 00:53:35 +00:00
|
|
|
|
|
|
|
#endif // ENABLE_AGOS2
|