2014-02-24 00:33:26 +00:00
|
|
|
/* 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 2
|
|
|
|
* 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, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MADS_SCENE_H
|
|
|
|
#define MADS_SCENE_H
|
|
|
|
|
|
|
|
#include "common/scummsys.h"
|
2014-02-24 02:34:20 +00:00
|
|
|
#include "common/array.h"
|
|
|
|
#include "common/rect.h"
|
2014-02-24 05:20:53 +00:00
|
|
|
#include "mads/assets.h"
|
2014-03-06 02:50:12 +00:00
|
|
|
#include "mads/hotspots.h"
|
2014-03-04 04:40:23 +00:00
|
|
|
#include "mads/messages.h"
|
2014-02-26 04:10:51 +00:00
|
|
|
#include "mads/msurface.h"
|
2014-02-25 14:21:19 +00:00
|
|
|
#include "mads/scene_data.h"
|
2014-03-02 16:38:56 +00:00
|
|
|
#include "mads/animation.h"
|
2014-03-04 01:53:27 +00:00
|
|
|
#include "mads/sequence.h"
|
2014-03-05 03:33:27 +00:00
|
|
|
#include "mads/sprites.h"
|
2014-02-24 00:33:26 +00:00
|
|
|
|
|
|
|
namespace MADS {
|
|
|
|
|
|
|
|
class Scene {
|
2014-02-24 05:20:53 +00:00
|
|
|
private:
|
|
|
|
/**
|
|
|
|
* Free the voculary list buffer
|
|
|
|
*/
|
|
|
|
void freeVocab();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the index of a given Vocab in the active vocab list
|
|
|
|
*/
|
|
|
|
int activeVocabIndexOf(int vocabId);
|
|
|
|
|
2014-02-25 14:21:19 +00:00
|
|
|
/**
|
|
|
|
* Secondary loading vocab list
|
|
|
|
*/
|
|
|
|
void loadVocabStrings();
|
2014-03-02 15:49:20 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Initialises the data for palette animation within the scene
|
|
|
|
*/
|
|
|
|
void initPaletteAnimation(Common::Array<RGB4> &animData, bool animFlag);
|
2014-03-03 04:09:17 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Handles a single frame within the game scene
|
|
|
|
*/
|
|
|
|
void doFrame();
|
2014-03-03 05:42:41 +00:00
|
|
|
|
|
|
|
void doPreactions();
|
|
|
|
|
|
|
|
void doAction();
|
|
|
|
|
|
|
|
void checkStartWalk();
|
|
|
|
|
|
|
|
void doSceneStep();
|
|
|
|
|
|
|
|
void checkKeyboard();
|
2014-02-24 05:20:53 +00:00
|
|
|
protected:
|
|
|
|
MADSEngine *_vm;
|
2014-02-24 00:33:26 +00:00
|
|
|
public:
|
2014-02-24 05:20:53 +00:00
|
|
|
SceneLogic *_sceneLogic;
|
2014-02-24 00:33:26 +00:00
|
|
|
int _priorSceneId;
|
|
|
|
int _nextSceneId;
|
|
|
|
int _currentSceneId;
|
2014-02-25 01:05:35 +00:00
|
|
|
Common::Array<VerbInit> _verbList;
|
2014-03-04 04:40:23 +00:00
|
|
|
TextDisplayList _textDisplay;
|
2014-02-26 00:52:35 +00:00
|
|
|
SpriteSlots _spriteSlots;
|
2014-03-02 22:49:52 +00:00
|
|
|
SpriteSets _sprites;
|
2014-02-26 00:52:35 +00:00
|
|
|
int _spritesIndex;
|
2014-03-03 04:09:17 +00:00
|
|
|
DynamicHotspots _dynamicHotspots;
|
2014-02-24 05:20:53 +00:00
|
|
|
byte *_vocabBuffer;
|
|
|
|
Common::Array<int> _activeVocabs;
|
2014-03-04 01:53:27 +00:00
|
|
|
SequenceList _sequences;
|
2014-03-04 14:33:57 +00:00
|
|
|
KernelMessages _kernelMessages;
|
2014-02-25 01:05:35 +00:00
|
|
|
Common::String _talkFont;
|
|
|
|
int _textSpacing;
|
2014-02-26 04:10:51 +00:00
|
|
|
Common::Array<Hotspot> _hotspots;
|
2014-02-25 14:21:19 +00:00
|
|
|
ScreenObjects _screenObjects;
|
2014-03-08 04:07:36 +00:00
|
|
|
ImageInterEntries _imageInterEntries;
|
2014-03-04 04:40:23 +00:00
|
|
|
DirtyAreas _dirtyAreas;
|
2014-02-26 00:52:35 +00:00
|
|
|
int _v1;
|
2014-02-26 04:10:51 +00:00
|
|
|
SceneInfo *_sceneInfo;
|
|
|
|
MSurface _backgroundSurface;
|
2014-03-07 03:31:41 +00:00
|
|
|
DepthSurface _depthSurface;
|
2014-03-03 04:09:17 +00:00
|
|
|
InterfaceSurface _interface;
|
2014-03-02 15:49:20 +00:00
|
|
|
bool _animFlag;
|
|
|
|
int _animVal1;
|
|
|
|
int _animCount;
|
|
|
|
Common::Array<uint32> _animTicksList;
|
|
|
|
Common::Array<RGB4> _animPalData;
|
|
|
|
SceneNodeList _nodes;
|
|
|
|
Common::StringArray _vocabStrings;
|
2014-03-08 04:07:36 +00:00
|
|
|
Animation *_animationData;
|
2014-03-04 04:40:23 +00:00
|
|
|
Animation *_activeAnimation;
|
2014-03-03 05:42:41 +00:00
|
|
|
bool _freeAnimationFlag;
|
2014-03-02 21:42:39 +00:00
|
|
|
int _depthStyle;
|
2014-03-02 23:37:09 +00:00
|
|
|
int _bandsRange;
|
|
|
|
int _scaleRange;
|
|
|
|
int _interfaceY;
|
|
|
|
int _spritesCount;
|
2014-03-08 04:07:36 +00:00
|
|
|
bool _v1A;
|
2014-03-03 00:29:54 +00:00
|
|
|
int _v1C;
|
2014-03-03 01:06:21 +00:00
|
|
|
MADSAction _action;
|
2014-03-03 01:50:35 +00:00
|
|
|
bool _roomChanged;
|
|
|
|
bool _reloadSceneFlag;
|
2014-03-03 05:42:41 +00:00
|
|
|
Common::Point _destPos;
|
|
|
|
int _destFacing;
|
2014-03-04 04:40:23 +00:00
|
|
|
Common::Point _posAdjust;
|
2014-03-08 19:05:17 +00:00
|
|
|
uint32 _frameStartTime;
|
2014-02-24 02:34:20 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*/
|
2014-02-24 05:20:53 +00:00
|
|
|
Scene(MADSEngine *vm);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Destructor
|
|
|
|
*/
|
|
|
|
~Scene();
|
2014-02-24 02:34:20 +00:00
|
|
|
|
2014-02-24 05:20:53 +00:00
|
|
|
/**
|
|
|
|
* Clear the vocabulary list
|
|
|
|
*/
|
|
|
|
void clearVocab();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add a given vocab entry to the active list
|
|
|
|
*/
|
|
|
|
void addActiveVocab(int vocabId);
|
|
|
|
|
2014-02-25 01:05:35 +00:00
|
|
|
/**
|
|
|
|
* Clear the sequence list
|
|
|
|
*/
|
|
|
|
void clearSequenceList();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clear the message list
|
|
|
|
*/
|
|
|
|
void clearMessageList();
|
|
|
|
|
2014-02-24 05:20:53 +00:00
|
|
|
/**
|
|
|
|
* Loads the scene logic for a given scene
|
|
|
|
*/
|
2014-02-25 01:05:35 +00:00
|
|
|
void loadSceneLogic();
|
|
|
|
|
2014-02-26 00:52:35 +00:00
|
|
|
/**
|
|
|
|
* Loads the resources associated with the given scene
|
|
|
|
* @param sceneId Scene to load
|
|
|
|
* @param prefix Prefix to use for retrieving animation data
|
|
|
|
* @param palFlag Flag for whether to reset the high/lo palette areas
|
|
|
|
*/
|
|
|
|
void loadScene(int sceneId, const Common::String &prefix, bool palFlag);
|
|
|
|
|
2014-02-25 01:05:35 +00:00
|
|
|
/**
|
|
|
|
* Loads the hotstpots for the scene
|
|
|
|
*/
|
|
|
|
void loadHotspots();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Loads the vocab list
|
|
|
|
*/
|
|
|
|
void loadVocab();
|
2014-02-26 00:52:35 +00:00
|
|
|
|
2014-03-03 01:50:35 +00:00
|
|
|
bool getDepthHighBits(const Common::Point &pt);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Main scene loop
|
|
|
|
*/
|
|
|
|
void loop();
|
2014-03-03 00:29:54 +00:00
|
|
|
|
2014-03-04 14:33:57 +00:00
|
|
|
/**
|
|
|
|
* Draw all the elements onto the scene
|
|
|
|
*/
|
|
|
|
void drawElements(bool transitionFlag, bool surfaceFlag);
|
|
|
|
|
2014-03-03 04:09:17 +00:00
|
|
|
/**
|
|
|
|
* Execute a click within the scene
|
|
|
|
*/
|
|
|
|
void leftClick();
|
|
|
|
|
2014-03-08 04:07:36 +00:00
|
|
|
/**
|
|
|
|
* Load an animation
|
|
|
|
*/
|
|
|
|
void loadAnimation(const Common::String &resName, int abortTimers = 0);
|
|
|
|
|
2014-02-24 05:20:53 +00:00
|
|
|
/**
|
|
|
|
* Clear the data for the scene
|
|
|
|
*/
|
|
|
|
void free();
|
2014-02-24 00:33:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace MADS
|
|
|
|
|
|
|
|
#endif /* MADS_SCENE_H */
|