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  bool ra2PromoteCurrentFrameToHiRes(int scrollX, int scrollY);
34  bool ra2PromoteHandler7PerspectiveToHiRes(int perspectiveX, int perspectiveY, int viewShift);
35 
36 protected:
37  void initGamePlayerFields() override;
38  void destroyGamePlayerFields() override;
39  void initGameVideoState() override;
40  void releaseGameVideoState() override;
41  bool shouldPreserveFrameBuffer() const override { return true; }
42  void handleFrameObject(int32 subSize, Common::SeekableReadStream &b) override;
43  bool handleGameFetch(int32 subSize, Common::SeekableReadStream &b) override;
44  bool handleGameTextResource(uint32 subType, int32 subSize, Common::SeekableReadStream &b) override;
45  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;
46  bool shouldAlwaysShowSubtitles() const override { return true; }
47  SmushFont *getGameFont(int font) override;
48  void adjustGamePalette() override;
49  bool shouldLoadAnimHeaderPalette() const override;
50  bool handleGameAnimHeader(byte *headerContent) override;
51  bool handleGameSetupStrings() override;
52  void handleGameParseNextFrame() override;
53  bool shouldRouteAllIACTs() const override { return true; }
54  bool handleGameFrameBufferSelect(int codec, int width, int height) override;
55  bool handleGameDimensionOverride(int codec, int width, int height) override;
56  int handleGameFrameObjectPitch(int pitch) override;
57  bool handleGameAdjustCoords(int codec, int &left, int &top, int &width, int &height, int pitch, int *srcSkipY) override;
58  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;
59  bool handleGameStoreFrame() override;
60  void handleGameFrameObjectPre(int codec, int left, int top, int width, int height, int dataSize) override;
61  void handleGameFrameObjectPost(int codec, const byte *data, int32 dataSize, int left, int top, int width, int height) override;
62  void handleGameFrameStart() override;
63  bool handleGameSkipChunk(uint32 subType, int32 subSize, Common::SeekableReadStream &b) override;
64  void handleGameGost(int32 subSize, Common::SeekableReadStream &b) override;
65  void handleGameProcessAudio(int16 feedSize) override;
66  bool isInsaneGame() const override { return true; }
67  void handleGameLoad(int32 subSize, Common::SeekableReadStream &b) override;
68 
69 private:
70  void handleLoad(int32 subSize, Common::SeekableReadStream &b);
71  void ra2HandleTextResource(const char *str, int fontId, int color,
72  int pos_x, int pos_y, int left, int top,
73  int width, int height, TextStyleFlags flg);
74  void ra2PrepareFrameObjectSurface(int left, int top, int width, int height);
75  bool ra2SelectFrameBuffer(int codec, int width, int height);
76  bool ra2EnsureLowResVideoBuffer();
77  void ra2ClearCurrentTarget();
78  bool ra2IsHighResMode() const;
79  bool ra2DecodePlacedDeltaCodec(int codec, const uint8 *src, int left, int top,
80  int width, int height, int pitch, int dataSize);
81  bool ra2DecodeCodec(int codec, const uint8 *src, int left, int top,
82  int width, int height, int pitch, int dataSize);
83  void ra2HandleDeltaPalette(int32 subSize, Common::SeekableReadStream &b);
84  void ra2StoreFobjData(int codec, const byte *data, int32 dataSize,
85  int left, int top, int width, int height);
86  void ra2HandleGost(int32 subSize, Common::SeekableReadStream &b);
87  void ra2InitAudioTrackSizes();
88  void ra2HandleFrameAudioChunk(uint32 subType, int32 subSize, Common::SeekableReadStream &b);
89  void ra2FeedAudio(uint8 *srcBuf, int groupId, int volume, int pan, int16 flags);
90 
91  byte *_loadBuffer;
92  int32 _loadBufferSize;
93  int32 _loadBufferOffset;
94  int32 _loadReadOffset;
95  int16 _lastLoadChunkIdx;
96  int16 _loadStreamId;
97  int _ra2FrameSourceSkipX;
98  int _ra2FrameSourceSkipY;
99  int _ra2FrameObjectOriginalWidth;
100  int _ra2FrameObjectOriginalHeight;
101  int _ra2FrameObjectSurfaceWidth;
102  int _ra2FrameObjectSurfaceHeight;
103  int _ra2DeltaBlocksWidth;
104  int _ra2DeltaBlocksHeight;
105  int _ra2DeltaGlyphsWidth;
106  int _ra2DeltaGlyphsHeight;
107  byte *_ra2LowResVideoBuffer;
108  int _ra2LowResVideoBufferSize;
109  bool _ra2NativeFrameNeedsClear;
110  bool _ra2UsingGameplaySurface;
111  bool _ra2PendingAnimHeaderPalette;
112  byte _ra2Codec45Palette[0x300];
113  byte _ra2Codec45Lookup[0x8000];
114  byte _ra2SkipRemapTable[256];
115  bool _ra2SkipRemapValid;
116 };
117 
118 } // End of namespace Scumm
119 
120 #endif
Definition: stream.h:745
Definition: actor.h:30