diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 0abb43cfd..0dc19144c 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -150,10 +150,7 @@ void OMW::Engine::frame(float frametime) MWBase::StateManager::State_NoGame) { #if 0 - Ogre::RenderWindow* window = mOgre->getWindow(); - unsigned int tri, batch; - MWBase::Environment::get().getWorld()->getTriangleBatchCount(tri, batch); - MWBase::Environment::get().getWindowManager()->wmUpdateFps(window->getLastFPS(), tri, batch); + MWBase::Environment::get().getWindowManager()->wmUpdateFps(fps); #endif MWBase::Environment::get().getWindowManager()->update(); } diff --git a/apps/openmw/mwbase/windowmanager.hpp b/apps/openmw/mwbase/windowmanager.hpp index 59407fbeb..d1f1ad3a3 100644 --- a/apps/openmw/mwbase/windowmanager.hpp +++ b/apps/openmw/mwbase/windowmanager.hpp @@ -152,7 +152,7 @@ namespace MWBase virtual void setConsoleSelectedObject(const MWWorld::Ptr& object) = 0; - virtual void wmUpdateFps(float fps, unsigned int triangleCount, unsigned int batchCount) = 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; diff --git a/apps/openmw/mwbase/world.hpp b/apps/openmw/mwbase/world.hpp index 00d4d8536..1f27756d1 100644 --- a/apps/openmw/mwbase/world.hpp +++ b/apps/openmw/mwbase/world.hpp @@ -130,8 +130,6 @@ namespace MWBase virtual void adjustSky() = 0; - virtual void getTriangleBatchCount(unsigned int &triangles, unsigned int &batches) = 0; - virtual const MWWorld::Fallback *getFallback () const = 0; virtual MWWorld::Player& getPlayer() = 0; diff --git a/apps/openmw/mwgui/hud.cpp b/apps/openmw/mwgui/hud.cpp index 9c8fa48a1..5f5f2eca3 100644 --- a/apps/openmw/mwgui/hud.cpp +++ b/apps/openmw/mwgui/hud.cpp @@ -70,7 +70,7 @@ namespace MWGui }; - HUD::HUD(CustomMarkerCollection &customMarkers, int fpsLevel, DragAndDrop* dragAndDrop) + HUD::HUD(CustomMarkerCollection &customMarkers, bool showFps, DragAndDrop* dragAndDrop) : Layout("openmw_hud.layout") , LocalMapBase(customMarkers) , mHealth(NULL) @@ -89,8 +89,6 @@ namespace MWGui , mCrosshair(NULL) , mFpsBox(NULL) , mFpsCounter(NULL) - , mTriangleCounter(NULL) - , mBatchCounter(NULL) , mHealthManaStaminaBaseLeft(0) , mWeapBoxBaseLeft(0) , mSpellBoxBaseLeft(0) @@ -166,10 +164,7 @@ namespace MWGui getWidget(mCrosshair, "Crosshair"); - setFpsLevel(fpsLevel); - - getWidget(mTriangleCounter, "TriangleCounter"); - getWidget(mBatchCounter, "BatchCounter"); + setFpsVisible(showFps); LocalMapBase::init(mMinimap, mCompass, Settings::Manager::getInt("local map hud widget size", "Map")); @@ -189,23 +184,15 @@ namespace MWGui delete mSpellIcons; } - void HUD::setFpsLevel(int level) + void HUD::setFpsVisible(const bool visible) { mFpsCounter = 0; MyGUI::Widget* fps; - getWidget(fps, "FPSBoxAdv"); - fps->setVisible(false); getWidget(fps, "FPSBox"); fps->setVisible(false); - if (level == 2) - { - getWidget(mFpsBox, "FPSBoxAdv"); - mFpsBox->setVisible(true); - getWidget(mFpsCounter, "FPSCounterAdv"); - } - else if (level == 1) + if (visible) { getWidget(mFpsBox, "FPSBox"); mFpsBox->setVisible(true); @@ -219,16 +206,6 @@ namespace MWGui mFpsCounter->setCaption(MyGUI::utility::toString((int)fps)); } - void HUD::setTriangleCount(unsigned int count) - { - mTriangleCounter->setCaption(MyGUI::utility::toString(count)); - } - - void HUD::setBatchCount(unsigned int count) - { - mBatchCounter->setCaption(MyGUI::utility::toString(count)); - } - void HUD::setValue(const std::string& id, const MWMechanics::DynamicStat& value) { int current = std::max(0, static_cast(value.getCurrent())); diff --git a/apps/openmw/mwgui/hud.hpp b/apps/openmw/mwgui/hud.hpp index e717e094e..9eed9811a 100644 --- a/apps/openmw/mwgui/hud.hpp +++ b/apps/openmw/mwgui/hud.hpp @@ -19,12 +19,10 @@ namespace MWGui class HUD : public Layout, public LocalMapBase { public: - HUD(CustomMarkerCollection& customMarkers, int fpsLevel, DragAndDrop* dragAndDrop); + HUD(CustomMarkerCollection& customMarkers, bool fpsVisible, DragAndDrop* dragAndDrop); virtual ~HUD(); void setValue (const std::string& id, const MWMechanics::DynamicStat& value); void setFPS(float fps); - void setTriangleCount(unsigned int count); - void setBatchCount(unsigned int count); /// Set time left for the player to start drowning /// @param time time left to start drowning @@ -40,7 +38,7 @@ namespace MWGui void setEffectVisible(bool visible); void setMinimapVisible(bool visible); - void setFpsLevel(const int level); + void setFpsVisible(const bool visible); void setSelectedSpell(const std::string& spellId, int successChancePercent); void setSelectedEnchantItem(const MWWorld::Ptr& item, int chargePercent); @@ -80,8 +78,6 @@ namespace MWGui MyGUI::Widget* mFpsBox; MyGUI::TextBox* mFpsCounter; - MyGUI::TextBox* mTriangleCounter; - MyGUI::TextBox* mBatchCounter; // bottom left elements int mHealthManaStaminaBaseLeft, mWeapBoxBaseLeft, mSpellBoxBaseLeft, mSneakBoxBaseLeft; diff --git a/apps/openmw/mwgui/settingswindow.cpp b/apps/openmw/mwgui/settingswindow.cpp index d895a28ea..23cf2c62e 100644 --- a/apps/openmw/mwgui/settingswindow.cpp +++ b/apps/openmw/mwgui/settingswindow.cpp @@ -32,10 +32,8 @@ namespace { if (level == 0) return "#{sOff}"; - else if (level == 1) - return "Basic"; - else - return "Detailed"; + else //if (level == 1) + return "#{sOn}"; } std::string textureFilteringToStr(const std::string& val) @@ -413,7 +411,7 @@ namespace MWGui void SettingsWindow::onFpsToggled(MyGUI::Widget* _sender) { - int newLevel = (Settings::Manager::getInt("fps", "HUD") + 1) % 3; + int newLevel = (Settings::Manager::getInt("fps", "HUD") + 1) % 2; Settings::Manager::setInt("fps", "HUD", newLevel); mFPSButton->setCaptionWithReplacing(fpsLevelToStr(newLevel)); apply(); diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index 096838f81..e4e0c3167 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -174,8 +174,6 @@ namespace MWGui , mAllowed(GW_ALL) , mRestAllowed(true) , mFPS(0.0f) - , mTriangleCount(0) - , mBatchCount(0) , mCurrentModals() , mFallbackMap(fallbackMap) { @@ -440,8 +438,6 @@ namespace MWGui cleanupGarbage(); mHud->setFPS(mFPS); - mHud->setTriangleCount(mTriangleCount); - mHud->setBatchCount(mBatchCount); mHud->update(); } @@ -1078,7 +1074,7 @@ namespace MWGui void WindowManager::processChangedSettings(const Settings::CategorySettingVector& changed) { - mHud->setFpsLevel(Settings::Manager::getInt("fps", "HUD")); + mHud->setFpsVisible(static_cast(Settings::Manager::getInt("fps", "HUD"))); mToolTips->setDelay(Settings::Manager::getFloat("tooltip delay", "GUI")); for (Settings::CategorySettingVector::const_iterator it = changed.begin(); @@ -1278,11 +1274,9 @@ namespace MWGui mConsole->executeFile (path); } - void WindowManager::wmUpdateFps(float fps, unsigned int triangleCount, unsigned int batchCount) + void WindowManager::wmUpdateFps(float fps) { mFPS = fps; - mTriangleCount = triangleCount; - mBatchCount = batchCount; } MWGui::DialogueWindow* WindowManager::getDialogueWindow() { return mDialogueWindow; } diff --git a/apps/openmw/mwgui/windowmanagerimp.hpp b/apps/openmw/mwgui/windowmanagerimp.hpp index 765a18156..7fccff2d8 100644 --- a/apps/openmw/mwgui/windowmanagerimp.hpp +++ b/apps/openmw/mwgui/windowmanagerimp.hpp @@ -172,7 +172,7 @@ namespace MWGui virtual void setConsoleSelectedObject(const MWWorld::Ptr& object); - virtual void wmUpdateFps(float fps, unsigned int triangleCount, unsigned int batchCount); + virtual void wmUpdateFps(float fps); ///< Set value for the given ID. virtual void setValue (const std::string& id, const MWMechanics::AttributeValue& value); @@ -474,8 +474,6 @@ namespace MWGui void updateVisible(); // Update visibility of all windows based on mode, shown and allowed settings float mFPS; - unsigned int mTriangleCount; - unsigned int mBatchCount; std::map mFallbackMap; diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 416ef7416..842a24ded 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1979,11 +1979,6 @@ namespace MWWorld //mRendering->processChangedSettings(settings); } - void World::getTriangleBatchCount(unsigned int &triangles, unsigned int &batches) - { - //mRendering->getTriangleBatchCount(triangles, batches); - } - bool World::isFlying(const MWWorld::Ptr &ptr) const { const MWMechanics::CreatureStats &stats = ptr.getClass().getCreatureStats(ptr); diff --git a/apps/openmw/mwworld/worldimp.hpp b/apps/openmw/mwworld/worldimp.hpp index 447bb1300..9598d4357 100644 --- a/apps/openmw/mwworld/worldimp.hpp +++ b/apps/openmw/mwworld/worldimp.hpp @@ -205,8 +205,6 @@ namespace MWWorld virtual void adjustSky(); - virtual void getTriangleBatchCount(unsigned int &triangles, unsigned int &batches); - virtual const Fallback *getFallback() const; virtual Player& getPlayer(); diff --git a/files/mygui/openmw_hud.layout b/files/mygui/openmw_hud.layout index 0cbe0dd97..dd114097e 100644 --- a/files/mygui/openmw_hud.layout +++ b/files/mygui/openmw_hud.layout @@ -132,46 +132,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/files/settings-default.cfg b/files/settings-default.cfg index f1af8b654..862f9495a 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -93,8 +93,7 @@ debug = false [HUD] # FPS counter # 0: not visible -# 1: basic FPS display -# 2: advanced FPS display (batches, triangles) +# 1: FPS display fps = 0 crosshair = true