Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-12-17 03:26:29 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-12-17 03:26:29 +0400
commite5b1f9c28d52254fd11e226ed4ac7bf07d7259d7 (patch)
treeb3a36c302cf470ed5e7c7a195e760623c82bbc7e /source/blender/editors/space_view3d/drawvolume.c
parentd46712cd298f59405646fc44acef52fbb11d2f82 (diff)
parent3c8ab559a5bd31fd38e9c5cf9da8505ca28f4887 (diff)
svn merge ^/trunk/blender -r42660:42669
Diffstat (limited to 'source/blender/editors/space_view3d/drawvolume.c')
-rw-r--r--source/blender/editors/space_view3d/drawvolume.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c
index 29ab1723381..fbea66daaba 100644
--- a/source/blender/editors/space_view3d/drawvolume.c
+++ b/source/blender/editors/space_view3d/drawvolume.c
@@ -158,23 +158,6 @@ static int convex(float *p0, float *up, float *a, float *b)
return dot_v3v3(up, tmp) >= 0;
}
-// copied from gpu_extension.c
-static int is_pow2(int n)
-{
- return ((n)&(n-1))==0;
-}
-
-static int larger_pow2(int n)
-{
- if (is_pow2(n))
- return n;
-
- while(!is_pow2(n))
- n= n&(n-1);
-
- return n*2;
-}
-
void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3], float dx, GPUTexture *tex_shadow)
{
RegionView3D *rv3d= ar->regiondata;
@@ -379,9 +362,9 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3
printf("No volume shadow\n");
if (!GPU_non_power_of_two_support()) {
- cor[0] = (float)res[0]/(float)larger_pow2(res[0]);
- cor[1] = (float)res[1]/(float)larger_pow2(res[1]);
- cor[2] = (float)res[2]/(float)larger_pow2(res[2]);
+ cor[0] = (float)res[0]/(float)power_of_2_max_i(res[0]);
+ cor[1] = (float)res[1]/(float)power_of_2_max_i(res[1]);
+ cor[2] = (float)res[2]/(float)power_of_2_max_i(res[2]);
}
// our slices are defined by the plane equation a*x + b*y +c*z + d = 0