History

memory wastes and code cleaning PR comments

atlante45 committed 13 years ago

Commit 5da525f1 parent 1781abe21 files · +47 −225Browse files

Showing the changes to interface/src/VoxelSystem.cpp (1 of 21 files). Show all

Unified · Split

interface/src/VoxelSystem.cpp+1−4
@@ -545,7 +545,6 @@ glm::vec3 VoxelSystem::computeVoxelVertex(const glm::vec3& startVertex, float vo · 544 unmodified lines
545545 return startVertex + glm::vec3(identityVertex[0], identityVertex[1], identityVertex[2]) * voxelScale;
546546 }
547547
548−bool VoxelSystem::_perlinModulateProgramInitialized = false;
549548 ProgramObject VoxelSystem::_perlinModulateProgram;
550549
551550 void VoxelSystem::init() {
@@ -634,7 +633,7 @@ void VoxelSystem::init() { · 82 unmodified lines
634633
635634
636635 // create our simple fragment shader if we're the first system to init
637− if (!_perlinModulateProgramInitialized) {
636+ if (!_perlinModulateProgram.isLinked()) {
638637 switchToResourcesParentIfRequired();
639638 _perlinModulateProgram.addShaderFromSourceFile(QGLShader::Vertex, "resources/shaders/perlin_modulate.vert");
640639 _perlinModulateProgram.addShaderFromSourceFile(QGLShader::Fragment, "resources/shaders/perlin_modulate.frag");
@@ -643,8 +642,6 @@ void VoxelSystem::init() { · 2 unmodified lines
643642 _perlinModulateProgram.bind();
644643 _perlinModulateProgram.setUniformValue("permutationNormalTexture", 0);
645644 _perlinModulateProgram.release();
646−
647− _perlinModulateProgramInitialized = true;
648645 }
649646 _initialized = true;
650647 }