当前位置: 首页>>代码示例>>C++>>正文


C++ Choice类代码示例

本文整理汇总了C++中Choice的典型用法代码示例。如果您正苦于以下问题:C++ Choice类的具体用法?C++ Choice怎么用?C++ Choice使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Choice类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: prepareCondition

void Controller::handlePut(Key& key, shared_ptr<Value> value,
        const Requirements& requirements) {
    Condition condition = prepareCondition(key, value->getSize(), requirements);
    {
        lock_guard<mutex> gurad(infoLock);
        info[key] = KeyInfo{make_unique<Requirements>(requirements),
            value->getSize()};
    }
    double estimatedCost;
    Choice* choice = decider->choose(condition, &estimatedCost);
    if (choice == nullptr) {
        throw NoChoiceAvailableException();
    }
    accountant->recordEstimate(estimatedCost);
    accountant->recordPut(choice->getId(), value->getSize());
    storeInto(key, value, *choice, requirements);
    choice_id old_choice_id = memory->remember(key, choice->getId());
    if (old_choice_id != 0) {
        auto it = choices.find(old_choice_id);
        assert(it != choices.end());
        Choice& old_choice = it->second;
        old_choice.getActor()->del(key, old_choice.getProfile());
    }
    estimator->notifyPut(key, requirements);
    if (enableStat) {
        stat->notifyPut(key);
    }
}
开发者ID:columbia,项目名称:grandet,代码行数:28,代码来源:controller.cpp

示例2: ScrollView

void DeveloperToolsScreen::CreateViews() {
	using namespace UI;
	root_ = new ScrollView(ORIENT_VERTICAL);

	I18NCategory *d = GetI18NCategory("Dialog");
	I18NCategory *de = GetI18NCategory("Developer");
	I18NCategory *gs = GetI18NCategory("Graphics");
	I18NCategory *a = GetI18NCategory("Audio");
	I18NCategory *s = GetI18NCategory("System");

	LinearLayout *list = root_->Add(new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(1.0f)));
	list->SetSpacing(0);
	list->Add(new ItemHeader(s->T("General")));
	list->Add(new Choice(de->T("System Information")))->OnClick.Handle(this, &DeveloperToolsScreen::OnSysInfo);
	list->Add(new CheckBox(&g_Config.bShowDeveloperMenu, de->T("Show Developer Menu")));

	Choice *cpuTests = new Choice(de->T("Run CPU Tests"));
	list->Add(cpuTests)->OnClick.Handle(this, &DeveloperToolsScreen::OnRunCPUTests);
#ifdef IOS
	const std::string testDirectory = g_Config.flash0Directory + "../";
#else
	const std::string testDirectory = g_Config.memCardDirectory;
#endif
	if (!File::Exists(testDirectory + "pspautotests/tests/")) {
		cpuTests->SetEnabled(false);
	}

	list->Add(new CheckBox(&g_Config.bEnableLogging, de->T("Enable Logging")))->OnClick.Handle(this, &DeveloperToolsScreen::OnLoggingChanged);
	list->Add(new Choice(de->T("Logging Channels")))->OnClick.Handle(this, &DeveloperToolsScreen::OnLogConfig);
	list->Add(new ItemHeader(de->T("Language")));
	list->Add(new Choice(de->T("Load language ini")))->OnClick.Handle(this, &DeveloperToolsScreen::OnLoadLanguageIni);
	list->Add(new Choice(de->T("Save language ini")))->OnClick.Handle(this, &DeveloperToolsScreen::OnSaveLanguageIni);
	list->Add(new Choice(d->T("Back")))->OnClick.Handle(this, &DeveloperToolsScreen::OnBack);
}
开发者ID:Carter07,项目名称:ppsspp,代码行数:34,代码来源:GameSettingsScreen.cpp

示例3: Clear

