aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/agos/agos.h1
-rw-r--r--engines/agos/items.cpp2
-rw-r--r--engines/agos/vga.cpp54
3 files changed, 56 insertions, 1 deletions
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index 876bc5d1da..8f0aba39c2 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -1127,6 +1127,7 @@ protected:
void startOverlayAnims();
void startAnOverlayAnim();
+ void startBlock(uint windowNum, uint vga_res, uint vga_sprite_id, uint x, uint y, uint palette);
bool itemIsSiblingOf(uint16 val);
bool itemIsParentOf(uint16 a, uint16 b);
diff --git a/engines/agos/items.cpp b/engines/agos/items.cpp
index 49699d4c02..95925669c6 100644
--- a/engines/agos/items.cpp
+++ b/engines/agos/items.cpp
@@ -2511,7 +2511,7 @@ void AGOSEngine::o4_animate() {
uint palette = getVarOrWord();
if (getBitFlag(96)) {
- printf("Start Block\n");
+ startBlock(windowNum, vga_res, vgaSpriteId, x, y, palette);
} else {
loadSprite(windowNum, vga_res, vgaSpriteId, x, y, palette);
}
diff --git a/engines/agos/vga.cpp b/engines/agos/vga.cpp
index 059228d35a..83846ef556 100644
--- a/engines/agos/vga.cpp
+++ b/engines/agos/vga.cpp
@@ -2927,4 +2927,58 @@ void AGOSEngine::startAnOverlayAnim() {
_vgaCurZoneNum = file;
}
+void AGOSEngine::startBlock(uint windowNum, uint zoneNum, uint vgaSpriteId, uint x, uint y, uint priority) {
+ VgaSprite *vsp = _vgaSprites;
+ const byte *vcPtrOrg;
+ uint16 tmp;
+ uint i;
+
+ while (vsp->id != 0)
+ vsp++;
+
+ _variableArray[201] = vgaSpriteId;
+
+ if (getBitFlag(95)) {
+ _droppingBlockAnim = vgaSpriteId;
+ _droppingBlockX = _variableArray[202];
+ _droppingBlockY = _variableArray[203];
+ _droppingBlockZ = _variableArray[204];
+ _droppingBlockLength = windowNum;
+ if (windowNum == 1) {
+ priority += 9;
+ y += 10;
+ x += 15;
+ }
+ _droppingBlockCount = 4;
+ _droppingBlockType = 4;
+ }
+
+ for (i = 0; i < windowNum; i++) {
+ vsp->palette = 0;
+ vsp->flags = 0;
+ vsp->priority = 0;
+ vsp->windowNum = 4;
+ vsp->zoneNum = 60;
+ vsp->y = y;
+ vsp->x = x;
+ vsp->id = vgaSpriteId;
+ vsp->image = zoneNum;
+
+ _vgaCurSpriteId = vgaSpriteId;
+ _vgaCurZoneNum = 60;
+
+ tmp = to16Wrapper(priority);
+
+ vcPtrOrg = _vcPtr;
+ _vcPtr = (byte *)&tmp;
+ vc23_setSpritePriority();
+ _vcPtr = vcPtrOrg;
+
+ vgaSpriteId++;
+ x += 15;
+ y += 10;
+ priority += 8;
+ }
+}
+
} // End of namespace AGOS