Exemplo n.º 1
0
void MystScriptParser::runScript(MystScript script, MystResource *invokingResource) {
	debugC(kDebugScript, "Script Size: %d", script->size());
	for (uint16 i = 0; i < script->size(); i++) {
		MystScriptEntry &entry = script->operator[](i);
		debugC(kDebugScript, "\tOpcode %d: %d", i, entry.opcode);

		if (entry.type == kMystScriptNormal)
			_invokingResource = invokingResource;
		else
			_invokingResource = _vm->_resources[entry.resourceId];

		runOpcode(entry.opcode, entry.var, entry.argc, entry.argv);
	}
}
Exemplo n.º 2
0
void MystScriptParser::runScript(const MystScript &script, MystArea *invokingResource) {
	_scriptNestingLevel++;

	for (uint16 i = 0; i < script.size(); i++) {
		const MystScriptEntry &entry = script[i];

		if (entry.type == kMystScriptNormal)
			_invokingResource = invokingResource;
		else
			_invokingResource = _vm->getCard()->getResource<MystArea>(entry.resourceId);

		runOpcode(entry.opcode, entry.var, entry.args);
	}

	_scriptNestingLevel--;
}
Exemplo n.º 3
0
void MystScriptParser::runScript(MystScript script, MystArea *invokingResource) {
	debugC(kDebugScript, "Script Size: %d", script->size());

	// Scripted drawing takes more time to simulate older hardware
	// This way opcodes can't overwrite what the previous ones drew too quickly
	_vm->_gfx->enableDrawingTimeSimulation(true);

	for (uint16 i = 0; i < script->size(); i++) {
		MystScriptEntry &entry = (*script)[i];
		debugC(kDebugScript, "\tOpcode %d: %d", i, entry.opcode);

		if (entry.type == kMystScriptNormal)
			_invokingResource = invokingResource;
		else
			_invokingResource = _vm->_resources[entry.resourceId];

		runOpcode(entry.opcode, entry.var, entry.argc, entry.argv);
	}

	_vm->_gfx->enableDrawingTimeSimulation(false);
}