diff --git a/src/server/distrend.c b/src/server/distrend.c --- a/src/server/distrend.c +++ b/src/server/distrend.c @@ -45,7 +45,7 @@ struct { char *name; char *submitter; char *email; - int priority; + int priority; // 1 is highest, 10 is lowest, 0 is done struct frameset **frameset; // What exactly is this now? hehe } blendjob[max]; @@ -60,7 +60,8 @@ struct { char url; char login_name; char login_pass; -} frameset[frame_count]; +} frameset[frame_count]; // Frame count is the frame number if the animation starts on zero... but animations start at frame 1 + // Using this method to save memory, because if animation starts on a high frame number, it would waste a lot of RAM on empty structures // -- end of Matthew's handywork -- struct { @@ -273,6 +274,7 @@ void frame_num_struct_builder(int jobnum int frame_finder(){ int your_frame = null; // your_frame is an interger value that will be given to the client as the frame number to render int x = 0; // the frameset number + int priority = 1; // start the scan for the next frame with priority 1 while(your_frame <= (sframe - eframe)){ // Finds the frameset number with a frame that needs to be rendered if (blendjob[jobnum].frameset[x].frame_status = 0) @@ -288,8 +290,20 @@ return your_frame; // your_frame is retu // This figures out how much of the job is done, where jobnum corresponds to the job number // This uses pointers, so when it is run it updates certain values in memory -void status_report_generator(int jobnum){ +void status_report_generator(){ + int num1 = 0; + int num2 = 0; + int num3 = 0; + while(num1 >= 0){ + while(blendjob[num1].frameset[num2].name != null){ + if(blendjob[num1].frameset[num2].priority = 0) // if job is done, go to next one + num1++; + + if(blendjob[num1].frameset[num2].priority !=0) + break; + } + } } // This function makes the value of the frame 2, which means its completed.