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:
authorXiao Xiangquan <xiaoxiangquan@gmail.com>2011-09-01 19:08:32 +0400
committerXiao Xiangquan <xiaoxiangquan@gmail.com>2011-09-01 19:08:32 +0400
commit981f7fcd0d315abb425bf34dd37f7cd4d9e8d55e (patch)
tree70800c93ec1a12579c32874e2a72eaf3290eba8e /source/blender/python/generic
parent5b91a783cf0ec132398a2767d3419d675e5126b5 (diff)
parent2365c64014b3e067bb212b2061f1d14c1f944090 (diff)
merge with trunk r39834
Diffstat (limited to 'source/blender/python/generic')
-rw-r--r--source/blender/python/generic/bgl.c6
-rw-r--r--source/blender/python/generic/noise_py_api.c20
2 files changed, 12 insertions, 14 deletions
diff --git a/source/blender/python/generic/bgl.c b/source/blender/python/generic/bgl.c
index 09432e0b316..ae8069cf3c5 100644
--- a/source/blender/python/generic/bgl.c
+++ b/source/blender/python/generic/bgl.c
@@ -52,11 +52,9 @@ static int Buffer_len(Buffer *self);
static PyObject *Buffer_item(Buffer *self, int i);
static PyObject *Buffer_slice(Buffer *self, int begin, int end);
static int Buffer_ass_item(Buffer *self, int i, PyObject *v);
-static int Buffer_ass_slice(Buffer *self, int begin, int end,
- PyObject *seq);
+static int Buffer_ass_slice(Buffer *self, int begin, int end, PyObject *seq);
static PyObject *Buffer_subscript(Buffer *self, PyObject *item);
-static int Buffer_ass_subscript(Buffer *self, PyObject *item,
- PyObject *value);
+static int Buffer_ass_subscript(Buffer *self, PyObject *item, PyObject *value);
static PySequenceMethods Buffer_SeqMethods = {
(lenfunc) Buffer_len, /*sq_length */
diff --git a/source/blender/python/generic/noise_py_api.c b/source/blender/python/generic/noise_py_api.c
index f5761f713a6..7be0998c0a1 100644
--- a/source/blender/python/generic/noise_py_api.c
+++ b/source/blender/python/generic/noise_py_api.c
@@ -210,8 +210,8 @@ static void randuvec(float v[3])
if((r = 1.f - v[2] * v[2]) > 0.f) {
float a = (float)(6.283185307f * frand());
r = (float)sqrt(r);
- v[0] = (float)(r * cos(a));
- v[1] = (float)(r * sin(a));
+ v[0] = (float)(r * cosf(a));
+ v[1] = (float)(r * sinf(a));
}
else {
v[2] = 1.f;
@@ -254,7 +254,7 @@ static PyObject *Noise_noise(PyObject *UNUSED(self), PyObject *args)
if(!PyArg_ParseTuple(args, "(fff)|i:noise", &x, &y, &z, &nb))
return NULL;
- return PyFloat_FromDouble((2.0 * BLI_gNoise(1.0, x, y, z, 0, nb) - 1.0));
+ return PyFloat_FromDouble((2.0f * BLI_gNoise(1.0f, x, y, z, 0, nb) - 1.0f));
}
/*-------------------------------------------------------------------------*/
@@ -264,11 +264,11 @@ static PyObject *Noise_noise(PyObject *UNUSED(self), PyObject *args)
static void noise_vector(float x, float y, float z, int nb, float v[3])
{
/* Simply evaluate noise at 3 different positions */
- v[0] = (float)(2.0 * BLI_gNoise(1.f, x + 9.321f, y - 1.531f, z - 7.951f, 0,
- nb) - 1.0);
- v[1] = (float)(2.0 * BLI_gNoise(1.f, x, y, z, 0, nb) - 1.0);
- v[2] = (float)(2.0 * BLI_gNoise(1.f, x + 6.327f, y + 0.1671f, z - 2.672f, 0,
- nb) - 1.0);
+ v[0]= (float)(2.0f * BLI_gNoise(1.f, x + 9.321f, y - 1.531f, z - 7.951f, 0,
+ nb) - 1.0f);
+ v[1]= (float)(2.0f * BLI_gNoise(1.f, x, y, z, 0, nb) - 1.0f);
+ v[2]= (float)(2.0f * BLI_gNoise(1.f, x + 6.327f, y + 0.1671f, z - 2.672f, 0,
+ nb) - 1.0f);
}
static PyObject *Noise_vector(PyObject *UNUSED(self), PyObject *args)
@@ -291,7 +291,7 @@ static float turb(float x, float y, float z, int oct, int hard, int nb,
float amp, out, t;
int i;
amp = 1.f;
- out = (float)(2.0 * BLI_gNoise(1.f, x, y, z, 0, nb) - 1.0);
+ out = (float)(2.0f * BLI_gNoise(1.f, x, y, z, 0, nb) - 1.0f);
if(hard)
out = (float)fabs(out);
for(i = 1; i < oct; i++) {
@@ -299,7 +299,7 @@ static float turb(float x, float y, float z, int oct, int hard, int nb,
x *= freqscale;
y *= freqscale;
z *= freqscale;
- t = (float)(amp * (2.0 * BLI_gNoise(1.f, x, y, z, 0, nb) - 1.0));
+ t = (float)(amp * (2.0f * BLI_gNoise(1.f, x, y, z, 0, nb) - 1.0f));
if(hard)
t = (float)fabs(t);
out += t;