void ControlMapper::Refresh() {
	Clear();
	I18NCategory *c = GetI18NCategory("MappableControls");

	std::map<std::string, int> keyImages;
	keyImages["Circle"] = I_CIRCLE;
	keyImages["Cross"] = I_CROSS;
	keyImages["Square"] = I_SQUARE;
	keyImages["Triangle"] = I_TRIANGLE;
	keyImages["Start"] = I_START;
	keyImages["Select"] = I_SELECT;
	keyImages["L"] = I_L;
	keyImages["R"] = I_R;

	using namespace UI;

	LinearLayout *root = Add(new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));

	auto iter = keyImages.find(keyName_);
	// First, look among images.
	if (iter != keyImages.end()) {
		root->Add(new Choice(iter->second, new LinearLayoutParams(200, WRAP_CONTENT)))->OnClick.Handle(this, &ControlMapper::OnReplaceAll);
	} else {
		// No image? Let's translate.
		Choice *choice = new Choice(c->T(keyName_.c_str()), new LinearLayoutParams(200, WRAP_CONTENT));
		choice->SetCentered(true);
		root->Add(choice)->OnClick.Handle(this, &ControlMapper::OnReplaceAll);
	}

	LinearLayout *rightColumn = root->Add(new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(1.0f)));
	rightColumn->SetSpacing(2.0f);
	std::vector<KeyDef> mappings;
	KeyMap::KeyFromPspButton(pspKey_, &mappings);

	for (size_t i = 0; i < mappings.size(); i++) {
		std::string deviceName = GetDeviceName(mappings[i].deviceId);
		std::string keyName = KeyMap::GetKeyOrAxisName(mappings[i].keyCode);
		int image = -1;

		LinearLayout *row = rightColumn->Add(new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));

		Choice *c = row->Add(new Choice(deviceName + "." + keyName, new LinearLayoutParams(1.0f)));
		char tagbuf[16];
		sprintf(tagbuf, "%i", (int)i);
		c->SetTag(tagbuf);
		c->OnClick.Handle(this, &ControlMapper::OnReplace);

		Choice *d = row->Add(new Choice("X"));
		d->SetTag(tagbuf);
		d->OnClick.Handle(this, &ControlMapper::OnDelete);

		row->Add(new Choice("+"))->OnClick.Handle(this, &ControlMapper::OnAdd);
	}

	if (mappings.size() == 0) {
		// look like an empty line
		rightColumn->Add(new Choice("", new LinearLayoutParams(WRAP_CONTENT, WRAP_CONTENT)))->OnClick.Handle(this, &ControlMapper::OnAdd);
	}
}
开发者ID:andont,项目名称:ppsspp,代码行数:59,代码来源:ControlMappingScreen.cpp

示例4: AddFileButton

void FileManager::AddFileButton(const wstring info, const string picN, const string coverN, const string coverCN, const string clickedN, const float pX, const float pY, const float cX, const float cY, 
	unsigned int a, const float bX, const float bY,const unsigned int bW, const unsigned int bH)
{
	Choice button;
	button.Init(picN,coverN,coverCN,clickedN,pX,pY,cX,cY,a,bX,bY,bW,bH);
	button.SetInfo(info);
	fileButtons.push_back(button);
}
开发者ID:nashdal13,项目名称:Iris_gal_maker,代码行数:8,代码来源:FileManager.cpp

示例5: Choice

void ShaderListScreen::ListShaders(DebugShaderType shaderType, UI::LinearLayout *view) {
	using namespace UI;
	std::vector<std::string> shaderIds_ = gpu->DebugGetShaderIDs(shaderType);
	for (auto id : shaderIds_) {
		Choice *choice = view->Add(new Choice(gpu->DebugGetShaderString(id, shaderType, SHADER_STRING_SHORT_DESC)));
		choice->SetTag(id);
		choice->OnClick.Handle(this, &ShaderListScreen::OnShaderClick);
	}
}
开发者ID:JhonBob,项目名称:ppsspp,代码行数:9,代码来源:DevScreens.cpp

示例6: storeInto

