Remove advanced FPS counter (obsoleted by the OSG stats viewer)

c++11
scrawl 10 years ago
parent bddd31e385
commit 8817f44d63

@ -150,10 +150,7 @@ void OMW::Engine::frame(float frametime)
MWBase::StateManager::State_NoGame) MWBase::StateManager::State_NoGame)
{ {
#if 0 #if 0
Ogre::RenderWindow* window = mOgre->getWindow(); MWBase::Environment::get().getWindowManager()->wmUpdateFps(fps);
unsigned int tri, batch;
MWBase::Environment::get().getWorld()->getTriangleBatchCount(tri, batch);
MWBase::Environment::get().getWindowManager()->wmUpdateFps(window->getLastFPS(), tri, batch);
#endif #endif
MWBase::Environment::get().getWindowManager()->update(); MWBase::Environment::get().getWindowManager()->update();
} }

@ -152,7 +152,7 @@ namespace MWBase
virtual void setConsoleSelectedObject(const MWWorld::Ptr& object) = 0; 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. /// 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;

@ -130,8 +130,6 @@ namespace MWBase
virtual void adjustSky() = 0; virtual void adjustSky() = 0;
virtual void getTriangleBatchCount(unsigned int &triangles, unsigned int &batches) = 0;
virtual const MWWorld::Fallback *getFallback () const = 0; virtual const MWWorld::Fallback *getFallback () const = 0;
virtual MWWorld::Player& getPlayer() = 0; virtual MWWorld::Player& getPlayer() = 0;

