PVS: fix several issues

This commit is contained in:
wmayer
2019-03-12 01:07:41 +01:00
parent 174b7143ef
commit 4e8a684a6d
3 changed files with 24 additions and 27 deletions

View File

@@ -323,8 +323,8 @@ const int texturewidth = 128;
const int textureheight = 128;
// Global variables
double cr = 0.33;
double ci = 0.43;
double global_cr = 0.33;
double global_ci = 0.43;
// Global pointer
//unsigned char * bitmap = new unsigned char[texturewidth*textureheight];
@@ -384,24 +384,24 @@ timersensorcallback(void * data, SoSensor *)
SoTexture2 * texnode = (SoTexture2*) data;
if (!direction) {
cr -= 0.0005;
ci += 0.0005;
global_cr -= 0.0005;
global_ci += 0.0005;
}
else {
cr += 0.0005;
ci -= 0.0005;
global_cr += 0.0005;
global_ci -= 0.0005;
}
if (ci<0.30)
if (global_ci<0.30)
direction = !direction;
else if (ci>0.83)
else if (global_ci>0.83)
direction = !direction;
SbVec2s size;
int nc;
unsigned char * image = texnode->image.startEditing(size, nc);
// Generate a julia set to use as a texturemap
julia(cr, ci, 2.5, size[0], size[1], 4, image, 64);
julia(global_cr, global_ci, 2.5, size[0], size[1], 4, image, 64);
texnode->image.finishEditing();
}
@@ -411,7 +411,7 @@ void AnimationTexture(SoSeparator * root)
if ( root == NULL ) return; // Shouldn't happen.
// Generate a julia set to use as a texturemap
julia(cr, ci, 2.5, texturewidth, textureheight, 4, bitmap, 64);
julia(global_cr, global_ci, 2.5, texturewidth, textureheight, 4, bitmap, 64);
SoTexture2 * texnode = texture();
@@ -434,6 +434,4 @@ void AnimationTexture(SoSeparator * root)
root->addChild(hints);
root->addChild(texnode);
root->addChild(new SoCube);
}
}