2014-02-23 19:33:26 -05: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-23 21:34:20 -05:00
|
|
|
#include "common/array.h"
|
|
|
|
#include "common/rect.h"
|
2014-02-24 00:20:53 -05:00
|
|
|
#include "mads/assets.h"
|
2014-03-13 22:25:16 -04:00
|
|
|
#include "mads/screen.h"
|
2014-03-05 21:50:12 -05:00
|
|
|
#include "mads/hotspots.h"
|
2014-03-03 23:40:23 -05:00
|
|
|
#include "mads/messages.h"
|
2014-02-25 23:10:51 -05:00
|
|
|
#include "mads/msurface.h"
|
2014-02-25 09:21:19 -05:00
|
|
|
#include "mads/scene_data.h"
|
2014-03-02 11:38:56 -05:00
|
|
|
#include "mads/animation.h"
|
2014-03-03 20:53:27 -05:00
|
|
|
#include "mads/sequence.h"
|
2014-03-04 22:33:27 -05:00
|
|
|
#include "mads/sprites.h"
|
2014-03-15 18:43:39 -04:00
|
|
|
#include "mads/user_interface.h"
|
2014-02-23 19:33:26 -05:00
|
|
|
|
|
|
|
namespace MADS {
|
|
|
|
|
|
|
|
class Scene {
|
2014-02-24 00:20:53 -05:00
|
|
|
private:
|
|
|
|
/**
|
|
|
|
* Return the index of a given Vocab in the active vocab list
|
|
|
|
*/
|
|
|
|
int activeVocabIndexOf(int vocabId);
|
|
|
|
|
2014-02-25 09:21:19 -05:00
|
|
|
/**
|
|
|
|
* Secondary loading vocab list
|
|
|
|
*/
|
|
|
|
void loadVocabStrings();
|
2014-03-02 10:49:20 -05:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Initialises the data for palette animation within the scene
|
|
|
|
*/
|
|
|
|
void initPaletteAnimation(Common::Array<RGB4> &animData, bool animFlag);
|
2014-03-02 23:09:17 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Handles a single frame within the game scene
|
|
|
|
*/
|
|
|
|
void doFrame();
|
2014-03-03 00:42:41 -05:00
|
|
|
|
|
|
|
void doPreactions();
|
|
|
|
|
|
|
|
void doAction();
|
|
|
|
|
|
|
|
void checkStartWalk();
|
|
|
|
|
|
|
|
void doSceneStep();
|
|
|
|
|
|
|
|
void checkKeyboard();
|
2014-02-24 00:20:53 -05:00
|
|
|
protected:
|
|
|
|
MADSEngine *_vm;
|
2014-02-23 19:33:26 -05:00
|
|
|
public:
|
2014-02-24 00:20:53 -05:00
|
|
|
SceneLogic *_sceneLogic;
|
2014-02-23 19:33:26 -05:00
|
|
|
int _priorSceneId;
|
|
|
|
int _nextSceneId;
|
|
|
|
int _currentSceneId;
|
2014-02-24 20:05:35 -05:00
|
|
|
Common::Array<VerbInit> _verbList;
|
2014-03-03 23:40:23 -05:00
|
|
|
TextDisplayList _textDisplay;
|
2014-02-25 19:52:35 -05:00
|
|
|
SpriteSlots _spriteSlots;
|
2014-03-02 17:49:52 -05:00
|
|
|
SpriteSets _sprites;
|
2014-02-25 19:52:35 -05:00
|
|
|
int _spritesIndex;
|
2014-03-02 23:09:17 -05:00
|
|
|
DynamicHotspots _dynamicHotspots;
|
2014-02-24 00:20:53 -05:00
|
|
|
Common::Array<int> _activeVocabs;
|
2014-03-03 20:53:27 -05:00
|
|
|
SequenceList _sequences;
|
2014-03-04 09:33:57 -05:00
|
|
|
KernelMessages _kernelMessages;
|
2014-02-24 20:05:35 -05:00
|
|
|
Common::String _talkFont;
|
|
|
|
int _textSpacing;
|
2014-03-15 17:38:44 -04:00
|
|
|
Hotspots _hotspots;
|
2014-03-03 23:40:23 -05:00
|
|
|
DirtyAreas _dirtyAreas;
|
2014-02-25 19:52:35 -05:00
|
|
|
int _v1;
|
2014-02-25 23:10:51 -05:00
|
|
|
SceneInfo *_sceneInfo;
|
|
|
|
MSurface _backgroundSurface;
|
2014-03-06 22:31:41 -05:00
|
|
|
DepthSurface _depthSurface;
|
2014-03-15 18:43:39 -04:00
|
|
|
UserInterface _userInterface;
|
2014-03-02 10:49:20 -05:00
|
|
|
bool _animFlag;
|
|
|
|
int _animVal1;
|
|
|
|
int _animCount;
|
|
|
|
Common::Array<uint32> _animTicksList;
|
|
|
|
Common::Array<RGB4> _animPalData;
|
|
|
|
SceneNodeList _nodes;
|
|
|
|
Common::StringArray _vocabStrings;
|
2014-03-07 23:07:36 -05:00
|
|
|
Animation *_animationData;
|
2014-03-03 23:40:23 -05:00
|
|
|
Animation *_activeAnimation;
|
2014-03-03 00:42:41 -05:00
|
|
|
bool _freeAnimationFlag;
|
2014-03-02 16:42:39 -05:00
|
|
|
int _depthStyle;
|
2014-03-02 18:37:09 -05:00
|
|
|
int _bandsRange;
|
|
|
|
int _scaleRange;
|
|
|
|
int _interfaceY;
|
|
|
|
int _spritesCount;
|
2014-03-02 20:06:21 -05:00
|
|
|
MADSAction _action;
|
2014-03-02 20:50:35 -05:00
|
|
|
bool _roomChanged;
|
|
|
|
bool _reloadSceneFlag;
|
2014-03-03 00:42:41 -05:00
|
|
|
Common::Point _destPos;
|
|
|
|
int _destFacing;
|
2014-03-03 23:40:23 -05:00
|
|
|
Common::Point _posAdjust;
|
2014-03-08 14:05:17 -05:00
|
|
|
uint32 _frameStartTime;
|
2014-03-15 21:33:15 -04:00
|
|
|
Layer _layer;
|
2014-03-19 23:33:18 -04:00
|
|
|
bool _lookFlag;
|
|
|
|
int _highlightedHotspot;
|
|
|
|
Common::Point _customDest;
|
2014-02-23 21:34:20 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*/
|
2014-02-24 00:20:53 -05:00
|
|
|
Scene(MADSEngine *vm);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Destructor
|
|
|
|
*/
|
|
|
|
~Scene();
|
2014-02-23 21:34:20 -05:00
|
|
|
|
2014-02-24 00:20:53 -05:00
|
|
|
/**
|
|
|
|
* Clear the vocabulary list
|
|
|
|
*/
|
|
|
|
void clearVocab();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add a given vocab entry to the active list
|
|
|
|
*/
|
|
|
|
void addActiveVocab(int vocabId);
|
|
|
|
|
2014-02-24 20:05:35 -05:00
|
|
|
/**
|
|
|
|
* Clear the sequence list
|
|
|
|
*/
|
|
|
|
void clearSequenceList();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clear the message list
|
|
|
|
*/
|
|
|
|
void clearMessageList();
|
|
|
|
|
2014-02-24 00:20:53 -05:00
|
|
|
/**
|
|
|
|
* Loads the scene logic for a given scene
|
|
|
|
*/
|
2014-02-24 20:05:35 -05:00
|
|
|
void loadSceneLogic();
|
|
|
|
|
2014-02-25 19:52:35 -05: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-24 20:05:35 -05:00
|
|
|
/**
|
|
|
|
* Loads the hotstpots for the scene
|
|
|
|
*/
|
|
|
|
void loadHotspots();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Loads the vocab list
|
|
|
|
*/
|
|
|
|
void loadVocab();
|
2014-02-25 19:52:35 -05:00
|
|
|
|
2014-03-02 20:50:35 -05:00
|
|
|
bool getDepthHighBits(const Common::Point &pt);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Main scene loop
|
|
|
|
*/
|
|
|
|
void loop();
|
2014-03-02 19:29:54 -05:00
|
|
|
|
2014-03-04 09:33:57 -05:00
|
|
|
/**
|
|
|
|
* Draw all the elements onto the scene
|
|
|
|
*/
|
2014-03-10 00:00:39 -04:00
|
|
|
void drawElements(ScreenTransition transitionType, bool surfaceFlag);
|
2014-03-04 09:33:57 -05:00
|
|
|
|
2014-03-07 23:07:36 -05:00
|
|
|
/**
|
|
|
|
* Load an animation
|
|
|
|
*/
|
|
|
|
void loadAnimation(const Common::String &resName, int abortTimers = 0);
|
|
|
|
|
2014-03-16 23:40:21 -04:00
|
|
|
/**
|
|
|
|
* Returns a vocab entry
|
|
|
|
*/
|
2014-03-17 00:20:50 -04:00
|
|
|
Common::String getVocab(int vocabId) { return _vocabStrings[vocabId - 1]; }
|
2014-03-16 23:40:21 -04:00
|
|
|
|
2014-02-24 00:20:53 -05:00
|
|
|
/**
|
|
|
|
* Clear the data for the scene
|
|
|
|
*/
|
|
|
|
void free();
|
2014-02-23 19:33:26 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace MADS
|
|
|
|
|
|
|
|
#endif /* MADS_SCENE_H */
|