CGE2: Implement snKill().

Add and implement Sprite::setCave() during the process.
This commit is contained in:
uruk 2014-06-13 16:13:36 +02:00
parent 6ac5e2cfcf
commit 95c844a035
3 changed files with 22 additions and 1 deletions

View File

@ -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) {

View File

@ -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));
}

View File

@ -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);