modify clr btn 16 plugins, add regdmp for sigtraps, rework mask_engine, mask rotate...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / playback3d.C
index 8d58deb3787880a2bd6dc3d1206163c8763b6337..eed42cd9f76e352825b8fb68870f745bbbfccb33 100644 (file)
@@ -1208,19 +1208,29 @@ void Playback3D::do_mask_sync(Playback3DCommand *command)
 
 // Clear screen
                glDisable(GL_TEXTURE_2D);
 
 // 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 {
                }
                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);
 
                }
                glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);