/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
*/
#ifndef NANCY_ENGINEDATA_H
#define NANCY_ENGINEDATA_H
#include "engines/nancy/commontypes.h"
namespace Nancy {
// Data types corresponding to chunks found inside BOOT
struct EngineData {
EngineData(Common::SeekableReadStream *chunkStream);
virtual ~EngineData() {}
};
// Boot summary. Contains data for the UI, game clock, starting a new game.
struct BSUM : public EngineData {
BSUM(Common::SeekableReadStream *chunkStream);
byte header[90];
Common::Path conversationTextsFilename;
Common::Path autotextFilename;
// Game start section
SceneChangeDescription firstScene;
uint16 startTimeHours;
uint16 startTimeMinutes;
// More Nancy Drew! scene
SceneChangeDescription adScene;
// UI
Common::Rect extraButtonHotspot; // Extra button is map in tvd, clock in nancy2 and up
Common::Rect extraButtonHighlightDest;
Common::Rect textboxScreenPosition;
Common::Rect inventoryBoxScreenPosition;
Common::Rect menuButtonSrc;
Common::Rect helpButtonSrc;
Common::Rect menuButtonDest;
Common::Rect helpButtonDest;
Common::Rect menuButtonHighlightSrc;
Common::Rect helpButtonHighlightSrc;
Common::Rect clockHighlightSrc;
// Transparent color
byte paletteTrans = 0;
byte rTrans = 0;
byte gTrans = 0;
byte bTrans = 0;
uint16 horizontalEdgesSize;
uint16 verticalEdgesSize;
uint16 numFonts;
uint16 playerTimeMinuteLength;
uint16 buttonPressTimeDelay;
uint16 dayStartMinutes = 0;
uint16 dayEndMinutes = 0;
byte overrideMovementTimeDeltas;
uint16 slowMovementTimeDelta;
uint16 fastMovementTimeDelta;
};
// Contains rects defining the in-game viewport
struct VIEW : public EngineData {
VIEW(Common::SeekableReadStream *chunkStream);
Common::Rect screenPosition;
Common::Rect bounds;
};
// Contains a list of .cal filenames, which are to be loaded at startup.
// .cal files themselves are just collections of image files used in dialogue.
// First introduced in nancy2.
struct PCAL : public EngineData {
PCAL(Common::SeekableReadStream *chunkStream);
Common::Array calNames;
};
// Contains definitions for all in-game items, as well as data for the
// inventory box at the bottom right of the game screen.
struct INV : public EngineData {
struct ItemDescription {
Common::String name;
byte keepItem = kInvItemKeepAlways;
uint16 sceneID = kNoScene;
uint16 sceneSoundFlag = kContinueSceneSound;
Common::Rect sourceRect;
Common::Rect highlightedSourceRect;
Common::String cantText;
Common::String cantTextNotHolding; // nancy2 only
SoundDescription cantSound;
SoundDescription cantSoundNotHolding; // nancy2 only
};
INV(Common::SeekableReadStream *chunkStream);
Common::Rect scrollbarSrcBounds;
Common::Point scrollbarDefaultPos;
uint16 scrollbarMaxScroll;
Common::Array ornamentSrcs;
Common::Array ornamentDests;
Common::Array curtainAnimationSrcs;
Common::Rect curtainsScreenPosition;
uint16 curtainsFrameTime;
uint16 captionAutoClearTime = 3000;
Common::Path inventoryBoxIconsImageName;
Common::Path inventoryCursorsImageName;
SoundDescription cantSound;
Common::String cantText;
Common::Array itemDescriptions;
};
// Contains data about the textbox at the bottom left of the game screen
struct TBOX : public EngineData {
TBOX(Common::SeekableReadStream *chunkStream);
Common::Rect scrollbarSrcBounds;
Common::Rect innerBoundingBox;
Common::Point scrollbarDefaultPos;
uint16 scrollbarMaxScroll;
uint16 upOffset;
uint16 downOffset;
uint16 leftOffset;
uint16 rightOffset;
Common::Array ornamentSrcs;
Common::Array ornamentDests;
uint16 defaultFontID;
uint16 defaultTextColor;
uint16 conversationFontID;
uint16 highlightConversationFontID;
uint16 tabWidth;
uint16 pageScrollPercent;
uint32 textBackground;
uint32 highlightTextBackground;
};
// Contains data about the map state. Only used in TVD and nancy1
struct MAP : public EngineData {
struct Location {
Common::String description;
Common::Rect hotspot;
SceneChangeDescription scenes[2];
Common::Rect labelSrc;
};
MAP(Common::SeekableReadStream *chunkStream);
Common::Array mapNames;
Common::Array mapPaletteNames;
Common::Array sounds;
// Globe section, TVD only
uint16 globeFrameTime;
Common::Array globeSrcs;
Common::Rect globeDest;
Common::Rect globeGargoyleSrc;
Common::Rect globeGargoyleDest;
// Button section, nancy1 only
Common::Rect buttonSrc;
Common::Rect buttonDest;
Common::Rect closedLabelSrc;
Common::Array locations;
Common::Point cursorPosition;
};
// Contains data for the help screen.
struct HELP : public EngineData {
HELP(Common::SeekableReadStream *chunkStream);
Common::Path imageName;
Common::Rect buttonDest;
Common::Rect buttonSrc;
Common::Rect buttonHoverSrc;
};
// Contains data for the credits screen.
struct CRED : public EngineData {
CRED(Common::SeekableReadStream *chunkStream);
Common::Path imageName;
Common::Array textNames;
Common::Rect textScreenPosition;
uint16 updateTime;
uint16 pixelsToScroll;
SoundDescription sound;
};
// Contains data for the main menu.
struct MENU : public EngineData {
MENU(Common::SeekableReadStream *chunkStream);
Common::Path _imageName;
Common::Array _buttonDests;
Common::Array _buttonDownSrcs;
Common::Array _buttonHighlightSrcs;
Common::Array _buttonDisabledSrcs;
};
// Contains data for the Setup screen (a.k.a settings menu)
struct SET : public EngineData {
SET(Common::SeekableReadStream *chunkStream);
Common::Path _imageName;
// Common::Rect _scrollbarsBounds
Common::Array _scrollbarBounds;
Common::Array _buttonDests;
Common::Array _buttonDownSrcs;
Common::Rect _doneButtonHighlightSrc;
Common::Array _scrollbarSrcs;
Common::Array _scrollbarsCenterYPos;
Common::Array _scrollbarsCenterXPosL;
Common::Array _scrollbarsCenterXPosR;
Common::Array _sounds;
};
// Contains data for the Save/Load screen. Used up to nancy7
struct LOAD : public EngineData {
LOAD(Common::SeekableReadStream *chunkStream);
Common::Path _image1Name;
int16 _mainFontID;
int16 _highlightFontID;
int16 _disabledFontID;
int16 _fontXOffset;
int16 _fontYOffset;
Common::Array _saveButtonDests;
Common::Array _loadButtonDests;
Common::Array _textboxBounds;
Common::Rect _doneButtonDest;
Common::Array _saveButtonDownSrcs;
Common::Array _loadButtonDownSrcs;
Common::Rect _doneButtonDownSrc;
Common::Array _saveButtonHighlightSrcs;
Common::Array _loadButtonHighlightSrcs;
Common::Rect _doneButtonHighlightSrc;
Common::Array _saveButtonDisabledSrcs;
Common::Array _loadButtonDisabledSrcs;
Common::Rect _doneButtonDisabledSrc;
Common::Rect _blinkingCursorSrc;
uint16 _blinkingTimeDelay;
Common::Array _cancelButtonSrcs;
Common::Array _cancelButtonDests;
Common::Rect _cancelButtonDownSrc;
Common::Rect _cancelButtonHighlightSrc;
Common::Rect _cancelButtonDisabledSrc;
Common::Path _gameSavedPopup;
Common::String _emptySaveText;
Common::String _defaultSaveNamePrefix;
// Common::Rect _gameSavedBounds
// v2 members
Common::Path _image2Name;
Common::Path _imageButtonsName;
Common::Array _unpressedButtonSrcs;
Common::Array _pressedButtonSrcs;
Common::Array _highlightedButtonSrcs;
Common::Array _disabledButtonSrcs;
Common::Array _buttonDests;
};
// Contains data for the prompt that appears when exiting the game
// without saving first. Introduced in nancy3.
struct SDLG : public EngineData {
struct Dialog {
Dialog(Common::SeekableReadStream *chunkStream);
Common::Path imageName;
Common::Rect yesDest;
Common::Rect noDest;
Common::Rect cancelDest;
Common::Rect yesHighlightSrc;
Common::Rect noHighlightSrc;
Common::Rect cancelHighlightSrc;
Common::Rect yesDownSrc;
Common::Rect noDownSrc;
Common::Rect cancelDownSrc;
};
SDLG(Common::SeekableReadStream *chunkStream);
Common::Array