Ejemplo n.º 1
0
void OSpit::xooffice30_closebook(const ArgumentArray &args) {
	// Close the blank linking book if it's open
	uint32 &book = _vm->_vars["odeskbook"];
	if (book != 1)
		return;

	// Set the variable to be "closed"
	book = 0;

	// Play the movie
	RivenVideo *video = _vm->_video->openSlot(1);
	video->seek(0);
	video->playBlocking();

	// Set the hotspots into their correct states
	RivenHotspot *closeBook = _vm->getCard()->getHotspotByName("closeBook");
	RivenHotspot *nullHotspot = _vm->getCard()->getHotspotByName("null");
	RivenHotspot *openBook = _vm->getCard()->getHotspotByName("openBook");

	closeBook->enable(false);
	nullHotspot->enable(false);
	openBook->enable(true);

	_vm->getCard()->drawPicture(1);
}
Ejemplo n.º 2
0
void BSpit::valveChangePosition(uint32 valvePosition, uint16 videoId, uint16 pictureId) {
	RivenVideo *video = _vm->_video->openSlot(videoId);
	video->seek(0);
	video->playBlocking();

	_vm->getCard()->drawPicture(pictureId);

	// If we changed state and the new state is that the valve is flowing to
	// the boiler, we need to update the boiler state.
	if (valvePosition == 1) {
		// Check which way the water is going at the boiler
		if (_vm->_vars["bidvlv"] == 1) {
			if (_vm->_vars["bblrarm"] == 1 && _vm->_vars["bblrwtr"] == 1) {
				// If the pipe is open, make sure the water is drained out
				_vm->_vars["bheat"] = 0;
				_vm->_vars["bblrwtr"] = 0;
				_vm->_sound->playCardSound("bBlrFar");
			}

			if (_vm->_vars["bblrarm"] == 0 && _vm->_vars["bblrwtr"] == 0) {
				// If the pipe is closed, fill the boiler again
				_vm->_vars["bheat"] = _vm->_vars["bblrvalve"];
				_vm->_vars["bblrwtr"] = 1;
				_vm->_sound->playCardSound("bBlrFar");
			}
		} else {
			// Have the grating inside the boiler match the switch outside
			_vm->_vars["bblrgrt"] = (_vm->_vars["bblrsw"] == 1) ? 0 : 1;
		}
	}

	_vm->_vars["bvalve"] = valvePosition;
}
Ejemplo n.º 3
0
void RivenVideoManager::updateMovies() {
	for (VideoList::iterator it = _videos.begin(); it != _videos.end(); it++) {
		RivenVideo *video = *it;
		// Check of the video has reached the end
		if (video->endOfVideo()) {
			if (video->isPlaying() && video->isLooping()) {
				// Seek back if looping
				video->seek(0);
			} else {
				continue;
			}
		}

		// Check if we need to draw a frame
		if (video->needsUpdate()) {
			video->drawNextFrame();
		}
	}
}
Ejemplo n.º 4
0
void BSpit::xbchipper(const ArgumentArray &args) {
	Common::Point startPos = getMouseDragStartPosition();

	bool pulledLever = false;
	while (mouseIsDown() && !_vm->hasGameEnded()) {
		Common::Point pos = getMousePosition();
		if (pos.y > startPos.y) {
			pulledLever = true;
			break;
		}

		_vm->doFrame();
	}

	if (pulledLever) {
		RivenVideo *video = _vm->_video->openSlot(2);
		video->seek(0);
		video->playBlocking();
	}
}