diff options
author | uruk | 2014-05-13 09:07:32 +0200 |
---|---|---|
committer | uruk | 2014-05-13 09:07:32 +0200 |
commit | 6e509152544cd895da1b63923bbc2adf890e6d5f (patch) | |
tree | 4e57bf50761f797996c9fcb101cbbb4cca0aa533 | |
parent | d7c54653092bc4ed24011a88a6748a98a0a99312 (diff) | |
download | scummvm-rg350-6e509152544cd895da1b63923bbc2adf890e6d5f.tar.gz scummvm-rg350-6e509152544cd895da1b63923bbc2adf890e6d5f.tar.bz2 scummvm-rg350-6e509152544cd895da1b63923bbc2adf890e6d5f.zip |
CGE2: Finish implementation of loadScript().
-rw-r--r-- | engines/cge2/cge2_main.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/engines/cge2/cge2_main.cpp b/engines/cge2/cge2_main.cpp index 23fe4cbfa9..38320c4a62 100644 --- a/engines/cge2/cge2_main.cpp +++ b/engines/cge2/cge2_main.cpp @@ -32,6 +32,7 @@ #include "cge2/text.h" #include "cge2/snail.h" #include "cge2/hero.h" +#include "cge2/spare.h" namespace CGE2 { @@ -174,6 +175,8 @@ void CGE2Engine::loadSprite(const char *fname, int ref, int scene, V3D &pos) { } if (_sprite) { + _sprite->_ref = ref; + _sprite->_flags._frnt = frnt; _sprite->_flags._east = east; _sprite->_flags._port = port; @@ -258,9 +261,15 @@ void CGE2Engine::loadScript(const char *fname) { _sprite = NULL; loadSprite(SpN, SpI, SpA, P); if (_sprite) { - warning("STUB: CGE2Engine::loadScript - SPARE:: thing"); if (BkG) _sprite->_flags._back = true; + + int n = _spare->count(); + if (_spare->locate(_sprite->_ref) == nullptr) + _spare->store(_sprite); + _sprite = nullptr; + if (_spare->count() == n) + error("Durplicated reference! %s", SpN); } } |