From c66629c1adfa5ad3346c15666a0da7fb3d2500d0 Mon Sep 17 00:00:00 2001 From: David Williams Date: Mon, 30 Mar 2009 22:01:06 +0000 Subject: [PATCH] Small linux fix --- .../OpenGL/OpenGLImmediateModeSupport.cpp | 6 ++--- .../OpenGLVertexBufferObjectSupport.cpp | 6 ++--- examples/OpenGL/OpenGLWidget.cpp | 24 +++++++++---------- examples/OpenGL/Shapes.cpp | 4 ++-- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/examples/OpenGL/OpenGLImmediateModeSupport.cpp b/examples/OpenGL/OpenGLImmediateModeSupport.cpp index 4b1edde7..596145b4 100644 --- a/examples/OpenGL/OpenGLImmediateModeSupport.cpp +++ b/examples/OpenGL/OpenGLImmediateModeSupport.cpp @@ -9,10 +9,10 @@ using namespace std; void renderRegionImmediateMode(PolyVox::IndexedSurfacePatch& isp) { const vector& vecVertices = isp.getVertices(); - const vector& vecIndices = isp.getIndices(); + const vector& vecIndices = isp.getIndices(); glBegin(GL_TRIANGLES); - for(vector::const_iterator iterIndex = vecIndices.begin(); iterIndex != vecIndices.end(); ++iterIndex) + for(vector::const_iterator iterIndex = vecIndices.begin(); iterIndex != vecIndices.end(); ++iterIndex) { const SurfaceVertex& vertex = vecVertices[*iterIndex]; const Vector3DFloat& v3dVertexPos = vertex.getPosition(); @@ -22,7 +22,7 @@ void renderRegionImmediateMode(PolyVox::IndexedSurfacePatch& isp) - uint8_t material = vertex.getMaterial() + 0.5; + PolyVox::uint8_t material = vertex.getMaterial() + 0.5; OpenGLColour colour = convertMaterialIDToColour(material); diff --git a/examples/OpenGL/OpenGLVertexBufferObjectSupport.cpp b/examples/OpenGL/OpenGLVertexBufferObjectSupport.cpp index f5f16df3..6b1656da 100644 --- a/examples/OpenGL/OpenGLVertexBufferObjectSupport.cpp +++ b/examples/OpenGL/OpenGLVertexBufferObjectSupport.cpp @@ -13,7 +13,7 @@ OpenGLSurfacePatch BuildOpenGLSurfacePatch(const IndexedSurfacePatch& isp) //Convienient access to the vertices and indices const vector& vecVertices = isp.getVertices(); - const vector& vecIndices = isp.getIndices(); + const vector& vecIndices = isp.getIndices(); //If we have any indices... if(!vecIndices.empty()) @@ -26,7 +26,7 @@ OpenGLSurfacePatch BuildOpenGLSurfacePatch(const IndexedSurfacePatch& isp) GLvoid* pIndices = (GLvoid*)(&(vecIndices[0])); //Fill the OpenGL index buffer with our data. - glBufferData(GL_ELEMENT_ARRAY_BUFFER, vecIndices.size() * sizeof(uint32_t), pIndices, GL_STATIC_DRAW); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, vecIndices.size() * sizeof(PolyVox::uint32_t), pIndices, GL_STATIC_DRAW); } result.noOfIndices = vecIndices.size(); @@ -57,7 +57,7 @@ OpenGLSurfacePatch BuildOpenGLSurfacePatch(const IndexedSurfacePatch& isp) *ptr = vertex.getNormal().getZ(); ptr++; - uint8_t material = vertex.getMaterial() + 0.5; + PolyVox::uint8_t material = vertex.getMaterial() + 0.5; OpenGLColour colour = convertMaterialIDToColour(material); diff --git a/examples/OpenGL/OpenGLWidget.cpp b/examples/OpenGL/OpenGLWidget.cpp index de923970..9be4bed9 100644 --- a/examples/OpenGL/OpenGLWidget.cpp +++ b/examples/OpenGL/OpenGLWidget.cpp @@ -26,11 +26,11 @@ void OpenGLWidget::setVolume(PolyVox::Volume* volData) { //Our volume is broken down into cuboid regions, and we create one mesh for each region. //This three-level for loop iterates over each region. - for(uint16_t uRegionZ = 0; uRegionZ < g_uVolumeSideLengthInRegions; ++uRegionZ) + for(PolyVox::uint16_t uRegionZ = 0; uRegionZ < g_uVolumeSideLengthInRegions; ++uRegionZ) { - for(uint16_t uRegionY = 0; uRegionY < g_uVolumeSideLengthInRegions; ++uRegionY) + for(PolyVox::uint16_t uRegionY = 0; uRegionY < g_uVolumeSideLengthInRegions; ++uRegionY) { - for(uint16_t uRegionX = 0; uRegionX < g_uVolumeSideLengthInRegions; ++uRegionX) + for(PolyVox::uint16_t uRegionX = 0; uRegionX < g_uVolumeSideLengthInRegions; ++uRegionX) { //Create a new surface patch (which is basiaclly the PolyVox term for a mesh). IndexedSurfacePatch* ispCurrent = new IndexedSurfacePatch(); @@ -38,13 +38,13 @@ void OpenGLWidget::setVolume(PolyVox::Volume* volData) //Compute the extents of the current region //FIXME - This is a little complex? PolyVox could //provide more functions for dealing with regions? - uint16_t regionStartX = uRegionX * g_uRegionSideLength; - uint16_t regionStartY = uRegionY * g_uRegionSideLength; - uint16_t regionStartZ = uRegionZ * g_uRegionSideLength; + PolyVox::uint16_t regionStartX = uRegionX * g_uRegionSideLength; + PolyVox::uint16_t regionStartY = uRegionY * g_uRegionSideLength; + PolyVox::uint16_t regionStartZ = uRegionZ * g_uRegionSideLength; - uint16_t regionEndX = regionStartX + g_uRegionSideLength + 1; //Why do we need the '+1' here? - uint16_t regionEndY = regionStartY + g_uRegionSideLength + 1; //Why do we need the '+1' here? - uint16_t regionEndZ = regionStartZ + g_uRegionSideLength + 1; //Why do we need the '+1' here? + PolyVox::uint16_t regionEndX = regionStartX + g_uRegionSideLength + 1; //Why do we need the '+1' here? + PolyVox::uint16_t regionEndY = regionStartY + g_uRegionSideLength + 1; //Why do we need the '+1' here? + PolyVox::uint16_t regionEndZ = regionStartZ + g_uRegionSideLength + 1; //Why do we need the '+1' here? Vector3DInt32 regLowerCorner(regionStartX, regionStartY, regionStartZ); Vector3DInt32 regUpperCorner(regionEndX, regionEndY, regionEndZ); @@ -131,11 +131,11 @@ void OpenGLWidget::paintGL() //Centre the volume on the origin glTranslatef(-g_uVolumeSideLength/2,-g_uVolumeSideLength/2,-g_uVolumeSideLength/2); - for(uint16_t uRegionZ = 0; uRegionZ < g_uVolumeSideLengthInRegions; ++uRegionZ) + for(PolyVox::uint16_t uRegionZ = 0; uRegionZ < g_uVolumeSideLengthInRegions; ++uRegionZ) { - for(uint16_t uRegionY = 0; uRegionY < g_uVolumeSideLengthInRegions; ++uRegionY) + for(PolyVox::uint16_t uRegionY = 0; uRegionY < g_uVolumeSideLengthInRegions; ++uRegionY) { - for(uint16_t uRegionX = 0; uRegionX < g_uVolumeSideLengthInRegions; ++uRegionX) + for(PolyVox::uint16_t uRegionX = 0; uRegionX < g_uVolumeSideLengthInRegions; ++uRegionX) { Vector3DUint8 v3dRegPos(uRegionX,uRegionY,uRegionZ); if(m_bUseOpenGLVertexBufferObjects) diff --git a/examples/OpenGL/Shapes.cpp b/examples/OpenGL/Shapes.cpp index b898b19c..d84c8fb3 100644 --- a/examples/OpenGL/Shapes.cpp +++ b/examples/OpenGL/Shapes.cpp @@ -2,7 +2,7 @@ using namespace PolyVox; -void createSphereInVolume(Volume& volData, float fRadius, uint8_t uValue) +void createSphereInVolume(Volume& volData, float fRadius, uint8_t uValue) { //This vector hold the position of the center of the volume Vector3DFloat v3dVolCenter(volData.getSideLength() / 2, volData.getSideLength() / 2, volData.getSideLength() / 2); @@ -30,7 +30,7 @@ void createSphereInVolume(Volume& volData, float fRadius, uint8_t uValu } } -void createCubeInVolume(Volume& volData, Vector3DUint16 lowerCorner, Vector3DUint16 upperCorner, uint8_t uValue) +void createCubeInVolume(Volume& volData, Vector3DUint16 lowerCorner, Vector3DUint16 upperCorner, uint8_t uValue) { //This three-level for loop iterates over every voxel between the specified corners for (int z = lowerCorner.getZ(); z <= upperCorner.getZ(); z++)