mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 19:19:56 +00:00
Remove advanced FPS counter (obsoleted by the OSG stats viewer)
This commit is contained in:
parent
bddd31e385
commit
8817f44d63
12 changed files with 15 additions and 106 deletions
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<float>& value)
|
||||
{
|
||||
int current = std::max(0, static_cast<int>(value.getCurrent()));
|
||||
|
|
|
@ -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<float>& 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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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<bool>(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; }
|
||||
|
|
|
@ -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<std::string, std::string> mFallbackMap;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -132,46 +132,5 @@
|
|||
<Widget type="TextBox" skin="NumFPS" position="3 3 25 17" align="Center" name="FPSCounter"/>
|
||||
</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>
|
||||
</MyGUI>
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue