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.
|
2004-01-13 01:26:18 +00:00
|
|
|
*
|
2007-05-31 20:28:29 +00:00
|
|
|
* Additional copyright for this file:
|
|
|
|
* Copyright (C) 1994-1998 Revolution Software Ltd.
|
|
|
|
*
|
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
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2004-01-13 01:26:18 +00:00
|
|
|
*/
|
|
|
|
|
2006-02-12 19:57:23 +00:00
|
|
|
#ifndef SWORD2_ANIMATION_H
|
|
|
|
#define SWORD2_ANIMATION_H
|
2004-01-12 11:11:19 +00:00
|
|
|
|
2007-02-08 21:55:37 +00:00
|
|
|
#include "sword2/screen.h"
|
2005-02-19 14:02:16 +00:00
|
|
|
|
2012-07-24 17:24:01 +00:00
|
|
|
namespace Graphics {
|
|
|
|
struct Surface;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace Video {
|
|
|
|
class VideoDecoder;
|
|
|
|
}
|
|
|
|
|
2007-02-08 21:55:37 +00:00
|
|
|
namespace Sword2 {
|
2005-02-19 14:02:16 +00:00
|
|
|
|
2009-02-21 15:07:05 +00:00
|
|
|
enum DecoderType {
|
|
|
|
kVideoDecoderDXA = 0,
|
2012-01-07 05:20:27 +00:00
|
|
|
kVideoDecoderSMK = 1,
|
2012-11-29 00:51:03 +00:00
|
|
|
kVideoDecoderPSX = 2,
|
|
|
|
kVideoDecoderMP2 = 3
|
2007-02-08 21:55:37 +00:00
|
|
|
};
|
|
|
|
|
2009-02-21 15:07:05 +00:00
|
|
|
struct MovieText {
|
|
|
|
uint16 _startFrame;
|
|
|
|
uint16 _endFrame;
|
|
|
|
uint32 _textNumber;
|
|
|
|
byte *_textMem;
|
|
|
|
SpriteInfo _textSprite;
|
|
|
|
uint16 _speechId;
|
|
|
|
bool _played;
|
|
|
|
|
|
|
|
void reset() {
|
|
|
|
_textMem = NULL;
|
|
|
|
_speechId = 0;
|
|
|
|
_played = false;
|
2007-02-08 21:55:37 +00:00
|
|
|
}
|
2005-02-19 14:02:16 +00:00
|
|
|
};
|
|
|
|
|
2010-05-18 14:17:24 +00:00
|
|
|
class MoviePlayer {
|
2006-07-08 11:42:07 +00:00
|
|
|
public:
|
2012-07-24 17:24:01 +00:00
|
|
|
MoviePlayer(Sword2Engine *vm, OSystem *system, Video::VideoDecoder *decoder, DecoderType decoderType);
|
2009-11-02 21:54:57 +00:00
|
|
|
virtual ~MoviePlayer();
|
2006-07-08 11:42:07 +00:00
|
|
|
|
2009-02-21 15:07:05 +00:00
|
|
|
bool load(const char *name);
|
|
|
|
void play(MovieText *movieTexts, uint32 numMovieTexts, uint32 leadIn, uint32 leadOut);
|
2006-07-08 11:42:07 +00:00
|
|
|
|
|
|
|
protected:
|
2009-02-21 15:07:05 +00:00
|
|
|
Sword2Engine *_vm;
|
|
|
|
OSystem *_system;
|
|
|
|
MovieText *_movieTexts;
|
|
|
|
uint32 _numMovieTexts;
|
|
|
|
uint32 _currentMovieText;
|
|
|
|
byte *_textSurface;
|
|
|
|
int _textX, _textY;
|
2010-05-23 11:16:10 +00:00
|
|
|
byte _white, _black;
|
2009-02-21 15:07:05 +00:00
|
|
|
DecoderType _decoderType;
|
2004-02-15 14:22:54 +00:00
|
|
|
|
2011-01-23 19:08:09 +00:00
|
|
|
Video::VideoDecoder *_decoder;
|
2004-01-13 10:09:53 +00:00
|
|
|
|
2009-02-21 15:07:05 +00:00
|
|
|
uint32 _leadOut;
|
|
|
|
int _leadOutFrame;
|
2004-01-13 14:22:29 +00:00
|
|
|
|
2012-01-07 05:20:27 +00:00
|
|
|
void performPostProcessing(Graphics::Surface *screen, uint16 pitch);
|
2010-05-18 14:17:24 +00:00
|
|
|
bool playVideo();
|
2012-01-07 05:20:27 +00:00
|
|
|
void drawFramePSX(const Graphics::Surface *frame);
|
2006-07-08 11:42:07 +00:00
|
|
|
|
2009-02-21 15:07:05 +00:00
|
|
|
void openTextObject(uint32 index);
|
2012-01-07 05:20:27 +00:00
|
|
|
void closeTextObject(uint32 index, Graphics::Surface *screen, uint16 pitch);
|
|
|
|
void drawTextObject(uint32 index, Graphics::Surface *screen, uint16 pitch);
|
2010-05-18 14:17:24 +00:00
|
|
|
|
2012-01-07 05:20:27 +00:00
|
|
|
uint32 getBlackColor();
|
|
|
|
uint32 getWhiteColor();
|
2004-01-13 01:26:18 +00:00
|
|
|
};
|
2006-07-08 11:42:07 +00:00
|
|
|
|
2012-07-24 17:24:01 +00:00
|
|
|
MoviePlayer *makeMoviePlayer(const char *name, Sword2Engine *vm, OSystem *system, uint32 frameCount);
|
2004-01-12 11:11:19 +00:00
|
|
|
|
|
|
|
} // End of namespace Sword2
|
|
|
|
|
|
|
|
#endif
|