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] = const char *map[][2] =
{ {
{ "fps", "General:Show FPS" },
{ "no-sound", "General:Disable Audio" }, { "no-sound", "General:Disable Audio" },
{ 0, 0 } { 0, 0 }
}; };

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

@ -155,8 +155,6 @@ namespace MWBase
virtual void setConsoleSelectedObject(const MWWorld::Ptr& object) = 0; virtual void setConsoleSelectedObject(const MWWorld::Ptr& object) = 0;
virtual void wmUpdateFps(float fps) = 0;
/// Set value for the given ID. /// Set value for the given ID.
virtual void setValue (const std::string& id, const MWMechanics::AttributeValue& value) = 0; virtual void setValue (const std::string& id, const MWMechanics::AttributeValue& value) = 0;
virtual void setValue (int parSkill, const MWMechanics::SkillValue& 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") : Layout("openmw_hud.layout")
, LocalMapBase(customMarkers, localMapRender) , LocalMapBase(customMarkers, localMapRender)
, mHealth(NULL) , mHealth(NULL)
@ -85,8 +85,6 @@ namespace MWGui
, mCellNameBox(NULL) , mCellNameBox(NULL)
, mDrowningFrame(NULL) , mDrowningFrame(NULL)
, mDrowningFlash(NULL) , mDrowningFlash(NULL)
, mFpsBox(NULL)
, mFpsCounter(NULL)
, mHealthManaStaminaBaseLeft(0) , mHealthManaStaminaBaseLeft(0)
, mWeapBoxBaseLeft(0) , mWeapBoxBaseLeft(0)
, mSpellBoxBaseLeft(0) , mSpellBoxBaseLeft(0)
@ -161,8 +159,6 @@ namespace MWGui
getWidget(mCrosshair, "Crosshair"); getWidget(mCrosshair, "Crosshair");
setFpsVisible(showFps);
LocalMapBase::init(mMinimap, mCompass, Settings::Manager::getInt("local map hud widget size", "Map")); LocalMapBase::init(mMinimap, mCompass, Settings::Manager::getInt("local map hud widget size", "Map"));
mMainWidget->eventMouseButtonClick += MyGUI::newDelegate(this, &HUD::onWorldClicked); mMainWidget->eventMouseButtonClick += MyGUI::newDelegate(this, &HUD::onWorldClicked);
@ -181,28 +177,6 @@ namespace MWGui
delete mSpellIcons; 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) void HUD::setValue(const std::string& id, const MWMechanics::DynamicStat<float>& value)
{ {
int current = std::max(0, static_cast<int>(value.getCurrent())); int current = std::max(0, static_cast<int>(value.getCurrent()));

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

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

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

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

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

@ -125,11 +125,5 @@
<Widget type="ImageBox" skin="HUD_Crosshair" position="0 0 32 32" align="Center Center" name="Crosshair"> <Widget type="ImageBox" skin="HUD_Crosshair" position="0 0 32 32" align="Center Center" name="Crosshair">
</Widget> </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> </Widget>
</MyGUI> </MyGUI>

@ -255,14 +255,6 @@
<Property key="Caption" value="Window border"/> <Property key="Caption" value="Window border"/>
</Widget> </Widget>
</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"> <Widget type="HBox" skin="" position="182 124 300 24">
<Property key="Visible" value="false"/> <Property key="Visible" value="false"/>
<UserString key="Hidden" value="true"/> <UserString key="Hidden" value="true"/>

@ -18,15 +18,6 @@ color_misc=0,205,205 # ????
</BasisSkin> </BasisSkin>
</Resource> </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"> <Resource type="ResourceSkin" name="SandText" size="16 16">
<Property key="FontName" value="Default"/> <Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Left Bottom"/> <Property key="TextAlign" value="Left Bottom"/>

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

Loading…
Cancel
Save