X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fplayback3d.C;h=eed42cd9f76e352825b8fb68870f745bbbfccb33;hp=8d58deb3787880a2bd6dc3d1206163c8763b6337;hb=c857b2fb7965d27d86d5785fb9f1b8957a871a1a;hpb=413642aafb5e96e9c72b53312176838526fbfd97 diff --git a/cinelerra-5.1/cinelerra/playback3d.C b/cinelerra-5.1/cinelerra/playback3d.C index 8d58deb3..eed42cd9 100644 --- a/cinelerra-5.1/cinelerra/playback3d.C +++ b/cinelerra-5.1/cinelerra/playback3d.C @@ -1208,19 +1208,29 @@ void Playback3D::do_mask_sync(Playback3DCommand *command) // Clear screen glDisable(GL_TEXTURE_2D); - if( command->default_auto->mode == MASK_MULTIPLY_ALPHA ) { - glClearColor(0.0, 0.0, 0.0, 0.0); - glColor4f((float)command->keyframe->value / 100, - (float)command->keyframe->value / 100, - (float)command->keyframe->value / 100, - 1.0); + float value = command->keyframe->value / 100.f; + if( value >= 0 ) { + if( command->default_auto->mode == MASK_MULTIPLY_ALPHA ) { + glClearColor(0.f, 0.f, 0.f, 0.f); + glColor4f(value, value, value, 1.f); + } + else { + glClearColor(1.f, 1.f, 1.f, 1.f); + value = 1.f - value; + glColor4f(value, value, value, 1.f); + } } else { - glClearColor(1.0, 1.0, 1.0, 1.0); - glColor4f((float)1.0 - (float)command->keyframe->value / 100, - (float)1.0 - (float)command->keyframe->value / 100, - (float)1.0 - (float)command->keyframe->value / 100, - 1.0); + if( command->default_auto->mode == MASK_MULTIPLY_ALPHA ) { + value = -value; + glClearColor(value, value, value, 1.f); + glColor4f(0.f, 0.f, 0.f, 0.f); + } + else { + value = 1.f + value; + glClearColor(value, value, value, 1.f); + glColor4f(1.f, 1.f, 1.f, 1.f); + } } glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);