fix make_shader segment count, repair mask tweak keyfrm updates for xlat,rotate,scale
authorGood Guy <good1.2guy@gmail.com>
Mon, 1 Jul 2019 23:17:50 +0000 (17:17 -0600)
committerGood Guy <good1.2guy@gmail.com>
Mon, 1 Jul 2019 23:17:50 +0000 (17:17 -0600)
cinelerra-5.1/cinelerra/cwindowgui.C
cinelerra-5.1/guicast/vframe3d.C

index eaf4af4..97ca8e6 100644 (file)
@@ -1455,7 +1455,7 @@ int CWindowCanvas::do_mask(int &redraw, int &rerender,
        mask_autos->get_prev_auto(position, PLAY_FORWARD, (Auto *&)prev_auto, 1);
        MaskAuto *prev_mask = (MaskAuto *)prev_auto;
        ArrayList<MaskPoint*> points;
-
+       int update_points = 1;
 // Determine the points based on whether
 // new keyframes will be generated or drawing is performed.
 // If keyframe generation occurs, use the interpolated mask.
@@ -2099,7 +2099,7 @@ int CWindowCanvas::do_mask(int &redraw, int &rerender,
                                gui->y_origin = mask_cursor_y;
                                rerender = 1;
                                redraw = 1;
-                               track = 0;
+                               update_points = 0;
                                break; }
                        case CWINDOW_MASK_ROTATE:
                                rotate = 1;
@@ -2158,7 +2158,7 @@ int CWindowCanvas::do_mask(int &redraw, int &rerender,
                                }
                                rerender = 1;
                                redraw = 1;
-                               track = 0;
+                               update_points = 0;
                                break; }
                        }
 
@@ -2226,7 +2226,8 @@ int CWindowCanvas::do_mask(int &redraw, int &rerender,
                MaskAuto temp_keyframe(mwindow->edl, mask_autos);
                temp_keyframe.copy_data(gui->mask_keyframe);
 // Apply interpolated points back to keyframe
-               temp_keyframe.set_points(&points, mwindow->edl->session->cwindow_mask);
+               if( update_points )
+                       temp_keyframe.set_points(&points, mwindow->edl->session->cwindow_mask);
                gui->mask_keyframe->copy_data(gui->orig_mask_keyframe);
                mask_autos->update_parameter(&temp_keyframe);
        }
index 52f096d..d7d4af0 100644 (file)
@@ -398,13 +398,16 @@ unsigned int VFrame::make_shader(const char **segments, ...)
        unsigned int program = 0;
 #ifdef HAVE_GL
 // Construct single source file out of arguments
-       int nb_segs = 1;
-       if( !segments ) {
+       int nb_segs = 0;
+       if( !segments ) {  // arg list
                va_list list;  va_start(list, segments);
                while( va_arg(list, char*) != 0 ) ++nb_segs;
                va_end(list);
        }
-       const char *segs[nb_segs];
+       else { // segment list
+               while( segments[nb_segs] ) ++nb_segs;
+       }
+       const char *segs[++nb_segs];
        if( !segments ) {
                va_list list;  va_start(list, segments);
                for( int i=0; i<nb_segs; ++i )