mirror of
https://github.com/PixarAnimationStudios/OpenSubdiv
synced 2024-09-19 14:20:00 +00:00
- clean up all unused variables / constructors...
- add a -Wall flag, but leave it commented out for now until the same is done for other compilers fixes #96
This commit is contained in:
parent
a2840260d7
commit
9ed6ac7da8
@ -98,6 +98,8 @@ set(CMAKE_MODULE_PATH
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmake
|
||||
)
|
||||
|
||||
#add_definitions(-Wall)
|
||||
|
||||
# Disable spurrious offsetof warning in gcc builds and clang
|
||||
if (CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||
add_definitions("-Wno-invalid-offsetof")
|
||||
|
@ -277,7 +277,6 @@ Hud::drawChar(std::vector<float> &vboSource, int x, int y, float r, float g, flo
|
||||
int
|
||||
Hud::drawString(std::vector<float> &vboSource, int x, int y, float r, float g, float b, const char *c) const
|
||||
{
|
||||
int numchar = (int)strlen(c);
|
||||
while(*c) {
|
||||
int ch = (*c) & 0x7f;
|
||||
x = drawChar(vboSource, x, y, r, g, b, ch);
|
||||
|
@ -244,7 +244,7 @@ static void
|
||||
initializeShapes( ) {
|
||||
|
||||
#include <shapes/bilinear_cube.h>
|
||||
// g_defaultShapes.push_back(SimpleShape(bilinear_cube, "bilinear_cube", kBilinear));
|
||||
g_defaultShapes.push_back(SimpleShape(bilinear_cube, "bilinear_cube", kBilinear));
|
||||
|
||||
#include <shapes/catmark_cube_corner0.h>
|
||||
g_defaultShapes.push_back(SimpleShape(catmark_cube_corner0, "catmark_cube_corner0", kCatmark));
|
||||
@ -424,7 +424,7 @@ updateGeom() {
|
||||
|
||||
float r = sin(g_frame*0.001f) * g_moveScale;
|
||||
for (int i = 0; i < nverts; ++i) {
|
||||
float move = 0.05f*cosf(p[0]*20+g_frame*0.01f);
|
||||
//float move = 0.05f*cosf(p[0]*20+g_frame*0.01f);
|
||||
float ct = cos(p[2] * r);
|
||||
float st = sin(p[2] * r);
|
||||
g_positions[i*3+0] = p[0]*ct + p[1]*st;
|
||||
@ -899,15 +899,15 @@ bindProgram(Effect effect, OpenSubdiv::OsdPatchArray const & patch)
|
||||
float specular[4];
|
||||
} lightSource[2];
|
||||
} lightingData = {
|
||||
0.5, 0.2f, 1.0f, 0.0f,
|
||||
0.1f, 0.1f, 0.1f, 1.0f,
|
||||
0.7f, 0.7f, 0.7f, 1.0f,
|
||||
0.8f, 0.8f, 0.8f, 1.0f,
|
||||
|
||||
-0.8f, 0.4f, -1.0f, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, 1.0f,
|
||||
0.5f, 0.5f, 0.5f, 1.0f,
|
||||
0.8f, 0.8f, 0.8f, 1.0f,
|
||||
{{ { 0.5, 0.2f, 1.0f, 0.0f },
|
||||
{ 0.1f, 0.1f, 0.1f, 1.0f },
|
||||
{ 0.7f, 0.7f, 0.7f, 1.0f },
|
||||
{ 0.8f, 0.8f, 0.8f, 1.0f } },
|
||||
|
||||
{ { -0.8f, 0.4f, -1.0f, 0.0f },
|
||||
{ 0.0f, 0.0f, 0.0f, 1.0f },
|
||||
{ 0.5f, 0.5f, 0.5f, 1.0f },
|
||||
{ 0.8f, 0.8f, 0.8f, 1.0f } }}
|
||||
};
|
||||
if (! g_lightingUB) {
|
||||
glGenBuffers(1, &g_lightingUB);
|
||||
|
@ -362,26 +362,26 @@ EffectDrawRegistry effectRegistry;
|
||||
OpenSubdivPtexShader::OpenSubdivPtexShader()
|
||||
: _level(3),
|
||||
_tessFactor(2),
|
||||
_adaptive(true),
|
||||
_wireframe(false),
|
||||
_scheme(OsdPtexMeshData::kCatmark),
|
||||
_kernel(OsdPtexMeshData::kCPU),
|
||||
_interpolateBoundary(OsdPtexMeshData::kInterpolateBoundaryNone),
|
||||
_adaptive(true),
|
||||
_wireframe(false),
|
||||
_ptexColor(NULL),
|
||||
_ptexDisplacement(NULL),
|
||||
_ptexOcclusion(NULL),
|
||||
_enableColor(true),
|
||||
_enableDisplacement(true),
|
||||
_enableOcclusion(true),
|
||||
_enableNormal(true),
|
||||
_ptexColor(NULL),
|
||||
_ptexDisplacement(NULL),
|
||||
_ptexOcclusion(NULL),
|
||||
_shaderSource( defaultShaderSource ),
|
||||
_adaptiveDirty(false),
|
||||
_diffEnvMapDirty(true),
|
||||
_specEnvMapDirty(true),
|
||||
_ptexColorDirty(true),
|
||||
_ptexDisplacementDirty(true),
|
||||
_ptexOcclusionDirty(true),
|
||||
_shaderSourceDirty(false),
|
||||
_shaderSource( defaultShaderSource )
|
||||
_shaderSourceDirty(false)
|
||||
{
|
||||
}
|
||||
|
||||
@ -1111,10 +1111,6 @@ OpenSubdivPtexShader::bindProgram(const MHWRender::MDrawContext & mDrawConte
|
||||
glProgramUniform1i(program, texPages, OCC_TEXTURE_UNIT + 2);
|
||||
}
|
||||
|
||||
|
||||
MHWRender::MRenderer *theRenderer = MHWRender::MRenderer::theRenderer();
|
||||
MHWRender::MTextureManager *theTextureManager = theRenderer->getTextureManager();
|
||||
|
||||
// diffuse environment map
|
||||
if (effectRegistry.getDiffuseEnvironmentId() != 0) {
|
||||
GLint difmap = glGetUniformLocation(program, "diffuseEnvironmentMap");
|
||||
|
@ -365,17 +365,17 @@ EffectDrawRegistry g_effectRegistry;
|
||||
OpenSubdivShader::OpenSubdivShader()
|
||||
: _level(3),
|
||||
_tessFactor(2),
|
||||
_adaptive(true),
|
||||
_wireframe(false),
|
||||
_scheme(OsdMeshData::kCatmark),
|
||||
_kernel(OsdMeshData::kCPU),
|
||||
_interpolateBoundary(OsdMeshData::kInterpolateBoundaryNone),
|
||||
_adaptive(true),
|
||||
_wireframe(false),
|
||||
_interpolateUVBoundary(OsdMeshData::kInterpolateBoundaryNone),
|
||||
_shaderSource( defaultShaderSource ),
|
||||
_hbrMeshDirty(true),
|
||||
_adaptiveDirty(true),
|
||||
_diffuseMapDirty(true),
|
||||
_shaderSourceDirty(false),
|
||||
_shaderSource( defaultShaderSource )
|
||||
_shaderSourceDirty(false)
|
||||
{
|
||||
}
|
||||
|
||||
@ -676,7 +676,7 @@ OpenSubdivShader::draw(const MHWRender::MDrawContext &mDrawContext,
|
||||
for (size_t i = 0; i < patches.size(); ++i) {
|
||||
OpenSubdiv::OsdPatchArray const & patch = patches[i];
|
||||
|
||||
GLint surfaceProgram = bindProgram(mDrawContext, osdDrawContext, patch);
|
||||
bindProgram(mDrawContext, osdDrawContext, patch);
|
||||
|
||||
if (patch.desc.type != OpenSubdiv::kNonPatch) {
|
||||
glPatchParameteri(GL_PATCH_VERTICES, patch.patchSize);
|
||||
|
@ -407,7 +407,6 @@ public:
|
||||
const MComponentDataIndexing &targetIndexing) const
|
||||
{
|
||||
#endif
|
||||
const MVertexBufferDescriptor &desc = vertexBuffer.descriptor();
|
||||
|
||||
MFnMesh meshFn(dagPath);
|
||||
int nVertices = meshFn.numVertices();
|
||||
|
@ -262,18 +262,16 @@ OpenSubdiv::OsdGLPtexTexture * g_osdPTexOcclusion = 0;
|
||||
OpenSubdiv::OsdGLPtexTexture * g_osdPTexSpecular = 0;
|
||||
const char * g_ptexColorFilename;
|
||||
|
||||
static void
|
||||
/*static void
|
||||
checkGLErrors(std::string const & where = "")
|
||||
{
|
||||
GLuint err;
|
||||
while ((err = glGetError()) != GL_NO_ERROR) {
|
||||
/*
|
||||
std::cerr << "GL error: "
|
||||
<< (where.empty() ? "" : where + " ")
|
||||
<< err << "\n";
|
||||
*/
|
||||
}
|
||||
}
|
||||
}*/
|
||||
//------------------------------------------------------------------------------
|
||||
static void
|
||||
calcNormals(OsdHbrMesh * mesh, std::vector<float> const & pos, std::vector<float> & result ) {
|
||||
@ -710,7 +708,7 @@ createPtex(const char *filename) {
|
||||
printf("Loading ptex : %s\n", filename);
|
||||
PtexTexture *ptex = PtexTexture::open(filename, ptexError, true);
|
||||
if (ptex == NULL) {
|
||||
printf("Error in reading %s\n", ptex);
|
||||
printf("Error in reading %s\n", filename);
|
||||
exit(1);
|
||||
}
|
||||
OpenSubdiv::OsdGLPtexTexture *osdPtex = OpenSubdiv::OsdGLPtexTexture::Create(
|
||||
@ -938,15 +936,15 @@ bindProgram(Effect effect, OpenSubdiv::OsdPatchArray const & patch)
|
||||
float specular[4];
|
||||
} lightSource[2];
|
||||
} lightingData = {
|
||||
0.5, 0.2f, 1.0f, 0.0f,
|
||||
0.1f, 0.1f, 0.1f, 1.0f,
|
||||
0.7f, 0.7f, 0.7f, 1.0f,
|
||||
0.8f, 0.8f, 0.8f, 1.0f,
|
||||
|
||||
-0.8f, 0.4f, -1.0f, 0.0f,
|
||||
0.0f, 0.0f, 0.0f, 1.0f,
|
||||
0.5f, 0.5f, 0.5f, 1.0f,
|
||||
0.8f, 0.8f, 0.8f, 1.0f,
|
||||
{{ { 0.5, 0.2f, 1.0f, 0.0f },
|
||||
{ 0.1f, 0.1f, 0.1f, 1.0f },
|
||||
{ 0.7f, 0.7f, 0.7f, 1.0f },
|
||||
{ 0.8f, 0.8f, 0.8f, 1.0f } },
|
||||
|
||||
{ { -0.8f, 0.4f, -1.0f, 0.0f },
|
||||
{ 0.0f, 0.0f, 0.0f, 1.0f },
|
||||
{ 0.5f, 0.5f, 0.5f, 1.0f },
|
||||
{ 0.8f, 0.8f, 0.8f, 1.0f } }}
|
||||
};
|
||||
if (! g_lightingUB) {
|
||||
glGenBuffers(1, &g_lightingUB);
|
||||
@ -1043,7 +1041,7 @@ drawModel() {
|
||||
|
||||
OpenSubdiv::OsdPatchType patchType = patch.desc.type;
|
||||
int patchPattern = patch.desc.pattern;
|
||||
int patchRotation = patch.desc.rotation;
|
||||
//int patchRotation = patch.desc.rotation;
|
||||
|
||||
if (g_mesh->GetDrawContext()->IsAdaptive()) {
|
||||
|
||||
|
@ -331,7 +331,7 @@ createOsdContext(int level)
|
||||
// Now, create current face given the number of verts per face and the
|
||||
// face index data.
|
||||
//
|
||||
OsdHbrFace * face = hmesh->NewFace(VERTS_PER_FACE, faces+i, 0);
|
||||
/* OsdHbrFace * face = */ hmesh->NewFace(VERTS_PER_FACE, faces+i, 0);
|
||||
|
||||
//
|
||||
// If you had ptex data, you would set it here, for example
|
||||
@ -446,7 +446,7 @@ updateGeom()
|
||||
//
|
||||
float r = sin(g_frame*0.001f);
|
||||
for (int i = 0; i < nverts; ++i) {
|
||||
float move = 0.05f*cosf(p[0]*20+g_frame*0.01f);
|
||||
//float move = 0.05f*cosf(p[0]*20+g_frame*0.01f);
|
||||
float ct = cos(p[2] * r);
|
||||
float st = sin(p[2] * r);
|
||||
|
||||
|
@ -76,7 +76,7 @@ template <class T> class HbrFVarData {
|
||||
public:
|
||||
|
||||
HbrFVarData()
|
||||
: initialized(0), faceid( 0 ) {
|
||||
: faceid(0), initialized(0) {
|
||||
}
|
||||
|
||||
~HbrFVarData() {
|
||||
|
@ -84,6 +84,7 @@ namespace OpenSubdiv {
|
||||
namespace OPENSUBDIV_VERSION {
|
||||
|
||||
OsdCLKernelBundle::OsdCLKernelBundle() :
|
||||
_clProgram(NULL),
|
||||
_clBilinearEdge(NULL),
|
||||
_clBilinearVertex(NULL),
|
||||
_clCatmarkFace(NULL),
|
||||
@ -92,8 +93,8 @@ OsdCLKernelBundle::OsdCLKernelBundle() :
|
||||
_clCatmarkVertexB(NULL),
|
||||
_clLoopEdge(NULL),
|
||||
_clLoopVertexA(NULL),
|
||||
_clLoopVertexB(NULL),
|
||||
_clProgram(NULL) {
|
||||
_clLoopVertexB(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
OsdCLKernelBundle::~OsdCLKernelBundle() {
|
||||
|
Loading…
Reference in New Issue
Block a user