void Controller::storeInto(Key& key, shared_ptr<Value> value,
        const Choice& choice, const Requirements& requirements) {
    Actor* actor = choice.getActor();
    Dbg() << "chose " << choice.desc() << " for this" << endl;
    if (requirements.metadata.empty()) {
        actor->put(key, value, choice.getProfile());
    } else {
        actor->put(key, value, choice.getProfile(), &requirements.metadata);
    }
}
开发者ID:columbia,项目名称:grandet,代码行数:10,代码来源:controller.cpp

示例7: ScrollView

void DeveloperToolsScreen::CreateViews() {
	using namespace UI;
	root_ = new ScrollView(ORIENT_VERTICAL);

	I18NCategory *d = GetI18NCategory("Dialog");
	I18NCategory *de = GetI18NCategory("Developer");
	I18NCategory *gs = GetI18NCategory("Graphics");
	I18NCategory *a = GetI18NCategory("Audio");
	I18NCategory *s = GetI18NCategory("System");

	LinearLayout *list = root_->Add(new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(1.0f)));
	list->SetSpacing(0);
	list->Add(new ItemHeader(s->T("General")));

#ifdef IOS
	if (!iosCanUseJit) {
		list->Add(new TextView(s->T("DynarecisJailed", "Dynarec (JIT) - (Not jailbroken - JIT not available)")));
	} else {
		auto jitCheckbox = new CheckBox(&g_Config.bJit, s->T("Dynarec", "Dynarec (JIT)"));
		jitCheckbox->SetEnabled(!PSP_IsInited());
		list->Add(jitCheckbox);
	}
#else
	auto jitCheckbox = new CheckBox(&g_Config.bJit, s->T("Dynarec", "Dynarec (JIT)"));
	jitCheckbox->SetEnabled(!PSP_IsInited());
	list->Add(jitCheckbox);
#endif

	list->Add(new Choice(de->T("System Information")))->OnClick.Handle(this, &DeveloperToolsScreen::OnSysInfo);
	list->Add(new CheckBox(&g_Config.bShowDeveloperMenu, de->T("Show Developer Menu")));
	list->Add(new CheckBox(&g_Config.bDumpDecryptedEboot, de->T("Dump Decrypted Eboot", "Dump Decrypted EBOOT.BIN (If Encrypted) When Booting Game")));

	Choice *cpuTests = new Choice(de->T("Run CPU Tests"));
	list->Add(cpuTests)->OnClick.Handle(this, &DeveloperToolsScreen::OnRunCPUTests);
#ifdef IOS
	const std::string testDirectory = g_Config.flash0Directory + "../";
#else
	const std::string testDirectory = g_Config.memCardDirectory;
#endif
	if (!File::Exists(testDirectory + "pspautotests/tests/")) {
		cpuTests->SetEnabled(false);
	}

	list->Add(new CheckBox(&g_Config.bEnableLogging, de->T("Enable Logging")))->OnClick.Handle(this, &DeveloperToolsScreen::OnLoggingChanged);
	list->Add(new Choice(de->T("Logging Channels")))->OnClick.Handle(this, &DeveloperToolsScreen::OnLogConfig);
	list->Add(new ItemHeader(de->T("Language")));
	list->Add(new Choice(de->T("Load language ini")))->OnClick.Handle(this, &DeveloperToolsScreen::OnLoadLanguageIni);
	list->Add(new Choice(de->T("Save language ini")))->OnClick.Handle(this, &DeveloperToolsScreen::OnSaveLanguageIni);
	list->Add(new ItemHeader(""));
	list->Add(new Choice(d->T("Back")))->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);
}
开发者ID:ShadarMan,项目名称:ppsspp,代码行数:51,代码来源:GameSettingsScreen.cpp

示例8: guard

