ScummVM API documentation
enginedata.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 NANCY_ENGINEDATA_H
23 #define NANCY_ENGINEDATA_H
24 
25 #include "engines/nancy/commontypes.h"
26 #include "engines/nancy/util.h"
27 
28 #include "common/hash-str.h"
29 #include "common/path.h"
30 
31 namespace Nancy {
32 
33 // Data types corresponding to chunks found inside BOOT
34 
35 struct EngineData {
37  virtual ~EngineData() {}
38 };
39 
40 // Boot summary. Contains data for the UI, game clock, starting a new game.
41 struct BSUM : public EngineData {
42  BSUM(Common::SeekableReadStream *chunkStream);
43 
44  byte header[90];
45 
46  Common::Path conversationTextsFilename;
47  Common::Path autotextFilename;
48 
49  // Nancy12+
50  Common::Path fontFilename;
51  Common::Path flagsFilename;
52 
53  // Game start section
54  SceneChangeDescription firstScene;
55  uint16 startTimeHours;
56  uint16 startTimeMinutes;
57 
58  // More Nancy Drew! scene
59  SceneChangeDescription adScene;
60 
61  // UI
62  Common::Rect extraButtonHotspot; // Extra button is map in tvd, clock in nancy2 and up
63  Common::Rect extraButtonHighlightDest;
64  Common::Rect textboxScreenPosition;
65  Common::Rect inventoryBoxScreenPosition;
66  Common::Rect menuButtonSrc;
67  Common::Rect helpButtonSrc;
68  Common::Rect menuButtonDest;
69  Common::Rect helpButtonDest;
70  Common::Rect menuButtonHighlightSrc;
71  Common::Rect helpButtonHighlightSrc;
72  Common::Rect clockHighlightSrc;
73 
74  // Transparent color
75  byte paletteTrans = 0;
76  byte rTrans = 0;
77  byte gTrans = 0;
78  byte bTrans = 0;
79 
80  uint16 horizontalEdgesSize;
81  uint16 verticalEdgesSize;
82 
83  uint16 numFonts;
84 
85  uint16 playerTimeMinuteLength;
86  uint16 buttonPressTimeDelay;
87  uint16 dayStartMinutes = 0;
88  uint16 dayEndMinutes = 0;
89  byte overrideMovementTimeDeltas;
90  uint16 slowMovementTimeDelta;
91  uint16 fastMovementTimeDelta;
92 };
93 
94 // Contains rects defining the in-game viewport
95 struct VIEW : public EngineData {
96  VIEW(Common::SeekableReadStream *chunkStream);
97 
98  Common::Rect screenPosition;
99  Common::Rect bounds;
100 };
101 
102 // Contains a list of .cal filenames, which are to be loaded at startup.
103 // .cal files themselves are just collections of image files used in dialogue.
104 // First introduced in nancy2.
105 struct PCAL : public EngineData {
106  PCAL(Common::SeekableReadStream *chunkStream);
107 
109 };
110 
111 // Contains definitions for all in-game items, as well as data for the
112 // inventory box at the bottom right of the game screen.
113 struct INV : public EngineData {
115  Common::String name;
116  byte keepItem = kInvItemKeepAlways;
117  uint16 sceneID = kNoScene;
118  uint16 sceneSoundFlag = kContinueSceneSound;
119  Common::Rect sourceRect;
120  Common::Rect highlightedSourceRect;
121 
122  Common::String cantText;
123  Common::String cantTextNotHolding; // nancy2 only
124  Common::String cantTexts[3]; // Nancy9 and newer
125  SoundDescription cantSound;
126  SoundDescription cantSoundNotHolding; // nancy2 only
127  SoundDescription cantSounds[3]; // Nancy9 and newer
128  };
129 
130  INV(Common::SeekableReadStream *chunkStream);
131 
132  Common::Rect scrollbarSrcBounds;
133  Common::Point scrollbarDefaultPos;
134  uint16 scrollbarMaxScroll;
135 
136  Common::Array<Common::Rect> ornamentSrcs;
137  Common::Array<Common::Rect> ornamentDests;
138 
139  Common::Array<Common::Rect> curtainAnimationSrcs;
140  Common::Rect curtainsScreenPosition;
141  uint16 curtainsFrameTime;
142 
143  uint16 captionAutoClearTime = 3000;
144 
145  Common::Path inventoryBoxIconsImageName;
146  Common::Path inventoryCursorsImageName;
147 
148  SoundDescription cantSound;
149  Common::String cantText;
150 
151  Common::Array<ItemDescription> itemDescriptions;
152 };
153 
154 // Contains data about the textbox at the bottom left of the game screen
155 struct TBOX : public EngineData {
156  TBOX(Common::SeekableReadStream *chunkStream);
157 
158  Common::Rect scrollbarSrcBounds;
159  Common::Rect innerBoundingBox;
160  Common::Point scrollbarDefaultPos;
161  uint16 scrollbarMaxScroll;
162 
163  uint16 upOffset;
164  uint16 downOffset;
165  uint16 leftOffset;
166  uint16 rightOffset;
167 
168  Common::Array<Common::Rect> ornamentSrcs;
169  Common::Array<Common::Rect> ornamentDests;
170 
171  uint16 defaultFontID;
172  uint16 defaultTextColor;
173  uint16 conversationFontID;
174  uint16 highlightConversationFontID;
175  uint16 tabWidth;
176  uint16 pageScrollPercent;
177 
178  uint32 textBackground;
179  uint32 highlightTextBackground;
180 
181  // Nancy 10+ extra layout variables.
182  int32 maxScrollWidth = 0;
183  int32 firstLineY = 0; // added to the y-cursor when starting a new line
184  uint16 lineStartXCursor = 0; // left inset of the text within the text area
185  int32 unknown1 = 0;
186  int32 unknown2 = 0;
187  int32 contentWidth = 0;
188  int32 contentHeight = 0;
189 };
190 
191 // Contains data about the map state. Only used in TVD and nancy1
192 struct MAP : public EngineData {
193  struct Location {
194  Common::String description;
195  Common::Rect hotspot;
196  SceneChangeDescription scenes[2];
197 
198  Common::Rect labelSrc;
199  };
200 
201  MAP(Common::SeekableReadStream *chunkStream);
202 
204  Common::Array<Common::Path> mapPaletteNames;
206 
207  // Globe section, TVD only
208  uint16 globeFrameTime;
209  Common::Array<Common::Rect> globeSrcs;
210  Common::Rect globeDest;
211  Common::Rect globeGargoyleSrc;
212  Common::Rect globeGargoyleDest;
213 
214  // Button section, nancy1 only
215  Common::Rect buttonSrc;
216  Common::Rect buttonDest;
217 
218  Common::Rect closedLabelSrc;
219 
220  Common::Array<Location> locations;
221 
222  Common::Point cursorPosition;
223 };
224 
225 // Contains data for the help screen.
226 struct HELP : public EngineData {
227  HELP(Common::SeekableReadStream *chunkStream);
228 
229  Common::Path imageName;
230  Common::Rect buttonDest;
231  Common::Rect buttonSrc;
232  Common::Rect buttonHoverSrc;
233 };
234 
235 // Contains data for the credits screen.
236 struct CRED : public EngineData {
237  CRED(Common::SeekableReadStream *chunkStream);
238 
239  Common::Path imageName;
240  Common::Array<Common::Path> textNames;
241  Common::Rect textScreenPosition;
242  uint16 updateTime;
243  uint16 pixelsToScroll;
244  SoundDescription sound;
245 };
246 
247 // Contains data for the main menu.
248 struct MENU : public EngineData {
249  MENU(Common::SeekableReadStream *chunkStream);
250 
251  Common::Path _imageName;
252  Common::Array<Common::Rect> _buttonDests;
253  Common::Array<Common::Rect> _buttonDownSrcs;
254  Common::Array<Common::Rect> _buttonHighlightSrcs;
255  Common::Array<Common::Rect> _buttonDisabledSrcs;
256 };
257 
258 // Contains data for the Setup screen (a.k.a settings menu)
259 struct SET : public EngineData {
260  SET(Common::SeekableReadStream *chunkStream);
261 
262  Common::Path _imageName;
263  // Common::Rect _scrollbarsBounds
264  Common::Array<Common::Rect> _scrollbarBounds;
265  Common::Array<Common::Rect> _buttonDests;
266  Common::Array<Common::Rect> _buttonDownSrcs;
267  Common::Rect _doneButtonHighlightSrc;
268  Common::Array<Common::Rect> _scrollbarSrcs;
269 
270  Common::Array<uint16> _scrollbarsCenterYPos;
271  Common::Array<uint16> _scrollbarsCenterXPosL;
272  Common::Array<uint16> _scrollbarsCenterXPosR;
273 
275 };
276 
277 // Contains data for the Save/Load screen. Used up to nancy7
278 struct LOAD : public EngineData {
279  LOAD(Common::SeekableReadStream *chunkStream);
280 
281  Common::Path _image1Name;
282 
283  int16 _mainFontID;
284  int16 _highlightFontID;
285  int16 _disabledFontID;
286  int16 _fontXOffset;
287  int16 _fontYOffset;
288 
289  Common::Array<Common::Rect> _saveButtonDests;
290  Common::Array<Common::Rect> _loadButtonDests;
291  Common::Array<Common::Rect> _textboxBounds;
292  Common::Rect _inputTextboxBounds;
293  Common::Rect _doneButtonDest;
294  Common::Array<Common::Rect> _saveButtonDownSrcs;
295  Common::Array<Common::Rect> _loadButtonDownSrcs;
296 
297  Common::Rect _doneButtonDownSrc;
298  Common::Array<Common::Rect> _saveButtonHighlightSrcs;
299  Common::Array<Common::Rect> _loadButtonHighlightSrcs;
300 
301  Common::Rect _doneButtonHighlightSrc;
302  Common::Array<Common::Rect> _saveButtonDisabledSrcs;
303  Common::Array<Common::Rect> _loadButtonDisabledSrcs;
304 
305  Common::Rect _doneButtonDisabledSrc;
306  Common::Rect _blinkingCursorSrc;
307  uint16 _blinkingTimeDelay;
308  Common::Array<Common::Rect> _cancelButtonSrcs;
309  Common::Array<Common::Rect> _cancelButtonDests;
310  Common::Rect _cancelButtonDownSrc;
311  Common::Rect _cancelButtonHighlightSrc;
312  Common::Rect _cancelButtonDisabledSrc;
313 
314  Common::Path _gameSavedPopup;
315  Common::String _emptySaveText;
316  Common::String _defaultSaveNamePrefix;
317  // Common::Rect _gameSavedBounds
318 
319  // v2 members
320  Common::Path _image2Name;
321  Common::Path _imageButtonsName;
322 
323  Common::Array<Common::Rect> _unpressedButtonSrcs;
324  Common::Array<Common::Rect> _pressedButtonSrcs;
325  Common::Array<Common::Rect> _highlightedButtonSrcs;
326  Common::Array<Common::Rect> _disabledButtonSrcs;
327 
328  Common::Array<Common::Rect> _buttonDests;
329 };
330 
331 // Contains data for the prompt that appears when exiting the game
332 // without saving first. Introduced in nancy3.
333 struct SDLG : public EngineData {
334  struct Dialog {
335  Dialog(Common::SeekableReadStream *chunkStream);
336 
337  Common::Path imageName;
338 
339  Common::Rect yesDest;
340  Common::Rect noDest;
341  Common::Rect cancelDest;
342 
343  Common::Rect yesHighlightSrc;
344  Common::Rect noHighlightSrc;
345  Common::Rect cancelHighlightSrc;
346 
347  Common::Rect yesDownSrc;
348  Common::Rect noDownSrc;
349  Common::Rect cancelDownSrc;
350  };
351 
352  SDLG(Common::SeekableReadStream *chunkStream);
353 
354  Common::Array<Dialog> dialogs;
355 };
356 
357 // Contains data for the hint system. Only used in nancy1.
358 struct HINT : public EngineData {
359  HINT(Common::SeekableReadStream *chunkStream);
360 
361  Common::Array<uint16> numHints;
362 };
363 
364 // Contains data for the slider puzzle. First used in nancy1
365 struct SPUZ : public EngineData {
366  SPUZ(Common::SeekableReadStream *chunkStream);
367 
369 };
370 
371 // Contains data for the clock UI that appears at the bottom left of the screen (top left in TVD)
372 // Not used in nancy1 but still present in the data.
373 struct CLOK : public EngineData {
374  CLOK(Common::SeekableReadStream *chunkStream);
375 
377  Common::Array<Common::Rect> animDests;
378 
379  Common::Array<Common::Rect> hoursHandSrcs;
380  Common::Array<Common::Rect> minutesHandSrcs;
381  Common::Rect screenPosition;
382  Common::Array<Common::Rect> hoursHandDests;
383  Common::Array<Common::Rect> minutesHandDests;
384 
385  Common::Rect staticImageSrc;
386  Common::Rect staticImageDest;
387 
388  uint32 timeToKeepOpen = 0;
389  uint16 frameTime = 0;
390 
391  bool clockIsDisabled = false;
392  bool clockIsDay = false; // nancy5 clock
393 
394  uint32 countdownTime = 0;
396  Common::Array<Common::Rect> countdownSrcs;
397  Common::Rect disabledSrc; // possibly useless
398 };
399 
400 // Contains data for special effects (fades between scenes/fades to black).
401 // Introduced in nancy2.
402 struct SPEC : public EngineData {
403  SPEC(Common::SeekableReadStream *chunkStream);
404 
405  byte fadeToBlackNumFrames;
406  uint16 fadeToBlackFrameTime;
407  byte crossDissolveNumFrames;
408 };
409 
410 // Contains data for the raycast puzzle in nancy3. Specifically, this is the
411 // data for the different "themes" that appear in the 3D space.
412 struct RCLB : public EngineData {
413  struct Theme {
414  Common::String themeName;
415 
416  Common::Array<uint32> wallIDs;
417 
418  Common::Array<uint16> exitFloorIDs;
419  Common::Array<uint16> floorIDs;
420  Common::Array<uint16> ceilingIDs;
421 
422  Common::Array<uint32> doorIDs;
423  Common::Array<uint32> transparentwallIDs;
424  Common::Array<uint32> objectwallIDs;
425  Common::Array<uint16> objectWallHeights;
426 
427  uint16 generalLighting;
428  uint16 hasLightSwitch;
429 
430  int16 transparentWallDensity;
431  int16 objectWallDensity;
432  int16 doorDensity;
433  };
434 
435  RCLB(Common::SeekableReadStream *chunkStream);
436 
437  uint16 lightSwitchID;
438  uint16 unk2;
439  Common::Array<Theme> themes;
440 };
441 
442 // Contains data about the raycast puzzle in nancy3. Specifically, this is the
443 // data for the debug map and the names of the textures to be used when rendering.
444 struct RCPR : public EngineData {
445  RCPR(Common::SeekableReadStream *chunkStream);
446 
447  Common::Array<Common::Rect> screenViewportSizes;
448  uint16 viewportSizeUsed;
449 
450  byte wallColor[3];
451  byte playerColor[3];
452  byte doorColor[3];
453  byte lightSwitchColor[3];
454  byte exitColor[3];
455  byte uColor6[3];
456  byte uColor7[3];
457  byte uColor8[3];
458  byte transparentWallColor[3];
459  byte uColor10[3];
460 
461  Common::Array<Common::Path> wallNames;
462  Common::Array<Common::Path> specialWallNames;
463  Common::Array<Common::Path> ceilingNames;
464  Common::Array<Common::Path> floorNames;
465 };
466 
467 // Contains the name and dimensions of an image.
468 struct ImageChunk : public EngineData {
470 
471  Common::Path imageName;
472  uint16 width;
473  uint16 height;
474 };
475 
476 // Contains text data. Every string is tagged with a key via which
477 // it can be accessed. Used to store dialogue and journal (autotext) strings.
478 // NOT found inside BOOT; these are stored in their own cifs, the names of which
479 // can be found inside BSUM. Introduced in nancy6.
480 struct CVTX : public EngineData {
481  CVTX(Common::SeekableReadStream *chunkStream);
482 
484 };
485 
486 struct TABL : public EngineData {
487  TABL(Common::SeekableReadStream *chunkStream);
488 
489  Common::String soundBaseName;
490  Common::Array<uint16> startIDs;
491  Common::Array<uint16> correctIDs;
494 };
495 
496 struct MARK : public EngineData {
497  MARK(Common::SeekableReadStream *chunkStream);
498 
499  Common::Array<Common::Rect> _markSrcs;
500 };
501 
502 // Shared UI elements. Introduced in Nancy 10
503 struct SHUI : public EngineData {
504  SHUI(Common::SeekableReadStream *chunkStream);
505 
506  Common::Array<Common::Rect> _closeRects; // Close/"X" button rects
507  Common::Array<Common::Rect> _sliderRects; // Slider rects
508 };
509 
510 // ScrollTextBox - introduced in Nancy 11. Standard UI popup header,
511 // followed by the rect to restore when the text box is closed.
512 struct SCTB : public EngineData {
513  SCTB(Common::SeekableReadStream *chunkStream);
514 
515  UIPopupHeader header;
516  Common::Rect restoreSrcRect;
517 };
518 
519 enum TaskButton {
520  kTaskButtonMenu = 0,
521  kTaskButtonInventory = 1,
522  kTaskButtonNotebook = 2,
523  kTaskButtonCellphone = 3,
524  // Nancy12 only: a non-clickable coin purse that shows Nancy's money on
525  // hover, inserted before HELP. HELP is therefore always the last taskbar
526  // button (index 4 in games without the coin purse, index 5 in Nancy12) and
527  // has no fixed constant.
528  kTaskButtonCoinPurse = 4
529 };
530 
531 // Taskbar (the always-on strip at the bottom of the screen with MENU /
532 // inventory / notebook / cellphone / HELP buttons). Introduced in Nancy 10.
533 struct TASK : public EngineData {
534  struct ButtonRecord {
535  UIButtonRecord button;
536  // Source rect for the notification sprite (the badge shown on
537  // the middle three buttons when the popup has new content).
538  // Empty for buttons that don't carry a notification.
539  Common::Rect notificationSrcRect;
540  Common::String clickSoundName[3];
541  };
542 
543  TASK(Common::SeekableReadStream *chunkStream);
544 
545  // Maximum taskbar button slots: menu / inventory / notebook / cell phone /
546  // help, plus Nancy12's extra coin purse. Earlier games fill only the first 5.
547  static const uint kNumButtons = 6;
548  static const uint kButtonRecordSize = 354;
549  static const uint kNumAltSounds = 3;
550 
551  Common::Path imageName;
552 
553  Common::Rect srcRect;
554  Common::Rect dstRect;
555  Common::Rect unkRect1;
556  Common::Rect unkRect2;
557 
558  ButtonRecord buttons[kNumButtons];
559 };
560 
561 // Web browser popup UI (used from the cell phone to view in-game "web
562 // pages"). Introduced in Nancy 10
563 struct UIBW : public EngineData {
564  struct Hotspot {
565  uint16 id = 0;
566  Common::Rect rect;
567  };
568 
569  struct UrlPage {
570  Common::Path imageName;
571  Common::Array<Hotspot> hotspots;
572  };
573 
574  UIBW(Common::SeekableReadStream *chunkStream);
575 
576  static const uint kUrlRecordSize = 215;
577  static const uint kMaxHotspotsPerPage = 10;
578 
579  Common::Path imageName;
581 };
582 
583 // Cell-phone popup UI. Introduced in Nancy 10.
584 struct UICL : public EngineData {
585  struct DialPadSlot {
586  Common::Rect srcRect;
587  Common::Rect destRect;
588  Common::String soundName;
589  };
590 
592  Common::Rect srcRectIdle;
593  Common::Rect srcRectPressed;
594  Common::Rect destRect;
595  };
596 
597  struct Contact {
598  // Prefix layout:
599  // [0..1] visibility flag (10 = always, 11 = never, else =
600  // scene event-flag index; contact hidden until set).
601  // [2..8] 7-digit dial pattern (slot indices 0..9).
602  // [9] '\n' terminator.
603  // [10..12] unused.
604  byte unknownPrefix[13];
605  Common::String name; // 20-byte null-terminated
606  // Suffix layout: [0..1] sceneID, [2..3] frameID,
607  // [4..5] event-flag label, [6] event-flag value, [7] unused.
608  byte unknownSuffix[8];
609  };
610 
612  Common::Rect srcRect;
613  Common::Rect destRect;
614  };
615 
616  static const uint kNumDialPadSlots = 15;
617  // Nancy 10-12 have 10 online sub-buttons; Nancy 13 added an 11th (the Back
618  // button, Ghidra widget 0x10) at the front of the array.
619  static const uint kNumSubButtons = 10;
620  static const uint kNumSubButtonsNancy13 = 11;
621  static const uint kNumStatusLabels = 3; // No Signal / No Access / Old Email Only
622 
623  UICL(Common::SeekableReadStream *chunkStream);
624 
625  UIPopupHeader header;
626  Common::Path overlayImageName;
627 
628  // Template the call-flow sounds (ring / pickup / invalid) are played
629  // through. Only the name is swapped per call; channel / volume /
630  // loops come from here.
631  SoundDescription callSoundTemplate;
632 
633  DialPadSlot dialPadSlots[kNumDialPadSlots];
634 
635  // Screen-frame and label rects
636  SrcDestRectPair dialHilite;
637  Common::Rect screenOutSrcRect;
638  int32 statusTextX = 0; // text X-baseline
639  int32 statusTextY = 0; // text Y-baseline
640  SrcDestRectPair welcomeScreen;
641  Common::String statusLabels[kNumStatusLabels]; // "No Signal", "No Access", "Old Email Only"
642  // Ribbon labels above the top-row buttons. In Nancy 13 the top row is
643  // Cam/Menu/Dir, and the review / delete screens reuse the same three columns
644  // with the Del/Send and Yes/No variants (all read from the 8-label block).
645  SrcDestRectPair dialLabel; // Nancy 13: "CAM"
646  SrcDestRectPair webLabel; // Nancy 13: "MENU"
647  SrcDestRectPair dirLabel; // Nancy 13: "DIR"
648  SrcDestRectPair dialingLabel; // Nancy 13: "DIAL"
649  SrcDestRectPair delLabel; // Nancy 13: "DEL"
650  SrcDestRectPair sendLabel; // Nancy 13: "SEND"
651  SrcDestRectPair yesLabel; // Nancy 13: "YES"
652  SrcDestRectPair noLabel; // Nancy 13: "NO"
653 
654  // Help "?" button (original button index 15). The visible Talk/Call key
655  // is dial-pad slot 12, not a separate widget.
656  ThreeRectWidget helpButton;
657 
658  // Screen-content sprite block
659  Common::String helpTextKey; // CVTX key for the help page text
660  Common::Rect signalSpriteSrc;
661  Common::Rect signalSpriteSrcAlt;
662  Common::Rect signalSpriteDest;
663  Common::Rect batterySpriteSrc;
664  Common::Rect batterySpriteSrcAlt;
665  Common::Rect batterySpriteDest;
666  SrcDestRectPair typeMessage;
667  SrcDestRectPair connectedLabel;
668  Common::Rect connectingSpriteSrc;
669  Common::Rect connectingSpriteSrcAlt; // state-8 variant
670  Common::Rect connectingSpriteDest;
671  SrcDestRectPair onlineHeading;
672  Common::Rect fullEmptyScreenSrc;
673  Common::Rect emailListContainer; // scrollbar/list container
674  Common::Rect dirArrowSrc;
675  Common::Rect dirCursorSrc;
676  SrcDestRectPair dirHeading;
677 
678  ThreeRectWidget subButtons[kNumSubButtonsNancy13];
679 
680  // Heading/icon SRC+DEST pairs
681  SrcDestRectPair searchHeading;
682  Common::Rect emailIconUnread;
683  Common::Rect emailIconSelected;
684  SrcDestRectPair emailHeading;
685  SrcDestRectPair helpHeading;
686  SrcDestRectPair browserHeading;
687 
688  // One initial email entry and one initial web-search entry can be baked
689  // into the UICL chunk itself; the original seeds them at new-game init
690  // (its cellphone reset). An empty key means the game ships that list empty.
691  SearchLink initialEmail;
692  SearchLink initialSearch;
693 
694  uint16 fontId1 = 0;
695  uint16 fontId2 = 0;
696 
697  Common::Path outgoingRingSound; // post-dial ring
698  Common::Path pickupSound; // call connect
699  Common::Path invalidNumberSound; // try again
700 
701  uint16 contactCount = 0;
702  Common::Array<Contact> contacts;
703 
704  // Nancy 13 added a camera / pictures sub-UI to the cell phone, which
705  // reorganized the chunk body. The fields below are only populated for
706  // Nancy 13 and later.
707  struct PictureRecord {
708  uint16 id = 0;
709  Common::Rect rect;
710  byte unknown[6] = {};
711  };
712 
713  Common::Rect cameraViewSrcRect; // camera viewfinder SRC on the overlay
714  int32 cameraTextX = 0;
715  int32 cameraTextY = 0;
716  Common::Path cameraViewImageName; // "UI_CellCamView_OVL"
717  Common::Path cameraClickSound;
718  Common::Rect pictureDisplayRect; // where a captured picture is shown
719  Common::Rect noPictureScreenRect; // "no pictures" placeholder
720  Common::Path helpTextKey2; // second CVTX key (phone-use help)
721  byte screenColors[9] = {}; // 3 RGB colors for the phone screen
722  Common::Array<PictureRecord> pictures; // captured-picture slots (up to 50)
723 };
724 
725 // Camera UI, added in Nancy 14. This is a standalone camera. While it is active,
726 // the cursor becomes a large viewfinder rectangle that the player aims at the
727 // scene; clicking photographs every subject whose region falls inside the framed
728 // area.
729 struct UICM : public EngineData {
730  UICM(Common::SeekableReadStream *chunkStream);
731 
732  // One photographable region. When a picture is taken, every subject whose
733  // frameID matches the current scene view and whose coords lie within the
734  // viewfinder rectangle is captured: its subjectID is recorded in the picture
735  // and its flag (if any) is set.
736  struct CameraSubject {
737  HotspotDescription hotspot; // frameID + region that can be photographed
738  int16 subjectID = -1; // identifies what was photographed
739  FlagDescription flag; // event flag set on capture (often unset)
740  };
741 
742  Common::Path overlayImageName; // "PHO_CameraView"
743  Common::Rect viewRect; // captured-picture bounds
744  uint16 maxPictures = 0; // most pictures the camera can hold
745  byte pictureCount = 0; // current picture count (0xff = none)
746  RandomSoundBlock shutterSound; // picture-capture cue
747 
749 };
750 
751 // New conversation popup UI (the text strip that appears above the taskbar
752 // when a character is speaking). Introduced in Nancy 10.
753 // Note: response hotspots are NOT in this chunk — they live in a separate
754 // TextBoxSummaryChunk, each carrying a response-sound filename referenced
755 // by ProcessConversation when STOP_VIDEO transitions to PLAYER_RESPONSE_SOUND.
756 struct UICO : public EngineData {
757  UICO(Common::SeekableReadStream *chunkStream);
758 
759  UIPopupHeader header;
760  Common::Rect textRect; // Text-drawing rect inside the popup overlay
761 };
762 
763 // New inventory popup UI (4x4 item grid with paging slider and category
764 // filter tabs along the right edge). Introduced in Nancy 10.
765 struct UIIV : public EngineData {
766  UIIV(Common::SeekableReadStream *chunkStream);
767 
768  static const uint kNumFilters = 6;
769 
770  UIPopupHeader header;
771  Common::Array<Common::Rect> slotSrcRects; // 16 entries (image coords)
772  Common::Array<Common::Rect> slotDestRects; // 16 entries (screen coords)
773  Common::Rect slotsHotspot; // Nancy13+: clickable region of the item slots
774  // When nonzero, items added while the popup is open are appended to the end
775  // of the inventory order instead of being inserted at the front (so the most
776  // recently dropped item ends up last). See Scene::addItemToInventory.
777  byte appendItemsWhileOpen = 0;
778  UIButtonSlot filters[kNumFilters]; // 6 entries
779  Common::Array<Common::Rect> tabCaptionSrcRects; // 6 entries
780  Common::Rect tabCaptionDestRect; // on-screen target
781 };
782 
783 // New notebook UI. Introduced in Nancy 10.
784 struct UINB : public EngineData {
785  UINB(Common::SeekableReadStream *chunkStream);
786 
787  static const uint kNumTabs = 2;
788  static const uint kNumPageSoundsPerSet = 3;
789 
790  UIPopupHeader header;
791  UIButtonSlot tabs[kNumTabs];
792  Common::Rect textRect;
793  byte primaryTextColor[3] = {}; // RGB, Nancy 13+
794  byte secondaryTextColor[3] = {}; // RGB, Nancy 13+
795  uint16 primaryFontID = 0;
796  uint16 secondaryFontAttr = 0;
797  uint16 useFilenameTextFlag = 0;
798  Common::Path conditionalTextFilename;
799  Common::Path actionableClickSounds[kNumPageSoundsPerSet];
800  Common::Path noActionClickSounds[kNumPageSoundsPerSet];
801  Common::Array<Common::Rect> tabCaptionSrcRects; // 2 entries
802  Common::Rect tabCaptionDestRect; // on-screen target
803 };
804 
805 // Event flags table. Introduced in Nancy 12, and replaces the event flag names
806 // that were hardcoded in the executable. Each record is a name followed by an id.
807 struct EVNT : public EngineData {
808  EVNT(Common::SeekableReadStream *chunkStream);
809 
810  static const uint kEventRecordSize = 35;
811 
812  Common::Array<Common::String> eventFlagNames;
813 };
814 
815 // UI overlay element table. Introduced in Nancy 12. Each record describes one UI
816 // element: the shared overlay image it belongs to, its on-screen rect and up to
817 // six associated sound cues. Unused slots use the name "NO_UI_ITEM", and slots
818 // without a given sound use "NO SOUND".
819 struct UIRC : public EngineData {
820  struct ItemRecord {
821  uint16 id = 0;
822  Common::Path overlayName;
823  Common::Rect rect;
824  int16 unknown1 = 0;
825  int16 unknown2 = 0;
826  int16 soundChannel = 0;
827  int16 soundVolume = 0;
828  Common::String soundNames[6];
829  };
830 
831  UIRC(Common::SeekableReadStream *chunkStream);
832 
833  static const uint kNumSounds = 6;
834  static const uint kItemRecordSize = 257;
835 
837 };
838 
839 // Music mix table. Introduced in Nancy 13. Each record maps a short location
840 // code (e.g. "BRI", "CAM", "TUT") to the set of music / ambience tracks that
841 // may play there ("TacitA"/"TacitB" are the silence variants).
842 struct MMIX : public EngineData {
843  struct Record {
844  Common::String name;
846  };
847 
848  MMIX(Common::SeekableReadStream *chunkStream);
849 
850  Common::Array<Record> records;
851 };
852 
853 // Level name table. Introduced in Nancy 15. Maps a short scene-prefix
854 // code (e.g. "KAP") to its human-readable level name (e.g. "Kapu Cave").
855 struct LVLN : public EngineData {
856  LVLN(Common::SeekableReadStream *chunkStream);
857 
858  Common::Array<Common::String> levelCodes; // e.g. "KAP"
859  Common::Array<Common::String> levelNames; // e.g. "Kapu Cave"
860 };
861 
862 // Player-character selector UI. Introduced in Nancy 15, where the player
863 // alternates between Nancy and the Hardy Boys.
864 // Each entry supplies the image names for one selectable character.
865 struct PCUI : public EngineData {
866  struct Character {
867  Common::String imageName; // e.g. "PUI_CRE_Nancy"
868  Common::String defaultImageName; // e.g. "PUI_CRE_Nancy_Default"
869  uint16 id = 0;
870  };
871 
872  PCUI(Common::SeekableReadStream *chunkStream);
873 
874  byte flag = 0;
875  Common::Array<Character> characters; // indexed by the on-disk slot byte
876 };
877 
878 // Fixed layout/graphics block for the Nancy 15 player-character ("Design
879 // Select") switcher screen. Companion to PCUI. Supplies the background and
880 // overlay image names plus the on-screen button/selection rects.
881 struct LDSN : public EngineData {
882  LDSN(Common::SeekableReadStream *chunkStream);
883 
884  Common::String backgroundImageName; // "UI_DesignSelectBG"
885  Common::String overlayImageName; // "UI_DesignSelect_OVL"
886  Common::Array<Common::Rect> rects; // button + per-character selection rects
887 };
888 
889 // Player-UI header. Introduced in Nancy 15, first chunk of each character's
890 // PUI_CRE_<char>_DEFAULT_BOOT file. Names the UI theme and its swatch image.
891 struct PUIH : public EngineData {
892  PUIH(Common::SeekableReadStream *chunkStream);
893 
894  byte flag = 0;
895  Common::String themeName; // e.g. "Nancy Classic Look (Default)"
896  Common::String swatchImageName; // e.g. "UI_Swatch_ND"
897 };
898 
899 // Player-UI random-sound bank. Introduced in Nancy 15 (per-character boot).
900 // Holds a base name plus a channel/volume and a list of sound groups, each
901 // group being a set of interchangeable (randomly-picked) sound variants -
902 // e.g. the character's "can't do that" response cues.
903 struct PUIV : public EngineData {
904  struct SoundGroup {
905  byte tag = 0;
907  };
908 
909  PUIV(Common::SeekableReadStream *chunkStream);
910 
911  Common::String name; // e.g. "DEF_ND_CANT"
912  uint16 channelID = 0; // shared playback channel (inferred)
913  uint32 unknown = 0;
914  uint16 volume = 0; // shared volume (inferred)
915  Common::Array<SoundGroup> soundGroups;
916 };
917 } // End of namespace Nancy
918 
919 #endif // NANCY_ENGINEDATA_H
Definition: enginedata.h:365
Definition: enginedata.h:41
Definition: enginedata.h:358
Definition: enginedata.h:334
Definition: str.h:59
Definition: enginedata.h:866
Definition: enginedata.h:402
Definition: enginedata.h:819
Definition: enginedata.h:486
Definition: enginedata.h:236
Definition: commontypes.h:160
Definition: enginedata.h:584
Definition: enginedata.h:597
Definition: enginedata.h:564
Definition: enginedata.h:756
Definition: rect.h:536
Definition: path.h:52
Definition: enginedata.h:591
Definition: enginedata.h:496
Definition: enginedata.h:193
Definition: stream.h:745
Definition: enginedata.h:192
Definition: enginedata.h:105
Definition: enginedata.h:881
Definition: enginedata.h:569
Definition: commontypes.h:395
Definition: enginedata.h:842
Definition: enginedata.h:563
Definition: enginedata.h:259
Definition: enginedata.h:468
Definition: enginedata.h:444
Definition: enginedata.h:248
Definition: commontypes.h:295
Definition: enginedata.h:226
Definition: enginedata.h:820
Definition: enginedata.h:113
Definition: enginedata.h:503
Definition: rect.h:144
Definition: enginedata.h:807
Definition: enginedata.h:373
Definition: commontypes.h:442
Definition: enginedata.h:95
Definition: enginedata.h:413
Definition: enginedata.h:585
Definition: enginedata.h:903
Definition: enginedata.h:512
Definition: enginedata.h:611
Definition: enginedata.h:278
Definition: enginedata.h:904
Definition: commontypes.h:277
Definition: enginedata.h:480
Definition: enginedata.h:855
Definition: enginedata.h:333
Definition: enginedata.h:155
Definition: enginedata.h:765
Definition: enginedata.h:35
Definition: enginedata.h:729
Definition: commontypes.h:414
Definition: enginedata.h:865
Definition: enginedata.h:736
Definition: commontypes.h:175
Definition: enginedata.h:533
Definition: enginedata.h:843
Definition: commontypes.h:189
Definition: enginedata.h:707
Definition: enginedata.h:891
Definition: actionmanager.h:32
Definition: enginedata.h:114
Definition: enginedata.h:784
Definition: enginedata.h:534
Definition: enginedata.h:412