command in v0
If for instance an object necessary for the sentence command is not reachable or pickupable (try to use faucet (object 55) with jar with water in microwave (object 50), the pick-up script of the jar will tell the actor to pickup object 99 (jar not in microwave)) the actor will try to pick-up the jar infinitely.
This is fixed by counting the amount of nested scripts the sentence command has called (directly or indirectly) so far and aborts it if there have been too many.
Some object functions allow actor IDs and object IDs as parameters. They are easily distinguishable in engines > 0 as actor IDs are < _numActors and object IDs are bigger. In v0 this is not the case as there are objects with IDs like 3 and 5 (e.g. the hamster). So object ID handling was unified for v0 and the other engines by introducing objIsActor(), objToActor() and ActorToObj().
It actually was stopMusic() before and so stopped only the music and not all sounds.
The former implementation is for the o_stopMusic opcode which is not supported directly by ScummVM (it always stops all sounds). It is kept as stopMusic_intern() but is not used anymore.
- handle mode switching correctly
- do not freeze scripts in cutscene mode (mode 0), as some scripts are freezed in mode 0 that should not be freezed
- kModeNoNewKid (mode 2) needs the same userState as mode 3
- rename o_cursorCommand to o_setMode as it is not really cursor specific
- handle actorHiding correctly (do not set costume to 0 as the previous costume cannot be reverted after hiding)
- add drawSentence
- document meanings for actor misc flags
- fix actor names for "new kid" if the radiation suit is used (all kids are set to 0 then with actor 0 name " ")
- cleanup actor switching routine
- _userPut is not used anymore in v0
- o_setObjectName has a default value
- o_putActorAtObject can either operate on a fg or bg object
Note: neither the default value nor the bg object opcode (4E) seem to be ever used by any script. So this commit is rather for completeness than for bug-fixing.
- o5_breakHere() seems to be still needed. For example edna does not manage to walk up the ladder if this is not enabled.
- numLocalObjects seems to be big enough so that < instead of <= can be used. The original interpreter only uses the local ids 0 .. 44 whereas scummvm has _numLocalObjects set to 200.
- getVerbEntrypoint() should not handle walk-to differently (revert 0x0D handling back to original behavior)
- VAR_ACTIVE_ACTOR actually is VAR_ACTIVE_OBJECT2
- runSentenceScript(): "if (_cmdVerb == kVerbWalkTo)" must be "if (_cmdVerb != kVerbWalkTo)"
- MM C64 uses command stack (SentenceTab, doSentence()) now
- _cmdObject... added for current SentenceTab. The _active... variables are only used to build a sentence in the inventory but never by a script.
-> many routines are not needed anymore and are removed
- removed complicated and unnecessary _v0ObjectIndex, _v0ObjectInInventory, _v0ObjectFlag vars
- started to merge object id and type into one object value (type<<8|id)
- verb preposition ids do not dependent on language -> remove from VerbSettings
Note:
- objects with type=0 are foreground objects. They have a state, an owner and a bg overlay image.
- objects with type=1 are bg objects. They do not have a state or owner and are already contained in the bg image. The do not have an entry in objectState/OwnerTable
Note: the transition is not completed yet. The code compiles but is probably not runnable as not every occurrence of _activeInventory has been properly replaced.
The usage of _v0ObjectIndex and _v0ObjectInInventory should be revised too and both variables should be replaced by another mechanism (maybe by using a single variable "obj = (type << 8) | id").
- moved v0 only vars _activeInventory, _activeObject, _activeVerb from ScummEngine_v2 to ScummEngine_v0
- removed _activeActor, _activeInvExecute, _activeObject2Inv and _activeInventory. They are handled by _activeObject/_activeObjectType and _activeObject2/_activeObject2Type now.
- removed _activeObject(2)Index as they only bloat the code without any benefit (?)
- merge prep-name tables from ScummEngine_v2::drawPreposition() and ScummEngine_v0::drawSentenceWord() by introducing ScummEngine_v2::drawPreposition()
- rename ObjectData.flags -> obj_type (quick-fix only, needs review! Maybe obj_nr and obj_type can be merged into one var: obj_nr = (obj_type << 8) | obj_nr)
- o_unknown2 is negation of o_ifActiveObject (o_ifNotEqualActiveObject2)
- renamed o_ifActiveObject -> o_ifEqualActiveObject2 as it acts only on _activeObject2
- renamed ScummEngine_v0::drawSentenceWord() -> ScummEngine_v0::getObjectName()
Sounds are played that fast in fast-mode that the queue gets stuck.
This is just a workaround and only fixes the symptoms. Check the queue handling for a correct fix.
The A-acute, I-acute, O-acute and U-acute seem to be missing from the font,
and are now all remapped to their unaccented ASCII variants. I and A
were added by 303333352a, and this patch adds O and U.
This is assuming the CP850 encoding, which is not entirely verified.
See bugs #2040311 and #3483383.
Now all of the Archive API is implemented to avoid possibly inconsistent
behavior when an ArchiveMan object is accessed via a class type higher in the
class hierachy.
Formerly the hasFile method was non-const, thus did not overwrite the virtual
hasFile method of SearchSet. Since all accesses to this function have been
done through a ArchiveMan typed variable, the missing overwrite should not
have caused any trouble.
It looks like this was forgotten in a6ec4f70da.
Still missing:
- Air, constantly decreasing, fill up with breathing
- Health, decreases by collision with evil fish
- Death, when health == 0
- Picking up pearls
The BaseSound class does now only save the sound filename instead of a file
handle. When a new sound is started a new file handle is created, which
assures that each sound uses a different file handle and thus allows for
directly streaming sounds from disk.
This fixes bug #3475610
"AGOS: Wrong sound effects during intro of Simon 2 (DOS)".
During the game, different colors are used for subtitles depending
which character is speaking. This commit tries to use the same colors
for the cutscene subtitles. The color to use has to be specified in the
subtitle file between the frame end and the start of text using @1, @2,
@3 or @4 (for George, George as a narrator, Nicole and Maguire
respectively).
- The initial import of original save files will now use the next free available slots instead of moving the original files to the top of the save file list
- add error check to loading routine for original saves
- also limit debug console command to main menu, since it causes issues when used during the game or during character generation