Changeset - 65364db5189e
[Not reviewed]
default
0 1 0
LordOfWar - 16 years ago 2009-07-05 00:27:08

Fixed a syntax error, changing curvy brackets to parenthesis

added a frameset structure

adjusted the job_builder and frame_finder functions to use the new structure

prepared to start a function called status_report_generator, this function will scan all the jobs and figure out how done they are

preparing to:
add code to the frame_finder function to scan all the jobs and then run the job of highest priority. Then I will add code to the status_report_generate to change the priority of the job to something the frame_finder won't look it if the job is completed.
1 file changed with 17 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/server/distrend.c
Show inline comments
 
@@ -42,13 +42,13 @@ int jobnum = 0;
 
// Structures for storing job information
 
// OOOOOOkay so we really need a struct for frameset rather than just an array, because we should track who each frame was sent out to. Please do this, someone! :D
 
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];
 

	
 
// -- Matthew's handywork --
 
// struct for storing informaiton on each frame for a particular blender job
 
struct {
 
@@ -57,13 +57,14 @@ struct {
 
	int frame_status; // status of frame, 0= unassigned, 1= taken, 2= done
 

	
 
	// For secondary upload location...
 
	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 {
 
  char *name;
 
  char *submitter;
 
  char *email;
 
@@ -270,12 +271,13 @@ void frame_num_struct_builder(int jobnum
 
}
 

	
 
// matches your computer up with a lovely frame to render
 
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)
 
			break;
 
	}
 

	
 
@@ -285,14 +287,26 @@ your_frame = blendjob[jobnum].frameset[x
 

	
 
return your_frame; // your_frame is returned as the frame to be rendered
 
}
 

	
 
// 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.
 
void the_finisher(int frame){
 
	blendjob[jobnum].frameset[frame]++;
 
}
0 comments (0 inline, 0 general)