[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).

/jesterKing


Index: source/blender/yafray/intern/yafray_Render.cpp
===================================================================
RCS file: 
/cvsroot/bf-blender/blender/source/blender/yafray/intern/yafray_Render.cpp,v
retrieving revision 1.4
diff -r1.4 yafray_Render.cpp
24a25
 >     char numprocs_buf = '1';
45a47
 >         sprintf(&numprocs_buf, "%d", R.r.YF_numprocs); /* For how 
many processors? */
122,123c124,126
<     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
1221a1222,1223
 >         
 >         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: 
/cvsroot/bf-blender/blender/source/blender/makesdna/DNA_scene_types.h,v
retrieving revision 1.16
diff -r1.16 DNA_scene_types.h
215a216
 >         int YF_numprocs;
218a220,221
 >         
 >         int pad1;