aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJohannes Schickel2008-04-24 13:27:05 +0000
committerJohannes Schickel2008-04-24 13:27:05 +0000
commit37d21cab59f6ad21a353562106cb2b3e4aa3d746 (patch)
tree7c719391105b169a5eef7b324b458706d4d0ac74 /engines
parentcaa7a4787c1b20946bc931dd5b907ce563163064 (diff)
downloadscummvm-rg350-37d21cab59f6ad21a353562106cb2b3e4aa3d746.tar.gz
scummvm-rg350-37d21cab59f6ad21a353562106cb2b3e4aa3d746.tar.bz2
scummvm-rg350-37d21cab59f6ad21a353562106cb2b3e4aa3d746.zip
Implemented special item string selection for french version of Kyra3.
svn-id: r31689
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/items_v3.cpp33
-rw-r--r--engines/kyra/kyra_v3.h10
-rw-r--r--engines/kyra/staticres.cpp26
3 files changed, 62 insertions, 7 deletions
diff --git a/engines/kyra/items_v3.cpp b/engines/kyra/items_v3.cpp
index 822caa2e5b..23162514c2 100644
--- a/engines/kyra/items_v3.cpp
+++ b/engines/kyra/items_v3.cpp
@@ -296,8 +296,8 @@ bool KyraEngine_v3::processItemDrop(uint16 sceneId, uint16 item, int x, int y, i
if (!unk1 && unk2) {
int itemStr = 1;
- //if (_lang == 1)
- // itemStr = getItemCommandStringDrop(item);
+ if (_lang == 1)
+ itemStr = getItemCommandStringDrop(item);
updateItemCommand(item, itemStr, 0xFF);
}
@@ -412,8 +412,8 @@ void KyraEngine_v3::exchangeMouseItem(int itemPos, int runScript) {
setMouseCursor(_itemInHand);
int str2 = 0;
- //if (_lang == 1)
- // str2 = getItemCommandStringPickUp(itemId);
+ if (_lang == 1)
+ str2 = getItemCommandStringPickUp(itemId);
updateItemCommand(itemId, str2, 0xFF);
_screen->showMouse();
@@ -440,8 +440,8 @@ bool KyraEngine_v3::pickUpItem(int x, int y, int runScript) {
setMouseCursor(itemId);
int itemString = 0;
- //if (_lang == 1)
- // itemString = getItemCommandStringPickUp(itemId);
+ if (_lang == 1)
+ itemString = getItemCommandStringPickUp(itemId);
updateItemCommand(itemId, itemString, 0xFF);
_itemInHand = itemId;
@@ -543,5 +543,26 @@ bool KyraEngine_v3::itemListMagic(int handItem, int itemSlot) {
return false;
}
+int KyraEngine_v3::getItemCommandStringDrop(uint16 item) {
+ debugC(9, kDebugLevelMain, "KyraEngine_v3::getItemCommandStringDrop(%u)", item);
+ assert(item < _itemStringMapSize);
+ int stringId = _itemStringMap[item];
+ return _itemStringDrop[stringId];
+}
+
+int KyraEngine_v3::getItemCommandStringPickUp(uint16 item) {
+ debugC(9, kDebugLevelMain, "KyraEngine_v3::getItemCommandStringPickUp(%u)", item);
+ assert(item < _itemStringMapSize);
+ int stringId = _itemStringMap[item];
+ return _itemStringPickUp[stringId];
+}
+
+int KyraEngine_v3::getItemCommandStringInv(uint16 item) {
+ debugC(9, kDebugLevelMain, "KyraEngine_v3::getItemCommandStringInv(%u)", item);
+ assert(item < _itemStringMapSize);
+ int stringId = _itemStringMap[item];
+ return _itemStringInv[stringId];
+}
+
} // end of namespace Kyra
diff --git a/engines/kyra/kyra_v3.h b/engines/kyra/kyra_v3.h
index 4e8a832118..9322bdf48e 100644
--- a/engines/kyra/kyra_v3.h
+++ b/engines/kyra/kyra_v3.h
@@ -327,6 +327,16 @@ private:
static const uint8 _itemMagicTable[];
bool itemListMagic(int handItem, int itemSlot);
+ static const uint8 _itemStringMap[];
+ static const uint _itemStringMapSize;
+ static const uint8 _itemStringPickUp[];
+ static const uint8 _itemStringDrop[];
+ static const uint8 _itemStringInv[];
+
+ int getItemCommandStringPickUp(uint16 item);
+ int getItemCommandStringDrop(uint16 item);
+ int getItemCommandStringInv(uint16 item);
+
// -> hand item
void setMouseCursor(uint16 item);
diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp
index 1bbafd481b..7b66253317 100644
--- a/engines/kyra/staticres.cpp
+++ b/engines/kyra/staticres.cpp
@@ -2350,7 +2350,31 @@ const uint8 KyraEngine_v3::_itemMagicTable[] = {
0xFF, 0xFF, 0xFF, 0xFF
};
-} // End of namespace Kyra
+const uint8 KyraEngine_v3::_itemStringMap[] = {
+ 1, 0, 2, 0, 2, 2, 0, 0,
+ 2, 2, 2, 2, 2, 2, 2, 0,
+ 0, 0, 0, 0, 0, 0, 3, 1,
+ 2, 0, 2, 2, 0, 0, 0, 0,
+ 0, 0, 1, 2, 0, 2, 0, 2,
+ 0, 0, 2, 0, 0, 0, 0, 1,
+ 1, 0, 2, 2, 0, 0, 2, 0,
+ 0, 2, 0, 2, 2, 0, 0, 2,
+ 0, 0, 0, 0, 2, 0, 0, 2
+};
+const uint KyraEngine_v3::_itemStringMapSize = ARRAYSIZE(KyraEngine_v3::_itemStringMap);
+const uint8 KyraEngine_v3::_itemStringPickUp[] = {
+ 0x4, 0x7, 0x0, 0xA
+};
+
+const uint8 KyraEngine_v3::_itemStringDrop[] = {
+ 0x5, 0x8, 0x1, 0xB
+};
+
+const uint8 KyraEngine_v3::_itemStringInv[] = {
+ 0x6, 0x9, 0x2, 0xC
+};
+
+} // End of namespace Kyra