void Controller::checkMigration(Key& key, const Choice& current,
        bool extraGet, shared_ptr<Value> valueGot) {
    Requirements requirements;
    size_t size;
    {
        lock_guard<mutex> guard(infoLock);
        if (info.count(key) == 0) return;
        requirements = *info[key].requirements.get();
        size = info[key].size;
    }
    Condition condition = prepareCondition(key, size, requirements);
    double estimatedCost;
    Choice* choice = decider->findBetter(condition, current, extraGet,
            &estimatedCost);
    if (choice != nullptr) {
        Dbg() << "migrating from " << current.desc() << " to " << choice->desc() << endl;
        shared_ptr<Value> value;
        Requirements migrateRequirements;
        if (extraGet) {
            value = current.getActor()->get(key, current.getProfile());
        } else {
            value = valueGot;
        }
        storeInto(key, value, *choice, requirements);
        choice_id old_id = memory->remember(key, choice->getId());
        deleteFrom(key, current);
        accountant->recordMigrate(current.getId(), choice->getId(), size,
                extraGet);
    }
}
开发者ID:columbia,项目名称:grandet,代码行数:30,代码来源:controller.cpp

示例9: assert

//==== Create & Init Choice  ====//
void GroupLayout::AddChoice( Choice & choice, const char* label, int used_w )
{
    assert( m_Group && m_Screen );

    //==== Choice Button ====//
    VspButton* button = new VspButton( m_X, m_Y, m_ChoiceButtonWidth, m_StdHeight, label );
    button->box( FL_THIN_UP_BOX );
    button->labelfont( 1 );
    button->labelsize( 12 );
    button->labelcolor( FL_BLACK );
    button->copy_label( label );
    m_Group->add( button );
    AddX( m_ChoiceButtonWidth );

    //==== Choice Picker ====//
    int choice_w = FitWidth( m_ChoiceButtonWidth + used_w, m_SliderWidth );
    Fl_Choice* fl_choice = new Fl_Choice( m_X, m_Y, choice_w, m_StdHeight );
    fl_choice->down_box( FL_BORDER_BOX );
    fl_choice->textfont( 1 );
    fl_choice->textsize( 12 );
    fl_choice->textcolor( FL_DARK_BLUE );
    m_Group->add( fl_choice );
    AddX( choice_w );

    //==== Add Choice Text ===//
    vector< string > choice_vec = choice.GetItems();
    for ( int i = 0 ; i < ( int )choice_vec.size() ; i++ )
    {
        fl_choice->add( choice_vec[i].c_str() );
    }
    fl_choice->value( 0 );

    choice.Init( m_Screen, fl_choice, button );

    if( strcmp( label, "AUTO_UPDATE" ) == 0 || strcmp( label, "" ) == 0 )
    {
        choice.SetButtonNameUpdate( true );
    }

    AddY( m_StdHeight );
    NewLineX();

}
开发者ID:Mr-Kumar-Abhishek,项目名称:OpenVSP,代码行数:44,代码来源:GroupLayout.cpp

示例10: SpaceIllegalAlternative

 void
 Space::_trycommit(const Choice& c, unsigned int a) {
   if (a >= c.alternatives())
     throw SpaceIllegalAlternative("Space::commit");
   if (failed())
     return;
   if (Brancher* b = brancher(c._id)) {
     // There is a matching brancher
     if (b->commit(*this,c,a) == ES_FAILED)
       fail();
   }
 }
开发者ID:Wushaowei001,项目名称:crossbow,代码行数:12,代码来源:core.cpp

示例11: assert

shared_ptr<Value> Controller::handleGet(Key& key, const Requirements& requirements) {
    shared_ptr<Value> value;

    Requirements mutable_requirements = requirements;

    choice_id cid;
    if (memory->recall(key, &cid)) {
        auto cit = choices.find(cid);
        assert(cit != choices.end());
        Choice choice = cit->second;
        accountant->recordGet(cid);

        Actor* actor = choice.getActor();
        Dbg() << "choice " << choice.desc() << "handle this" << endl;
        if (requirements.prefer_url) {
            value = actor->get_url(key, requirements.expiration, choice.getProfile());
        }
        if (!value) {
            value = actor->get(key, choice.getProfile(), requirements.range, &mutable_requirements.metadata);
        }

        if (!value) {
            Err() << "cannot find " << key.toString() << " in choice " << choice.desc() << endl;
            for (auto& choice_pair : choices) {
                Choice& choice = choice_pair.second;
                if (choice.getActor()->get(key, choice.getProfile(), requirements.range, &mutable_requirements.metadata)) {
                    Err() << "found key in " << choice.desc() << "instead" << endl;
                    abort();
                }
            }
        }

        if (enableGetMigration) {
            bool extraGet = !value->hasUrl();
            checkMigration(key, choice, extraGet, value);
        }
    }

    estimator->notifyGet(key, mutable_requirements);
    if (enableStat) {
        stat->notifyGet(key);
    }

    return value;
}
开发者ID:columbia,项目名称:grandet,代码行数:45,代码来源:controller.cpp

