mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-31 03:45:34 +00:00
removed more osg/Version includes that are not necessary
revert to old formatting
This commit is contained in:
parent
57d519f26d
commit
e697f1c14c
7 changed files with 92 additions and 135 deletions
|
@ -7,8 +7,6 @@
|
|||
|
||||
#include <boost/filesystem/fstream.hpp>
|
||||
|
||||
#include <osg/Version>
|
||||
|
||||
#include <osgViewer/ViewerEventHandlers>
|
||||
#include <osgDB/WriteFile>
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
#include <limits>
|
||||
#include <optional>
|
||||
|
||||
#include <osg/Version>
|
||||
#include <osg/MatrixTransform>
|
||||
#include <osg/Geometry>
|
||||
#include <osg/ValueObject>
|
||||
|
@ -138,7 +137,6 @@ osgParticle::Particle* ParticleSystem::createParticle(const osgParticle::Particl
|
|||
void ParticleSystem::drawImplementation(osg::RenderInfo& renderInfo) const
|
||||
{
|
||||
osg::State & state = *renderInfo.getState();
|
||||
#if OSG_MIN_VERSION_REQUIRED(3, 5, 6)
|
||||
if(state.useVertexArrayObject(getUseVertexArrayObject()))
|
||||
{
|
||||
state.getCurrentVertexArrayState()->assignNormalArrayDispatcher();
|
||||
|
@ -148,9 +146,6 @@ void ParticleSystem::drawImplementation(osg::RenderInfo& renderInfo) const
|
|||
{
|
||||
state.getAttributeDispatchers().activateNormalArray(mNormalArray);
|
||||
}
|
||||
#else
|
||||
state.Normal(0.3, 0.3, 0.3);
|
||||
#endif
|
||||
osgParticle::ParticleSystem::drawImplementation(renderInfo);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
#include <cassert>
|
||||
#include <components/resource/scenemanager.hpp>
|
||||
|
||||
#include <osg/Version>
|
||||
|
||||
namespace SceneUtil
|
||||
{
|
||||
|
||||
|
@ -189,9 +187,7 @@ void MorphGeometry::cull(osg::NodeVisitor *nv)
|
|||
|
||||
positionDst->dirty();
|
||||
|
||||
#if OSG_MIN_VERSION_REQUIRED(3, 5, 10)
|
||||
geom.osg::Drawable::dirtyGLObjects();
|
||||
#endif
|
||||
|
||||
nv->pushOntoNodePath(&geom);
|
||||
nv->apply(geom);
|
||||
|
|
|
@ -13,12 +13,8 @@
|
|||
|
||||
/* Modified for OpenMW */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "optimizer.hpp"
|
||||
|
||||
#include <osg/Version>
|
||||
#include <osg/Transform>
|
||||
#include <osg/MatrixTransform>
|
||||
#include <osg/PositionAttitudeTransform>
|
||||
|
@ -37,7 +33,6 @@
|
|||
#include <osgUtil/Statistics>
|
||||
#include <osgUtil/MeshOptimizers>
|
||||
|
||||
#include <typeinfo>
|
||||
#include <algorithm>
|
||||
#include <numeric>
|
||||
|
||||
|
@ -629,21 +624,10 @@ void Optimizer::FlattenStaticTransformsVisitor::apply(osg::Node& node)
|
|||
traverse(node);
|
||||
}
|
||||
|
||||
bool needvbo(const osg::Geometry* geom)
|
||||
{
|
||||
#if OSG_MIN_VERSION_REQUIRED(3,5,6)
|
||||
return true;
|
||||
#else
|
||||
return geom->getUseVertexBufferObjects();
|
||||
#endif
|
||||
}
|
||||
|
||||
osg::Array* cloneArray(osg::Array* array, osg::VertexBufferObject*& vbo, const osg::Geometry* geom)
|
||||
{
|
||||
array = static_cast<osg::Array*>(array->clone(osg::CopyOp::DEEP_COPY_ALL));
|
||||
if (!vbo && needvbo(geom))
|
||||
vbo = new osg::VertexBufferObject;
|
||||
if (vbo)
|
||||
if (!vbo) vbo = new osg::VertexBufferObject;
|
||||
array->setVertexBufferObject(vbo);
|
||||
return array;
|
||||
}
|
||||
|
@ -1199,9 +1183,7 @@ osg::PrimitiveSet* clonePrimitive(osg::PrimitiveSet* ps, osg::ElementBufferObjec
|
|||
osg::DrawElements* drawElements = ps->getDrawElements();
|
||||
if (!drawElements) return ps;
|
||||
|
||||
if (!ebo && needvbo(geom))
|
||||
ebo = new osg::ElementBufferObject;
|
||||
if (ebo)
|
||||
if (!ebo) ebo = new osg::ElementBufferObject;
|
||||
drawElements->setElementBufferObject(ebo);
|
||||
|
||||
return ps;
|
||||
|
@ -1808,11 +1790,8 @@ bool Optimizer::MergeGeometryVisitor::mergeGeometry(osg::Geometry& lhs,osg::Geom
|
|||
{
|
||||
// must promote to a DrawElementsUInt
|
||||
osg::DrawElementsUInt* new_primitive = new osg::DrawElementsUInt(primitive->getMode());
|
||||
if (needvbo(&lhs))
|
||||
{
|
||||
if (!ebo) ebo = new osg::ElementBufferObject;
|
||||
new_primitive->setElementBufferObject(ebo);
|
||||
}
|
||||
std::copy(primitiveUByte->begin(),primitiveUByte->end(),std::back_inserter(*new_primitive));
|
||||
new_primitive->offsetIndices(base);
|
||||
(*primItr) = new_primitive;
|
||||
|
@ -1820,11 +1799,8 @@ bool Optimizer::MergeGeometryVisitor::mergeGeometry(osg::Geometry& lhs,osg::Geom
|
|||
{
|
||||
// must promote to a DrawElementsUShort
|
||||
osg::DrawElementsUShort* new_primitive = new osg::DrawElementsUShort(primitive->getMode());
|
||||
if (needvbo(&lhs))
|
||||
{
|
||||
if (!ebo) ebo = new osg::ElementBufferObject;
|
||||
new_primitive->setElementBufferObject(ebo);
|
||||
}
|
||||
std::copy(primitiveUByte->begin(),primitiveUByte->end(),std::back_inserter(*new_primitive));
|
||||
new_primitive->offsetIndices(base);
|
||||
(*primItr) = new_primitive;
|
||||
|
@ -1851,11 +1827,8 @@ bool Optimizer::MergeGeometryVisitor::mergeGeometry(osg::Geometry& lhs,osg::Geom
|
|||
{
|
||||
// must promote to a DrawElementsUInt
|
||||
osg::DrawElementsUInt* new_primitive = new osg::DrawElementsUInt(primitive->getMode());
|
||||
if (needvbo(&lhs))
|
||||
{
|
||||
if (!ebo) ebo = new osg::ElementBufferObject;
|
||||
new_primitive->setElementBufferObject(ebo);
|
||||
}
|
||||
std::copy(primitiveUShort->begin(),primitiveUShort->end(),std::back_inserter(*new_primitive));
|
||||
new_primitive->offsetIndices(base);
|
||||
(*primItr) = new_primitive;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
#include "riggeometry.hpp"
|
||||
|
||||
#include <osg/Version>
|
||||
|
||||
#include <components/debug/debuglog.hpp>
|
||||
#include <components/resource/scenemanager.hpp>
|
||||
#include <osg/MatrixTransform>
|
||||
|
@ -260,9 +258,7 @@ void RigGeometry::cull(osg::NodeVisitor* nv)
|
|||
if (tangentDst)
|
||||
tangentDst->dirty();
|
||||
|
||||
#if OSG_MIN_VERSION_REQUIRED(3, 5, 10)
|
||||
geom.osg::Drawable::dirtyGLObjects();
|
||||
#endif
|
||||
|
||||
nv->pushOntoNodePath(&geom);
|
||||
nv->apply(geom);
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#include <osg/Drawable>
|
||||
#include <osg/NodeVisitor>
|
||||
#include <osg/Version>
|
||||
|
||||
#include <components/debug/debuglog.hpp>
|
||||
#include <components/resource/scenemanager.hpp>
|
||||
|
|
Loading…
Reference in a new issue