1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-30 01:45:38 +00:00

Merge branch 'constexpr' into 'master'

Sprinkle a couple of constexpr found by VS

See merge request OpenMW/openmw!800

(cherry picked from commit 5e8ea624bc85acebf457592dd10b790124ecf6ef)

5704b2ac Sprinkle a couple of constexpr found by VS
This commit is contained in:
psi29a 2021-05-04 21:03:14 +00:00
parent e6b097085b
commit e94181b2b2
2 changed files with 5 additions and 5 deletions

View file

@ -161,9 +161,9 @@ namespace ESM
{
// Generate WNAM record
signed char wnam[LAND_GLOBAL_MAP_LOD_SIZE];
float max = std::numeric_limits<signed char>::max();
float min = std::numeric_limits<signed char>::min();
float vertMult = static_cast<float>(ESM::Land::LAND_SIZE - 1) / LAND_GLOBAL_MAP_LOD_SIZE_SQRT;
constexpr float max = std::numeric_limits<signed char>::max();
constexpr float min = std::numeric_limits<signed char>::min();
constexpr float vertMult = static_cast<float>(ESM::Land::LAND_SIZE - 1) / LAND_GLOBAL_MAP_LOD_SIZE_SQRT;
for (int row = 0; row < LAND_GLOBAL_MAP_LOD_SIZE_SQRT; ++row)
{
for (int col = 0; col < LAND_GLOBAL_MAP_LOD_SIZE_SQRT; ++col)

View file

@ -212,8 +212,8 @@ public:
{
// We arrived at a leaf.
// Since the tree is used for LOD level selection instead of culling, we do not need to load the actual height data here.
float minZ = -std::numeric_limits<float>::max();
float maxZ = std::numeric_limits<float>::max();
constexpr float minZ = -std::numeric_limits<float>::max();
constexpr float maxZ = std::numeric_limits<float>::max();
float cellWorldSize = mStorage->getCellWorldSize();
osg::BoundingBox boundingBox(osg::Vec3f((center.x()-halfSize)*cellWorldSize, (center.y()-halfSize)*cellWorldSize, minZ),
osg::Vec3f((center.x()+halfSize)*cellWorldSize, (center.y()+halfSize)*cellWorldSize, maxZ));