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.
|
|
|
|
*
|
2021-12-26 18:47:58 +01: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 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2014-02-18 02:34:22 +01:00
|
|
|
*
|
2011-07-04 17:58:38 +00:00
|
|
|
* 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.
|
2014-02-18 02:34:22 +01:00
|
|
|
*
|
2011-07-04 17:58:38 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
2021-12-26 18:47:58 +01:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2011-07-04 17:58:38 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef NEVERHOOD_SMACKERPLAYER_H
|
|
|
|
#define NEVERHOOD_SMACKERPLAYER_H
|
|
|
|
|
|
|
|
#include "video/smk_decoder.h"
|
|
|
|
#include "neverhood/neverhood.h"
|
|
|
|
#include "neverhood/entity.h"
|
2022-12-21 04:18:04 +01:00
|
|
|
#include "neverhood/subtitles.h"
|
2011-07-04 17:58:38 +00:00
|
|
|
|
|
|
|
namespace Neverhood {
|
|
|
|
|
|
|
|
class Scene;
|
|
|
|
class Palette;
|
2022-12-21 04:18:04 +01:00
|
|
|
class SmackerPlayer;
|
2011-07-04 17:58:38 +00:00
|
|
|
|
|
|
|
class SmackerSurface : public BaseSurface {
|
|
|
|
public:
|
|
|
|
SmackerSurface(NeverhoodEngine *vm);
|
2020-02-09 12:05:30 +01:00
|
|
|
void draw() override;
|
2011-07-04 17:58:38 +00:00
|
|
|
void setSmackerFrame(const Graphics::Surface *smackerFrame);
|
2013-06-11 11:33:05 +02:00
|
|
|
void unsetSmackerFrame();
|
2022-12-21 04:18:04 +01:00
|
|
|
void renderSubtitles();
|
2011-07-04 17:58:38 +00:00
|
|
|
protected:
|
|
|
|
const Graphics::Surface *_smackerFrame;
|
2022-12-21 04:18:04 +01:00
|
|
|
Common::ScopedPtr<SubtitlePlayer> _subtitles;
|
|
|
|
uint32 frameNumber;
|
|
|
|
friend class SmackerPlayer;
|
2011-07-04 17:58:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class SmackerDoubleSurface : public SmackerSurface {
|
|
|
|
public:
|
|
|
|
SmackerDoubleSurface(NeverhoodEngine *vm);
|
2020-02-09 12:05:30 +01:00
|
|
|
void draw() override;
|
2011-07-04 17:58:38 +00:00
|
|
|
};
|
|
|
|
|
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);
|
2020-02-09 12:05:30 +01:00
|
|
|
~SmackerPlayer() override;
|
2023-01-19 02:16:51 +01:00
|
|
|
Common::SharedPtr<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 19:01:47 +02: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;
|
2023-01-19 02:16:51 +01:00
|
|
|
Common::SharedPtr<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 */
|