aboutsummaryrefslogtreecommitdiff
path: root/engines/cge2
diff options
context:
space:
mode:
authoruruk2014-06-13 16:13:36 +0200
committeruruk2014-06-13 16:13:36 +0200
commit95c844a0351d8865aa5190bb5572dff23b8886fd (patch)
tree0554cfaea9b4ba16ff3784c3e1a154a253a235fa /engines/cge2
parent6ac5e2cfcfa3e13b3eb93c88790c7babcb7af6d2 (diff)
downloadscummvm-rg350-95c844a0351d8865aa5190bb5572dff23b8886fd.tar.gz
scummvm-rg350-95c844a0351d8865aa5190bb5572dff23b8886fd.tar.bz2
scummvm-rg350-95c844a0351d8865aa5190bb5572dff23b8886fd.zip
CGE2: Implement snKill().
Add and implement Sprite::setCave() during the process.
Diffstat (limited to 'engines/cge2')
-rw-r--r--engines/cge2/snail.cpp18
-rw-r--r--engines/cge2/vga13h.cpp4
-rw-r--r--engines/cge2/vga13h.h1
3 files changed, 22 insertions, 1 deletions
diff --git a/engines/cge2/snail.cpp b/engines/cge2/snail.cpp
index aa0988f293..07cded033e 100644
--- a/engines/cge2/snail.cpp
+++ b/engines/cge2/snail.cpp
@@ -30,6 +30,7 @@
#include "cge2/hero.h"
#include "cge2/text.h"
#include "cge2/sound.h"
+#include "cge2/events.h"
namespace CGE2 {
@@ -324,7 +325,22 @@ void CommandHandler::runCommand() {
}
void CGE2Engine::snKill(Sprite *spr) {
- warning("STUB: CGE2Engine::snKill()");
+ if (spr) {
+ if (spr->_flags._kept)
+ releasePocket(spr);
+ Sprite *nx = spr->_next;
+ hide1(spr);
+ _vga->_showQ->remove(spr);
+ _eventManager->clearEvent(spr);
+ if (spr->_flags._kill)
+ delete spr;
+ else {
+ spr->setCave(-1);
+ _spare->dispose(spr);
+ }
+ if (nx && nx->_flags._slav)
+ snKill(nx);
+ }
}
void CGE2Engine::snHide(Sprite *spr, int val) {
diff --git a/engines/cge2/vga13h.cpp b/engines/cge2/vga13h.cpp
index e59e82579e..28f738c6c7 100644
--- a/engines/cge2/vga13h.cpp
+++ b/engines/cge2/vga13h.cpp
@@ -516,6 +516,10 @@ void Sprite::tick() {
step();
}
+void Sprite::setCave(int c) {
+ _scene = c;
+}
+
void Sprite::gotoxyz(int x, int y, int z) {
gotoxyz(V3D(x, y, z));
}
diff --git a/engines/cge2/vga13h.h b/engines/cge2/vga13h.h
index dee551fe82..c864e481af 100644
--- a/engines/cge2/vga13h.h
+++ b/engines/cge2/vga13h.h
@@ -262,6 +262,7 @@ public:
CommandHandler::Command *snList(Action type);
virtual void touch(uint16 mask, int x, int y, Common::KeyCode keyCode);
virtual void tick();
+ virtual void setCave(int c);
void clrHide() { if (_ext) _ext->_b0 = NULL; }
void sync(Common::Serializer &s);