From 27577ce765d18e82098847901e3155524a5794e6 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 28 Feb 2016 16:49:18 +0100 Subject: [PATCH] Add ESM::Land::DEFAULT_HEIGHT --- apps/openmw/mwworld/scene.cpp | 2 +- components/esm/loadland.hpp | 3 +++ components/esmterrain/storage.cpp | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwworld/scene.cpp b/apps/openmw/mwworld/scene.cpp index 65348763a..ba2829469 100644 --- a/apps/openmw/mwworld/scene.cpp +++ b/apps/openmw/mwworld/scene.cpp @@ -271,7 +271,7 @@ namespace MWWorld else { static std::vector defaultHeight; - defaultHeight.resize(verts*verts, -2048.f); + defaultHeight.resize(verts*verts, ESM::Land::DEFAULT_HEIGHT); mPhysics->addHeightField (&defaultHeight[0], cell->getCell()->getGridX(), cell->getCell()->getGridY(), worldsize / (verts-1), verts); } diff --git a/components/esm/loadland.hpp b/components/esm/loadland.hpp index 8a8d6fdd2..a2bf1573e 100644 --- a/components/esm/loadland.hpp +++ b/components/esm/loadland.hpp @@ -46,6 +46,9 @@ struct Land DATA_VTEX = 16 }; + // default height to use in case there is no Land record + static const int DEFAULT_HEIGHT = -2048; + // number of vertices per side static const int LAND_SIZE = 65; diff --git a/components/esmterrain/storage.cpp b/components/esmterrain/storage.cpp index 68b32cf2a..86d1e08e6 100644 --- a/components/esmterrain/storage.cpp +++ b/components/esmterrain/storage.cpp @@ -16,7 +16,7 @@ namespace ESMTerrain { - const float defaultHeight = -2048; + const float defaultHeight = ESM::Land::DEFAULT_HEIGHT; Storage::Storage(const VFS::Manager *vfs, const std::string& normalMapPattern, bool autoUseNormalMaps, const std::string& specularMapPattern, bool autoUseSpecularMaps) : mVFS(vfs)