aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2014-03-23 09:19:28 -0400
committerPaul Gilbert2014-03-23 09:19:28 -0400
commit0d158075019940ccf25b4e5b9bd4676e9a06f87d (patch)
treef6401d511b1f2633c7901c4603a492665dd6a862 /engines
parent6fed5933a84421f413daeb0983281381acc7c128 (diff)
downloadscummvm-rg350-0d158075019940ccf25b4e5b9bd4676e9a06f87d.tar.gz
scummvm-rg350-0d158075019940ccf25b4e5b9bd4676e9a06f87d.tar.bz2
scummvm-rg350-0d158075019940ccf25b4e5b9bd4676e9a06f87d.zip
MADS: Fixes for animating inventory item
Diffstat (limited to 'engines')
-rw-r--r--engines/mads/game.cpp3
-rw-r--r--engines/mads/scene.cpp2
-rw-r--r--engines/mads/screen.cpp8
-rw-r--r--engines/mads/user_interface.cpp12
4 files changed, 15 insertions, 10 deletions
diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp
index 60481c69e4..4b907d1880 100644
--- a/engines/mads/game.cpp
+++ b/engines/mads/game.cpp
@@ -63,6 +63,9 @@ Game::Game(MADSEngine *vm): _vm(vm), _surface(nullptr), _objects(vm),
// Load the inventory object list
_objects.load();
+ if (_objects._inventoryList.size() > 0)
+ // At least one item in default inventory, so select first item for display
+ _scene._userInterface._selectedInvIndex = 0;
// Load the quotes
loadQuotes();
diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp
index da64def95d..cfdfa87c61 100644
--- a/engines/mads/scene.cpp
+++ b/engines/mads/scene.cpp
@@ -386,7 +386,7 @@ void Scene::doFrame() {
_kernelMessages.update();
}
- _userInterface._uiSlots.draw(_vm->_game->_abortTimers2 == kTransitionFadeIn,
+ _userInterface._uiSlots.draw(_vm->_game->_abortTimers2 == 0,
_vm->_game->_abortTimers2 != 0);
// Write any text needed by the interface
diff --git a/engines/mads/screen.cpp b/engines/mads/screen.cpp
index 22896e011b..964e83630c 100644
--- a/engines/mads/screen.cpp
+++ b/engines/mads/screen.cpp
@@ -120,8 +120,8 @@ void DirtyArea::setUISlot(const UISlot *slot) {
int type = slot->_slotType;
if (type <= -20)
type += 20;
- if (type >= 64)
- type &= 0xBF;
+ if (type >= 0x40)
+ type &= ~0x40;
MSurface &intSurface = _vm->_game->_scene._userInterface;
switch (type) {
@@ -148,7 +148,7 @@ void DirtyArea::setUISlot(const UISlot *slot) {
_bounds.top = slot->_position.y;
} else {
_bounds.left = slot->_position.x + w / 2;
- _bounds.top = slot->_position.y + h / 2;
+ _bounds.top = slot->_position.y - h + 1;
}
setArea(w, h, intSurface.w, intSurface.h);
@@ -182,7 +182,7 @@ void DirtyAreas::merge(int startIndex, int count) {
continue;
if ((*this)[outerCtr]._textActive && (*this)[innerCtr]._textActive)
- mergeAreas(outerCtr, innerCtr);
+ mergeAreas(innerCtr, outerCtr);
}
}
}
diff --git a/engines/mads/user_interface.cpp b/engines/mads/user_interface.cpp
index 4a35d24ad0..2ea656d0c5 100644
--- a/engines/mads/user_interface.cpp
+++ b/engines/mads/user_interface.cpp
@@ -125,7 +125,7 @@ void UISlots::draw(bool updateFlag, bool delFlag) {
if (slot._slotType >= ST_NONE && !(slot._slotType & 0x40)) {
if (!dirtyArea._active) {
- error("TODO: Original code here doesn't make sense!");
+ error("Should never reach this point, even in original");
}
if (dirtyArea._textActive) {
@@ -133,10 +133,12 @@ void UISlots::draw(bool updateFlag, bool delFlag) {
if (slot._field2 == 200) {
MSprite *sprite = asset->getFrame(slot._frameNumber & 0x7F);
- sprite->copyTo(&userInterface, slot._position);
+ sprite->copyTo(&userInterface, slot._position,
+ sprite->getTransparencyIndex());
} else {
MSprite *sprite = asset->getFrame(slot._frameNumber - 1);
- sprite->copyTo(&userInterface, slot._position);
+ sprite->copyTo(&userInterface, slot._position,
+ sprite->getTransparencyIndex());
}
}
}
@@ -175,7 +177,7 @@ void UISlots::draw(bool updateFlag, bool delFlag) {
slot._slotType -= 20;
} else {
if (updateFlag)
- slot._slotType &= 0xBF;
+ slot._slotType &= ~0x40;
else
slot._slotType |= 0x40;
}
@@ -613,7 +615,7 @@ void UserInterface::inventoryAnim() {
if (++_invFrameNumber > asset->getCount())
_invFrameNumber = 1;
- // Loop through the slots list for ?? entry
+ // Loop through the slots list for inventory animation entry
for (uint i = 0; i < _uiSlots.size(); ++i) {
if (_uiSlots[i]._field2 == 200)
_uiSlots[i]._slotType = -5;