[Scummvm-cvs-logs] SF.net SVN: scummvm: [24471] scummvm/trunk/engines/agos
kirben at users.sourceforge.net
kirben at users.sourceforge.net
Mon Oct 23 13:13:58 CEST 2006
Revision: 24471
http://svn.sourceforge.net/scummvm/?rev=24471&view=rev
Author: kirben
Date: 2006-10-23 04:13:51 -0700 (Mon, 23 Oct 2006)
Log Message:
-----------
Add minor icon code differences in Elvira 2
Modified Paths:
--------------
scummvm/trunk/engines/agos/agos.h
scummvm/trunk/engines/agos/icons.cpp
scummvm/trunk/engines/agos/script_e2.cpp
scummvm/trunk/engines/agos/verb.cpp
Modified: scummvm/trunk/engines/agos/agos.h
===================================================================
--- scummvm/trunk/engines/agos/agos.h 2006-10-23 10:06:32 UTC (rev 24470)
+++ scummvm/trunk/engines/agos/agos.h 2006-10-23 11:13:51 UTC (rev 24471)
@@ -777,10 +777,10 @@
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);
Modified: scummvm/trunk/engines/agos/icons.cpp
===================================================================
--- scummvm/trunk/engines/agos/icons.cpp 2006-10-23 10:06:32 UTC (rev 24470)
+++ scummvm/trunk/engines/agos/icons.cpp 2006-10-23 11:13:51 UTC (rev 24471)
@@ -167,7 +167,7 @@
}
}
-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 @@
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 @@
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 @@
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,15 +448,91 @@
}
/* 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();
_scrollUpHitArea = ha - _hitAreas;
if (getGameType() == GType_FF) {
ha->x = 496;
@@ -593,74 +669,16 @@
}
}
-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 @@
_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
Modified: scummvm/trunk/engines/agos/script_e2.cpp
===================================================================
--- scummvm/trunk/engines/agos/script_e2.cpp 2006-10-23 10:06:32 UTC (rev 24470)
+++ scummvm/trunk/engines/agos/script_e2.cpp 2006-10-23 11:13:51 UTC (rev 24471)
@@ -106,7 +106,7 @@
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();
}
Modified: scummvm/trunk/engines/agos/verb.cpp
===================================================================
--- scummvm/trunk/engines/agos/verb.cpp 2006-10-23 10:06:32 UTC (rev 24470)
+++ scummvm/trunk/engines/agos/verb.cpp 2006-10-23 11:13:51 UTC (rev 24471)
@@ -788,11 +788,11 @@
}
//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)) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list