|
|
Hi there.
I have just started working on porting the PVM patch for POVRay from 3.1g to
3.5 and noticed a fairly large change in the way Option_Variable[] works.
There doesn't appear to be much documentation about it. I hope that someone
could point me in the right direction.
The old code uses:
{ PVM_TASKS_OP, "PVM_Tasks" },
{ PVM_WIDTH_OP, "PVM_Width" },
{ PVM_HEIGHT_OP, "PVM_Height" },
{ PVM_SLAVE_OP, "PVM_Slave" },
...
and sets the variables in void process_variable(TOKEN variable,char *value)
as shown below:
case PVM_TASKS_OP:
if (sscanf(value, "%d", &PvmTasks) != 1 || PvmTasks < 1) {
PvmTasks = 9999; /* Try to start one slave/available PVM host */
}
return;
case PVM_WIDTH_OP:
if (sscanf(value, "%d", &PvmChunkWidth) != 1 || PvmChunkWidth < 4)
PvmChunkWidth = PVM_DEFAULT_GRID_WIDTH;
return;
case PVM_HEIGHT_OP:
if (sscanf(value, "%d", &PvmChunkHeight) != 1 || PvmChunkHeight < 4)
PvmChunkHeight = PVM_DEFAULT_GRID_HEIGHT;
return;
case PVM_SLAVE_OP:
PvmSlavename = POV_MALLOC( sizeof(char)*(strlen(value)+1),
"PVM Slavename");
strcpy(PvmSlavename, value);
return;
....
What is the new way of preforming this? Is this likely to change again in
future versions?
I think I see how Command_Option[] works, or at least how it relates to the
new Option_Variable[] works.
Thanks for any assistance.
Lee Begg
Post a reply to this message
|
|