@ -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") : Layout("openmw_hud.layout")
, LocalMapBase(customMarkers) , LocalMapBase(customMarkers)
, mHealth(NULL) , mHealth(NULL)
@ -89,8 +89,6 @@ namespace MWGui
, mCrosshair(NULL) , mCrosshair(NULL)
, mFpsBox(NULL) , mFpsBox(NULL)
, mFpsCounter(NULL) , mFpsCounter(NULL)
, mTriangleCounter(NULL)
, mBatchCounter(NULL)
, mHealthManaStaminaBaseLeft(0) , mHealthManaStaminaBaseLeft(0)
, mWeapBoxBaseLeft(0) , mWeapBoxBaseLeft(0)
, mSpellBoxBaseLeft(0) , mSpellBoxBaseLeft(0)
@ -166,10 +164,7 @@ namespace MWGui
getWidget(mCrosshair, "Crosshair"); getWidget(mCrosshair, "Crosshair");
setFpsLevel(fpsLevel); setFpsVisible(showFps);
getWidget(mTriangleCounter, "TriangleCounter");
getWidget(mBatchCounter, "BatchCounter");
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"));
@ -189,23 +184,15 @@ namespace MWGui
delete mSpellIcons; delete mSpellIcons;
} }
void HUD::setFpsLevel(int level) void HUD::setFpsVisible(const bool visible)
{ {
mFpsCounter = 0; mFpsCounter = 0;
MyGUI::Widget* fps; MyGUI::Widget* fps;
getWidget(fps, "FPSBoxAdv");
fps->setVisible(false);
getWidget(fps, "FPSBox"); getWidget(fps, "FPSBox");
fps->setVisible(false); fps->setVisible(false);
if (level == 2) if (visible)
{
getWidget(mFpsBox, "FPSBoxAdv");
mFpsBox->setVisible(true);
getWidget(mFpsCounter, "FPSCounterAdv");
}
else if (level == 1)
{ {
getWidget(mFpsBox, "FPSBox"); getWidget(mFpsBox, "FPSBox");
mFpsBox->setVisible(true); mFpsBox->setVisible(true);
@ -219,16 +206,6 @@ namespace MWGui
mFpsCounter->setCaption(MyGUI::utility::toString((int)fps)); 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<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,12 +19,10 @@ namespace MWGui
class HUD : public Layout, public LocalMapBase class HUD : public Layout, public LocalMapBase
{ {
public: public:
HUD(CustomMarkerCollection& customMarkers, int fpsLevel, DragAndDrop* dragAndDrop); HUD(CustomMarkerCollection& customMarkers, bool fpsVisible, DragAndDrop* dragAndDrop);
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); void setFPS(float fps);
void setTriangleCount(unsigned int count);
void setBatchCount(unsigned int count);
/// 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
@ -40,7 +38,7 @@ namespace MWGui
void setEffectVisible(bool visible); void setEffectVisible(bool visible);
void setMinimapVisible(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 setSelectedSpell(const std::string& spellId, int successChancePercent);
void setSelectedEnchantItem(const MWWorld::Ptr& item, int chargePercent); void setSelectedEnchantItem(const MWWorld::Ptr& item, int chargePercent);
@ -80,8 +78,6 @@ namespace MWGui
MyGUI::Widget* mFpsBox; MyGUI::Widget* mFpsBox;
MyGUI::TextBox* mFpsCounter; MyGUI::TextBox* mFpsCounter;
MyGUI::TextBox* mTriangleCounter;
MyGUI::TextBox* mBatchCounter;
// bottom left elements // bottom left elements
int mHealthManaStaminaBaseLeft, mWeapBoxBaseLeft, mSpellBoxBaseLeft, mSneakBoxBaseLeft; int mHealthManaStaminaBaseLeft, mWeapBoxBaseLeft, mSpellBoxBaseLeft, mSneakBoxBaseLeft;

@ -32,10 +32,8 @@ namespace
{ {
if (level == 0) if (level == 0)
return "#{sOff}"; return "#{sOff}";
else if (level == 1) else //if (level == 1)
return "Basic"; return "#{sOn}";
else
return "Detailed";
} }
std::string textureFilteringToStr(const std::string& val) std::string textureFilteringToStr(const std::string& val)
@ -413,7 +411,7 @@ namespace MWGui
void SettingsWindow::onFpsToggled(MyGUI::Widget* _sender) 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); Settings::Manager::setInt("fps", "HUD", newLevel);
mFPSButton->setCaptionWithReplacing(fpsLevelToStr(newLevel)); mFPSButton->setCaptionWithReplacing(fpsLevelToStr(newLevel));
apply(); apply();

@ -174,8 +174,6 @@ namespace MWGui
, mAllowed(GW_ALL) , mAllowed(GW_ALL)
, mRestAllowed(true) , mRestAllowed(true)
, mFPS(0.0f) , mFPS(0.0f)
, mTriangleCount(0)
, mBatchCount(0)
, mCurrentModals() , mCurrentModals()
, mFallbackMap(fallbackMap) , mFallbackMap(fallbackMap)
{ {
@ -440,8 +438,6 @@ namespace MWGui
cleanupGarbage(); cleanupGarbage();
mHud->setFPS(mFPS); mHud->setFPS(mFPS);
mHud->setTriangleCount(mTriangleCount);
mHud->setBatchCount(mBatchCount);
mHud->update(); mHud->update();
} }
@ -1078,7 +1074,7 @@ namespace MWGui
void WindowManager::processChangedSettings(const Settings::CategorySettingVector& changed) void WindowManager::processChangedSettings(const Settings::CategorySettingVector& changed)
{ {
mHud->setFpsLevel(Settings::Manager::getInt("fps", "HUD")); 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();
@ -1278,11 +1274,9 @@ namespace MWGui
mConsole->executeFile (path); mConsole->executeFile (path);
} }
void WindowManager::wmUpdateFps(float fps, unsigned int triangleCount, unsigned int batchCount) void WindowManager::wmUpdateFps(float fps)
{ {
mFPS = fps; mFPS = fps;
mTriangleCount = triangleCount;
mBatchCount = batchCount;
} }
MWGui::DialogueWindow* WindowManager::getDialogueWindow() { return mDialogueWindow; } MWGui::DialogueWindow* WindowManager::getDialogueWindow() { return mDialogueWindow; }

@ -172,7 +172,7 @@ namespace MWGui
virtual void setConsoleSelectedObject(const MWWorld::Ptr& object); 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. ///< 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);
@ -474,8 +474,6 @@ namespace MWGui
void updateVisible(); // Update visibility of all windows based on mode, shown and allowed settings void updateVisible(); // Update visibility of all windows based on mode, shown and allowed settings
float mFPS; float mFPS;
unsigned int mTriangleCount;
unsigned int mBatchCount;
std::map<std::string, std::string> mFallbackMap; std::map<std::string, std::string> mFallbackMap;

@ -1979,11 +1979,6 @@ namespace MWWorld
//mRendering->processChangedSettings(settings); //mRendering->processChangedSettings(settings);
} }
void World::getTriangleBatchCount(unsigned int &triangles, unsigned int &batches)
{
//mRendering->getTriangleBatchCount(triangles, batches);
}
bool World::isFlying(const MWWorld::Ptr &ptr) const bool World::isFlying(const MWWorld::Ptr &ptr) const
{ {
const MWMechanics::CreatureStats &stats = ptr.getClass().getCreatureStats(ptr); const MWMechanics::CreatureStats &stats = ptr.getClass().getCreatureStats(ptr);

@ -205,8 +205,6 @@ namespace MWWorld
virtual void adjustSky(); virtual void adjustSky();
virtual void getTriangleBatchCount(unsigned int &triangles, unsigned int &batches);
virtual const Fallback *getFallback() const; virtual const Fallback *getFallback() const;
virtual Player& getPlayer(); virtual Player& getPlayer();

@ -132,46 +132,5 @@
<Widget type="TextBox" skin="NumFPS" position="3 3 25 17" align="Center" name="FPSCounter"/> <Widget type="TextBox" skin="NumFPS" position="3 3 25 17" align="Center" name="FPSCounter"/>
</Widget> </Widget>
<!-- Advanced FPSCounter box -->
<Widget type="Widget" skin="" position="12 12 135 64" align="Left Top" name="FPSBoxAdv">
<Property key="Visible" value="false"/>
<Widget type="Widget" skin="" position="0 0 80 60" align="Left Top">
<Widget type="TextBox" skin="NumFPS" position="0 0 80 32" align="Left Top">
<Property key="Caption" value="FPS: "/>
<Property key="TextAlign" value="Right"/>
</Widget>
<Widget type="TextBox" skin="NumFPS" position="0 16 80 32" align="Left Top">
<Property key="Caption" value="Triangles: "/>
<Property key="TextAlign" value="Right"/>
</Widget>
<Widget type="TextBox" skin="NumFPS" position="0 32 80 32" align="Left Top">
<Property key="Caption" value="Batches: "/>
<Property key="TextAlign" value="Right"/>
</Widget>
</Widget>
<Widget type="Widget" skin="" position="80 0 55 60" align="Left Top">
<Widget type="TextBox" skin="NumFPS" position="0 0 55 32" align="Left Top" name="FPSCounterAdv">
<Property key="TextAlign" value="Left"/>
</Widget>
<Widget type="TextBox" skin="NumFPS" position="0 16 55 32" align="Left Top" name="TriangleCounter">
<Property key="TextAlign" value="Left"/>
</Widget>
<Widget type="TextBox" skin="NumFPS" position="0 32 55 32" align="Left Top" name="BatchCounter">
<Property key="TextAlign" value="Left"/>
</Widget>
</Widget>
</Widget>
</Widget> </Widget>
</MyGUI> </MyGUI>

@ -93,8 +93,7 @@ debug = false
[HUD] [HUD]
# FPS counter # FPS counter
# 0: not visible # 0: not visible
# 1: basic FPS display # 1: FPS display
# 2: advanced FPS display (batches, triangles)
fps = 0 fps = 0
crosshair = true crosshair = true

Loading…
Cancel
Save