diff options
author | uruk | 2014-05-29 20:05:51 +0200 |
---|---|---|
committer | uruk | 2014-05-29 20:05:51 +0200 |
commit | 60825760fd6eaa4a50c9a9e0bd9a2a5b0380d95c (patch) | |
tree | c2dd9c75242ff0ecb831870e580a611aec324cf5 /engines | |
parent | 7c73ce5d8b516976180aa38e76f75e88b1cbc474 (diff) | |
download | scummvm-rg350-60825760fd6eaa4a50c9a9e0bd9a2a5b0380d95c.tar.gz scummvm-rg350-60825760fd6eaa4a50c9a9e0bd9a2a5b0380d95c.tar.bz2 scummvm-rg350-60825760fd6eaa4a50c9a9e0bd9a2a5b0380d95c.zip |
CGE2: Implement snGhost().
Also implement Sprite::ghost().
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cge2/snail.cpp | 7 | ||||
-rw-r--r-- | engines/cge2/vga13h.cpp | 18 |
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; } |