ScummVM API documentation
fool_prologue.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#ifndef FOOL_PROLOGUE_H
23#define FOOL_PROLOGUE_H
24
25#include "common/array.h"
26#include "common/scummsys.h"
27#include "common/str.h"
28#include "graphics/surface.h"
29#include "graphics/mactoolbox/toolbox.h"
30
31#include "fool/fool.h"
32
33
34namespace Fool {
35
36class ZBasic;
37
38enum FoolPrologueFontID : uint16 {
39 // We subtract 10 from the original ID so they can coexist with
40 // the fonts from the main game.
41 kPrologueFontFool = 240,
42 kPrologueFontSmall = 241,
43};
44
45struct Particle {
46 int16 xPos = 0;
47 int16 yPos = 0;
48 int16 size = 0;
49 int16 veloc = 0;
50};
51
52struct Line {
53 int16 xStart = 0;
54 int16 yStart = 0;
55 int16 xEnd = 0;
56 int16 yEnd = 0;
57};
58
60 int16 xLeft = 0;
61 int16 xRight = 0;
62 int16 yPos = 0;
63};
64
66public:
67 FoolPrologue(FoolVersion version, const int *zstrOffset): _version(version), _zstrOffset(zstrOffset) {}
68 ~FoolPrologue() {}
69
70 void run(bool finale, const BitMap &prevWindow);
71
72 void setup(bool finale, const BitMap &prevWindow); // sub_128_004
73 void copyScreenToPage(int16 screenPage); // sub_128_1ba
74 void setPortBitsToPage(int16 screenPage); // sub_128_1f4
75 void delay(int16 numTicks); // sub_128_21e
76 void delayFromMarker(int16 numTicks); // sub_128_24a
77 void drawTextRight(const Common::U32String &str, int16 x, int16 y); // sub_128_26c
78 void drawTextCenter(const Common::U32String &str, int16 x, int16 y); // sub_128_2a6
79 void fillRect(int16 top, int16 left, int16 bottom, int16 right, int16 patternID); // sub_128_2f0
80 void zoomClose(int16 patternID, PatternMode mode); // sub_128_354
81 void drawTreasurePhaseIn(int16 offset, int16 count); // sub_128_3ee
82 void scanlineBlitPageToScreen(int16 screenPage, int16 left, int16 right, int16 updatePeriod); // sub_128_50a
83 void blitPageToScreen(int16 screenPage); // sub_128_610
84 void scanlineTransition(int16 patternID); // sub_128_64a
85 void zoomTransition(int16 screenPage); // sub_128_6e4
86 void zoomFlash(int16 startTop, int16 startLeft, int16 startBottom, int16 startRight, int16 endTop, int16 endLeft, int16 endBottom, int16 endRight, int16 steps); // sub_128_800
87 void drawText(const Common::U32String &str, int16 x, int16 y); // sub_128_a6c
88 void drawRainRecycle(int16 ticks); // sub_128_a8c
89 void shuffleScanlines(); // sub_128_ccc
90 void drawClickMessage(); // sub_128_de2
91 void drawClickMessageRightAlign(); // sub_128_e1c
92 void waitForClick(); // sub_128_e58
93 void waitForMouseUp(); // sub_128_e80
94 void onUpdateEvent(); // sub_128_ed2
95 void onDiskEvent(); // sub_128_ee0
96
97 void setupWindow(); // sub_129_004
98 void unk1(); // sub_129_764
99
100 void prologueRun(); // sub_130_004
101 void prologueBufferNextPicture(); // sub_130_cea
102 void prologueDrawLoadingMsg(); // sub_130_d28
103 void drawRain(); // sub_130_db0
104 void drawRainDrop(); // sub_130_e82
105 void prologueRenderNextText(); // sub_130_f48
106
107 // fool_finale.cpp
108 void finaleRun(); // sub_131_004
109 void finaleDrawLoadingMsg(); // sub_131_4dc0
110 void finaleDrawFoolUhOh(); // sub_131_4e48
111 void finaleStartText(); // sub_131_4e98
112 void finaleDrawWind(int16 offset); // sub_131_4f96
113 void finaleCardRotate(); // sub_131_5038
114
115private:
116 FoolVersion _version;
117 const int *_zstrOffset;
119 ZBasic *_zbasic;
120 bool _quit = false;
121
122 // last tick count
123 uint32 _tickMarker; // var_i32_2
124 int16 _rainIndex; // var_i16_6
125 GrafPtr _grafPtrWindow; // var_i32_8
126 GrafPtr _grafPtrMenu; // var_i32_c
127
128 int16 _windowWidth; // var_i16_10
129 int16 _windowHeight; // var_i16_12
130 int16 _windowLeft; // var_i16_14
131 int16 _windowTop; // var_i16_16
132
133 EventRecord _event; // var_ev_22
134
135 WindowRecord _windowRecord; // var_window_24
136
137 BitMap _dstPage; // var_i32_32
138
139 Common::Rect _pageRect; // var_rect_38
140 BitMap _srcPage; // var_i32_40
141 BitMap _bgPage; // var_i32_4e
142
143 // 1 for prologue, 2 for finale
144 int16 _mode; // var_i16_1aa
145
146 int16 _prologueLoading; // var_i16_3ce
147 int16 _prologuePicIndex; // var_i16_3d4
148
149 // picture resource handles
150 PicHandle _pics[92] = { nullptr }; // arr_i32_0
151
152 Pattern _patterns[5]; // arr_pat_194
153
154 Particle _rain[251]; // arr_i16_1e8
155 TreasureLine _treasure[251]; // arr_i16_1e8
156
157 GrafPort _grafPortWindow; // arr_i32_9c0
158 GrafPort _grafPortMenu; // arr_i32_a8a
159
160 BitMap _cardSlices[16]; // arr_i32_1e3fc
161
162 BitMap _foolSlice; // arr_i32_3bca4
163
164 BitMap _screenPages[12]; // arr_i32_41296
165
166 int16 _randScanline[SCREEN_HEIGHT] = { 0 }; // arr_i16_412ea
167
168 int16 _cardLines[32]; // arr_i16_41af4
169
170};
171
172} // End of namespace Fool
173
174#endif // FOOL_PROLOGUE_H
Definition: ustr.h:57
Definition: fool_prologue.h:65
Definition: zbasic.h:203
Definition: toolbox.h:573
Definition: rect.h:536
Definition: fool_prologue.h:52
Definition: fool_prologue.h:45
Definition: fool_prologue.h:59
Definition: toolbox.h:486
Definition: toolbox.h:452
Definition: toolbox.h:98
Definition: toolbox.h:481