forked from mirror/openmw-tes3mp
Merge remote-tracking branch 'thoronador/fix-numeric-limits-usage'
This commit is contained in:
commit
eb45793eab
10 changed files with 16 additions and 15 deletions
|
@ -2,7 +2,8 @@
|
||||||
|
|
||||||
#include "view.hpp"
|
#include "view.hpp"
|
||||||
|
|
||||||
CSVDoc::SubView::SubView (const CSMWorld::UniversalId& id) : mUniversalId (id)
|
CSVDoc::SubView::SubView (const CSMWorld::UniversalId& id)
|
||||||
|
: mUniversalId (id), mParent (NULL)
|
||||||
{
|
{
|
||||||
/// \todo add a button to the title bar that clones this sub view
|
/// \todo add a button to the title bar that clones this sub view
|
||||||
|
|
||||||
|
|
|
@ -507,7 +507,7 @@ namespace MWGui
|
||||||
mScrollBar->setVisible(true);
|
mScrollBar->setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
BookTypesetter::Ptr typesetter = BookTypesetter::create (mHistory->getWidth(), std::numeric_limits<int>().max());
|
BookTypesetter::Ptr typesetter = BookTypesetter::create (mHistory->getWidth(), std::numeric_limits<int>::max());
|
||||||
|
|
||||||
for (std::vector<DialogueText*>::iterator it = mHistoryContents.begin(); it != mHistoryContents.end(); ++it)
|
for (std::vector<DialogueText*>::iterator it = mHistoryContents.begin(); it != mHistoryContents.end(); ++it)
|
||||||
(*it)->write(typesetter, &mKeywordSearch, mTopicLinks);
|
(*it)->write(typesetter, &mKeywordSearch, mTopicLinks);
|
||||||
|
|
|
@ -220,7 +220,7 @@ namespace MWMechanics
|
||||||
// Use the smallest soulgem that is large enough to hold the soul
|
// Use the smallest soulgem that is large enough to hold the soul
|
||||||
MWWorld::ContainerStore& container = caster.getClass().getContainerStore(caster);
|
MWWorld::ContainerStore& container = caster.getClass().getContainerStore(caster);
|
||||||
MWWorld::ContainerStoreIterator gem = container.end();
|
MWWorld::ContainerStoreIterator gem = container.end();
|
||||||
float gemCapacity = std::numeric_limits<float>().max();
|
float gemCapacity = std::numeric_limits<float>::max();
|
||||||
std::string soulgemFilter = "misc_soulgem"; // no other way to check for soulgems? :/
|
std::string soulgemFilter = "misc_soulgem"; // no other way to check for soulgems? :/
|
||||||
for (MWWorld::ContainerStoreIterator it = container.begin(MWWorld::ContainerStore::Type_Miscellaneous);
|
for (MWWorld::ContainerStoreIterator it = container.begin(MWWorld::ContainerStore::Type_Miscellaneous);
|
||||||
it != container.end(); ++it)
|
it != container.end(); ++it)
|
||||||
|
|
|
@ -515,7 +515,7 @@ void RenderingManager::configureFog(const float density, const Ogre::ColourValue
|
||||||
if (density == 0)
|
if (density == 0)
|
||||||
{
|
{
|
||||||
mFogStart = 0;
|
mFogStart = 0;
|
||||||
mFogEnd = std::numeric_limits<float>().max();
|
mFogEnd = std::numeric_limits<float>::max();
|
||||||
mRendering.getCamera()->setFarClipDistance (max);
|
mRendering.getCamera()->setFarClipDistance (max);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -153,7 +153,7 @@ namespace MWScript
|
||||||
if (cell->getCell()->hasWater())
|
if (cell->getCell()->hasWater())
|
||||||
runtime.push (cell->getWaterLevel());
|
runtime.push (cell->getWaterLevel());
|
||||||
else
|
else
|
||||||
runtime.push (-std::numeric_limits<float>().max());
|
runtime.push (-std::numeric_limits<float>::max());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -438,7 +438,7 @@ namespace MWScript
|
||||||
|
|
||||||
// If the objects are in different worldspaces, return a large value (just like vanilla)
|
// If the objects are in different worldspaces, return a large value (just like vanilla)
|
||||||
if (ref.getCell()->getCell()->getCellId().mWorldspace != ref2.getCell()->getCell()->getCellId().mWorldspace)
|
if (ref.getCell()->getCell()->getCellId().mWorldspace != ref2.getCell()->getCell()->getCellId().mWorldspace)
|
||||||
return std::numeric_limits<float>().max();
|
return std::numeric_limits<float>::max();
|
||||||
|
|
||||||
double diff[3];
|
double diff[3];
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ namespace MWSound
|
||||||
else if (type == SampleType_Int16)
|
else if (type == SampleType_Int16)
|
||||||
{
|
{
|
||||||
value = *reinterpret_cast<const Ogre::int16*>(&data[sample*advance]);
|
value = *reinterpret_cast<const Ogre::int16*>(&data[sample*advance]);
|
||||||
value /= float(std::numeric_limits<Ogre::int16>().max());
|
value /= float(std::numeric_limits<Ogre::int16>::max());
|
||||||
}
|
}
|
||||||
else if (type == SampleType_Float32)
|
else if (type == SampleType_Float32)
|
||||||
{
|
{
|
||||||
|
|
|
@ -124,10 +124,10 @@ namespace MWWorld
|
||||||
|
|
||||||
void Scene::getGridCenter(int &cellX, int &cellY)
|
void Scene::getGridCenter(int &cellX, int &cellY)
|
||||||
{
|
{
|
||||||
int maxX = std::numeric_limits<int>().min();
|
int maxX = std::numeric_limits<int>::min();
|
||||||
int maxY = std::numeric_limits<int>().min();
|
int maxY = std::numeric_limits<int>::min();
|
||||||
int minX = std::numeric_limits<int>().max();
|
int minX = std::numeric_limits<int>::max();
|
||||||
int minY = std::numeric_limits<int>().max();
|
int minY = std::numeric_limits<int>::max();
|
||||||
CellStoreCollection::iterator iter = mActiveCells.begin();
|
CellStoreCollection::iterator iter = mActiveCells.begin();
|
||||||
while (iter!=mActiveCells.end())
|
while (iter!=mActiveCells.end())
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,8 +34,8 @@ namespace ESMTerrain
|
||||||
if (!land)
|
if (!land)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
min = std::numeric_limits<float>().max();
|
min = std::numeric_limits<float>::max();
|
||||||
max = -std::numeric_limits<float>().max();
|
max = -std::numeric_limits<float>::max();
|
||||||
for (int row=0; row<ESM::Land::LAND_SIZE; ++row)
|
for (int row=0; row<ESM::Land::LAND_SIZE; ++row)
|
||||||
{
|
{
|
||||||
for (int col=0; col<ESM::Land::LAND_SIZE; ++col)
|
for (int col=0; col<ESM::Land::LAND_SIZE; ++col)
|
||||||
|
|
|
@ -15,8 +15,8 @@ namespace Gui
|
||||||
|
|
||||||
public:
|
public:
|
||||||
NumericEditBox()
|
NumericEditBox()
|
||||||
: mValue(0), mMinValue(std::numeric_limits<int>().min()),
|
: mValue(0), mMinValue(std::numeric_limits<int>::min()),
|
||||||
mMaxValue(std::numeric_limits<int>().max())
|
mMaxValue(std::numeric_limits<int>::max())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void initialiseOverride();
|
void initialiseOverride();
|
||||||
|
|
Loading…
Reference in a new issue