aboutsummaryrefslogtreecommitdiff
path: root/kyra
diff options
context:
space:
mode:
authorJohannes Schickel2005-12-14 14:08:30 +0000
committerJohannes Schickel2005-12-14 14:08:30 +0000
commitdf8e542f39463fac72e0688eb1a664621bfd4943 (patch)
treea5aa653e2d190691f18f75dc22ea101bdd440735 /kyra
parent25024e6943454e04aaedd4c8dd14b61a5cffba3c (diff)
downloadscummvm-rg350-df8e542f39463fac72e0688eb1a664621bfd4943.tar.gz
scummvm-rg350-df8e542f39463fac72e0688eb1a664621bfd4943.tar.bz2
scummvm-rg350-df8e542f39463fac72e0688eb1a664621bfd4943.zip
Implemented command line update when picking up or dropping down items.
svn-id: r19798
Diffstat (limited to 'kyra')
-rw-r--r--kyra/kyra.cpp15
-rw-r--r--kyra/kyra.h12
-rw-r--r--kyra/staticres.cpp43
3 files changed, 64 insertions, 6 deletions
diff --git a/kyra/kyra.cpp b/kyra/kyra.cpp
index bbd9116ef2..87dcb23081 100644
--- a/kyra/kyra.cpp
+++ b/kyra/kyra.cpp
@@ -2993,7 +2993,8 @@ int KyraEngine::processItemDrop(uint16 sceneId, uint8 item, int x, int y, int un
itemDropDown(x, y, destX, destY, freeItem, item);
if (unk1 == 0 && unk2 != 0) {
- // XXX updateSentenceCommand
+ assert(_itemList && _droppedList);
+ updateSentenceCommand(_itemList[item], _droppedList[0], 179);
}
return 1;
@@ -3013,7 +3014,8 @@ void KyraEngine::exchangeItemWithMouseItem(uint16 sceneId, int itemIndex) {
// XXX snd_kyraPlaySound 53
setMouseItem(_itemInHand);
- // XXX
+ assert(_itemList && _takenList);
+ updateSentenceCommand(_itemList[_itemInHand], _takenList[1], 179);
_screen->showMouse();
clickEventHandler2();
}
@@ -3170,9 +3172,11 @@ void KyraEngine::dropItem(int unk1, int item, int x, int y, int unk2) {
return;
// call kyraPlaySound(54)
if (12 == countItemsInScene(_currentCharacter->sceneId)) {
- // XXX drawSentenceCommand
+ assert(_noDropList);
+ drawSentenceCommand(_noDropList[0], 6);
} else {
- // XXX drawSentenceCommand
+ assert(_noDropList);
+ drawSentenceCommand(_noDropList[1], 6);
}
}
@@ -4799,7 +4803,8 @@ int KyraEngine::processInputHelper(int xpos, int ypos) {
int item2 = currentRoom->itemsTable[item];
currentRoom->itemsTable[item] = 0xFF;
setMouseItem(item2);
- // XXX updateSentenceCommand
+ assert(_itemList && _takenList);
+ updateSentenceCommand(_itemList[item2], _takenList[0], 179);
_itemInHand = item2;
_screen->showMouse();
clickEventHandler2();
diff --git a/kyra/kyra.h b/kyra/kyra.h
index 9deb490962..f2a9b72170 100644
--- a/kyra/kyra.h
+++ b/kyra/kyra.h
@@ -689,6 +689,18 @@ protected:
int _seq_COLTable_Size;
int _seq_textsTable_Size;
+ char **_itemList;
+ char **_takenList;
+ char **_placedList;
+ char **_droppedList;
+ char **_noDropList;
+
+ int _itemList_Size;
+ int _takenList_Size;
+ int _placedList_Size;
+ int _droppedList_Size;
+ int _noDropList_Size;
+
char **_characterImageTable;
int _characterImageTableSize;
diff --git a/kyra/staticres.cpp b/kyra/staticres.cpp
index 6128097521..d6e19a323b 100644
--- a/kyra/staticres.cpp
+++ b/kyra/staticres.cpp
@@ -26,7 +26,7 @@
namespace Kyra {
-#define RESFILE_VERSION 3
+#define RESFILE_VERSION 4
#define GAME_FLAGS (GF_FLOPPY | GF_TALKIE | GF_DEMO | GF_AUDIOCD)
#define LANGUAGE_FLAGS (GF_ENGLISH | GF_FRENCH | GF_GERMAN | GF_SPANISH | GF_LNGUNK)
@@ -188,6 +188,12 @@ void KyraEngine::res_loadResources(int type) {
loadTable(resFile, "CHAR-IMAGE.TXT", (byte***)&_characterImageTable, &_characterImageTableSize);
loadShapes(resFile, "SHAPES-DEFAULT.SHP", &_defaultShapeTable, &_defaultShapeTableSize);
+
+ res_loadLangTable("ITEMLIST.", &resFile, (byte***)&_itemList, &_itemList_Size, loadNativeLanguage);
+ res_loadLangTable("TAKEN.", &resFile, (byte***)&_takenList, &_takenList_Size, loadNativeLanguage);
+ res_loadLangTable("PLACED.", &resFile, (byte***)&_placedList, &_placedList_Size, loadNativeLanguage);
+ res_loadLangTable("DROPPED.", &resFile, (byte***)&_droppedList, &_droppedList_Size, loadNativeLanguage);
+ res_loadLangTable("NODROP.", &resFile, (byte***)&_noDropList, &_noDropList_Size, loadNativeLanguage);
}
#undef loadRooms
@@ -258,6 +264,41 @@ void KyraEngine::res_unloadResources(int type) {
delete [] _defaultShapeTable;
_defaultShapeTableSize = 0;
+
+ for (int i = 0; i < _itemList_Size; ++i) {
+ delete [] _itemList[i];
+ }
+ delete [] _itemList;
+ _itemList_Size = 0;
+ _itemList = 0;
+
+ for (int i = 0; i < _takenList_Size; ++i) {
+ delete [] _takenList[i];
+ }
+ delete [] _takenList;
+ _takenList_Size = 0;
+ _takenList = 0;
+
+ for (int i = 0; i < _placedList_Size; ++i) {
+ delete [] _placedList[i];
+ }
+ delete [] _placedList;
+ _placedList_Size = 0;
+ _placedList = 0;
+
+ for (int i = 0; i < _droppedList_Size; ++i) {
+ delete [] _droppedList[i];
+ }
+ delete [] _droppedList;
+ _droppedList_Size = 0;
+ _droppedList = 0;
+
+ for (int i = 0; i < _noDropList_Size; ++i) {
+ delete [] _noDropList[i];
+ }
+ delete [] _noDropList;
+ _noDropList_Size = 0;
+ _noDropList = 0;
}
}