ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
seqplayer_eob_segacd.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 #ifdef ENABLE_EOB
23 
24 #ifndef KYRA_SEQPLAYER_SEGACD_H
25 #define KYRA_SEQPLAYER_SEGACD_H
26 
27 namespace Common {
28  class SeekableReadStream;
29  class SeekableReadStreamEndian;
30 }
31 
32 namespace Kyra {
33 class EoBEngine;
34 class Screen_EoB;
35 class SegaRenderer;
36 class SegaCDResource;
37 class SegaSequencePlayer {
38 public:
39  SegaSequencePlayer(EoBEngine *vm, Screen_EoB *screen, SegaCDResource *res);
40  ~SegaSequencePlayer();
41 
42  bool play(int id);
43  void pause(bool togglePause);
44 
45 private:
46  void run(const uint8 *data);
47 
48  void animateWaterdeepScene();
49  void updateSpeechAnimations();
50  void updateSpeechAnimGraphics(int animDrawOp);
51 
52  struct TileSet {
53  const uint16 *data;
54  uint16 width;
55  uint16 height;
56  };
57 
58  TileSet *_tileSets;
59 
60  struct DrawObject {
61  uint16 agg;
62  const uint16 *tileData;
63  uint16 width;
64  uint16 height;
65  uint16 nTblVal;
66  uint16 x;
67  uint16 y;
68  uint16 addr;
69  };
70 
71  uint16 _waterdeepScene;
72  uint16 _playSpeechAnimation;
73  uint16 _speechAnimType;
74  uint16 _speechAnimDrawOps[14];
75  uint32 _frameTimer;
76  uint32 _pauseStart;
77  bool _fastForward;
78 
79  int _waterdeepSceneTimer, _speechAnimTimer;
80  uint16 _speechAnimNo, _speechAnimFrame;
81  int _playingID;
82  int _newTrack;
83 
84  uint8 *_scaleSrcBuffer;
85  uint8 *_scaleOutBuffer;
86  uint16 *_scaleStampMap;
87  uint16 *_scaleTraceVectors;
88 
89  uint32 _debugResyncCnt;
90 
91  DrawObject *_drawObjects;
92 
93  EoBEngine *_vm;
94  Screen_EoB *_screen;
95  SegaRenderer *_renderer;
96  SegaAnimator *_animator;
97  SegaCDResource *_res;
98  ScrollManager *_scrollManager;
99 
100 private:
101  class SQOpcode : public Common::Functor1Mem<const uint8*, void, SegaSequencePlayer> {
102  public:
104  SQOpcode(SegaSequencePlayer *sq, const SQFunc::FuncType &func, const char *dbgName) : SQFunc(sq, func), _msg(Common::String::format(" %s()", dbgName)) {}
105  ~SQOpcode() override {}
106  void run(const uint8 *arg) {
107  assert(arg);
108  debugC(7, kDebugLevelSequence, "%s", _msg.c_str());
109  if (SQFunc::isValid())
110  SQFunc::operator()(arg);
111  }
112  private:
113  Common::String _msg;
114  };
115 
116  Common::Array<SQOpcode*> _opcodes;
117 
118  void s_initDrawObject(const uint8 *pos);
119  void s_drawTileSet(const uint8 *pos);
120  void s_loadTileDataSingle(const uint8 *pos);
121  void s_drawTileSetCustom(const uint8 *pos);
122  void s_drawTileSetCustomTopToBottom(const uint8 *pos);
123  void s_fillRect(const uint8 *pos);
124  void s_void(const uint8*) {}
125  void s_initSprite(const uint8 *pos);
126  void s_removeSprite(const uint8 *pos);
127  void s_displayTextJp(const uint8 *pos);
128  void s_fadeToNeutral(const uint8 *pos);
129  void s_fadeToBlack(const uint8 *pos);
130  void s_fadeToNeutral2(const uint8 *pos);
131  void s_fadeToWhite(const uint8 *pos);
132  void s_setPalette(const uint8 *pos);
133  void s_vScroll(const uint8 *pos);
134  void s_hScroll(const uint8 *pos);
135  void s_paletteOps(const uint8 *pos);
136  void s_initSpriteCustomCoords(const uint8 *pos);
137  void s_fillRectWithPattern(const uint8 *pos);
138  void s_loadTileDataSeries(const uint8 *pos);
139  void s_drawTileSetSeries(const uint8 *pos);
140  void s_initSpriteSeries(const uint8 *pos);
141  void s_initSpriteCustom(const uint8 *pos);
142  void s_drawTileSetCustomCoords(const uint8 *pos);
143  void s_waitForPaletteFade(const uint8*);
144  void s_clearSprites(const uint8*);
145  void s_moveSprites2(const uint8 *pos);
146  void s_moveSprites(const uint8 *pos);
147  void s_moveMorphSprite(const uint8 *pos);
148  void s_unpauseCD(const uint8 *pos);
149  void s_toggleWaterDeepAnimations(const uint8 *pos);
150  void s_assignSpeechAnimGraphics(const uint8 *pos);
151  void s_toggleSpeechAnimation(const uint8 *pos);
152  void s_orbZoomEffect(const uint8*);
153  void s_stopCD(const uint8*);
154  void s_playCD(const uint8 *pos);
155  void s_displayTextEn(const uint8 *pos);
156  void s_loadCustomPalettes(const uint8 *pos);
157  void s_playSoundEffect(const uint8 *pos);
158 
159 private:
160  const uint8 *_cdaTracks;
161  const uint8 *_wdAnimSprites;
162  const uint8 *_speechAnimData;
163  const uint16 *_wdDsX;
164  const uint8 *_wdDsY;
165  const uint16 *_patternTables[6];
166 };
167 
168 } // End of namespace Kyra
169 
170 #endif
171 #endif // ENABLE_EOB
Definition: str.h:59
Definition: array.h:52
void void void void void debugC(int level, uint32 debugChannel, MSVC_PRINTF const char *s,...) GCC_PRINTF(3
Definition: algorithm.h:29
Definition: func.h:452
Definition: detection.h:27