[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23654] trunk/blender/source/blender/ render: Some more compile fixes for jaguarandi's commit, this time for msvc+scons

Joshua Leung aligorith at gmail.com
Tue Oct 6 12:23:25 CEST 2009


Revision: 23654
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23654
Author:   aligorith
Date:     2009-10-06 12:23:25 +0200 (Tue, 06 Oct 2009)

Log Message:
-----------
Some more compile fixes for jaguarandi's commit, this time for msvc+scons

* Replaced ... = {}; with ... = {0}; 

* Solved problem with logf(), where msvc couldn't figure out which version of log() to call (solved by casting the int argument to a float, but could also have been to double)...

* The cflags and cxxflags for scons when compiling the rendering module were only valid for gcc compiles. These will still need to get added for msvc sometime, but for now, there are no more warnings about unknown options...

Modified Paths:
--------------
    trunk/blender/source/blender/render/SConscript
    trunk/blender/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp
    trunk/blender/source/blender/render/intern/source/rayshade.c

Modified: trunk/blender/source/blender/render/SConscript
===================================================================
--- trunk/blender/source/blender/render/SConscript	2009-10-06 04:37:25 UTC (rev 23653)
+++ trunk/blender/source/blender/render/SConscript	2009-10-06 10:23:25 UTC (rev 23654)
@@ -1,8 +1,14 @@
 #!/usr/bin/python
 Import ('env')
 
-cflags = ['-O2','-msse2','-mfpmath=sse']
-cxxflags = ['-O2','-msse2','-mfpmath=sse']
+if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
+	# FIXME: need to set the appropriate flags for msvc, otherwise we get warnings
+	cflags = []
+	cxxflags = []
+else:
+	cflags = ['-O2','-msse2','-mfpmath=sse']
+	cxxflags = ['-O2','-msse2','-mfpmath=sse']
+
 sources = env.Glob('intern/source/*.c')
 raysources = env.Glob('intern/raytrace/*.cpp')
 

Modified: trunk/blender/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp
===================================================================
--- trunk/blender/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp	2009-10-06 04:37:25 UTC (rev 23653)
+++ trunk/blender/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp	2009-10-06 10:23:25 UTC (rev 23654)
@@ -362,8 +362,8 @@
 				//Worst case heuristic (cost of each child is linear)
 				float hcost, left_side, right_side;
 				
-				left_side = bb_area(sweep_left.bb, sweep_left.bb+3)*(sweep_left.cost+logf(i));
-				right_side= bb_area(sweep[i].bb, sweep[i].bb+3)*(sweep[i].cost+logf(size-i));
+				left_side = bb_area(sweep_left.bb, sweep_left.bb+3)*(sweep_left.cost+logf((float)i));
+				right_side= bb_area(sweep[i].bb, sweep[i].bb+3)*(sweep[i].cost+logf((float)size-i));
 				hcost = left_side+right_side;
 
 				assert(left_side >= 0);

Modified: trunk/blender/source/blender/render/intern/source/rayshade.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/rayshade.c	2009-10-06 04:37:25 UTC (rev 23653)
+++ trunk/blender/source/blender/render/intern/source/rayshade.c	2009-10-06 10:23:25 UTC (rev 23654)
@@ -134,7 +134,7 @@
 }
 
 #ifdef RE_RAYCOUNTER
-RayCounter re_rc_counter[BLENDER_MAX_THREADS] = {};
+RayCounter re_rc_counter[BLENDER_MAX_THREADS] = {0};
 #endif
 
 
@@ -180,7 +180,7 @@
 	
 #ifdef RE_RAYCOUNTER
 	{
-		RayCounter sum = {};
+		RayCounter sum = {0};
 		int i;
 		for(i=0; i<BLENDER_MAX_THREADS; i++)
 			RE_RC_MERGE(&sum, re_rc_counter+i);





More information about the Bf-blender-cvs mailing list