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
 
@@ -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.
0 comments (0 inline, 0 general)