ScummVM API documentation
smush_player_ra2.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #if !defined(SCUMM_SMUSH_PLAYER_RA2_H) && defined(ENABLE_SCUMM_7_8)
23 #define SCUMM_SMUSH_PLAYER_RA2_H
24 
25 #include "scumm/smush/smush_player.h"
26 
27 namespace Scumm {
28 
29 class SmushPlayerRebel2 : public SmushPlayer {
30 public:
31  SmushPlayerRebel2(ScummEngine_v7 *scumm, IMuseDigital *imuseDigital, Insane *insane);
32  ~SmushPlayerRebel2() override;
33  void unpause() override;
34  bool ra2PromoteCurrentFrameToHiRes(int scrollX, int scrollY);
35  bool ra2PromoteHandler7PerspectiveToHiRes(int perspectiveX, int perspectiveY, int viewShift);
36  bool isPlayingLoadBuffer() const { return _loadContinuationStream != nullptr; }
37 
38 protected:
39  void initGamePlayerFields() override;
40  void destroyGamePlayerFields() override;
41  void initGameVideoState() override;
42  void releaseGameVideoState() override;
43  bool shouldPreserveFrameBuffer() const override { return true; }
44  void handleFrameObject(int32 subSize, Common::SeekableReadStream &b) override;
45  bool handleGameFetch(int32 subSize, Common::SeekableReadStream &b) override;
46  bool handleGameTextResource(uint32 subType, int32 subSize, Common::SeekableReadStream &b) override;
47  bool handleGameTextRendering(const char *str, int fontId, int color, int pos_x, int pos_y, int left, int top, int width, int height, TextStyleFlags flg) override;
48  bool shouldAlwaysShowSubtitles() const override { return true; }
49  SmushFont *getGameFont(int font) override;
50  void adjustGamePalette() override;
51  bool shouldLoadAnimHeaderPalette() const override;
52  bool handleGameAnimHeader(byte *headerContent) override;
53  bool handleGameSetupStrings() override;
54  void handleGameParseNextFrame() override;
55  bool shouldRouteAllIACTs() const override { return true; }
56  bool handleGameFrameBufferSelect(int codec, int width, int height) override;
57  bool handleGameDimensionOverride(int codec, int width, int height) override;
58  int handleGameFrameObjectPitch(int pitch) override;
59  bool handleGameAdjustCoords(int codec, int &left, int &top, int &width, int &height, int pitch, int *srcSkipY) override;
60  bool handleGameCodecDecode(int codec, const uint8 *src, int left, int top, int width, int height, int pitch, int dataSize, uint8 param = 0, uint16 parm2 = 0) override;
61  bool handleGameStoreFrame() override;
62  void handleGameFrameObjectPre(int codec, int left, int top, int width, int height, int dataSize) override;
63  void handleGameFrameObjectPost(int codec, const byte *data, int32 dataSize, int left, int top, int width, int height) override;
64  void handleGameFrameStart() override;
65  bool handleGameSkipChunk(uint32 subType, int32 subSize, Common::SeekableReadStream &b) override;
66  void handleGameGost(int32 subSize, Common::SeekableReadStream &b) override;
67  void handleGameProcessAudio(int16 feedSize) override;
68  bool isInsaneGame() const override { return true; }
69  void handleGameLoad(int32 subSize, Common::SeekableReadStream &b) override;
70 
71 private:
72  void handleLoad(int32 subSize, Common::SeekableReadStream &b);
73  void ra2StartLoadPlayback();
74  void ra2HandleTextResource(const char *str, int fontId, int color,
75  int pos_x, int pos_y, int left, int top,
76  int width, int height, TextStyleFlags flg);
77  void ra2PrepareFrameObjectSurface(int left, int top, int width, int height);
78  bool ra2SelectFrameBuffer(int codec, int width, int height);
79  bool ra2EnsureLowResVideoBuffer();
80  void ra2ClearCurrentTarget();
81  bool ra2IsHighResMode() const;
82  bool ra2DecodePlacedDeltaCodec(int codec, const uint8 *src, int left, int top,
83  int width, int height, int pitch, int dataSize);
84  bool ra2DecodeCodec(int codec, const uint8 *src, int left, int top,
85  int width, int height, int pitch, int dataSize);
86  void ra2HandleDeltaPalette(int32 subSize, Common::SeekableReadStream &b);
87  void ra2StoreFobjData(int codec, const byte *data, int32 dataSize,
88  int left, int top, int width, int height);
89  void ra2HandleGost(int32 subSize, Common::SeekableReadStream &b);
90  void ra2InitAudioTrackSizes();
91  void ra2HandleFrameAudioChunk(uint32 subType, int32 subSize, Common::SeekableReadStream &b);
92  void ra2FeedAudio(uint8 *srcBuf, int groupId, int volume, int pan, int16 flags);
93 
94  byte *_loadBuffer;
95  int32 _loadBufferSize;
96  int32 _loadBufferOffset;
97  int32 _loadReadOffset;
98  int16 _lastLoadChunkIdx;
99  int16 _loadStreamId;
100  bool _loadPlaybackPending;
101  Common::SeekableReadStream *_loadContinuationStream;
102  uint32 _loadContinuationSize;
103  int32 _loadContinuationFrameCount;
104  int _ra2FrameSourceSkipX;
105  int _ra2FrameSourceSkipY;
106  int _ra2FrameObjectOriginalWidth;
107  int _ra2FrameObjectOriginalHeight;
108  int _ra2FrameObjectSurfaceWidth;
109  int _ra2FrameObjectSurfaceHeight;
110  int _ra2SpecialBufferWidth;
111  int _ra2SpecialBufferHeight;
112  int _ra2DeltaBlocksWidth;
113  int _ra2DeltaBlocksHeight;
114  int _ra2DeltaGlyphsWidth;
115  int _ra2DeltaGlyphsHeight;
116  byte *_ra2LowResVideoBuffer;
117  int _ra2LowResVideoBufferSize;
118  bool _ra2NativeFrameNeedsClear;
119  bool _ra2UsingGameplaySurface;
120  bool _ra2PendingAnimHeaderPalette;
121  byte _ra2Codec45Palette[0x300];
122  byte _ra2Codec45Lookup[0x8000];
123  byte _ra2SkipRemapTable[256];
124  bool _ra2SkipRemapValid;
125 };
126 
127 } // End of namespace Scumm
128 
129 #endif
Definition: stream.h:745
Definition: actor.h:30