2011-07-04 17:58:38 +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.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef NEVERHOOD_SMACKERPLAYER_H
|
|
|
|
#define NEVERHOOD_SMACKERPLAYER_H
|
|
|
|
|
|
|
|
#include "video/smk_decoder.h"
|
|
|
|
#include "neverhood/neverhood.h"
|
|
|
|
#include "neverhood/entity.h"
|
|
|
|
|
|
|
|
namespace Neverhood {
|
|
|
|
|
|
|
|
class Scene;
|
|
|
|
class Palette;
|
|
|
|
|
|
|
|
class SmackerSurface : public BaseSurface {
|
|
|
|
public:
|
|
|
|
SmackerSurface(NeverhoodEngine *vm);
|
|
|
|
virtual void draw();
|
|
|
|
void setSmackerFrame(const Graphics::Surface *smackerFrame);
|
2013-06-11 09:33:05 +00:00
|
|
|
void unsetSmackerFrame();
|
2011-07-04 17:58:38 +00:00
|
|
|
protected:
|
|
|
|
const Graphics::Surface *_smackerFrame;
|
|
|
|
};
|
|
|
|
|
|
|
|
class SmackerDoubleSurface : public SmackerSurface {
|
|
|
|
public:
|
|
|
|
SmackerDoubleSurface(NeverhoodEngine *vm);
|
|
|
|
virtual void draw();
|
|
|
|
};
|
|
|
|
|
2013-01-03 22:38:56 +00:00
|
|
|
class NeverhoodSmackerDecoder : public Video::SmackerDecoder {
|
|
|
|
public:
|
|
|
|
void forceSeekToFrame(uint frame);
|
|
|
|
};
|
|
|
|
|
2011-07-04 17:58:38 +00:00
|
|
|
class SmackerPlayer : public Entity {
|
|
|
|
public:
|
2012-10-12 19:19:24 +00:00
|
|
|
SmackerPlayer(NeverhoodEngine *vm, Scene *scene, uint32 fileHash, bool doubleSurface, bool flag, bool paused = false);
|
2011-07-04 17:58:38 +00:00
|
|
|
~SmackerPlayer();
|
|
|
|
BaseSurface *getSurface() { return _smackerSurface; }
|
2011-07-14 19:03:09 +00:00
|
|
|
void open(uint32 fileHash, bool keepLastFrame);
|
2011-07-04 17:58:38 +00:00
|
|
|
void close();
|
2012-10-12 19:19:24 +00:00
|
|
|
void gotoFrame(int frameNumber);
|
2011-07-26 08:38:19 +00:00
|
|
|
uint32 getFrameCount();
|
2013-07-14 17:01:47 +00:00
|
|
|
uint32 getFrameNumber();
|
2011-07-04 17:58:38 +00:00
|
|
|
uint getStatus();
|
2011-07-26 08:38:19 +00:00
|
|
|
void setDrawPos(int16 x, int16 y);
|
2011-09-15 13:16:22 +00:00
|
|
|
void rewind();
|
2012-10-10 11:23:46 +00:00
|
|
|
bool isDone() { return getFrameNumber() + 1 == getFrameCount(); }
|
2013-01-03 22:38:56 +00:00
|
|
|
NeverhoodSmackerDecoder *getSmackerDecoder() const { return _smackerDecoder; }
|
2011-07-04 17:58:38 +00:00
|
|
|
protected:
|
|
|
|
Scene *_scene;
|
|
|
|
Palette *_palette;
|
2013-01-03 22:38:56 +00:00
|
|
|
NeverhoodSmackerDecoder *_smackerDecoder;
|
2011-07-04 17:58:38 +00:00
|
|
|
SmackerSurface *_smackerSurface;
|
2011-08-02 10:56:16 +00:00
|
|
|
uint32 _fileHash;
|
2011-07-14 19:03:09 +00:00
|
|
|
bool _smackerFirst;
|
2011-07-04 17:58:38 +00:00
|
|
|
bool _doubleSurface;
|
|
|
|
Common::SeekableReadStream *_stream;
|
2011-07-14 19:03:09 +00:00
|
|
|
bool _keepLastFrame;
|
2012-05-11 11:03:40 +00:00
|
|
|
bool _videoDone;
|
2012-10-12 19:19:24 +00:00
|
|
|
bool _paused;
|
2011-07-26 08:38:19 +00:00
|
|
|
int _drawX, _drawY;
|
2011-07-04 17:58:38 +00:00
|
|
|
void update();
|
2011-08-02 10:56:16 +00:00
|
|
|
void updateFrame();
|
2011-07-04 17:58:38 +00:00
|
|
|
void updatePalette();
|
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Neverhood
|
|
|
|
|
|
|
|
#endif /* NEVERHOOD_SMACKERPLAYER_H */
|