diff --git a/engines/myst3/myst3.cpp b/engines/myst3/myst3.cpp index 34b23cdb9ec..3bacfc93505 100644 --- a/engines/myst3/myst3.cpp +++ b/engines/myst3/myst3.cpp @@ -469,4 +469,9 @@ void Myst3Engine::addSpotItem(uint16 id, uint16 condition, bool fade) { _node->loadSpotItem(*_archive, id, condition, fade); } +void Myst3Engine::addSunSpot(uint16 pitch, uint16 heading, uint16 intensity, + uint16 color, uint16 var, bool varControlledIntensity, uint16 radius) { + warning("Sunspots are not implemented"); +} + } // end of namespace Myst3 diff --git a/engines/myst3/myst3.h b/engines/myst3/myst3.h index f720e3c367d..e6854558d94 100644 --- a/engines/myst3/myst3.h +++ b/engines/myst3/myst3.h @@ -83,6 +83,8 @@ public: void playSimpleMovie(uint16 id); void addSpotItem(uint16 id, uint16 condition, bool fade); + void addSunSpot(uint16 pitch, uint16 heading, uint16 intensity, + uint16 color, uint16 var, bool varControlledIntensity, uint16 radius); void processInput(bool lookOnly); void drawFrame(); diff --git a/engines/myst3/script.cpp b/engines/myst3/script.cpp index f17886437e3..3096e5c9317 100644 --- a/engines/myst3/script.cpp +++ b/engines/myst3/script.cpp @@ -58,6 +58,14 @@ Script::Script(Myst3Engine *vm): OP_4( 25, movieInitOverrridePosition, kEvalValue, kCondition, kValue, kValue ); OP_3( 26, movieInitScriptedPosition, kEvalValue, kVar, kVar ); OP_2( 35, sunspotAdd, kValue, kValue ); + OP_3( 36, sunspotAddIntensity, kValue, kValue, kValue ); + OP_3( 37, sunspotAddVarIntensity, kValue, kValue, kVar ); + OP_4( 38, sunspotAddIntensityColor, kValue, kValue, kValue, kValue ); + OP_5( 39, sunspotAddVarIntensityColor, kValue, kValue, kValue, kValue, kVar ); + OP_4( 40, sunspotAddIntensityRadius, kValue, kValue, kValue, kValue ); + OP_5( 41, sunspotAddVarIntensityRadius, kValue, kValue, kValue, kVar, kValue ); + OP_5( 42, sunspotAddIntColorRadius, kValue, kValue, kValue, kValue, kValue ); + OP_5( 43, sunspotAddVarIntColorRadius, kValue, kValue, kValue, kValue, kVar ); // Six args OP_2( 44, inventoryAddFront, kVar, kValue ); OP_2( 45, inventoryAddBack, kVar, kValue ); OP_1( 46, inventoryRemove, kVar ); @@ -452,7 +460,91 @@ void Script::movieInitScriptedPosition(Context &c, const Opcode &cmd) { void Script::sunspotAdd(Context &c, const Opcode &cmd) { debugC(kDebugScript, "Opcode %d: Add sunspot: pitch %d heading %d", cmd.op, cmd.args[0], cmd.args[1]); - warning("Unimplemented opcode %d", cmd.op); + uint16 intensity = _vm->_vars->getSunspotIntensity(); + uint16 color = _vm->_vars->getSunspotColor(); + uint16 radius = _vm->_vars->getSunspotRadius(); + + _vm->addSunSpot(cmd.args[0], cmd.args[1], intensity, color, 1, false, radius); +} + +void Script::sunspotAddIntensity(Context &c, const Opcode &cmd) { + debugC(kDebugScript, "Opcode %d: Add sunspot: pitch %d heading %d", cmd.op, cmd.args[0], cmd.args[1]); + + uint16 intensity = cmd.args[2]; + uint16 color = _vm->_vars->getSunspotColor(); + uint16 radius = _vm->_vars->getSunspotRadius(); + + _vm->addSunSpot(cmd.args[0], cmd.args[1], intensity, color, 1, false, radius); +} + +void Script::sunspotAddVarIntensity(Context &c, const Opcode &cmd) { + debugC(kDebugScript, "Opcode %d: Add sunspot: pitch %d heading %d", cmd.op, cmd.args[0], cmd.args[1]); + + uint16 intensity = cmd.args[2]; + uint16 color = _vm->_vars->getSunspotColor(); + uint16 radius = _vm->_vars->getSunspotRadius(); + + _vm->addSunSpot(cmd.args[0], cmd.args[1], intensity, color, cmd.args[3], true, radius); +} + +void Script::sunspotAddIntensityColor(Context &c, const Opcode &cmd) { + debugC(kDebugScript, "Opcode %d: Add sunspot: pitch %d heading %d", cmd.op, cmd.args[0], cmd.args[1]); + + uint16 intensity = cmd.args[2]; + uint16 color = cmd.args[3]; + uint16 radius = _vm->_vars->getSunspotRadius(); + + _vm->addSunSpot(cmd.args[0], cmd.args[1], intensity, color, 1, false, radius); +} + +void Script::sunspotAddVarIntensityColor(Context &c, const Opcode &cmd) { + debugC(kDebugScript, "Opcode %d: Add sunspot: pitch %d heading %d", cmd.op, cmd.args[0], cmd.args[1]); + + uint16 intensity = cmd.args[2]; + uint16 color = cmd.args[3]; + uint16 radius = _vm->_vars->getSunspotRadius(); + + _vm->addSunSpot(cmd.args[0], cmd.args[1], intensity, color, cmd.args[4], true, radius); +} + +void Script::sunspotAddIntensityRadius(Context &c, const Opcode &cmd) { + debugC(kDebugScript, "Opcode %d: Add sunspot: pitch %d heading %d", cmd.op, cmd.args[0], cmd.args[1]); + + uint16 intensity = cmd.args[2]; + uint16 color = _vm->_vars->getSunspotColor(); + uint16 radius = cmd.args[3]; + + _vm->addSunSpot(cmd.args[0], cmd.args[1], intensity, color, 1, false, radius); +} + +void Script::sunspotAddVarIntensityRadius(Context &c, const Opcode &cmd) { + debugC(kDebugScript, "Opcode %d: Add sunspot: pitch %d heading %d", cmd.op, cmd.args[0], cmd.args[1]); + + uint16 intensity = cmd.args[2]; + uint16 color = _vm->_vars->getSunspotColor(); + uint16 radius = cmd.args[4]; + + _vm->addSunSpot(cmd.args[0], cmd.args[1], intensity, color, cmd.args[3], true, radius); +} + +void Script::sunspotAddIntColorRadius(Context &c, const Opcode &cmd) { + debugC(kDebugScript, "Opcode %d: Add sunspot: pitch %d heading %d", cmd.op, cmd.args[0], cmd.args[1]); + + uint16 intensity = cmd.args[2]; + uint16 color = cmd.args[3]; + uint16 radius = cmd.args[4]; + + _vm->addSunSpot(cmd.args[0], cmd.args[1], intensity, color, 1, false, radius); +} + +void Script::sunspotAddVarIntColorRadius(Context &c, const Opcode &cmd) { + debugC(kDebugScript, "Opcode %d: Add sunspot: pitch %d heading %d", cmd.op, cmd.args[0], cmd.args[1]); + + uint16 intensity = cmd.args[2]; + uint16 color = cmd.args[3]; + uint16 radius = cmd.args[5]; + + _vm->addSunSpot(cmd.args[0], cmd.args[1], intensity, color, cmd.args[4], true, radius); } void Script::inventoryAddFront(Context &c, const Opcode &cmd) { diff --git a/engines/myst3/script.h b/engines/myst3/script.h index b91963b8105..63882a3444b 100644 --- a/engines/myst3/script.h +++ b/engines/myst3/script.h @@ -113,6 +113,14 @@ private: DECLARE_OPCODE(movieInitOverrridePosition); DECLARE_OPCODE(movieInitScriptedPosition); DECLARE_OPCODE(sunspotAdd); + DECLARE_OPCODE(sunspotAddIntensity); + DECLARE_OPCODE(sunspotAddVarIntensity); + DECLARE_OPCODE(sunspotAddIntensityColor); + DECLARE_OPCODE(sunspotAddVarIntensityColor); + DECLARE_OPCODE(sunspotAddIntensityRadius); + DECLARE_OPCODE(sunspotAddVarIntensityRadius); + DECLARE_OPCODE(sunspotAddIntColorRadius); + DECLARE_OPCODE(sunspotAddVarIntColorRadius); DECLARE_OPCODE(inventoryAddFront); DECLARE_OPCODE(inventoryAddBack); DECLARE_OPCODE(inventoryRemove); diff --git a/engines/myst3/variables.cpp b/engines/myst3/variables.cpp index 059c70e5c79..9630e0cd6cd 100644 --- a/engines/myst3/variables.cpp +++ b/engines/myst3/variables.cpp @@ -32,6 +32,10 @@ Variables::Variables(Myst3Engine *vm): VAR(62, LocationRoom, false) VAR(63, LocationNode, false) + VAR(115, SunspotIntensity, false) + VAR(116, SunspotColor, false) + VAR(117, SunspotRadius, false) + VAR(142, MovieOverrideStartFrame, true) VAR(143, MovieOverrideEndFrame, true) VAR(144, MovieVolume1, true) diff --git a/engines/myst3/variables.h b/engines/myst3/variables.h index 35497448326..d9c4cbe6f24 100644 --- a/engines/myst3/variables.h +++ b/engines/myst3/variables.h @@ -54,6 +54,10 @@ public: DECLARE_VAR(62, LocationRoom) DECLARE_VAR(63, LocationNode) + DECLARE_VAR(115, SunspotIntensity) + DECLARE_VAR(116, SunspotColor) + DECLARE_VAR(117, SunspotRadius) + DECLARE_VAR(142, MovieStartFrame) DECLARE_VAR(143, MovieEndFrame) DECLARE_VAR(149, MovieConditionBit)