Changeset - 551b376545b8
[Not reviewed]
default
0 1 0
Nathan Brink (binki) - 16 years ago 2009-07-13 22:32:35
ohnobinki@ohnopublishing.net
finished malloc-ifying frame_num_struct_builder()
1 file changed with 7 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/server/distrend.c
Show inline comments
 
@@ -83,12 +83,13 @@ struct general_info {
 
// Stores Blender Job Info
 
struct blendjob {
 
  struct blendjob *next; /* next will be NULL unless if there is another blendjob */
 
  char *name;
 
  char *submitter;
 
  char *email;
 
  unsigned int jobnum;
 
  int priority;  // 1 is lowest, 10 is highest, 0 is done
 
  int percent_done;
 
  int completed_frames; // number of completed frames for stats/etc
 
  int assigned_frames; // number of assigned frames (that are not yet completed) for stats/etc
 
  int total_frames; // how many frames are in the animation for stats/etc
 
  int avg_render_time; // average seconds it took to render a frame
 
@@ -212,19 +213,22 @@ void status_report_generator(){
 

	
 
// **** Structure Builder: This function creates frame array based on the total number of frames to be rendered, which will then be parsed by function frame_farmer.
 
void frame_num_struct_builder(struct blendjob *job, unsigned int numframes) {
 
  int jobnum_new = highest_jobnum + 1; /* global vars will someday leave us  */
 
	int counter;
 

	
 
	
 
	job->frameset = malloc(sizeof(struct frameset) * numframes);
 
	if(!job->frameset)
 
	  fprintf(stderr, "error allocating memory");
 

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

	
 
	for(counter = 0; counter < total; counter ++)
 
	  /* This builds the array, with the array starting at zero and the frame_num starting at sframe */
 
	  blendjob[jobnum_new].frameset[x].frame_num = counter + 1;
 
	  job->frameset[counter].frame_num = counter + 1;
 
	
 
	highest_jobnum++; // After it has created the job, it adds one to the highest_jobnum interger
 
}
 

	
 

	
 

	
0 comments (0 inline, 0 general)