ScummVM API documentation
types.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 CHEWY_TYPES_H
23 #define CHEWY_TYPES_H
24 
25 #include "common/serializer.h"
26 #include "chewy/defines.h"
27 #include "chewy/object_extra.h"
28 
29 namespace Chewy {
30 
31 #include "common/pack-start.h" // START STRUCT PACKING
32 
33 struct GameFlags {
34  bool R0SlimeUsed : 1;
35  bool R0PillowThrow : 1;
36  bool R0Monocle : 1;
37  bool R0Noteboook : 1;
38  bool R2ElectrocutedBork : 1;
39  bool R2FussSchleim : 1;
40  bool R5Terminal : 1;
41  bool R5Door : 1;
42 
43  bool R6BolaSchild : 1;
44  bool R6BolaOk : 1;
45  bool R6BolaBecher : 1;
46  bool R6DoorLeftF : 1;
47  bool R6DoorLeftB : 1;
48  bool R6DoorRightB : 1;
49  bool R7DoorRight : 1;
50  bool R7Hebel : 1;
51 
52  bool R7SeilLeft : 1;
53  bool R7SeilOk : 1;
54  bool R7RHaken : 1;
55  bool R7BorkFlug : 1;
56  bool R7ChewyFlug : 1;
57  bool R8Folter : 1;
58  bool R8Stein : 1;
59  bool R8GTuer : 1;
60 
61  bool R8Kohle : 1;
62  bool R8Abkuehlen : 1;
63  bool R8GipsWurf : 1;
64  bool R9Gitter : 1;
65  bool R9Surimy : 1;
66  bool R10Surimy : 1;
67  bool R10SurimyOk : 1;
68  bool R11CardOk : 1;
69 
70  bool R11TerminalOk : 1;
71  bool R11DoorRightB : 1;
72  bool R11DoorRightF : 1;
73  bool R12Betreten : 1;
74  bool R12ChewyBork : 1;
75  bool R12Talisman : 1;
76  bool R12TalismanOk : 1;
77  bool R12RaumOk : 1;
78 
79  bool R12BorkTalk : 1;
80  bool R12BorkInRohr : 1;
81  bool R12TransOn : 1;
82  bool R12ChainLeft : 1;
83  bool R13BorkOk : 1;
84  bool R13Band : 1;
85  bool R13Bandlauf : 1;
86  bool R13Surf : 1;
87 
88  bool R14Feuer : 1;
89  bool R14Translator : 1;
90  bool R14FluxoFlex : 1;
91  bool R14GleiterAuf : 1;
92  bool R14Sicherung : 1;
93  bool R14Waffe : 1;
94  bool R16F5Exit : 1;
95  bool R17GitterWeg : 1;
96 
97  bool R17Seil : 1;
98  bool R17HebelOk : 1;
99  bool R17EnergyOut : 1;
100  bool R17DoorKommand : 1;
101  bool R18DoorBruecke : 1;
102  bool R18CartridgeInSlot : 1;
103  bool R18CartTerminal : 1;
104  bool R18CartSave : 1;
105 
106  bool R18SurimyThrown : 1;
107  bool R18SondeMoni : 1;
108  bool R18MonitorSwitch : 1;
109  bool R18Crown : 1;
110  bool R18FirstEntry : 1;
111  bool R18Grid : 1;
112  bool R21Salto : 1;
113  bool R21GitterEnergie : 1;
114 
115  bool R21GitterMuell : 1;
116  bool R21Hebel1 : 1;
117  bool R21Hebel2 : 1;
118  bool R21Hebel3 : 1;
119  bool R21Laser1Weg : 1;
120  bool R21Laser2Weg : 1;
121  bool R21Gang : 1;
122  bool R22Paint : 1;
123 
124  bool R22ChewyPlatt : 1;
125  bool R22BorkPlatt : 1;
126  bool R22GetBork : 1;
127  bool R23FluxoFlex : 1;
128  bool R23Cartridge : 1;
129  bool R24FirstEntry : 1;
130  bool R25FirstEntry : 1;
131  bool R25GliderFlamesExtinguished : 1;
132 
133  bool R25SurimyLauf : 1;
134  bool R25GliderExit : 1;
135  bool R27SurimyOk : 1;
136  bool R28SurimyCar : 1;
137  bool R28ChewyPump : 1;
138  bool R28LetterBox : 1;
139  bool R28EntryHaus : 1;
140  bool R28Manuskript : 1;
141 
142  bool R28RKuerbis : 1;
143  bool R28ExitTown : 1;
144  bool R28PostCar : 1;
145  bool R29Pumpe : 1;
146  bool R29Schlauch1 : 1;
147  bool R29WaterHose : 1;
148  bool R29AutoSitz : 1;
149  bool R31PflanzeWeg : 1;
150 
151  bool R31KoernerDa : 1;
152  bool R31Wasser : 1;
153  bool R31KlappeZu : 1;
154  bool R31SurFurz : 1;
155  bool R32HowardWeg : 1;
156  bool R32UseSchreib : 1;
157  bool R32PapierOk : 1;
158  bool R32Script : 1;
159 
160  bool R33SchubFirst : 1;
161  bool R33Messer : 1;
162  bool R33MunterOk : 1;
163  bool R33MunterGet : 1;
164  bool R35TransCat : 1;
165  bool R35Falle : 1;
166  bool R35Schublade : 1;
167  bool R35CatEat : 1;
168 
169  bool R37UsedTranslatorOnRooster : 1;
170  bool R37TakenDenturesFromGlass : 1;
171  bool R37DogAshamed : 1;
172  bool R37RoosterFoughtWithDog : 1;
173  bool R37Mes : 1;
174  bool R39TranslatorUsed : 1;
175  bool R39TvOn : 1;
176  bool R39ScriptOk : 1;
177 
178  bool R39HowardDa : 1;
179  bool R39HowardWach : 1;
180  bool R40TeilKarte : 1;
181  bool R40TrainMove : 1;
182  bool R40TrainOk : 1;
183  bool R40Geld : 1;
184  bool R40PoliceStart : 1;
185  bool R40PoliceAway : 1;
186 
187  bool R40PoliceAb : 1;
188  bool R40Wettbewerb : 1;
189  bool R40HoUse : 1;
190  bool R40HaendlerOk : 1;
191  bool R40DuengerMit : 1;
192  bool R40DuengerTele : 1;
193  bool R41FirstTalk : 1;
194  bool R41LolaOk : 1;
195 
196  bool R41Einbruch : 1;
197  bool R41BruchInfo : 1;
198  bool R41KuerbisInfo : 1;
199  bool R41RepairInfo : 1;
200  bool R41HowardDiaOK : 1;
201  bool R42FirstEntry : 1;
202  bool R42LetterOk : 1;
203  bool R42HoToBeamter : 1;
204 
205  bool R42StampOk : 1;
206  bool R42LetterStamped : 1;
207  bool R42StationEmployeeAway : 1;
208  bool R43GetPgLady : 1;
209  bool R45TaxiOk : 1;
210  bool R45MagOk : 1;
211  bool R46GetLeder : 1;
212  bool R47SchlossOk : 1;
213 
214  bool R48TaxiEntry : 1;
215  bool R49WegFrei : 1;
216  bool R49BoyWeg : 1;
217  bool R49BoyAni : 1;
218  bool R50Zigarre : 1;
219  bool R50KeyOK : 1;
220  bool R51FirstEntry : 1;
221  bool R51HotelRoom : 1;
222 
223  bool R51KillerWeg : 1;
224  bool R52HotDogOk : 1;
225  bool R52TuerAuf : 1;
226  bool R52LichtAn : 1;
227  bool R52KakerJoke : 1;
228  bool R52KakerWeg : 1;
229  bool R53Kostuem : 1;
230  bool R53Visit : 1;
231 
232  bool R54HotDogOk : 1;
233  bool R54FputzerWeg : 1;
234  bool R54LiftOk : 1;
235  bool R54Schild : 1;
236  bool R55SekWeg : 1;
237  bool R55Location : 1;
238  bool R55Entry : 1;
239  bool R55Job : 1;
240 
241  bool R55ScriptWeg : 1;
242  bool R55EscScriptOk : 1;
243  bool R55RaumOk : 1;
244  bool R55R54First : 1;
245  bool R56GetTabak : 1;
246  bool R56AbfahrtOk : 1;
247  bool R56Kneipe : 1;
248  bool R56WhiskyMix : 1;
249 
250  // flags 25
251  bool R57StudioAuf : 1;
252  bool R59PosterWeg : 1;
253  bool R62Flucht : 1;
254  bool R62FirstEntry : 1;
255  bool R62TShow : 1;
256  bool R62LauraTransformation : 1;
257  bool R63Fire : 1;
258  bool R63FxManAway : 1;
259 
260  bool R63Uhr : 1;
261  bool R64ManAway : 1;
262  bool flags26_4 : 1;
263  bool flags26_8 : 1;
264  bool changedArtifactOrigin : 1;
265  bool flags26_20 : 1;
266  bool flags26_40 : 1;
267  bool R67SongOk : 1;
268 
269  bool R67KommodeAuf : 1;
270  bool R67KostuemWeg : 1;
271  bool R67PapageiWeg : 1;
272  bool R68KarteDa : 1;
273  bool R68Parrot : 1;
274  bool R68DivaAway : 1;
275  bool R68Song : 1;
276  bool R68IndigoDia : 1;
277 
278  bool R68DrinkCoupon : 1;
279  bool R71LeopardVined : 1;
280  bool flags28_4 : 1;
281  bool flags28_8 : 1;
282  bool flags28_10 : 1;
283  bool flags28_20 : 1; // bushes moved
284  bool flags28_40 : 1; // machete picked up
285  bool R74CutRubberPlant : 1;
286 
287  bool flags29_1 : 1;
288  bool flags29_2 : 1;
289  bool flags29_4 : 1;
290  bool flags29_8 : 1;
291  bool flags29_10 : 1;
292  bool flags29_20 : 1;
293  bool flags29_40 : 1;
294  bool flags29_80 : 1;
295 
296  bool flags30_1 : 1;
297  bool flags30_2 : 1;
298  bool flags30_4 : 1;
299  bool flags30_8 : 1;
300  bool flags30_10 : 1;
301  bool flags30_20 : 1;
302  bool flags30_40 : 1;
303  bool flags30_80 : 1;
304 
305  bool R88UsedMonkey : 1;
306  bool gottenDiary : 1;
307  bool R84GoonsPresent : 1;
308  bool flags31_8 : 1;
309  bool flags31_10 : 1;
310  byte flags31_20 : 1;
311  byte flags31_40 : 1;
312  byte flags31_80 : 1;
313 
314  // Further flags
315  bool flags32_1 : 1;
316  bool flags32_2 : 1;
317  bool flags32_4 : 1;
318  bool flags32_8 : 1;
319  bool flags32_10 : 1;
320  bool flags32_20 : 1;
321  bool flags32_40 : 1;
322  bool flags32_80 : 1;
323 
324  bool flags33_1 : 1;
325  bool flags33_2 : 1;
326  bool flags33_4 : 1;
327  bool flags33_8 : 1;
328  bool flags33_10 : 1;
329  bool flags33_20 : 1;
330  bool flags33_40 : 1;
331  bool flags33_80 : 1;
332 
333  bool flags34_1 : 1;
334  bool flags34_2 : 1;
335  bool flags34_4 : 1;
336  bool flags34_8 : 1;
337  bool flags34_10 : 1;
338  bool flags34_20 : 1;
339  bool flags34_40 : 1;
340  bool flags34_80 : 1;
341 
342  bool flags35_1 : 1;
343  bool flags35_2 : 1;
344  bool flags35_4 : 1;
345  bool flags35_8 : 1;
346  bool flags35_10 : 1;
347  bool flags35_20 : 1;
348  bool flags35_40 : 1;
349  bool flags35_80 : 1;
350 
351  bool flags36_1 : 1;
352  bool flags36_2 : 1;
353  bool flags36_4 : 1;
354  bool flags36_8 : 1;
355  bool flags36_10 : 1;
356  bool flags36_20 : 1;
357  bool flags36_40 : 1;
358  bool flags36_80 : 1;
359 
360  bool flags37_1 : 1;
361  bool flags37_2 : 1;
362  bool flags37_4 : 1;
363  bool flags37_8 : 1;
364  bool flags37_10 : 1;
365  bool flags37_20 : 1;
366  bool flags37_40 : 1;
367  bool flags37_80 : 1;
368 
369  bool R64AshtrayTaken : 1; // picked up ashtray in TV room
370  bool flags38_2 : 1;
371  uint8 flags38_unused : 6;
372 
373  GameFlags() { clear(); }
374  void clear();
375 } PACKED_STRUCT;
376 #include "common/pack-end.h" // END STRUCT PACKING
377 
378 struct GameState : public GameFlags {
379  GameState() : GameFlags(), _flags(this) {
380  _flags->clear();
381  }
382 
386  void clear();
387 
391  bool synchronize(Common::Serializer &s);
392 
393  GameFlags *_flags = nullptr;
394 
395  int16 MainMenuY = 0;
396  int16 InvDisp = 0;
397  int16 DispZx = 0;
398  int16 DispZy = 0;
399  int16 DispFlag = 0;
400  int16 InventY = 0;
401  int16 InventSlot[MAX_MOV_OBJ] = { 0 };
402 
403  RoomMovObject room_m_obj[MAX_MOV_OBJ];
404  RoomStaticInventory room_s_obj[MAX_FEST_OBJ];
405  RoomExit room_e_obj[MAX_EXIT];
406  int16 X[MAX_PERSON] = { 0 };
407  int16 Y[MAX_PERSON] = { 0 };
408  int16 Phase[MAX_PERSON] = { 0 };
409  int16 _personHide[MAX_PERSON] = { 0 };
410  int16 _personRoomNr[MAX_PERSON] = { 0 };
411  int16 ZoomXy[MAX_PERSON][2] = {{ 0 }};
412  int16 PersonGlobalDia[MAX_PERSON] = { 0 };
413  int16 PersonDia[MAX_PERSON] = { 0 };
414  int16 PersonDiaRoom[MAX_PERSON] = { 0 };
415  int16 PersonDiaTmpRoom[MAX_PERSON] = { 0 };
416 
417  int16 ChewyAni = 0;
418  int16 DiaAMov = 0;
419  int16 scrollx = 0;
420  int16 scrolly = 0;
421  int16 ScrollxStep = 0;
422  int16 ScrollyStep = 0;
423  int16 DelaySpeed = 0;
424  int16 AadDelay = 0;
425  int16 AadSilent = 0;
426 
427  uint8 R0FueterLab = 0;
428  uint8 R6RaumBetreten = 0;
429  uint8 R6BolaJoke = 0;
430  uint8 R7BellCount = 0;
431  uint8 R11IdCardNr = 0;
432  uint8 R12BorkCount = 0;
433 
434  uint8 R13MonitorStatus = 0;
435 
436  uint8 R17Location = 0;
437 
438  int16 R23GliderExit = 0;
439 
440  uint8 R24Lever[3] = { 0 };
441  uint8 R24HebelDir[3] = { 0 };
442  uint8 R24KristallLast[3] = { 0 };
443  uint8 R25SurimyGo = 0;
444  uint8 R27HowardGed = 0;
445  uint8 R28PumpTxt1 = 0;
446  uint8 R28PumpTxt = 0;
447 
448  uint8 R31SurimyGo = 0;
449  uint8 R33SurimyGo = 0;
450  uint8 R33Munter[4] = { 0 };
451 
452  int16 R39TvKanal = 0;
453  uint8 R39TvRecord = 0;
454  uint8 R39ClintNews = 0;
455 
456  uint8 R40PoliceAniStatus = 0;
457  uint8 R41TrainCount = 0;
458 
459  uint8 R47Schloss[3] = { 0 };
460  uint8 R48TaxiPerson[MAX_PERSON] = { 0 };
461  uint8 R48Auswahl[5] = { 0 };
462 
463  uint8 R49BoyAniCount = 0;
464  uint8 R51DoorCount = 0;
465  uint8 R54LiftCount = 0;
466  uint8 R54HowardVorne = 0;
467 
468  short R55ExitDia = 0;
469 
470  int16 R58TmpRoom = 0;
471  int16 R58TmpRoom1 = 0;
472  int16 R58TmpSx = 0;
473  int16 R58TmpSy = 0;
474  int16 R58TmpX = 0;
475  int16 R58TmpY = 0;
476  int16 R64Moni1Ani = 0;
477 
478  int16 R64Moni2Ani = 0;
479 
480  // ---- //
481  int16 R71Val1 = 0;
482  int16 R71Val2 = 0;
483  // ---- //
484  int16 r76State = 0;
485  // ---- //
486  int16 R79Val[3] = {0, 0, 0};
487  // ---- //
488  int r90_Array187030[8][4] = {
489  {0, 1, 180, 190},
490  {0, 1, 60, 60},
491  {0, 1, 140, 150},
492  {0, 1, 140, 230},
493  {0, 1, 40, 340},
494  {0, 1, 49, 50},
495  {0, 1, 88, 90},
496  {0, 1, 170, 190}
497  };
498 
499  // ---- //
500  int r94Scrollx = 0;
501  // --- //
502 
503  uint8 mi[8] = {0};
504  int16 SVal1 = 0;
505  int16 SVal2 = 0;
506  int16 SVal3 = 0;
507  int16 SVal4 = 0;
508  uint8 FramesPerSecond = 0;
509 };
510 
511 struct AutoMov {
512  int16 X;
513  int16 Y;
514 };
515 
516 struct MovPhasen {
517  int16 AtsText;
518  int16 Phase[4][2];
519 
520  int16 Lines;
521  int16 Repeat;
522 
523  uint8 ZoomFak;
524  uint8 Start;
525 };
526 
527 struct MovLine {
528  int16 EndXyz[3];
529  uint8 PhNr;
530  uint8 Vorschub;
531 };
532 
533 struct AniBlock {
534  int16 Nr;
535  uint8 Repeat;
536  uint8 Dir;
537 
538  uint8 Mode;
539 
540  uint8 Dummy;
541 };
542 
543 struct Flags {
544  uint16 StopAutoObj : 1;
545  uint16 AniUserAction : 1;
546  uint16 AutoAniPlay : 1;
547  uint16 StaticUseTxt : 1;
548  uint16 GedAction : 1;
549  uint16 ChAutoMov : 1;
550  uint16 ChAutoMovXy : 1; // TODO: Check removal in favor of stopAutoMove
551  uint16 BreakAMov : 1;
552 
553  uint16 AtsAction : 1;
554  uint16 AdsAction : 1;
555  uint16 AtsText : 1;
556  uint16 DialogCloseup : 1;
557  uint16 ShowAtsInvTxt : 1;
558  uint16 MainInput : 1;
559  uint16 InventMenu : 1;
560  uint16 NoScroll : 1;
561 
562  uint16 ExitMov : 1;
563  uint16 MausTxt : 1;
564  uint16 LoadGame : 1;
565  uint16 mainMouseFlag: 1;
566  uint16 ZoomMov : 1;
567  uint16 SaveMenu : 1;
568 
569  uint16 SpzAni : 1;
570  uint16 MouseLeft : 1;
571  uint16 ChewyDontGo : 1;
572  uint16 NoPalAfterFlc : 1;
573  uint16 NoDiaBox : 1;
574  uint16 NoEndPosMovObj: 1;
575  uint16 SavePersonRnr : 1;
576 };
577 
578 extern void *MALLOC(size_t size);
579 
580 } // namespace Chewy
581 
582 #endif
Definition: types.h:543
Definition: object_extra.h:81
Definition: types.h:516
Definition: types.h:378
Definition: serializer.h:79
Definition: types.h:527
Definition: object_extra.h:47
Definition: types.h:533
Definition: object_extra.h:113
Definition: types.h:511
Definition: types.h:33
Definition: ani_dat.h:25