2014-02-25 09:21:19 -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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "common/scummsys.h"
|
2014-02-25 19:52:35 -05:00
|
|
|
#include "mads/scene_data.h"
|
2014-02-25 09:21:19 -05:00
|
|
|
#include "mads/mads.h"
|
|
|
|
#include "mads/nebular/nebular_scenes.h"
|
|
|
|
|
|
|
|
namespace MADS {
|
|
|
|
|
|
|
|
SpriteSlot::SpriteSlot() {
|
|
|
|
_spriteType = ST_NONE;
|
|
|
|
_seqIndex = 0;
|
2014-02-25 19:52:35 -05:00
|
|
|
_spritesIndex = 0;
|
2014-02-25 09:21:19 -05:00
|
|
|
_frameNumber = 0;
|
|
|
|
_depth = 0;
|
|
|
|
_scale = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
SpriteSlot::SpriteSlot(SpriteType type, int seqIndex) {
|
|
|
|
_spriteType = type;
|
|
|
|
_seqIndex = seqIndex;
|
2014-02-25 19:52:35 -05:00
|
|
|
_spritesIndex = 0;
|
2014-02-25 09:21:19 -05:00
|
|
|
_frameNumber = 0;
|
|
|
|
_depth = 0;
|
|
|
|
_scale = 0;
|
|
|
|
}
|
|
|
|
|
2014-02-25 19:52:35 -05:00
|
|
|
/*------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
void SpriteSlots::clear(bool flag) {
|
|
|
|
_vm->_game->_scene._textDisplay.clear();
|
|
|
|
|
|
|
|
if (flag)
|
|
|
|
_vm->_game->_scene._sprites.clear();
|
|
|
|
|
|
|
|
Common::Array<SpriteSlot>::clear();
|
|
|
|
push_back(SpriteSlot(ST_FULL_SCREEN_REFRESH, -1));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Releases any sprites used by the player
|
|
|
|
*/
|
|
|
|
void SpriteSlots::releasePlayerSprites() {
|
|
|
|
Player &player = _vm->_game->player();
|
|
|
|
|
|
|
|
if (player._spritesLoaded && player._numSprites > 0) {
|
|
|
|
int spriteEnd = player._spritesStart + player._numSprites - 1;
|
|
|
|
do {
|
|
|
|
deleteEntry(spriteEnd);
|
|
|
|
} while (--spriteEnd >= player._spritesStart);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SpriteSlots::deleteEntry(int index) {
|
|
|
|
remove_at(index);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-02-25 09:21:19 -05:00
|
|
|
/*------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
TextDisplay::TextDisplay() {
|
|
|
|
_active = false;
|
|
|
|
_spacing = 0;
|
|
|
|
_expire = 0;
|
|
|
|
_col1 = _col2 = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
DynamicHotspot::DynamicHotspot() {
|
|
|
|
_seqIndex = 0;
|
|
|
|
_facing = 0;
|
|
|
|
_descId = 0;
|
|
|
|
_field14 = 0;
|
|
|
|
_articleNumber = 0;
|
|
|
|
_cursor = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
SequenceEntry::SequenceEntry() {
|
2014-02-25 19:52:35 -05:00
|
|
|
_spritesIndex = 0;
|
2014-02-25 09:21:19 -05:00
|
|
|
_flipped =0;
|
|
|
|
_frameIndex = 0;
|
|
|
|
_frameStart = 0;
|
|
|
|
_numSprites = 0;
|
|
|
|
_animType = 0;
|
|
|
|
_frameInc = 0;
|
|
|
|
_depth = 0;
|
|
|
|
_scale = 0;
|
|
|
|
_dynamicHotspotIndex = -1;
|
|
|
|
_triggerCountdown = 0;
|
|
|
|
_doneFlag = 0;
|
|
|
|
_entries._count = 0;
|
|
|
|
_abortMode = 0;
|
|
|
|
_actionNouns[0] = _actionNouns[1] = _actionNouns[2] = 0;
|
|
|
|
_numTicks = 0;
|
|
|
|
_extraTicks = 0;
|
|
|
|
_timeout = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
KernelMessage::KernelMessage() {
|
|
|
|
_flags = 0;
|
|
|
|
_seqInex = 0;
|
|
|
|
_asciiChar = '\0';
|
|
|
|
_asciiChar2 = '\0';
|
|
|
|
_colors = 0;
|
|
|
|
Common::Point _posiition;
|
|
|
|
_msgOffset = 0;
|
|
|
|
_numTicks = 0;
|
|
|
|
_frameTimer2 = 0;
|
|
|
|
_frameTimer = 0;
|
|
|
|
_timeout = 0;
|
|
|
|
_field1C = 0;
|
|
|
|
_abortMode = 0;
|
|
|
|
_nounList[0] = _nounList[1] = _nounList[2] = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
Hotspot::Hotspot() {
|
|
|
|
_facing = 0;
|
|
|
|
_articleNumber = 0;
|
|
|
|
_cursor = 0;
|
|
|
|
_vocabId = 0;
|
|
|
|
_verbId = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
Hotspot::Hotspot(Common::SeekableReadStream &f) {
|
|
|
|
_bounds.left = f.readSint16LE();
|
|
|
|
_bounds.top = f.readSint16LE();
|
|
|
|
_bounds.right = f.readSint16LE();
|
|
|
|
_bounds.bottom = f.readSint16LE();
|
|
|
|
_feetPos.x = f.readSint16LE();
|
|
|
|
_feetPos.y = f.readSint16LE();
|
|
|
|
_facing = f.readByte();
|
|
|
|
_articleNumber = f.readByte();
|
|
|
|
f.skip(1);
|
|
|
|
_cursor = f.readByte();
|
|
|
|
_vocabId = f.readUint16LE();
|
|
|
|
_verbId = f.readUint16LE();
|
|
|
|
}
|
|
|
|
|
|
|
|
} // End of namespace MADS
|