aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2006-10-23 05:58:53 +0000
committerTravis Howell2006-10-23 05:58:53 +0000
commit80048e232787d247381ba718e68ca3aa7e5200cd (patch)
treea72d393c41997e5ddc1d5a70d5c070aa4f9277eb
parent45965e35766bf2ede011e0f0775754363699937f (diff)
downloadscummvm-rg350-80048e232787d247381ba718e68ca3aa7e5200cd.tar.gz
scummvm-rg350-80048e232787d247381ba718e68ca3aa7e5200cd.tar.bz2
scummvm-rg350-80048e232787d247381ba718e68ca3aa7e5200cd.zip
Add hasIcon difference in Elvira 1
svn-id: r24468
-rw-r--r--engines/agos/agos.cpp2
-rw-r--r--engines/agos/agos.h2
-rw-r--r--engines/agos/icons.cpp8
-rw-r--r--engines/agos/items.cpp14
4 files changed, 15 insertions, 11 deletions
diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index 06035cd050..6d840713a4 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -682,7 +682,7 @@ void AGOSEngine::setupGame() {
_vgaMemSize = gVars->memory[kMemSimon1Games];
#endif
_itemMemSize = 64000;
- _tableMemSize = 50000;
+ _tableMemSize = 100000;
_frameRate = 4;
_vgaBaseDelay = 1;
_numVars = 255;
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index 6af12b7def..83d00b67e7 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -781,7 +781,7 @@ protected:
void removeArrows(WindowBlock *window, uint num);
void draw_icon_c(WindowBlock *window, uint icon, uint x, uint y);
- bool has_item_childflag_0x10(Item *item);
+ bool hasIcon(Item *item);
uint itemGetIconNumber(Item *item);
uint setupIconHitArea(WindowBlock *window, uint num, uint x, uint y, Item *item_ptr);
void drawIconArray(uint i, Item *item_ptr, int line, int classMask);
diff --git a/engines/agos/icons.cpp b/engines/agos/icons.cpp
index b2926d4856..ae778072c6 100644
--- a/engines/agos/icons.cpp
+++ b/engines/agos/icons.cpp
@@ -288,7 +288,7 @@ void AGOSEngine::drawIconArray_Simon(uint num, Item *itemRef, int line, int clas
while (itemRef && line-- != 0) {
curWidth = 0;
while (itemRef && width > curWidth) {
- if ((classMask == 0 || itemRef->classFlags & classMask) && has_item_childflag_0x10(itemRef))
+ if ((classMask == 0 || itemRef->classFlags & classMask) && hasIcon(itemRef))
curWidth += iconSize;
itemRef = derefItem(itemRef->next);
}
@@ -306,7 +306,7 @@ void AGOSEngine::drawIconArray_Simon(uint num, Item *itemRef, int line, int clas
showArrows = false;
while (itemRef) {
- if ((classMask == 0 || itemRef->classFlags & classMask) && has_item_childflag_0x10(itemRef)) {
+ if ((classMask == 0 || itemRef->classFlags & classMask) && hasIcon(itemRef)) {
if (item_again == false) {
window->iconPtr->iconArray[k].item = itemRef;
if (getGameType() == GType_SIMON2) {
@@ -389,7 +389,7 @@ void AGOSEngine::drawIconArray_FF(uint num, Item *itemRef, int line, int classMa
uint16 ct = xp;
while (itemRef && ct < iconperline) {
if ((classMask == 0) || ((itemRef->classFlags & classMask) != 0)) {
- if (has_item_childflag_0x10(itemRef)) {
+ if (hasIcon(itemRef)) {
ct += 45;
k++;
}
@@ -410,7 +410,7 @@ void AGOSEngine::drawIconArray_FF(uint num, Item *itemRef, int line, int classMa
while (itemRef) {
if ((classMask != 0) && ((itemRef->classFlags & classMask) == 0))
goto l1;
- if (has_item_childflag_0x10(itemRef) == 0)
+ if (hasIcon(itemRef) == 0)
goto l1;
if (!idone) {
/*
diff --git a/engines/agos/items.cpp b/engines/agos/items.cpp
index b0ebabe0ae..6d5e869038 100644
--- a/engines/agos/items.cpp
+++ b/engines/agos/items.cpp
@@ -60,6 +60,15 @@ void AGOSEngine::allocItemHeap() {
error("Out Of Memory - Items");
}
+bool AGOSEngine::hasIcon(Item *item) {
+ if (getGameType() == GType_ELVIRA1) {
+ return (getUserFlag(item, 7) != 0);
+ } else {
+ SubObject *child = (SubObject *)findChildOfType(item, 2);
+ return (child && (child->objectFlags & kOFIcon) != 0);
+ }
+}
+
uint AGOSEngine::itemGetIconNumber(Item *item) {
if (getGameType() == GType_ELVIRA1) {
return getUserFlag(item, 7);
@@ -341,11 +350,6 @@ void AGOSEngine::linkItem(Item *item, Item *parent) {
}
}
-bool AGOSEngine::has_item_childflag_0x10(Item *item) {
- SubObject *child = (SubObject *)findChildOfType(item, 2);
- return child && (child->objectFlags & kOFIcon) != 0;
-}
-
int AGOSEngine::wordMatch(Item *item, int16 a, int16 n) {
if ((a == -1) && (n == item->noun))
return 1;