diff --git a/Core/Config.cpp b/Core/Config.cpp index a902d0c515..b32c4cfcbf 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -99,7 +99,7 @@ void Config::Load(const char *iniFileName) #endif graphics->Get("BufferedRendering", &bBufferedRendering, true); graphics->Get("HardwareTransform", &bHardwareTransform, true); - graphics->Get("TextureFiltering", &iTexFiltering, false); + graphics->Get("TextureFiltering", &iTexFiltering, 1); graphics->Get("SSAA", &SSAntiAliasing, 0); graphics->Get("VBO", &bUseVBO, false); graphics->Get("FrameSkip", &iFrameSkip, 0); diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 7aea9bca9f..1cab0a2730 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -36,6 +36,7 @@ public: I18NCategory *category, ScreenManager *screenManager, LayoutParams *layoutParams = 0) : Choice(text, "", false, layoutParams), value_(value), choices_(choices), minVal_(minVal), numChoices_(numChoices), category_(category), screenManager_(screenManager) { + if (*value < minVal) *value = minVal; OnClick.Handle(this, &PopupMultiChoice::HandleClick); UpdateText(); } @@ -83,8 +84,38 @@ void PopupMultiChoice::Draw(UIContext &dc) { dc.Draw()->DrawText(dc.theme->uiFont, valueText_.c_str(), bounds_.x2() - 8, bounds_.centerY(), 0xFFFFFFFF, ALIGN_RIGHT | ALIGN_VCENTER); } +class PopupSliderChoice : public Choice { +public: + PopupSliderChoice(int *value, int minValue, int maxValue, const std::string &text, ScreenManager *screenManager, LayoutParams *layoutParams = 0) + : Choice(text, "", false, layoutParams), value_(value), minValue_(minValue), maxValue_(maxValue), screenManager_(screenManager) { + OnClick.Handle(this, &PopupSliderChoice::HandleClick); + } + + void Draw(UIContext &dc); + +private: + EventReturn HandleClick(EventParams &e); + + int *value_; + int minValue_; + int maxValue_; + ScreenManager *screenManager_; +}; + +EventReturn PopupSliderChoice::HandleClick(EventParams &e) { + Screen *popupScreen = new SliderPopupScreen(value_, minValue_, maxValue_, text_); + screenManager_->push(popupScreen); + return EVENT_DONE; } +void PopupSliderChoice::Draw(UIContext &dc) { + Choice::Draw(dc); + char temp[4]; + sprintf(temp, "%i", *value_); + dc.Draw()->DrawText(dc.theme->uiFont, temp, bounds_.x2() - 8, bounds_.centerY(), 0xFFFFFFFF, ALIGN_RIGHT | ALIGN_VCENTER); +} + +} void GameSettingsScreen::CreateViews() { GameInfo *info = g_gameInfoCache.GetInfo(gamePath_, true); @@ -167,6 +198,8 @@ void GameSettingsScreen::CreateViews() { audioSettingsScroll->Add(audioSettings); tabHolder->AddTab("Audio", audioSettingsScroll); audioSettings->Add(new Choice(a->T("Download Atrac3+ plugin")))->OnClick.Handle(this, &GameSettingsScreen::OnDownloadPlugin); + audioSettings->Add(new PopupSliderChoice(&g_Config.iSEVolume, 0, 8, a->T("FX volume"), screenManager())); + audioSettings->Add(new PopupSliderChoice(&g_Config.iBGMVolume, 0, 8, a->T("BGM volume"), screenManager())); audioSettings->Add(new CheckBox(&g_Config.bEnableSound, a->T("Enable Sound"))); audioSettings->Add(new CheckBox(&g_Config.bEnableAtrac3plus, a->T("Enable Atrac3+"))); diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index ff915e36e9..03b6ec9548 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -411,6 +411,7 @@ void NativeInitGraphics() { ui_theme.checkOn = I_CHECKEDBOX; ui_theme.checkOff = I_SQUARE; ui_theme.whiteImage = SOLIDWHITE; + ui_theme.sliderKnob = I_CIRCLE; ui_theme.buttonStyle.background = UI::Drawable(UI::DRAW_4GRID, I_BUTTON); ui_theme.buttonStyle.fgColor = 0xFFFFFFFF; ui_theme.buttonStyle.image = I_BUTTON; diff --git a/native b/native index 07feef3f44..cd8987b33b 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit 07feef3f445eba07958eb5c86dfc5a299ca4a1ac +Subproject commit cd8987b33bbe299af0383609db28fecd6546bffe