aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorathrxx2019-02-17 23:22:09 +0100
committerathrxx2019-03-06 20:48:22 +0100
commit39eb1c4cc4a409b08197eaf67a5bd51e2ba6b3c6 (patch)
tree0cabb75b93c553b1db56e0ec493e7606738d5123 /engines
parentf72ccb972d02adde75ebf1cc8dbb5b687ecaa57c (diff)
downloadscummvm-rg350-39eb1c4cc4a409b08197eaf67a5bd51e2ba6b3c6.tar.gz
scummvm-rg350-39eb1c4cc4a409b08197eaf67a5bd51e2ba6b3c6.tar.bz2
scummvm-rg350-39eb1c4cc4a409b08197eaf67a5bd51e2ba6b3c6.zip
KYRA: (EOB1/Amiga) - fix detect magic spell
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/engine/eobcommon.cpp27
-rw-r--r--engines/kyra/engine/items_eob.cpp8
-rw-r--r--engines/kyra/engine/kyra_rpg.h1
3 files changed, 31 insertions, 5 deletions
diff --git a/engines/kyra/engine/eobcommon.cpp b/engines/kyra/engine/eobcommon.cpp
index 198fc5ed20..456282c23a 100644
--- a/engines/kyra/engine/eobcommon.cpp
+++ b/engines/kyra/engine/eobcommon.cpp
@@ -61,7 +61,7 @@ EoBCoreEngine::EoBCoreEngine(OSystem *system, const GameFlags &flags) : KyraRpgE
_drawSceneTimer = 0;
_largeItemShapes = _smallItemShapes = _thrownItemShapes = _spellShapes = _firebeamShapes = 0;
- _itemIconShapes = _wallOfForceShapes = _teleporterShapes = _sparkShapes = _compassShapes = 0;
+ _itemIconShapes = _amigaBlueItemIconShapes = _wallOfForceShapes = _teleporterShapes = _sparkShapes = _compassShapes = 0;
_redSplatShape = _greenSplatShape = _deadCharShape = _disabledCharGrid = 0;
_blackBoxSmallGrid = _weaponSlotGrid = _blackBoxWideGrid = _lightningColumnShape = 0;
@@ -780,6 +780,15 @@ void EoBCoreEngine::loadItemsAndDecorationsShapes() {
_screen->loadShapeSetBitmap("ITEMICN", 5, 3);
for (int i = 0; i < _numItemIconShapes; i++)
_itemIconShapes[i] = _screen->encodeShape((i % 0x14) << 1, (i / 0x14) << 4, 2, 0x10, false, _cgaMappingIcons);
+
+ if (_flags.platform == Common::kPlatformAmiga && _flags.gameID == GI_EOB1) {
+ _amigaBlueItemIconShapes = new const uint8*[_numItemIconShapes];
+ for (int i = 0; i < _numItemIconShapes; i++) {
+ int bx = (i % 0x14) << 1;
+ int by = (i / 0x14) << 4;
+ _amigaBlueItemIconShapes[i] = _screen->getPagePixel(2, (bx << 3) + 8, by + 88) ? _screen->encodeShape(bx, by + 80, 2, 0x10, false, 0) : _screen->encodeShape(bx, by, 2, 0x10, false, 0);
+ }
+ }
}
_teleporterShapes = new const uint8*[6];
@@ -872,6 +881,13 @@ void EoBCoreEngine::releaseItemsAndDecorationsShapes() {
}
}
+ if (_amigaBlueItemIconShapes) {
+ for (int i = 0; i < _numItemIconShapes; i++) {
+ if (_amigaBlueItemIconShapes[i])
+ delete[] _amigaBlueItemIconShapes[i];
+ }
+ }
+
if (_sparkShapes) {
for (int i = 0; i < 3; i++) {
if (_sparkShapes[i])
@@ -922,6 +938,7 @@ void EoBCoreEngine::releaseItemsAndDecorationsShapes() {
delete[] _thrownItemShapes;
delete[] _spellShapes;
delete[] _itemIconShapes;
+ delete[] _amigaBlueItemIconShapes;
delete[] _sparkShapes;
delete[] _wallOfForceShapes;
delete[] _teleporterShapes;
@@ -946,8 +963,12 @@ void EoBCoreEngine::setHandItem(Item itemIndex) {
const uint8 *shp = _itemIconShapes[icon];
const uint8 *ovl = 0;
- if (icon && (_items[_itemInHand].flags & 0x80) && (_partyEffectFlags & 2))
- ovl = _flags.gameID == GI_EOB1 ? ((_configRenderMode == Common::kRenderCGA) ? _itemsOverlayCGA : &_itemsOverlay[icon << 4]) : _screen->generateShapeOverlay(shp, _lightBlueFadingTable);
+ if (icon && (_items[_itemInHand].flags & 0x80) && (_partyEffectFlags & 2)) {
+ if (_amigaBlueItemIconShapes)
+ shp = _amigaBlueItemIconShapes[icon];
+ else
+ ovl = _flags.gameID == GI_EOB1 ? ((_configRenderMode == Common::kRenderCGA) ? _itemsOverlayCGA : &_itemsOverlay[icon << 4]) : _screen->generateShapeOverlay(shp, _lightBlueFadingTable);
+ }
int mouseOffs = itemIndex ? 8 : 0;
_screen->setMouseCursor(mouseOffs, mouseOffs, shp, ovl);
diff --git a/engines/kyra/engine/items_eob.cpp b/engines/kyra/engine/items_eob.cpp
index 4d11d0dea3..b4d9d67b2b 100644
--- a/engines/kyra/engine/items_eob.cpp
+++ b/engines/kyra/engine/items_eob.cpp
@@ -463,17 +463,21 @@ void EoBCoreEngine::drawItemIconShape(int pageNum, Item itemId, int x, int y) {
int icn = _items[itemId].icon;
bool applyBluePal = ((_partyEffectFlags & 2) && (_items[itemId].flags & 0x80)) ? true : false;
const uint8 *ovl = 0;
+ const uint8 *shp = _itemIconShapes[icn];
if (applyBluePal) {
if (_flags.gameID == GI_EOB1) {
- ovl = (_configRenderMode == Common::kRenderCGA) ? _itemsOverlayCGA : &_itemsOverlay[icn << 4];
+ if (_amigaBlueItemIconShapes)
+ shp = _amigaBlueItemIconShapes[icn];
+ else
+ ovl = (_configRenderMode == Common::kRenderCGA) ? _itemsOverlayCGA : &_itemsOverlay[icn << 4];
} else {
_screen->setFadeTable(_lightBlueFadingTable);
_screen->setShapeFadingLevel(1);
}
}
- _screen->drawShape(pageNum, _itemIconShapes[icn], x, y, 0, ovl ? 2 : 0, ovl);
+ _screen->drawShape(pageNum, shp, x, y, 0, ovl ? 2 : 0, ovl);
if (applyBluePal) {
_screen->setFadeTable(_greyFadingTable);
diff --git a/engines/kyra/engine/kyra_rpg.h b/engines/kyra/engine/kyra_rpg.h
index dbdd2560e2..13853fb296 100644
--- a/engines/kyra/engine/kyra_rpg.h
+++ b/engines/kyra/engine/kyra_rpg.h
@@ -139,6 +139,7 @@ protected:
void initStaticResource();
const uint8 **_itemIconShapes;
+ const uint8 **_amigaBlueItemIconShapes;
// Main loop
virtual void update() = 0;