示例12: Clear

void ControlMapper::Refresh() {
	Clear();

	using namespace UI;

	LinearLayout *root = Add(new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));
	
	root->Add(new Choice(keyName_, new LinearLayoutParams(200, WRAP_CONTENT)))->OnClick.Handle(this, &ControlMapper::OnReplaceAll);
	LinearLayout *rightColumn = root->Add(new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(1.0f)));
	rightColumn->SetSpacing(2.0f);
	std::vector<KeyDef> mappings;
	KeyMap::KeyFromPspButton(pspKey_, &mappings);

	for (size_t i = 0; i < mappings.size(); i++) {
		std::string deviceName = GetDeviceName(mappings[i].deviceId);
		std::string keyName = KeyMap::GetKeyOrAxisName(mappings[i].keyCode);
		int image = -1;

		LinearLayout *row = rightColumn->Add(new LinearLayout(ORIENT_HORIZONTAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)));

		Choice *c = row->Add(new Choice(deviceName + "." + keyName, new LinearLayoutParams(1.0f)));
		char tagbuf[16];
		sprintf(tagbuf, "%i", (int)i);
		c->SetTag(tagbuf);
		c->OnClick.Handle(this, &ControlMapper::OnReplace);

		Choice *d = row->Add(new Choice("X"));
		d->SetTag(tagbuf);
		d->OnClick.Handle(this, &ControlMapper::OnDelete);

		row->Add(new Choice("+"))->OnClick.Handle(this, &ControlMapper::OnAdd);
	}

	if (mappings.size() == 0) {
		// look like an empty line
		rightColumn->Add(new Choice("", new LinearLayoutParams(WRAP_CONTENT, WRAP_CONTENT)))->OnClick.Handle(this, &ControlMapper::OnAdd);
	}
}
开发者ID:MoonSnidget,项目名称:ppsspp,代码行数:38,代码来源:ControlMappingScreen.cpp

示例13: SpaceIllegalAlternative

 void
 Space::_commit(const Choice& c, unsigned int a) {
   if (a >= c.alternatives())
     throw SpaceIllegalAlternative();
   if (failed())
     return;
   /*
    * Due to weakly monotonic propagators the following scenario might
    * occur: a brancher has been committed with all its available
    * choices. Then, propagation determines less information
    * than before and the brancher now will create new choices.
    * Later, during recomputation, all of these choices
    * can be used together, possibly interleaved with 
    * choices for other branchers. That means all branchers
    * must be scanned to find the matching brancher for the choice.
    *
    * b_commit tries to optimize scanning as it is most likely that
    * recomputation does not generate new choices during recomputation
    * and hence b_commit is moved from newer to older branchers.
    */
   Brancher* b_old = b_commit;
   // Try whether we are lucky
   while (b_commit != Brancher::cast(&bl))
     if (c._id != b_commit->id())
       b_commit = Brancher::cast(b_commit->next());
     else
       goto found;
   if (b_commit == Brancher::cast(&bl)) {
     // We did not find the brancher, start at the beginning
     b_commit = Brancher::cast(bl.next());
     while (b_commit != b_old)
       if (c._id != b_commit->id())
         b_commit = Brancher::cast(b_commit->next());
       else
         goto found;
   }
   // There is no matching brancher!
   throw SpaceNoBrancher();
 found:
   // There is a matching brancher
   if (b_commit->commit(*this,c,a) == ES_FAILED)
     fail();
 }
