2018-03-23 19:51:13 +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 17:47:58 +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 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2018-03-23 19:51:13 +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.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2021-12-26 17:47:58 +00:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2018-03-23 19:51:13 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PINK_CEL_DECODER_H
|
|
|
|
#define PINK_CEL_DECODER_H
|
|
|
|
|
2018-05-21 09:30:27 +00:00
|
|
|
#include "video/flic_decoder.h"
|
2018-03-23 19:51:13 +00:00
|
|
|
|
|
|
|
namespace Pink {
|
|
|
|
|
|
|
|
class CelDecoder : public Video::FlicDecoder {
|
2018-03-23 20:52:16 +00:00
|
|
|
public:
|
2020-02-09 11:05:31 +00:00
|
|
|
bool loadStream(Common::SeekableReadStream *stream) override;
|
2018-04-06 07:03:56 +00:00
|
|
|
|
2020-02-13 20:28:22 +00:00
|
|
|
uint16 getTransparentColourIndex() const;
|
2018-04-06 07:03:56 +00:00
|
|
|
|
2020-02-13 20:28:22 +00:00
|
|
|
Common::Point getCenter() const;
|
|
|
|
const Graphics::Surface *getCurrentFrame() const;
|
2018-05-22 05:03:37 +00:00
|
|
|
void skipFrame();
|
2018-03-25 19:32:07 +00:00
|
|
|
|
2018-06-12 08:16:52 +00:00
|
|
|
void setEndOfTrack();
|
|
|
|
|
2018-03-23 20:52:16 +00:00
|
|
|
protected:
|
2018-05-22 05:03:37 +00:00
|
|
|
class CelVideoTrack : public FlicVideoTrack {
|
|
|
|
public:
|
|
|
|
CelVideoTrack(Common::SeekableReadStream *stream, uint16 frameCount, uint16 width, uint16 height, bool skipHeader = false);
|
2020-02-09 11:05:31 +00:00
|
|
|
void readHeader() override;
|
2018-03-23 20:52:16 +00:00
|
|
|
|
2020-02-13 20:28:22 +00:00
|
|
|
uint16 getTransparentColourIndex() const;
|
2018-04-06 07:03:56 +00:00
|
|
|
|
2018-06-11 20:29:46 +00:00
|
|
|
// Hack. Pink needs so that Track needed an update after lastFrame delay ends
|
2018-06-12 08:16:52 +00:00
|
|
|
void setEndOfTrack() { _curFrame = _frameCount; }
|
2018-06-11 20:29:46 +00:00
|
|
|
bool endOfTrack() const override { return getCurFrame() >= getFrameCount(); }
|
|
|
|
|
2020-02-13 20:28:22 +00:00
|
|
|
Common::Point getCenter() const;
|
|
|
|
const Graphics::Surface *getCurrentFrame() const;
|
2018-03-27 10:53:03 +00:00
|
|
|
|
2018-05-22 05:03:37 +00:00
|
|
|
void skipFrame();
|
2018-06-11 20:29:46 +00:00
|
|
|
|
|
|
|
bool rewind() override;
|
|
|
|
|
2018-05-22 05:03:37 +00:00
|
|
|
private:
|
2020-01-31 13:07:05 +00:00
|
|
|
const Graphics::Surface *decodeNextFrame() override;
|
2018-05-22 05:03:37 +00:00
|
|
|
void readPrefixChunk();
|
2018-04-02 05:57:56 +00:00
|
|
|
|
2018-05-22 05:03:37 +00:00
|
|
|
Common::Point _center;
|
|
|
|
byte _transparentColourIndex;
|
|
|
|
};
|
2018-03-23 19:51:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|