aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTravis Howell2006-10-23 11:13:51 +0000
committerTravis Howell2006-10-23 11:13:51 +0000
commit7a5b0c1870ab60f901be689d9b0cc89fde550fb2 (patch)
tree9844227de1f48b5b077c28b8c33118256a8b7eea /engines
parent4c9fc74964a9b786982ecc5880b6e54be41c96ca (diff)
downloadscummvm-rg350-7a5b0c1870ab60f901be689d9b0cc89fde550fb2.tar.gz
scummvm-rg350-7a5b0c1870ab60f901be689d9b0cc89fde550fb2.tar.bz2
scummvm-rg350-7a5b0c1870ab60f901be689d9b0cc89fde550fb2.zip
Add minor icon code differences in Elvira 2
svn-id: r24471
Diffstat (limited to 'engines')
-rw-r--r--engines/agos/agos.h4
-rw-r--r--engines/agos/icons.cpp176
-rw-r--r--engines/agos/script_e2.cpp2
-rw-r--r--engines/agos/verb.cpp10
4 files changed, 99 insertions, 93 deletions
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index 8264d8caa3..089dfa5961 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -777,10 +777,10 @@ protected:
void drawMousePointer_FF();
void drawMousePart(int image, byte x, byte y);
- void defineArrowBoxes(WindowBlock *window);
+ void addArrows(WindowBlock *window);
void removeArrows(WindowBlock *window, uint num);
- void draw_icon_c(WindowBlock *window, uint icon, uint x, uint y);
+ void drawIcon(WindowBlock *window, uint icon, uint x, uint y);
bool hasIcon(Item *item);
uint itemGetIconNumber(Item *item);
uint setupIconHitArea(WindowBlock *window, uint num, uint x, uint y, Item *item_ptr);
diff --git a/engines/agos/icons.cpp b/engines/agos/icons.cpp
index ae778072c6..647459e3b1 100644
--- a/engines/agos/icons.cpp
+++ b/engines/agos/icons.cpp
@@ -167,7 +167,7 @@ static void decompressIcon(byte *dst, byte *src, uint width, uint height, byte b
}
}
-void AGOSEngine::draw_icon_c(WindowBlock *window, uint icon, uint x, uint y) {
+void AGOSEngine::drawIcon(WindowBlock *window, uint icon, uint x, uint y) {
byte *dst;
byte *src;
@@ -223,7 +223,7 @@ void AGOSEngine::draw_icon_c(WindowBlock *window, uint icon, uint x, uint y) {
if (getPlatform() == Common::kPlatformAmiga) {
src = _iconFilePtr;
src += READ_BE_UINT32(&((uint32 *)src)[icon]);
- decompressIconAmiga(dst, src, 24, 24, 16, _dxSurfacePitch);
+ decompressIconAmiga(dst, src, 24, 24, color, _dxSurfacePitch);
} else {
src = _iconFilePtr;
src += READ_LE_UINT16(&((uint16 *)src)[icon]);
@@ -310,15 +310,15 @@ void AGOSEngine::drawIconArray_Simon(uint num, Item *itemRef, int line, int clas
if (item_again == false) {
window->iconPtr->iconArray[k].item = itemRef;
if (getGameType() == GType_SIMON2) {
- draw_icon_c(window, itemGetIconNumber(itemRef), x_pos, y_pos);
+ drawIcon(window, itemGetIconNumber(itemRef), x_pos, y_pos);
window->iconPtr->iconArray[k].boxCode =
setupIconHitArea(window, 0, x_pos, y_pos, itemRef);
} else if (getGameType() == GType_SIMON1) {
- draw_icon_c(window, itemGetIconNumber(itemRef), x_pos * 3, y_pos);
+ drawIcon(window, itemGetIconNumber(itemRef), x_pos * 3, y_pos);
window->iconPtr->iconArray[k].boxCode =
setupIconHitArea(window, 0, x_pos * 3, y_pos, itemRef);
} else {
- draw_icon_c(window, itemGetIconNumber(itemRef), x_pos * 3, y_pos * 3);
+ drawIcon(window, itemGetIconNumber(itemRef), x_pos * 3, y_pos * 3);
window->iconPtr->iconArray[k].boxCode =
setupIconHitArea(window, 0, x_pos * 3, y_pos * 3, itemRef);
}
@@ -343,7 +343,7 @@ void AGOSEngine::drawIconArray_Simon(uint num, Item *itemRef, int line, int clas
if (showArrows != 0 || window->iconPtr->line != 0) {
/* Plot arrows and add their boxes */
- defineArrowBoxes(window);
+ addArrows(window);
window->iconPtr->upArrow = _scrollUpHitArea;
window->iconPtr->downArrow = _scrollDownHitArea;
}
@@ -448,12 +448,88 @@ l1:; itemRef = derefItem(itemRef->next);
}
/* Plot arrows and add their boxes */
- defineArrowBoxes(window);
+ addArrows(window);
window->iconPtr->upArrow = _scrollUpHitArea;
window->iconPtr->downArrow = _scrollDownHitArea;
}
-void AGOSEngine::defineArrowBoxes(WindowBlock *window) {
+uint AGOSEngine::setupIconHitArea(WindowBlock *window, uint num, uint x, uint y, Item *item_ptr) {
+ HitArea *ha;
+
+ ha = findEmptyHitArea();
+
+ if (getGameType() == GType_FF) {
+ ha->x = x;
+ ha->y = y;
+ ha->item_ptr = item_ptr;
+ ha->width = 45;
+ ha->height = 44;
+ ha->flags = kBFBoxInUse | kBFBoxItem;
+ ha->id = num;
+ ha->priority = 100;
+ ha->verb = 208;
+ } else if (getGameType() == GType_SIMON2) {
+ ha->x = x + 110;
+ ha->y = window->y + y;
+ ha->item_ptr = item_ptr;
+ ha->width = 20;
+ ha->height = 20;
+ ha->flags = kBFDragBox | kBFBoxInUse | kBFBoxItem;
+ ha->id = 0x7FFD;
+ ha->priority = 100;
+ ha->verb = 208;
+ } else if (getGameType() == GType_SIMON1) {
+ ha->x = (x + window->x) * 8;
+ ha->y = y * 25 + window->y;
+ ha->item_ptr = item_ptr;
+ ha->width = 24;
+ ha->height = 24;
+ ha->flags = kBFDragBox | kBFBoxInUse | kBFBoxItem;
+ ha->id = 0x7FFD;
+ ha->priority = 100;
+ ha->verb = 208;
+ } else if (getGameType() == GType_WW) {
+ ha->x = (x + window->x) * 8;
+ ha->y = y * 20 + window->y;
+ ha->item_ptr = item_ptr;
+ ha->width = 24;
+ ha->height = 20;
+ ha->flags = kBFDragBox | kBFBoxInUse | kBFBoxItem;
+ ha->id = 0x7FFD;
+ ha->priority = 100;
+ ha->verb = 208;
+ } else if (getGameType() == GType_ELVIRA2) {
+ ha->x = (x + window->x) * 8;
+ ha->y = y * 8 + window->y;
+ ha->item_ptr = item_ptr;
+ ha->width = 24;
+ ha->height = 24;
+ ha->id = 0x7FFD;
+ ha->priority = 100;
+
+ if (window->iconPtr->classMask == 2) {
+ ha->flags = kBFDragBox | kBFBoxInUse;
+ ha->verb = 248 + 0x4000;
+ } else {
+ ha->flags = kBFDragBox | kBFBoxInUse | kBFBoxItem;
+ ha->verb = 208;
+ }
+ } else {
+ ha->x = (x + window->x) * 8;
+ ha->y = y * 8 + window->y;
+ ha->item_ptr = item_ptr;
+ ha->width = 24;
+ ha->height = 24;
+ ha->flags = kBFDragBox | kBFBoxInUse | kBFBoxItem;
+ ha->id = 0x7FFD;
+ ha->priority = 100;
+ ha->verb = 253;
+ }
+
+ return ha - _hitAreas;
+}
+
+void AGOSEngine::addArrows(WindowBlock *window) {
HitArea *ha;
ha = findEmptyHitArea();
@@ -593,74 +669,16 @@ void AGOSEngine::defineArrowBoxes(WindowBlock *window) {
}
}
-uint AGOSEngine::setupIconHitArea(WindowBlock *window, uint num, uint x, uint y, Item *item_ptr) {
- HitArea *ha;
-
- ha = findEmptyHitArea();
-
- if (getGameType() == GType_FF) {
- ha->x = x;
- ha->y = y;
- ha->item_ptr = item_ptr;
- ha->width = 45;
- ha->height = 44;
- ha->flags = kBFBoxInUse | kBFBoxItem;
- ha->id = num;
- ha->priority = 100;
- ha->verb = 208;
- } else if (getGameType() == GType_SIMON2) {
- ha->x = x + 110;
- ha->y = window->y + y;
- ha->item_ptr = item_ptr;
- ha->width = 20;
- ha->height = 20;
- ha->flags = kBFDragBox | kBFBoxInUse | kBFBoxItem;
- ha->id = 0x7FFD;
- ha->priority = 100;
- ha->verb = 208;
- } else if (getGameType() == GType_SIMON1) {
- ha->x = (x + window->x) * 8;
- ha->y = y * 25 + window->y;
- ha->item_ptr = item_ptr;
- ha->width = 24;
- ha->height = 24;
- ha->flags = kBFDragBox | kBFBoxInUse | kBFBoxItem;
- ha->id = 0x7FFD;
- ha->priority = 100;
- ha->verb = 208;
+void AGOSEngine::removeArrows(WindowBlock *window, uint num) {
+ if (getGameType() == GType_SIMON1) {
+ stopAnimateSimon1(128);
} else if (getGameType() == GType_WW) {
- ha->x = (x + window->x) * 8;
- ha->y = y * 20 + window->y;
- ha->item_ptr = item_ptr;
- ha->width = 24;
- ha->height = 20;
- ha->flags = kBFDragBox | kBFBoxInUse | kBFBoxItem;
- ha->id = 0x7FFD;
- ha->priority = 100;
- ha->verb = 208;
+ setBitFlag(22, false);
+ setWindowImageEx(6, 103);
} else if (getGameType() == GType_ELVIRA2) {
- ha->x = (x + window->x) * 8;
- ha->y = y * 8 + window->y;
- ha->item_ptr = item_ptr;
- ha->width = 24;
- ha->height = 24;
- ha->flags = kBFDragBox | kBFBoxInUse | kBFBoxItem;
- ha->id = 0x7FFD;
- ha->priority = 100;
- ha->verb = 208;
- } else {
- ha->x = (x + window->x) * 8;
- ha->y = y * 8 + window->y;
- ha->item_ptr = item_ptr;
- ha->width = 24;
- ha->height = 24;
- ha->flags = kBFDragBox | kBFBoxInUse | kBFBoxItem;
- ha->id = 0x7FFD;
- ha->priority = 100;
- ha->verb = 253;
+ setBitFlag(21, false);
+ setWindowImageEx(6, 106);
}
-
- return ha - _hitAreas;
}
void AGOSEngine::removeIconArray(uint num) {
@@ -700,16 +718,4 @@ void AGOSEngine::removeIconArray(uint num) {
_fcsData2[num] = 0;
}
-void AGOSEngine::removeArrows(WindowBlock *window, uint num) {
- if (getGameType() == GType_SIMON1) {
- stopAnimateSimon1(128);
- } else if (getGameType() == GType_WW) {
- setBitFlag(22, false);
- setWindowImageEx(6, 103);
- } else if (getGameType() == GType_ELVIRA2) {
- setBitFlag(21, false);
- setWindowImageEx(6, 106);
- }
-}
-
} // End of namespace AGOS
diff --git a/engines/agos/script_e2.cpp b/engines/agos/script_e2.cpp
index d75cfe75bd..fc573ea63a 100644
--- a/engines/agos/script_e2.cpp
+++ b/engines/agos/script_e2.cpp
@@ -106,7 +106,7 @@ void AGOSEngine::oe2_drawItem() {
int x = getVarOrWord();
int y = getVarOrWord();
mouseOff();
- draw_icon_c(_windowArray[a % 8], itemGetIconNumber(i), x, y);
+ drawIcon(_windowArray[a % 8], itemGetIconNumber(i), x, y);
mouseOn();
}
diff --git a/engines/agos/verb.cpp b/engines/agos/verb.cpp
index 337a9accc7..d5281b09ba 100644
--- a/engines/agos/verb.cpp
+++ b/engines/agos/verb.cpp
@@ -788,11 +788,11 @@ void AGOSEngine::boxController(uint x, uint y, uint mode) {
}
//if (_nameLocked == 0) {
- if (best_ha->flags & kBFNoTouchName) {
- clearName();
- } else if (best_ha != _lastNameOn) {
- displayName(best_ha);
- }
+ //if (best_ha->flags & kBFNoTouchName) {
+ // clearName();
+ //} else if (best_ha != _lastNameOn) {
+ // displayName(best_ha);
+ //}
//}
if (best_ha->flags & kBFInvertTouch && !(best_ha->flags & kBFBoxSelected)) {