mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-17 10:21:11 +00:00
fix
Signed-off-by: Bret Curtis <psi29a@gmail.com>
This commit is contained in:
parent
f12879a04c
commit
66c9469a80
@ -444,15 +444,12 @@ namespace MWRender
|
|||||||
if (size < 1.f)
|
if (size < 1.f)
|
||||||
{
|
{
|
||||||
osg::Vec3f cellPos = pos / ESM::Land::REAL_SIZE;
|
osg::Vec3f cellPos = pos / ESM::Land::REAL_SIZE;
|
||||||
cellPos.x() = std::max(cellPos.x(), std::floor(minBound.x()));
|
if ((minBound.x() > std::floor(minBound.x()) && cellPos.x() < minBound.x()) || (minBound.y() > std::floor(minBound.y()) && cellPos.y() < minBound.y()))
|
||||||
cellPos.x() = std::min(cellPos.x(), std::ceil(maxBound.x()));
|
continue;
|
||||||
cellPos.y() = std::max(cellPos.y(), std::floor(minBound.y()));
|
if ((maxBound.x() < std::ceil(maxBound.x()) && cellPos.x() >= maxBound.x()) || (minBound.y() < std::ceil(maxBound.y()) && cellPos.y() >= maxBound.y()))
|
||||||
cellPos.y() = std::min(cellPos.y(), std::ceil(maxBound.y()));
|
|
||||||
if (cellPos.x() < minBound.x() || cellPos.x() > maxBound.x() || cellPos.y() < minBound.y() || cellPos.y() > maxBound.y())
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
float d = (viewPoint - pos).length();
|
float d = (viewPoint - pos).length();
|
||||||
if (!activeGrid)
|
if (!activeGrid)
|
||||||
{
|
{
|
||||||
@ -619,7 +616,7 @@ namespace MWRender
|
|||||||
if (mergeGroup->getNumChildren())
|
if (mergeGroup->getNumChildren())
|
||||||
{
|
{
|
||||||
SceneUtil::Optimizer optimizer;
|
SceneUtil::Optimizer optimizer;
|
||||||
if ((relativeViewPoint - mergeGroup->getBound().center()).length2() > mergeGroup->getBound().radius2())
|
if ((relativeViewPoint - mergeGroup->getBound().center()).length() > mergeGroup->getBound().radius()*2)
|
||||||
{
|
{
|
||||||
optimizer.setViewPoint(relativeViewPoint);
|
optimizer.setViewPoint(relativeViewPoint);
|
||||||
optimizer.setMergeAlphaBlending(true);
|
optimizer.setMergeAlphaBlending(true);
|
||||||
@ -630,17 +627,16 @@ namespace MWRender
|
|||||||
|
|
||||||
group->addChild(mergeGroup);
|
group->addChild(mergeGroup);
|
||||||
|
|
||||||
if (compile)
|
|
||||||
{
|
|
||||||
stateToCompile._mode = osgUtil::GLObjectsVisitor::COMPILE_DISPLAY_LISTS;
|
|
||||||
mergeGroup->accept(stateToCompile);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mDebugBatches)
|
if (mDebugBatches)
|
||||||
{
|
{
|
||||||
DebugVisitor dv;
|
DebugVisitor dv;
|
||||||
mergeGroup->accept(dv);
|
mergeGroup->accept(dv);
|
||||||
}
|
}
|
||||||
|
if (compile)
|
||||||
|
{
|
||||||
|
stateToCompile._mode = osgUtil::GLObjectsVisitor::COMPILE_DISPLAY_LISTS;
|
||||||
|
mergeGroup->accept(stateToCompile);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto ico = mSceneManager->getIncrementalCompileOperation();
|
auto ico = mSceneManager->getIncrementalCompileOperation();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user