mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-01 02:15:32 +00:00
Get rid of some remaining instances of C limit macros
This commit is contained in:
parent
573af17cf9
commit
a71cfca580
3 changed files with 12 additions and 9 deletions
|
@ -1,5 +1,6 @@
|
||||||
#include "util.hpp"
|
#include "util.hpp"
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
#include <QUndoStack>
|
#include <QUndoStack>
|
||||||
|
@ -214,7 +215,7 @@ QWidget *CSVWorld::CommandDelegate::createEditor (QWidget *parent, const QStyleO
|
||||||
case CSMWorld::ColumnBase::Display_UnsignedInteger8:
|
case CSMWorld::ColumnBase::Display_UnsignedInteger8:
|
||||||
{
|
{
|
||||||
DialogueSpinBox *sb = new DialogueSpinBox(parent);
|
DialogueSpinBox *sb = new DialogueSpinBox(parent);
|
||||||
sb->setRange(0, UCHAR_MAX);
|
sb->setRange(0, std::numeric_limits<unsigned char>::max());
|
||||||
return sb;
|
return sb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,7 +226,7 @@ QWidget *CSVWorld::CommandDelegate::createEditor (QWidget *parent, const QStyleO
|
||||||
case CSMWorld::ColumnBase::Display_Float:
|
case CSMWorld::ColumnBase::Display_Float:
|
||||||
{
|
{
|
||||||
DialogueDoubleSpinBox *dsb = new DialogueDoubleSpinBox(parent);
|
DialogueDoubleSpinBox *dsb = new DialogueDoubleSpinBox(parent);
|
||||||
dsb->setRange(-FLT_MAX, FLT_MAX);
|
dsb->setRange(-std::numeric_limits<float>::max(), std::numeric_limits<float>::max());
|
||||||
dsb->setSingleStep(0.01f);
|
dsb->setSingleStep(0.01f);
|
||||||
dsb->setDecimals(3);
|
dsb->setDecimals(3);
|
||||||
return dsb;
|
return dsb;
|
||||||
|
@ -234,7 +235,7 @@ QWidget *CSVWorld::CommandDelegate::createEditor (QWidget *parent, const QStyleO
|
||||||
case CSMWorld::ColumnBase::Display_Double:
|
case CSMWorld::ColumnBase::Display_Double:
|
||||||
{
|
{
|
||||||
DialogueDoubleSpinBox *dsb = new DialogueDoubleSpinBox(parent);
|
DialogueDoubleSpinBox *dsb = new DialogueDoubleSpinBox(parent);
|
||||||
dsb->setRange(-FLT_MAX, FLT_MAX);
|
dsb->setRange(-std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
|
||||||
dsb->setSingleStep(0.01f);
|
dsb->setSingleStep(0.01f);
|
||||||
dsb->setDecimals(6);
|
dsb->setDecimals(6);
|
||||||
return dsb;
|
return dsb;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#include "cellpreloader.hpp"
|
#include "cellpreloader.hpp"
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
#include <limits>
|
||||||
|
|
||||||
#include <components/debug/debuglog.hpp>
|
#include <components/debug/debuglog.hpp>
|
||||||
#include <components/resource/scenemanager.hpp>
|
#include <components/resource/scenemanager.hpp>
|
||||||
|
@ -251,7 +252,7 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
// throw out oldest cell to make room
|
// throw out oldest cell to make room
|
||||||
PreloadMap::iterator oldestCell = mPreloadCells.begin();
|
PreloadMap::iterator oldestCell = mPreloadCells.begin();
|
||||||
double oldestTimestamp = DBL_MAX;
|
double oldestTimestamp = std::numeric_limits<double>::max();
|
||||||
double threshold = 1.0; // seconds
|
double threshold = 1.0; // seconds
|
||||||
for (PreloadMap::iterator it = mPreloadCells.begin(); it != mPreloadCells.end(); ++it)
|
for (PreloadMap::iterator it = mPreloadCells.begin(); it != mPreloadCells.end(); ++it)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "loadland.hpp"
|
#include "loadland.hpp"
|
||||||
|
|
||||||
|
#include <limits>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "esmreader.hpp"
|
#include "esmreader.hpp"
|
||||||
|
@ -200,9 +201,9 @@ namespace ESM
|
||||||
mLandData->mTextures[i] = 0;
|
mLandData->mTextures[i] = 0;
|
||||||
for (int i = 0; i < LAND_NUM_VERTS; ++i)
|
for (int i = 0; i < LAND_NUM_VERTS; ++i)
|
||||||
{
|
{
|
||||||
mLandData->mColours[i*3+0] = -1;
|
mLandData->mColours[i*3+0] = 255;
|
||||||
mLandData->mColours[i*3+1] = -1;
|
mLandData->mColours[i*3+1] = 255;
|
||||||
mLandData->mColours[i*3+2] = -1;
|
mLandData->mColours[i*3+2] = 255;
|
||||||
}
|
}
|
||||||
mLandData->mUnk1 = 0;
|
mLandData->mUnk1 = 0;
|
||||||
mLandData->mUnk2 = 0;
|
mLandData->mUnk2 = 0;
|
||||||
|
@ -252,8 +253,8 @@ namespace ESM
|
||||||
if (reader.isNextSub("VHGT")) {
|
if (reader.isNextSub("VHGT")) {
|
||||||
VHGT vhgt;
|
VHGT vhgt;
|
||||||
if (condLoad(reader, flags, target->mDataLoaded, DATA_VHGT, &vhgt, sizeof(vhgt))) {
|
if (condLoad(reader, flags, target->mDataLoaded, DATA_VHGT, &vhgt, sizeof(vhgt))) {
|
||||||
target->mMinHeight = FLT_MAX;
|
target->mMinHeight = std::numeric_limits<float>::max();
|
||||||
target->mMaxHeight = -FLT_MAX;
|
target->mMaxHeight = -std::numeric_limits<float>::max();
|
||||||
float rowOffset = vhgt.mHeightOffset;
|
float rowOffset = vhgt.mHeightOffset;
|
||||||
for (int y = 0; y < LAND_SIZE; y++) {
|
for (int y = 0; y < LAND_SIZE; y++) {
|
||||||
rowOffset += vhgt.mHeightData[y * LAND_SIZE];
|
rowOffset += vhgt.mHeightData[y * LAND_SIZE];
|
||||||
|
|
Loading…
Reference in a new issue