示例#1
0
void ofApp::update() {
	ofBackground(0);
	
    #ifdef INTERACTIVE
        if(playState <= 1) {
            #ifdef KINECT
                updateKinect();
            #else
                updateWebcam();
            #endif
            
            updateBlobs();
            updateFBOs();
            if(ofGetFrameNum() % 60 == 0) {
                updateBrightness();
            }
        }
        else if(playState >= 2) {
            updateMovies();
        }
    #else
        if (playState == 1) playState = 2;
        updateMovies();
    #endif

	// Write
	if(ofGetMinutes() % 10 == 0) {
        writeDiagnostics();
	}

}
示例#2
0
文件: video.cpp 项目: murgo/scummvm
void VideoManager::drawVideoFrame(VideoHandle handle, Audio::Timestamp time) {
	assert(handle != NULL_VID_HANDLE);
	_videoStreams[handle]->seek(time);
	updateMovies();
	delete _videoStreams[handle].video;
	_videoStreams[handle].clear();
}
示例#3
0
void VideoManager::drawVideoFrame(VideoHandle handle, const Audio::Timestamp &time) {
	// FIXME: This should be done separately from the "playing"
	// videos eventually.
	assert(handle);
	handle->seek(time);
	updateMovies();
	handle->close();
}
示例#4
0
void VideoManager::delayUntilMovieEnds(VideoHandle videoHandle) {
	while (!_videoStreams[videoHandle].endOfVideo() && !_vm->shouldQuit()) {
		if (updateMovies())
			_vm->_system->updateScreen();

		// Cut down on CPU usage
		_vm->_system->delayMillis(10);
	}

	delete _videoStreams[videoHandle].video;
	_videoStreams[videoHandle].clear();
}
示例#5
0
void VideoManager::waitUntilMovieEnds(VideoHandle videoHandle) {
	if (!videoHandle)
		return;

	// Sanity check
	if (videoHandle._ptr->isLooping())
		error("Called waitUntilMovieEnds() on a looping video");

	bool continuePlaying = true;

	while (!videoHandle->endOfVideo() && !_vm->shouldQuit() && continuePlaying) {
		if (updateMovies())
			_vm->_system->updateScreen();

		Common::Event event;
		while (_vm->_system->getEventManager()->pollEvent(event)) {
			switch (event.type) {
			case Common::EVENT_RTL:
			case Common::EVENT_QUIT:
				continuePlaying = false;
				break;
			case Common::EVENT_KEYDOWN:
				switch (event.kbd.keycode) {
				case Common::KEYCODE_SPACE:
					_vm->pauseGame();
					break;
				case Common::KEYCODE_ESCAPE:
					continuePlaying = false;
					_vm->doVideoTimer(videoHandle, true);
					break;
				default:
					break;
			}
			default:
				break;
			}
		}

		// Cut down on CPU usage
		_vm->_system->delayMillis(10);
	}

	// Ensure it's removed
	removeEntry(videoHandle._ptr);
}
示例#6
0
void VideoManager::waitUntilMovieEnds(VideoHandle videoHandle) {
	if (videoHandle == NULL_VID_HANDLE)
		return;

	bool continuePlaying = true;

	while (!_videoStreams[videoHandle].endOfVideo() && !_vm->shouldQuit() && continuePlaying) {
		_vm->_sound->updateSLST(); // Must update ambient sound fading for Riven while movie is playing
		if (updateMovies())
			_vm->_system->updateScreen();

		Common::Event event;
		while (_vm->_system->getEventManager()->pollEvent(event)) {
			switch (event.type) {
			case Common::EVENT_RTL:
			case Common::EVENT_QUIT:
				continuePlaying = false;
				break;
			case Common::EVENT_KEYDOWN:
				switch (event.kbd.keycode) {
				case Common::KEYCODE_SPACE:
					_vm->pauseGame();
					break;
				case Common::KEYCODE_ESCAPE:
					continuePlaying = false;
					_vm->doVideoTimer(videoHandle, true);
					break;
				default:
					break;
			}
			default:
				break;
			}
		}

		// Cut down on CPU usage
		_vm->_system->delayMillis(10);
	}

	delete _videoStreams[videoHandle].video;
	_videoStreams[videoHandle].clear();
}
示例#7
0
void CGameManager::update() {
	updateMovies();
	frameMessage(getRoom());
	_timers.update(g_vm->_events->getTicksCount());
	_trueTalkManager.removeCompleted();

	CScreenManager::_screenManagerPtr->_mouseCursor->update();

	CViewItem *view = getView();
	if (view) {
		// Expand the game manager's bounds to encompass all the view's items
		for (CTreeItem *item = view; item; item = item->scan(view)) {
			Rect r = item->getBounds();
			if (!r.isEmpty())
				_bounds.extend(r);
		}

		// Also include the PET control in the bounds
		if (_project) {
			CPetControl *pet = _project->getPetControl();
			if (pet)
				_bounds.extend(pet->getBounds());
		}

		// And the text cursor
		CScreenManager *screenManager = CScreenManager::_screenManagerPtr;
		CTextCursor *textCursor = screenManager->_textCursor;
		if (textCursor && textCursor->_active)
			_bounds.extend(textCursor->getCursorBounds());
		
		// Set the surface bounds
		screenManager->setSurfaceBounds(SURFACE_BACKBUFFER, _bounds);

		// Handle redrawing the view
		if (!_bounds.isEmpty()) {
			_gameView->draw(_bounds);
			_bounds = Rect();
		}

		_gameState.checkForViewChange();
	}
}
示例#8
0
void VideoManager::delayUntilMovieEnds(VideoHandle videoHandle) {
	// FIXME: Why is this separate from waitUntilMovieEnds?
	// It seems to only cut out the event loop (which is bad).

	if (!videoHandle)
		return;

	// Sanity check
	if (videoHandle._ptr->isLooping())
		error("Called delayUntilMovieEnds() on a looping video");

	while (!videoHandle->endOfVideo() && !_vm->shouldQuit()) {
		if (updateMovies())
			_vm->_system->updateScreen();

		// Cut down on CPU usage
		_vm->_system->delayMillis(10);
	}

	// Ensure it's removed
	removeEntry(videoHandle._ptr);
}