开发者ID:lquan,项目名称:CSAI,代码行数:43,代码来源:core.cpp

示例14: GetI18NCategory

void GameSettingsScreen::CreateViews() {
	GameInfo *info = g_gameInfoCache.GetInfo(gamePath_, true);

	cap60FPS_ = g_Config.iForceMaxEmulatedFPS == 60;
	showDebugStats_ = g_Config.bShowDebugStats;

	iAlternateSpeedPercent_ = 3;
	for (int i = 0; i < 8; i++) {
		if (g_Config.iFpsLimit <= alternateSpeedTable[i]) {
			iAlternateSpeedPercent_ = i;
			break;
		}
	}

	// Information in the top left.
	// Back button to the bottom left.
	// Scrolling action menu to the right.
	using namespace UI;

	I18NCategory *d = GetI18NCategory("Dialog");
	I18NCategory *gs = GetI18NCategory("Graphics");
	I18NCategory *c = GetI18NCategory("Controls");
	I18NCategory *a = GetI18NCategory("Audio");
	I18NCategory *s = GetI18NCategory("System");
	I18NCategory *ms = GetI18NCategory("MainSettings");
	I18NCategory *dev = GetI18NCategory("Developer");

	root_ = new AnchorLayout(new LayoutParams(FILL_PARENT, FILL_PARENT));

	ViewGroup *leftColumn = new AnchorLayout(new LinearLayoutParams(1.0f));
	root_->Add(leftColumn);

	root_->Add(new Choice(d->T("Back"), "", false, new AnchorLayoutParams(150, 64, 10, NONE, NONE, 10)))->OnClick.Handle<UIScreen>(this, &UIScreen::OnBack);

	TabHolder *tabHolder = new TabHolder(ORIENT_VERTICAL, 200, new AnchorLayoutParams(10, 0, 10, 0, false));

	root_->Add(tabHolder);

	// TODO: These currently point to global settings, not game specific ones.

	// Graphics
	ViewGroup *graphicsSettingsScroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, FILL_PARENT));
	LinearLayout *graphicsSettings = new LinearLayout(ORIENT_VERTICAL);
	graphicsSettings->SetSpacing(0);
	graphicsSettingsScroll->Add(graphicsSettings);
	tabHolder->AddTab(ms->T("Graphics"), graphicsSettingsScroll);

	graphicsSettings->Add(new ItemHeader(gs->T("Rendering Mode")));
	static const char *renderingMode[] = { "Non-Buffered Rendering", "Buffered Rendering", "Read Framebuffers To Memory (CPU)", "Read Framebuffers To Memory (GPU)"};
	graphicsSettings->Add(new PopupMultiChoice(&g_Config.iRenderingMode, gs->T("Mode"), renderingMode, 0, ARRAY_SIZE(renderingMode), gs, screenManager()))->OnChoice.Handle(this, &GameSettingsScreen::OnRenderingMode);


	graphicsSettings->Add(new ItemHeader(gs->T("Frame Rate Control")));
	static const char *frameSkip[] = {"Off", "1", "2", "3", "4", "5", "6", "7", "8"};
	graphicsSettings->Add(new PopupMultiChoice(&g_Config.iFrameSkip, gs->T("Frame Skipping"), frameSkip, 0, ARRAY_SIZE(frameSkip), gs, screenManager()));
	graphicsSettings->Add(new CheckBox(&g_Config.bAutoFrameSkip, gs->T("Auto FrameSkip")));
	graphicsSettings->Add(new CheckBox(&cap60FPS_, gs->T("Force max 60 FPS (helps GoW)")));
	static const char *customSpeed[] = {"Unlimited", "25%", "50%", "75%", "100%", "125%", "150%", "200%", "300%"};
	graphicsSettings->Add(new PopupMultiChoice(&iAlternateSpeedPercent_, gs->T("Alternative Speed"), customSpeed, 0, ARRAY_SIZE(customSpeed), gs, screenManager()));

	graphicsSettings->Add(new ItemHeader(gs->T("Features")));
	postProcChoice_ = graphicsSettings->Add(new Choice(gs->T("Postprocessing Shader")));
	postProcChoice_->OnClick.Handle(this, &GameSettingsScreen::OnPostProcShader);
	postProcChoice_->SetEnabled(g_Config.iRenderingMode != FB_NON_BUFFERED_MODE);

