Changeset - 282ae2c01a29
[Not reviewed]
default
0 1 0
Nathan Brink (binki) - 16 years ago 2009-07-24 20:43:21
ohnobinki@ohnopublishing.net
renamed variables of frameset
1 file changed with 10 insertions and 10 deletions:
0 comments (0 inline, 0 general)
src/server/distrend.c
Show inline comments
 
@@ -114,15 +114,15 @@ struct blendjob {
 
  struct frameset *frameset;
 
};
 

	
 

	
 
// Frameset Structure
 
struct frameset {
 
	int frame_num; // frame number to render
 
	int num; // frame number to render
 
	char slave_name; // user that frame is assigned to
 
	int frame_status; // status of frame, 0= unassigned, 1= taken, 2= done
 
	int status; // status of frame, 0= unassigned, 1= taken, 2= done
 
	clock_t start_time; // time the frame was started
 
	int time_to_render; // the total seconds it took to render the frame
 
}; // Frameset array is generated by status_report_generator function
 
                         // 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
 

	
 

	
 
@@ -152,13 +152,13 @@ void start_data(){
 
		general_info.total_frames_rendered = 0;
 
	}
 
}
 

	
 
// **** Finish-Setter: Sets a frame to the "completed" status.
 
void finish_frame(struct blendjob *blendjob, int frame){
 
  blendjob->frameset[frame].frame_status = 2;
 
  blendjob->frameset[frame].status = 2;
 
  blendjob->frameset[frame].time_to_render = (clock() - blendjob[jobnum].frameset[frame].start_time); // Consider changin time-to-render to time-for-frame or something?
 

	
 
  general_info.total_frames_rendered++; // Increase total frames var for stats
 
}
 

	
 

	
 
@@ -214,20 +214,20 @@ void status_report_generator(struct blen
 
	  percent_frames_finished = 0;
 
	  total_time = 0;
 

	
 
	  while(framecounter < blendjob_ptr->total_frames)
 
	    /* scans through frames, based on their status it runs a statement(s) */
 
	    {
 
	      if(blendjob_ptr->frameset[framecounter].frame_status == 2)
 
	      if(blendjob_ptr->frameset[framecounter].status == 2)
 
		/* If the frame is done */
 
		{
 
		  finished_frames ++;
 
		  total_time += blendjob_ptr->frameset[framecounter].time_to_render;
 
		}
 
	      
 
	      if(blendjob_ptr->frameset[framecounter].frame_status == 1)
 
	      if(blendjob_ptr->frameset[framecounter].status == 1)
 
		/* If the frame is assigned */
 
		{
 
		  pending_frames ++;
 
		  workers_working ++;
 
		}
 
	      
 
@@ -283,14 +283,14 @@ void frame_num_struct_builder(struct ble
 
	  fprintf(stderr, "error allocating memory");
 

	
 
	job->total_frames = numframes; // sets the total number of frames in animation for status purposes
 
	job->jobnum = jobnum_new;
 

	
 
	for(counter = 0; counter < numframes; counter ++)
 
	  /* This builds the array, with the array starting at zero and the frame_num starting at sframe */
 
	  job->frameset[counter].frame_num = counter + startframe;
 
	  /* This builds the array, with the array starting at zero and the frameset.num starting at sframe */
 
	  job->frameset[counter].num = counter + startframe;
 

	
 
	highest_jobnum++; // After it has created the job, it adds one to the highest_jobnum interger
 
}
 

	
 

	
 

	
 
@@ -333,13 +333,13 @@ int frame_finder(struct blendjob *head, 
 
	}
 
      
 
      found = 0;
 
      for(your_frame = 0; 
 
	  your_frame < blendjob_ptr->total_frames;
 
	  your_frame ++)
 
	if(blendjob_ptr->frameset[your_frame].frame_status == 0)
 
	if(blendjob_ptr->frameset[your_frame].status == 0)
 
	  found = 1;
 
      
 
      if(!found)
 
	{
 
	  /* there are no frames left in this job */
 
	  blendjob_ptr->priority --;
 
@@ -351,13 +351,13 @@ int frame_finder(struct blendjob *head, 
 
	  fprintf(stderr, "Job %d is finished, this is probably the place to call the job-removal function\n", blendjob_ptr->jobnum);
 
	}
 
    } /* while(!found) */
 
  
 
  fprintf(stderr, "Missing apostrophe !!!!!!!!!!!!!!\n"); abort();
 
  /* sets the value of the frame to 1, which means its taken !!!!!! MISSSING APOSTROPHE!!!!!!! */
 
  blendjob_ptr->frameset[your_frame].frame_status++; 
 
  blendjob_ptr->frameset[your_frame].status++; 
 
  
 
  blendjob_ptr->frameset[your_frame].start_time = clock();
 

	
 
  *job = blendjob_ptr;
 
  *frame =  &blendjob_ptr->frameset[your_frame];
 

	
 
@@ -381,13 +381,13 @@ void blend_frame_watchdog(struct blendjo
 
      {
 
	if((blendjob_ptr->frameset[counter].start_time + (watchdog_forgiveness * 3600)) < clock()) 
 
	  /*
 
	    If frame is not completed within the number of hours specified by watchdog_forgiveness 
 
	    Then change the frame status to unassigned
 
	  */
 
	  blendjob_ptr->frameset[counter].frame_status = 0;
 
	  blendjob_ptr->frameset[counter].status = 0;
 
      }
 

	
 
}
 

	
 
/**
 
   Finds a blendjob struct based on the jobnum
0 comments (0 inline, 0 general)