void TSpit::xt7800_setup(const ArgumentArray &args) { // First, let's store the base receptacle hotspots for the marbles if (_marbleBaseHotspots.empty()) for (uint16 i = 0; i < kMarbleCount; i++) { RivenHotspot *marbleHotspot = _vm->getCard()->getHotspotByName(s_marbleNames[i]); _marbleBaseHotspots.push_back(marbleHotspot->getRect()); } // Move the marble hotspots based on their position variables setMarbleHotspots(); _vm->_vars["themarble"] = 0; }
void TSpit::drawMarbles() { _vm->_gfx->beginScreenUpdate(); for (uint32 i = 0; i < kMarbleCount; i++) { // Don't draw the marble if we're holding it if (_vm->_vars["themarble"] - 1 == i) continue; RivenHotspot *marbleHotspot = _vm->getCard()->getHotspotByName(s_marbleNames[i]); Common::Rect rect = marbleHotspot->getRect(); // Trim the rect down a bit rect.left += 3; rect.top += 3; rect.right -= 2; rect.bottom -= 2; _vm->_gfx->drawExtrasImage(i + 200, rect); } _vm->_gfx->applyScreenUpdate(); }
bool RivenConsole::Cmd_Hotspots(int argc, const char **argv) { Common::Array<RivenHotspot *> hotspots = _vm->getCard()->getHotspots(); debugPrintf("Current card (%d) has %d hotspots:\n", _vm->getCard()->getId(), hotspots.size()); for (uint16 i = 0; i < hotspots.size(); i++) { RivenHotspot *hotspot = hotspots[i]; debugPrintf("Hotspot %d, index %d, BLST ID %d (", i, hotspot->getIndex(), hotspot->getBlstId()); if (hotspot->isEnabled()) debugPrintf("enabled"); else debugPrintf("disabled"); Common::Rect rect = hotspot->getRect(); debugPrintf(") - (%d, %d, %d, %d)\n", rect.left, rect.top, rect.right, rect.bottom); debugPrintf(" Name = %s\n", hotspot->getName().c_str()); } return true; }
void OSpit::xbookclick(const ArgumentArray &args) { // Let's hook onto our video RivenVideo *video = _vm->_video->getSlot(args[0]); // Convert from the standard QuickTime base time to milliseconds // The values are in terms of 1/600 of a second. // Have I said how much I just *love* QuickTime? </sarcasm> uint32 startTime = args[1] * 1000 / 600; uint32 endTime = args[2] * 1000 / 600; // Track down our hotspot Common::String hotspotName = Common::String::format("touchBook%d", args[3]); RivenHotspot *hotspot = _vm->getCard()->getHotspotByName(hotspotName); Common::Rect hotspotRect = hotspot->getRect(); debug(0, "xbookclick:"); debug(0, "\tVideo Code = %d", args[0]); debug(0, "\tStart Time = %dms", startTime); debug(0, "\tEnd Time = %dms", endTime); debug(0, "\tHotspot = %d -> %s", args[3], hotspotName.c_str()); // Just let the video play while we wait until Gehn opens the trap book for us while (video->getTime() < startTime && !_vm->hasGameEnded()) { _vm->doFrame(); } // Break out if we're quitting if (_vm->hasGameEnded()) return; // OK, Gehn has opened the trap book and has asked us to go in. Let's watch // and see what the player will do... while (video->getTime() < endTime && !_vm->hasGameEnded()) { if (hotspotRect.contains(getMousePosition())) _vm->_cursor->setCursor(kRivenOpenHandCursor); else _vm->_cursor->setCursor(kRivenMainCursor); if (mouseIsDown()) { if (hotspotRect.contains(getMousePosition())) { // OK, we've used the trap book! We go for ride lady! _vm->_video->closeVideos(); // Stop all videos _vm->_cursor->setCursor(kRivenHideCursor); // Hide the cursor _vm->_gfx->scheduleTransition(kRivenTransitionBlend); _vm->getCard()->drawPicture(3); // Black out the screen _vm->_sound->playSound(0); // Play the link sound _vm->delay(12000); _vm->getCard()->playMovie(7); // Activate Gehn Link Video RivenVideo *linkVideo = _vm->_video->openSlot(1); // Play Gehn Link Video linkVideo->playBlocking(); _vm->_vars["ocage"] = 1; _vm->_vars["agehn"] = 4; // Set Gehn to the trapped state _vm->_vars["atrapbook"] = 1; // We've got the trap book again _vm->_sound->playSound(0); // Play the link sound again _vm->_gfx->scheduleTransition(kRivenTransitionBlend); _vm->changeToCard(_vm->getStack()->getCardStackId(0x2885)); // Link out! _vm->_inventory->forceVisible(true); _vm->delay(2000); _vm->_inventory->forceVisible(false); _vm->_scriptMan->stopAllScripts(); // Stop all running scripts (so we don't remain in the cage) return; } } _vm->doFrame(); } // Break out if we're quitting if (_vm->hasGameEnded()) return; // If there was no click and this is the third time Gehn asks us to // use the trap book, he will shoot the player. Dead on arrival. // Run the credits from here. if (_vm->_vars["agehn"] == 3) { runCredits(args[0], 5000, 995); return; } // There was no click, so just play the rest of the video. video->playBlocking(); }