#if defined(_WIN32) || defined(USING_QT_UI)
	graphicsSettings->Add(new CheckBox(&g_Config.bFullScreen, gs->T("FullScreen")))->OnClick.Handle(this, &GameSettingsScreen::OnFullscreenChange);
#endif
	graphicsSettings->Add(new CheckBox(&g_Config.bStretchToDisplay, gs->T("Stretch to Display")));
	// Small Display: To avoid overlapping touch controls on large tablets. Better control over this will be coming later.
	graphicsSettings->Add(new CheckBox(&g_Config.bSmallDisplay, gs->T("Small Display")));
	if (pixel_xres < pixel_yres * 1.3) // Smaller than 4:3
		graphicsSettings->Add(new CheckBox(&g_Config.bPartialStretch, gs->T("Partial Vertical Stretch")));
	graphicsSettings->Add(new CheckBox(&g_Config.bMipMap, gs->T("Mipmapping")));

	graphicsSettings->Add(new ItemHeader(gs->T("Performance")));

#ifndef USING_GLES2
	static const char *internalResolutions[] = {"Auto (1:1)", "1x PSP", "2x PSP", "3x PSP", "4x PSP", "5x PSP", "6x PSP", "7x PSP", "8x PSP", "9x PSP", "10x PSP" };
#else
	static const char *internalResolutions[] = {"Auto (1:1)", "1x PSP", "2x PSP", "3x PSP", "4x PSP", "5x PSP" };
#endif
	resolutionChoice_ = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iInternalResolution, gs->T("Rendering Resolution"), internalResolutions, 0, ARRAY_SIZE(internalResolutions), gs, screenManager()));
	resolutionChoice_->OnClick.Handle(this, &GameSettingsScreen::OnResolutionChange);
	resolutionChoice_->SetEnabled(g_Config.iRenderingMode != FB_NON_BUFFERED_MODE);
#ifdef _WIN32
	graphicsSettings->Add(new CheckBox(&g_Config.bVSync, gs->T("VSync")));
#endif
	graphicsSettings->Add(new CheckBox(&g_Config.bHardwareTransform, gs->T("Hardware Transform")));
	CheckBox *swSkin = graphicsSettings->Add(new CheckBox(&g_Config.bSoftwareSkinning, gs->T("Software Skinning")));
	CheckBox *vtxCache = graphicsSettings->Add(new CheckBox(&g_Config.bVertexCache, gs->T("Vertex Cache")));
	vtxCache->SetEnabledPtr((bool *)&g_Config.bHardwareTransform);
	graphicsSettings->Add(new CheckBox(&g_Config.bTextureBackoffCache, gs->T("Lazy texture caching", "Lazy texture caching (speedup)")));
	graphicsSettings->Add(new CheckBox(&g_Config.bTextureSecondaryCache, gs->T("Retain changed textures", "Retain changed textures (speedup, mem hog)")));

	// Seems solid, so we hide the setting.
	// CheckBox *vtxJit = graphicsSettings->Add(new CheckBox(&g_Config.bVertexDecoderJit, gs->T("Vertex Decoder JIT")));

	if (PSP_IsInited()) {
		swSkin->SetEnabled(false);
//.........这里部分代码省略.........
开发者ID:A671DR218,项目名称:ppsspp,代码行数:101,代码来源:GameSettingsScreen.cpp

示例15: runChoice

void Spawner::runChoice(const Choice choice) {
  QProcess::startDetached(choice.id(), choice.params());
}
开发者ID:cbiffle,项目名称:runcible,代码行数:3,代码来源:spawner.cpp


注:本文中的Choice类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。