示例#1
0
void ThemeEngine::listUsableThemes(Common::List<ThemeDescriptor> &list) {
#ifndef DISABLE_GUI_BUILTIN_THEME
	ThemeDescriptor th;
	th.name = "ScummVM Classic Theme (Builtin Version)";
	th.id = "builtin";
	th.filename.clear();
	list.push_back(th);
#endif

	if (ConfMan.hasKey("themepath"))
		listUsableThemes(Common::FSNode(ConfMan.get("themepath")), list);

	listUsableThemes(SearchMan, list);

	// Now we need to strip all duplicates
	// TODO: It might not be the best idea to strip duplicates. The user might
	// have different versions of a specific theme in his paths, thus this code
	// might show him the wrong version. The problem is we have no ways of checking
	// a theme version currently. Also since we want to avoid saving the full path
	// in the config file we can not do any better currently.
	Common::List<ThemeDescriptor> output;

	for (Common::List<ThemeDescriptor>::const_iterator i = list.begin(); i != list.end(); ++i) {
		if (Common::find_if(output.begin(), output.end(), TDComparator(i->id)) == output.end())
			output.push_back(*i);
	}

	list = output;
	output.clear();
}
示例#2
0
void MoviePlayer::play(MovieText *movieTexts, uint32 numMovieTexts, uint32 leadIn, uint32 leadOut) {
    // This happens when quitting during the "eye" cutscene.
    if (_vm->shouldQuit())
        return;

    _leadOutFrame = _decoder->getFrameCount();
    if (_leadOutFrame > 60)
        _leadOutFrame -= 60;

    _movieTexts = movieTexts;
    _numMovieTexts = numMovieTexts;
    _currentMovieText = 0;
    _leadOut = leadOut;

    if (leadIn) {
        _vm->_sound->playMovieSound(leadIn, kLeadInSound);
    }

    if (_bgSoundStream) {
        _snd->playInputStream(Audio::Mixer::kSFXSoundType, _bgSoundHandle, _bgSoundStream);
    }

    bool terminated = false;

    Common::List<Common::Event> stopEvents;
    Common::Event stopEvent;
    stopEvents.clear();
    stopEvent.type = Common::EVENT_KEYDOWN;
    stopEvent.kbd = Common::KEYCODE_ESCAPE;
    stopEvents.push_back(stopEvent);

    terminated = !playVideo(stopEvents);

    closeTextObject(_currentMovieText, NULL);

    if (terminated) {
        _snd->stopHandle(*_bgSoundHandle);
        _vm->_sound->stopMovieSounds();
        _vm->_sound->stopSpeech();
    }

    while (_snd->isSoundHandleActive(*_bgSoundHandle))
        _system->delayMillis(100);
}