[Bf-committers] Yafray: button for setting numbers of processors to use (threads to create)

Nathan Letwory bf-committers@blender.org
Tue, 06 Jan 2004 23:11:37 +0200

Having a two-way system, I want to harness all the power I've got, so I  
added a button to the YafRayGI panel to set the number of processors. 
Below are diffs for the files that are concerned. BTW, it doesn't yet 
take in account Desoto's patch (I changed the type for yfr, for 
instance, but it shouldn't be difficult to add).


Index: source/blender/yafray/intern/yafray_Render.cpp
RCS file: 
retrieving revision 1.4
diff -r1.4 yafray_Render.cpp
 >     char numprocs_buf = '1';
 >         sprintf(&numprocs_buf, "%d", R.r.YF_numprocs); /* For how 
many processors? */
<     string yfr = "yafray " + xmlpath;
<     if(system(yfr.c_str())==0)
 >     char yfr[512];
 >         sprintf(yfr, "yafray -c %c %s", numprocs_buf, xmlpath.c_str());
 >     if(system(yfr)==0)

Index: source/blender/src/buttons_scene.c
RCS file: /cvsroot/bf-blender/blender/source/blender/src/buttons_scene.c,v
retrieving revision 1.24
diff -r1.24 buttons_scene.c
 >         uiDefButI(block, NUM, 0, "Processors:", 159,35,154,20, 
&G.scene->r.YF_numprocs, 1.0, 8.0, 10, 10, "Number of processors to use");

Index: source/blender/makesdna/DNA_scene_types.h
RCS file: 
retrieving revision 1.16
diff -r1.16 DNA_scene_types.h
 >         int YF_numprocs;
 >         int pad1;