Remove old FPS setting code

openmw-37
scrawl 9 years ago
parent 47664e1370
commit 13c7235b6b

@ -20,7 +20,6 @@ MwIniImporter::MwIniImporter()
{
const char *map[][2] =
{
{ "fps", "General:Show FPS" },
{ "no-sound", "General:Disable Audio" },
{ 0, 0 }
};

@ -168,9 +168,6 @@ void OMW::Engine::frame(float frametime)
if (mEnvironment.getStateManager()->getState()!=
MWBase::StateManager::State_NoGame)
{
#if 0
mEnvironment.getWindowManager()->wmUpdateFps(fps);
#endif
mEnvironment.getWindowManager()->update();
}

@ -155,8 +155,6 @@ namespace MWBase
virtual void setConsoleSelectedObject(const MWWorld::Ptr& object) = 0;
virtual void wmUpdateFps(float fps) = 0;
/// Set value for the given ID.
virtual void setValue (const std::string& id, const MWMechanics::AttributeValue& value) = 0;
virtual void setValue (int parSkill, const MWMechanics::SkillValue& value) = 0;

@ -67,7 +67,7 @@ namespace MWGui
};
HUD::HUD(CustomMarkerCollection &customMarkers, bool showFps, DragAndDrop* dragAndDrop, MWRender::LocalMap* localMapRender)
HUD::HUD(CustomMarkerCollection &customMarkers, DragAndDrop* dragAndDrop, MWRender::LocalMap* localMapRender)
: Layout("openmw_hud.layout")
, LocalMapBase(customMarkers, localMapRender)
, mHealth(NULL)
@ -85,8 +85,6 @@ namespace MWGui
, mCellNameBox(NULL)
, mDrowningFrame(NULL)
, mDrowningFlash(NULL)
, mFpsBox(NULL)
, mFpsCounter(NULL)
, mHealthManaStaminaBaseLeft(0)
, mWeapBoxBaseLeft(0)
, mSpellBoxBaseLeft(0)
@ -161,8 +159,6 @@ namespace MWGui
getWidget(mCrosshair, "Crosshair");
setFpsVisible(showFps);
LocalMapBase::init(mMinimap, mCompass, Settings::Manager::getInt("local map hud widget size", "Map"));
mMainWidget->eventMouseButtonClick += MyGUI::newDelegate(this, &HUD::onWorldClicked);
@ -181,28 +177,6 @@ namespace MWGui
delete mSpellIcons;
}
void HUD::setFpsVisible(const bool visible)
{
mFpsCounter = 0;
MyGUI::Widget* fps;
getWidget(fps, "FPSBox");
fps->setVisible(false);
if (visible)
{
getWidget(mFpsBox, "FPSBox");
//mFpsBox->setVisible(true);
getWidget(mFpsCounter, "FPSCounter");
}
}
void HUD::setFPS(float fps)
{
if (mFpsCounter)
mFpsCounter->setCaption(MyGUI::utility::toString((int)fps));
}
void HUD::setValue(const std::string& id, const MWMechanics::DynamicStat<float>& value)
{
int current = std::max(0, static_cast<int>(value.getCurrent()));

@ -19,10 +19,9 @@ namespace MWGui
class HUD : public Layout, public LocalMapBase
{
public:
HUD(CustomMarkerCollection& customMarkers, bool fpsVisible, DragAndDrop* dragAndDrop, MWRender::LocalMap* localMapRender);
HUD(CustomMarkerCollection& customMarkers, DragAndDrop* dragAndDrop, MWRender::LocalMap* localMapRender);
virtual ~HUD();
void setValue (const std::string& id, const MWMechanics::DynamicStat<float>& value);
void setFPS(float fps);
/// Set time left for the player to start drowning
/// @param time time left to start drowning
@ -38,8 +37,6 @@ namespace MWGui
void setEffectVisible(bool visible);
void setMinimapVisible(bool visible);
void setFpsVisible(const bool visible);
void setSelectedSpell(const std::string& spellId, int successChancePercent);
void setSelectedEnchantItem(const MWWorld::Ptr& item, int chargePercent);
void setSelectedWeapon(const MWWorld::Ptr& item, int durabilityPercent);
@ -77,9 +74,6 @@ namespace MWGui
MyGUI::TextBox* mWeaponSpellBox;
MyGUI::Widget *mDrowningFrame, *mDrowningFlash;
MyGUI::Widget* mFpsBox;
MyGUI::TextBox* mFpsCounter;
// bottom left elements
int mHealthManaStaminaBaseLeft, mWeapBoxBaseLeft, mSpellBoxBaseLeft, mSneakBoxBaseLeft;
// bottom right elements

@ -166,7 +166,6 @@ namespace MWGui
getWidget(mFullscreenButton, "FullscreenButton");
getWidget(mVSyncButton, "VSyncButton");
getWidget(mWindowBorderButton, "WindowBorderButton");
getWidget(mFPSButton, "FPSButton");
getWidget(mFOVSlider, "FOVSlider");
getWidget(mAnisotropySlider, "AnisotropySlider");
getWidget(mTextureFilteringButton, "TextureFilteringButton");
@ -201,7 +200,6 @@ namespace MWGui
mSettingsTab->eventTabChangeSelect += MyGUI::newDelegate(this, &SettingsWindow::onTabChanged);
mOkButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SettingsWindow::onOkButtonClicked);
mTextureFilteringButton->eventComboChangePosition += MyGUI::newDelegate(this, &SettingsWindow::onTextureFilteringChanged);
mFPSButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SettingsWindow::onFpsToggled);
mResolutionList->eventListChangePosition += MyGUI::newDelegate(this, &SettingsWindow::onResolutionSelected);
mWaterTextureSize->eventComboChangePosition += MyGUI::newDelegate(this, &SettingsWindow::onWaterTextureSizeChanged);
@ -256,8 +254,6 @@ namespace MWGui
mShadowsEnabledButton->setEnabled(false);
}
mFPSButton->setCaptionWithReplacing(fpsLevelToStr(Settings::Manager::getInt("fps", "HUD")));
MyGUI::TextBox* fovText;
getWidget(fovText, "FovText");
fovText->setCaption("Field of View (" + MyGUI::utility::toString(int(Settings::Manager::getInt("field of view", "General"))) + ")");
@ -427,14 +423,6 @@ namespace MWGui
}
}
void SettingsWindow::onFpsToggled(MyGUI::Widget* _sender)
{
int newLevel = (Settings::Manager::getInt("fps", "HUD") + 1) % 2;
Settings::Manager::setInt("fps", "HUD", newLevel);
mFPSButton->setCaptionWithReplacing(fpsLevelToStr(newLevel));
apply();
}
void SettingsWindow::onTextureFilteringChanged(MyGUI::ComboBox* _sender, size_t pos)
{
Settings::Manager::setString("texture filtering", "General", Misc::StringUtils::lowerCase(_sender->getItemNameAt(pos)));

@ -30,7 +30,6 @@ namespace MWGui
MyGUI::Button* mFullscreenButton;
MyGUI::Button* mVSyncButton;
MyGUI::Button* mWindowBorderButton;
MyGUI::Button* mFPSButton;
MyGUI::ScrollBar* mFOVSlider;
MyGUI::ScrollBar* mDifficultySlider;
MyGUI::ScrollBar* mAnisotropySlider;
@ -53,7 +52,6 @@ namespace MWGui
void onTabChanged(MyGUI::TabControl* _sender, size_t index);
void onOkButtonClicked(MyGUI::Widget* _sender);
void onFpsToggled(MyGUI::Widget* _sender);
void onTextureFilteringChanged(MyGUI::ComboBox* _sender, size_t pos);
void onSliderChangePosition(MyGUI::ScrollBar* scroller, size_t pos);
void onButtonToggled(MyGUI::Widget* _sender);

@ -185,7 +185,6 @@ namespace MWGui
, mForceHidden(GW_None)
, mAllowed(GW_ALL)
, mRestAllowed(true)
, mFPS(0.0f)
, mFallbackMap(fallbackMap)
, mShowOwned(0)
, mVersionDescription(versionDescription)
@ -296,7 +295,7 @@ namespace MWGui
trackWindow(mDialogueWindow, "dialogue");
mContainerWindow = new ContainerWindow(mDragAndDrop);
trackWindow(mContainerWindow, "container");
mHud = new HUD(mCustomMarkers, Settings::Manager::getInt("fps", "HUD"), mDragAndDrop, mLocalMapRender);
mHud = new HUD(mCustomMarkers, mDragAndDrop, mLocalMapRender);
mToolTips = new ToolTips();
mScrollWindow = new ScrollWindow();
mBookWindow = new BookWindow();
@ -464,8 +463,6 @@ namespace MWGui
{
cleanupGarbage();
mHud->setFPS(mFPS);
mHud->update();
}
@ -1138,7 +1135,6 @@ namespace MWGui
void WindowManager::processChangedSettings(const Settings::CategorySettingVector& changed)
{
mHud->setFpsVisible(static_cast<bool>(Settings::Manager::getInt("fps", "HUD")));
mToolTips->setDelay(Settings::Manager::getFloat("tooltip delay", "GUI"));
for (Settings::CategorySettingVector::const_iterator it = changed.begin();
@ -1322,11 +1318,6 @@ namespace MWGui
mConsole->executeFile (path);
}
void WindowManager::wmUpdateFps(float fps)
{
mFPS = fps;
}
MWGui::DialogueWindow* WindowManager::getDialogueWindow() { return mDialogueWindow; }
MWGui::InventoryWindow* WindowManager::getInventoryWindow() { return mInventoryWindow; }
MWGui::CountDialog* WindowManager::getCountDialog() { return mCountDialog; }

@ -180,8 +180,6 @@ namespace MWGui
virtual void setConsoleSelectedObject(const MWWorld::Ptr& object);
virtual void wmUpdateFps(float fps);
///< Set value for the given ID.
virtual void setValue (const std::string& id, const MWMechanics::AttributeValue& value);
virtual void setValue (int parSkill, const MWMechanics::SkillValue& value);
@ -486,8 +484,6 @@ namespace MWGui
void updateMap();
float mFPS;
std::map<std::string, std::string> mFallbackMap;
int mShowOwned;

@ -125,11 +125,5 @@
<Widget type="ImageBox" skin="HUD_Crosshair" position="0 0 32 32" align="Center Center" name="Crosshair">
</Widget>
<!-- Basic FPSCounter box -->
<Widget type="Widget" skin="" position="12 12 32 26" align="Left Top" name="FPSBox">
<Property key="Visible" value="false"/>
<Widget type="TextBox" skin="NumFPS" position="3 3 25 17" align="Center" name="FPSCounter"/>
</Widget>
</Widget>
</MyGUI>

@ -255,14 +255,6 @@
<Property key="Caption" value="Window border"/>
</Widget>
</Widget>
<Widget type="HBox" skin="" position="182 94 300 24">
<Property key="Visible" value="false"/>
<UserString key="Hidden" value="true"/>
<Widget type="AutoSizedButton" skin="MW_Button" position="0 0 24 24" align="Left Top" name="FPSButton"/>
<Widget type="AutoSizedTextBox" skin="SandText" position="28 4 32 16" align="Left Top">
<Property key="Caption" value="FPS"/>
</Widget>
</Widget>
<Widget type="HBox" skin="" position="182 124 300 24">
<Property key="Visible" value="false"/>
<UserString key="Hidden" value="true"/>

@ -18,15 +18,6 @@ color_misc=0,205,205 # ????
</BasisSkin>
</Resource>
<Resource type="ResourceSkin" name="NumFPS" size="16 16">
<Property key="FontName" value="MonoFont"/>
<Property key="TextAlign" value="HCenter Bottom"/>
<Property key="TextColour" value="1 1 1"/>
<Property key="TextShadow" value="true"/>
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch"/>
</Resource>
<Resource type="ResourceSkin" name="SandText" size="16 16">
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Left Bottom"/>

@ -84,11 +84,6 @@ fade start = 0.8
debug = false
[HUD]
# FPS counter
# 0: not visible
# 1: FPS display
fps = 0
crosshair = true
[Objects]

Loading…
Cancel
Save