SCI: Added some SCI3 selector related information
- Added a TODO for the usage of the -info- selector in kClone and kDisposeClone in SCI3 scripts, as it's no longer used in SCI3 - Added information about which of the selectors are missing in SCI3. There are some more which are missing, but aren't used in SCI2-SCI3 anyway - Some styling svn-id: r54291
This commit is contained in:
parent
3d7f7b49fe
commit
bb9b7c24f9
4 changed files with 16 additions and 10 deletions
|
@ -155,6 +155,7 @@ reg_t kClone(EngineState *s, int argc, reg_t *argv) {
|
|||
|
||||
debugC(2, kDebugLevelMemory, "Attempting to clone from %04x:%04x", PRINT_REG(parentAddr));
|
||||
|
||||
// TODO: SCI3 equivalent, SCI3 objects don't have an -info- selector
|
||||
uint16 infoSelector = readSelectorValue(s->_segMan, parentAddr, SELECTOR(_info_));
|
||||
cloneObj = s->_segMan->allocateClone(&cloneAddr);
|
||||
|
||||
|
@ -179,6 +180,10 @@ reg_t kClone(EngineState *s, int argc, reg_t *argv) {
|
|||
|
||||
// Mark as clone
|
||||
infoSelector &= ~kInfoFlagClass; // remove class bit
|
||||
if (getSciVersion() == SCI_VERSION_3)
|
||||
// TODO: SCI3 equivalent, SCI3 objects don't have an -info- selector
|
||||
warning("TODO: not modifying -info- selector in kClone for SCI3");
|
||||
else
|
||||
writeSelectorValue(s->_segMan, cloneAddr, SELECTOR(_info_), infoSelector | kInfoFlagClone);
|
||||
|
||||
cloneObj->setSpeciesSelector(cloneObj->getPos());
|
||||
|
@ -206,6 +211,7 @@ reg_t kDisposeClone(EngineState *s, int argc, reg_t *argv) {
|
|||
// At least kq4early relies on this behaviour. The scripts clone "Sound", then set bit 1 manually
|
||||
// and call kDisposeClone later. In that case we may not free it, otherwise we will run into issues
|
||||
// later, because kIsObject would then return false and Sound object wouldn't get checked.
|
||||
// TODO: SCI3 equivalent, SCI3 objects don't have an -info- selector
|
||||
uint16 infoSelector = readSelectorValue(s->_segMan, obj, SELECTOR(_info_));
|
||||
if ((infoSelector & 3) == kInfoFlagClone)
|
||||
object->markAsFreed();
|
||||
|
|
|
@ -40,7 +40,7 @@ struct SelectorCache {
|
|||
}
|
||||
|
||||
// Statically defined selectors, (almost the) same in all SCI versions
|
||||
Selector _info_;
|
||||
Selector _info_; ///< Removed in SCI3
|
||||
Selector y;
|
||||
Selector x;
|
||||
Selector view, loop, cel; ///< Description of a specific image
|
||||
|
@ -58,8 +58,9 @@ struct SelectorCache {
|
|||
// style
|
||||
Selector state, font, type;///< Used by controls
|
||||
// window
|
||||
Selector cursor, max; ///< Used by EditControl
|
||||
Selector mark; //< Used by list controls
|
||||
Selector cursor; ///< Used by EditControl
|
||||
Selector max; ///< Used by EditControl, removed in SCI3
|
||||
Selector mark; //< Used by list controls (script internal, is needed by us for the QfG import rooms)
|
||||
Selector sort; //< Used by list controls (script internal, is needed by us for QfG3 import room)
|
||||
// who
|
||||
Selector message; ///< Used by GetEvent
|
||||
|
@ -96,8 +97,8 @@ struct SelectorCache {
|
|||
Selector subtitleLang;
|
||||
Selector size;
|
||||
Selector points; ///< Used by AvoidPath()
|
||||
Selector palette;
|
||||
Selector dataInc;
|
||||
Selector palette; ///< Used by the SCI0-SCI1.1 animate code, unused in SCI2-SCI2.1, removed in SCI3
|
||||
Selector dataInc; ///< Used to sync music with animations, removed in SCI3
|
||||
// handle (in SCI1)
|
||||
Selector min; ///< SMPTE time format
|
||||
Selector sec;
|
||||
|
@ -109,7 +110,7 @@ struct SelectorCache {
|
|||
|
||||
// SCI1 selectors which have been moved a bit in SCI1.1, but otherwise static
|
||||
Selector cantBeHere; ///< Checks for movement avoidance in SCI1+. Replaces canBeHere
|
||||
Selector topString; ///< SCI1 scroll lists use this instead of lsTop
|
||||
Selector topString; ///< SCI1 scroll lists use this instead of lsTop. Removed in SCI3
|
||||
Selector flags;
|
||||
|
||||
// SCI1+ audio sync related selectors, not static. They're used for lip syncing in
|
||||
|
|
|
@ -307,9 +307,8 @@ Common::String SciEngine::strSplit(const char *str, const char *sep) {
|
|||
kLanguage lang = getSciLanguage();
|
||||
kLanguage subLang = K_LANG_NONE;
|
||||
|
||||
if (SELECTOR(subtitleLang) != -1) {
|
||||
if (SELECTOR(subtitleLang) != -1)
|
||||
subLang = (kLanguage)readSelectorValue(_gamestate->_segMan, _gameObjectAddress, SELECTOR(subtitleLang));
|
||||
}
|
||||
|
||||
kLanguage secondLang;
|
||||
Common::String retval = getSciLanguageString(str, lang, &secondLang);
|
||||
|
|
|
@ -1735,7 +1735,7 @@ void run_vm(EngineState *s) {
|
|||
|
||||
if (s->r_acc.offset >= scr->getBufSize()) {
|
||||
error("VM: lofsa operation overflowed: %04x:%04x beyond end"
|
||||
" of script (at %04x)\n", PRINT_REG(s->r_acc), scr->getBufSize());
|
||||
" of script (at %04x)", PRINT_REG(s->r_acc), scr->getBufSize());
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue