aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/cge2/snail.cpp7
-rw-r--r--engines/cge2/vga13h.cpp18
2 files changed, 18 insertions, 7 deletions
diff --git a/engines/cge2/snail.cpp b/engines/cge2/snail.cpp
index d92862a1ed..ede6206d1f 100644
--- a/engines/cge2/snail.cpp
+++ b/engines/cge2/snail.cpp
@@ -521,7 +521,12 @@ void CGE2Engine::snRoom(Sprite *spr, int val) {
}
void CGE2Engine::snGhost(Bitmap *bmp) {
- warning("STUB: CGE2Engine::snGhost()");
+ V2D p(this, *bmp->_v & 0xFFFF, *bmp->_v >> 16);
+ bmp->hide(p.x, p.y);
+ delete bmp->_b;
+ bmp->_v = nullptr;
+ bmp->_b = nullptr;
+ delete bmp;
}
void CGE2Engine::hide1(Sprite *spr) {
diff --git a/engines/cge2/vga13h.cpp b/engines/cge2/vga13h.cpp
index 97a31bbb69..98daf56f3d 100644
--- a/engines/cge2/vga13h.cpp
+++ b/engines/cge2/vga13h.cpp
@@ -606,12 +606,18 @@ void Sprite::hide() {
BitmapPtr Sprite::ghost() {
SprExt *e = _ext;
if (!e->_b1)
- return NULL;
-
- BitmapPtr bmp = new Bitmap(_vm, 0, 0, (uint8 *)NULL);
- assert(bmp != NULL);
-
- warning("STUB: Sprite::ghost()");
+ return nullptr;
+
+ BitmapPtr bmp = new Bitmap(_vm, 0, 0, (uint8 *)nullptr);
+ assert(bmp != nullptr);
+ bmp->_w = e->_b1->_w;
+ bmp->_h = e->_b1->_h;
+ bmp->_b = new HideDesc[bmp->_h];
+ assert(bmp->_b != nullptr);
+ memcpy(bmp->_b, e->_b1->_b, sizeof(HideDesc)* bmp->_h);
+ uint8 *v = new uint8;
+ *v = (e->_p1.y << 16) + e->_p1.x;
+ bmp->_v = v;
return bmp;
}