Mesh: modernize C++11
* remove redundant void-arg * use nullptr * replace deprecated headers
This commit is contained in:
@@ -96,7 +96,7 @@ private:
|
||||
MeshRenderer::Private::Private()
|
||||
: vertices(GL_ARRAY_BUFFER)
|
||||
, indices(GL_ELEMENT_ARRAY_BUFFER)
|
||||
, pcolors(0)
|
||||
, pcolors(nullptr)
|
||||
, matbinding(SoMaterialBindingElement::OVERALL)
|
||||
, initialized(false)
|
||||
{
|
||||
@@ -168,12 +168,12 @@ void MeshRenderer::Private::renderGLArray(SoGLRenderAction *action, GLenum mode)
|
||||
indices.bind();
|
||||
|
||||
if (matbinding != SoMaterialBindingElement::OVERALL)
|
||||
glInterleavedArrays(GL_C4F_N3F_V3F, 0, 0);
|
||||
glInterleavedArrays(GL_C4F_N3F_V3F, 0, nullptr);
|
||||
else
|
||||
glInterleavedArrays(GL_N3F_V3F, 0, 0);
|
||||
glInterleavedArrays(GL_N3F_V3F, 0, nullptr);
|
||||
|
||||
glDrawElements(mode, indices.size() / sizeof(uint32_t),
|
||||
GL_UNSIGNED_INT, NULL);
|
||||
GL_UNSIGNED_INT, nullptr);
|
||||
|
||||
vertices.release();
|
||||
indices.release();
|
||||
@@ -429,7 +429,7 @@ bool MeshRenderer::matchMaterial(SoState* state) const
|
||||
// the buffer doesn't contain color information
|
||||
if (matbind == SoMaterialBindingElement::OVERALL)
|
||||
return true;
|
||||
const SbColor * pcolors = 0;
|
||||
const SbColor * pcolors = nullptr;
|
||||
SoGLLazyElement* gl = SoGLLazyElement::getInstance(state);
|
||||
if (gl) {
|
||||
pcolors = gl->getDiffusePointer();
|
||||
@@ -489,7 +489,7 @@ void SoFCIndexedFaceSet::initClass()
|
||||
|
||||
SoFCIndexedFaceSet::SoFCIndexedFaceSet()
|
||||
: renderTriangleLimit(UINT_MAX)
|
||||
, selectBuf(0)
|
||||
, selectBuf(nullptr)
|
||||
{
|
||||
SO_NODE_CONSTRUCTOR(SoFCIndexedFaceSet);
|
||||
SO_NODE_ADD_FIELD(updateGLArray, (false));
|
||||
@@ -639,7 +639,7 @@ void SoFCIndexedFaceSet::drawCoords(const SoGLCoordinateElement * const vertexli
|
||||
const SoTextureCoordinateBundle * const /*texcoords*/,
|
||||
const int32_t * /*texindices*/)
|
||||
{
|
||||
const SbVec3f * coords3d = 0;
|
||||
const SbVec3f * coords3d = nullptr;
|
||||
coords3d = vertexlist->getArrayPtr3();
|
||||
|
||||
int mod = numindices/(4*this->renderTriangleLimit)+1;
|
||||
@@ -716,8 +716,8 @@ void SoFCIndexedFaceSet::generateGLArrays(SoGLRenderAction * action)
|
||||
const SoCoordinateElement * coords;
|
||||
const SbVec3f * normals;
|
||||
const int32_t * cindices;
|
||||
const SbColor * pcolors = 0;
|
||||
const float * transp = 0;
|
||||
const SbColor * pcolors = nullptr;
|
||||
const float * transp = nullptr;
|
||||
int numindices, numcolors = 0, numtransp = 0;
|
||||
const int32_t * nindices;
|
||||
const int32_t * tindices;
|
||||
@@ -1013,7 +1013,7 @@ void SoFCIndexedFaceSet::stopSelection(SoAction * action)
|
||||
}
|
||||
|
||||
delete [] selectBuf;
|
||||
selectBuf = 0;
|
||||
selectBuf = nullptr;
|
||||
std::sort(hit.begin(),hit.end());
|
||||
|
||||
Gui::SoGLSelectAction *doaction = static_cast<Gui::SoGLSelectAction*>(action);
|
||||
|
||||
Reference in New Issue
Block a user