From 85c55333b334f18f795118a3a3e4a2d2c210253b Mon Sep 17 00:00:00 2001 From: uruk Date: Tue, 10 Jun 2014 14:38:30 +0200 Subject: [PATCH] CGE2: Handle kCmdSetRef. Fix Snail during the process. --- engines/cge2/snail.cpp | 7 +++++-- engines/cge2/spare.cpp | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/engines/cge2/snail.cpp b/engines/cge2/snail.cpp index 3af4c88d376..6957f8f50ea 100644 --- a/engines/cge2/snail.cpp +++ b/engines/cge2/snail.cpp @@ -488,8 +488,11 @@ void CGE2Engine::snFlag(int ref, int val) { warning("STUB: CGE2Engine::snFlag()"); } -void CGE2Engine::snSetRef(Sprite *spr, int val) { - warning("STUB: CGE2Engine::snSetRef()"); +void CGE2Engine::snSetRef(Sprite *spr, int val) { // TODO:: Recheck this! + if (spr) { + spr->_ref = val; + _spare->update(spr); + } } void CGE2Engine::snBackPt(Sprite *spr, int val) { diff --git a/engines/cge2/spare.cpp b/engines/cge2/spare.cpp index 445247177df..63e85e8ed67 100644 --- a/engines/cge2/spare.cpp +++ b/engines/cge2/spare.cpp @@ -79,6 +79,8 @@ void Spare::update(Sprite *spr) { Sprite *sp = locate(spr->_ref); if (sp == nullptr) store(spr); + else + *sp = *spr; } void Spare::dispose(Sprite *spr) {