diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-10-06 14:23:25 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-10-06 14:23:25 +0400 |
commit | c93127d06fd7fc0219ec103bfab94b11cc13f9e0 (patch) | |
tree | ed61ab71c15f5e585434dcb784f6fd1f8274ef2b /source | |
parent | 58557ea737713dc654f4f313530b1acf920763c6 (diff) |
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...
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/render/SConscript | 10 | ||||
-rw-r--r-- | source/blender/render/intern/raytrace/rayobject_rtbuild.cpp | 4 | ||||
-rw-r--r-- | source/blender/render/intern/source/rayshade.c | 4 |
3 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/render/SConscript b/source/blender/render/SConscript index 88942ced027..17c20e8807a 100644 --- a/source/blender/render/SConscript +++ b/source/blender/render/SConscript @@ -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') diff --git a/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp b/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp index 9523e725893..a16499d4f91 100644 --- a/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp +++ b/source/blender/render/intern/raytrace/rayobject_rtbuild.cpp @@ -362,8 +362,8 @@ int rtbuild_heuristic_object_split(RTBuilder *b, int nchilds) //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); diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index 08d1785446f..8c0920a93fa 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -134,7 +134,7 @@ RayObject* RE_rayobject_create(Render *re, int type, int size) } #ifdef RE_RAYCOUNTER -RayCounter re_rc_counter[BLENDER_MAX_THREADS] = {}; +RayCounter re_rc_counter[BLENDER_MAX_THREADS] = {0}; #endif @@ -180,7 +180,7 @@ void freeraytree(Render *re) #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); |