style cleanup
This commit is contained in:
@@ -45,7 +45,7 @@ public:
|
||||
/**
|
||||
* Destroys the factory.
|
||||
*/
|
||||
virtual ~AUD_IFactory(){}
|
||||
virtual ~AUD_IFactory() {}
|
||||
|
||||
/**
|
||||
* Creates a reader for playback of the sound source.
|
||||
|
@@ -42,7 +42,7 @@ public:
|
||||
/**
|
||||
* Destroys the reader.
|
||||
*/
|
||||
virtual ~AUD_IReader(){}
|
||||
virtual ~AUD_IReader() {}
|
||||
|
||||
/**
|
||||
* Tells whether the source provides seeking functionality or not.
|
||||
|
@@ -41,7 +41,7 @@ public:
|
||||
/**
|
||||
* Destroys the writer.
|
||||
*/
|
||||
virtual ~AUD_IWriter(){}
|
||||
virtual ~AUD_IWriter() {}
|
||||
|
||||
/**
|
||||
* Returns how many samples have been written so far.
|
||||
|
@@ -46,16 +46,19 @@ __device void to_unit_disk(float *x, float *y)
|
||||
if(a > -b) {
|
||||
if(a > b) {
|
||||
r = a;
|
||||
phi = M_PI_4_F *(b/a);
|
||||
} else {
|
||||
r = b;
|
||||
phi = M_PI_4_F *(2.0f - a/b);
|
||||
}
|
||||
} else {
|
||||
phi = M_PI_4_F *(b/a);
|
||||
}
|
||||
else {
|
||||
r = b;
|
||||
phi = M_PI_4_F *(2.0f - a/b);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(a < b) {
|
||||
r = -a;
|
||||
phi = M_PI_4_F *(4.0f + b/a);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
r = -b;
|
||||
if(b != 0.0f)
|
||||
phi = M_PI_4_F *(6.0f - a/b);
|
||||
|
@@ -37,39 +37,39 @@ color magic(point p, int n, float distortion)
|
||||
y *= dist;
|
||||
|
||||
if(n > 1) {
|
||||
x= cos(x-y-z);
|
||||
x = cos(x-y-z);
|
||||
x *= dist;
|
||||
|
||||
if(n > 2) {
|
||||
z= sin(-x-y-z);
|
||||
z = sin(-x-y-z);
|
||||
z *= dist;
|
||||
|
||||
if(n > 3) {
|
||||
x= -cos(-x+y-z);
|
||||
x = -cos(-x+y-z);
|
||||
x *= dist;
|
||||
|
||||
if(n > 4) {
|
||||
y= -sin(-x+y+z);
|
||||
y = -sin(-x+y+z);
|
||||
y *= dist;
|
||||
|
||||
if(n > 5) {
|
||||
y= -cos(-x+y+z);
|
||||
y = -cos(-x+y+z);
|
||||
y *= dist;
|
||||
|
||||
if(n > 6) {
|
||||
x= cos(x+y+z);
|
||||
x = cos(x+y+z);
|
||||
x *= dist;
|
||||
|
||||
if(n > 7) {
|
||||
z= sin(x+y-z);
|
||||
z = sin(x+y-z);
|
||||
z *= dist;
|
||||
|
||||
if(n > 8) {
|
||||
x= -cos(-x-y+z);
|
||||
x = -cos(-x-y+z);
|
||||
x *= dist;
|
||||
|
||||
if(n > 9) {
|
||||
y= -sin(x-y+z);
|
||||
y = -sin(x-y+z);
|
||||
y *= dist;
|
||||
}
|
||||
}
|
||||
|
@@ -239,8 +239,8 @@ color node_mix_soft(float t, color col1, color col2)
|
||||
{
|
||||
float tm = 1.0 - t;
|
||||
|
||||
color one= color(1.0);
|
||||
color scr= one - (one - col2)*(one - col1);
|
||||
color one = color(1.0);
|
||||
color scr = one - (one - col2)*(one - col1);
|
||||
|
||||
return tm*col1 + t*((one - col1)*col2*col1 + col1*scr);
|
||||
}
|
||||
|
@@ -58,7 +58,8 @@ __device float fresnel_dielectric(float eta, const float3 N,
|
||||
neta = 1 / eta;
|
||||
Nn = N;
|
||||
*is_inside = false;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// we are inside the surface,
|
||||
cos = -cos;
|
||||
neta = eta;
|
||||
@@ -74,7 +75,8 @@ __device float fresnel_dielectric(float eta, const float3 N,
|
||||
*dTdy = make_float3(0.0f, 0.0f, 0.0f);
|
||||
#endif
|
||||
return 1; // total internal reflection
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
float dnp = sqrtf(arg);
|
||||
float nK = (neta * cos)- dnp;
|
||||
*T = -(neta * I)+(nK * Nn);
|
||||
|
@@ -144,9 +144,10 @@ __device int bsdf_translucent_sample(const ShaderData *sd, const ShaderClosure *
|
||||
*domega_in_dx *= -125.0f;
|
||||
*domega_in_dy *= -125.0f;
|
||||
#endif
|
||||
} else
|
||||
}
|
||||
else {
|
||||
*pdf = 0;
|
||||
|
||||
}
|
||||
return LABEL_TRANSMIT|LABEL_DIFFUSE;
|
||||
}
|
||||
|
||||
|
@@ -210,7 +210,8 @@ __device int bsdf_microfacet_ggx_sample(const ShaderData *sd, const ShaderClosur
|
||||
#endif
|
||||
}
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// CAUTION: the i and o variables are inverted relative to the paper
|
||||
// eq. 39 - compute actual refractive direction
|
||||
float3 R, T;
|
||||
@@ -443,7 +444,8 @@ __device int bsdf_microfacet_beckmann_sample(const ShaderData *sd, const ShaderC
|
||||
#endif
|
||||
}
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// CAUTION: the i and o variables are inverted relative to the paper
|
||||
// eq. 39 - compute actual refractive direction
|
||||
float3 R, T;
|
||||
|
@@ -127,19 +127,22 @@ __device int bsdf_ward_sample(const ShaderData *sd, const ShaderClosure *sc, flo
|
||||
float tanPhi = alphaRatio * tanf(M_PI_2_F * val);
|
||||
cosPhi = 1 / sqrtf(1 + tanPhi * tanPhi);
|
||||
sinPhi = tanPhi * cosPhi;
|
||||
} else if(randu < 0.5f) {
|
||||
}
|
||||
else if(randu < 0.5f) {
|
||||
float val = 1 - 4 * (0.5f - randu);
|
||||
float tanPhi = alphaRatio * tanf(M_PI_2_F * val);
|
||||
// phi = M_PI_F - phi;
|
||||
cosPhi = -1 / sqrtf(1 + tanPhi * tanPhi);
|
||||
sinPhi = -tanPhi * cosPhi;
|
||||
} else if(randu < 0.75f) {
|
||||
}
|
||||
else if(randu < 0.75f) {
|
||||
float val = 4 * (randu - 0.5f);
|
||||
float tanPhi = alphaRatio * tanf(M_PI_2_F * val);
|
||||
//phi = M_PI_F + phi;
|
||||
cosPhi = -1 / sqrtf(1 + tanPhi * tanPhi);
|
||||
sinPhi = tanPhi * cosPhi;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
float val = 1 - 4 * (1 - randu);
|
||||
float tanPhi = alphaRatio * tanf(M_PI_2_F * val);
|
||||
// phi = 2 * M_PI_F - phi;
|
||||
|
@@ -196,8 +196,10 @@ __device int bsdf_westin_sheen_sample(const ShaderData *sd, const ShaderClosure
|
||||
*domega_in_dx *= 125.0f;
|
||||
*domega_in_dy *= 125.0f;
|
||||
#endif
|
||||
} else
|
||||
}
|
||||
else {
|
||||
pdf = 0;
|
||||
}
|
||||
return LABEL_REFLECT|LABEL_DIFFUSE;
|
||||
}
|
||||
|
||||
|
@@ -69,11 +69,11 @@ __device float3 hsv_to_rgb(float3 hsv)
|
||||
s = hsv.y;
|
||||
v = hsv.z;
|
||||
|
||||
if(s==0.0f) {
|
||||
if(s == 0.0f) {
|
||||
rgb = make_float3(v, v, v);
|
||||
}
|
||||
else {
|
||||
if(h==1.0f)
|
||||
if(h == 1.0f)
|
||||
h = 0.0f;
|
||||
|
||||
h *= 6.0f;
|
||||
|
@@ -104,7 +104,7 @@ __device float grad(int hash, float x, float y, float z)
|
||||
// use vectors pointing to the edges of the cube
|
||||
int h = hash & 15;
|
||||
float u = h<8 ? x : y;
|
||||
float v = h<4 ? y : h==12||h==14 ? x : z;
|
||||
float v = h<4 ? y : h == 12 || h == 14 ? x : z;
|
||||
return ((h&1) ? -u : u) + ((h&2) ? -v : v);
|
||||
}
|
||||
|
||||
|
@@ -245,7 +245,7 @@ void Camera::device_free(Device *device, DeviceScene *dscene)
|
||||
|
||||
bool Camera::modified(const Camera& cam)
|
||||
{
|
||||
return !((shuttertime== cam.shuttertime) &&
|
||||
return !((shuttertime == cam.shuttertime) &&
|
||||
(aperturesize == cam.aperturesize) &&
|
||||
(blades == cam.blades) &&
|
||||
(bladesrotation == cam.bladesrotation) &&
|
||||
|
@@ -459,7 +459,8 @@ extern "C" int GHOST_HACK_getFirstFile(char buf[FIRSTFILEBUFLG])
|
||||
strncpy(buf, g_firstFileBuf, FIRSTFILEBUFLG - 1);
|
||||
buf[FIRSTFILEBUFLG - 1] = '\0';
|
||||
return 1;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@@ -94,7 +94,8 @@ int main (int argc, char *argv[])
|
||||
if (verbose) {
|
||||
if (error_status) {
|
||||
fprintf(stderr, "|--* Memory test FAILED\n|\n");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "|--* Memory tested as good (as it should be)\n|\n");
|
||||
}
|
||||
}
|
||||
@@ -130,7 +131,8 @@ int main (int argc, char *argv[])
|
||||
if (verbose) {
|
||||
if (retval) {
|
||||
fprintf(stderr, "|--* Memory test failed (as it should be)\n");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "|--* Memory test FAILED to find corrupted blocks \n");
|
||||
}
|
||||
}
|
||||
@@ -147,7 +149,8 @@ int main (int argc, char *argv[])
|
||||
if (verbose) {
|
||||
if (error_status) {
|
||||
fprintf(stderr,"|\n|--* Errors were detected\n");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
fprintf(stderr,"|\n|--* Test exited succesfully\n");
|
||||
}
|
||||
|
||||
|
@@ -157,7 +157,8 @@ static int my_gets(SOCKET sock, char * line, int maxlen)
|
||||
line++;
|
||||
*line = 0;
|
||||
break;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
line++;
|
||||
maxlen--;
|
||||
}
|
||||
@@ -251,15 +252,20 @@ HRESULT __stdcall VF_OpenFileFunc_Blen(
|
||||
|
||||
if (strcmp(key, "width") == 0) {
|
||||
rval->width = atoi(val);
|
||||
} else if (strcmp(key, "height") == 0) {
|
||||
}
|
||||
else if (strcmp(key, "height") == 0) {
|
||||
rval->height = atoi(val);
|
||||
} else if (strcmp(key, "start") == 0) {
|
||||
}
|
||||
else if (strcmp(key, "start") == 0) {
|
||||
rval->start = atoi(val);
|
||||
} else if (strcmp(key, "end") == 0) {
|
||||
}
|
||||
else if (strcmp(key, "end") == 0) {
|
||||
rval->end = atoi(val);
|
||||
} else if (strcmp(key, "rate") == 0) {
|
||||
}
|
||||
else if (strcmp(key, "rate") == 0) {
|
||||
rval->rate = atoi(val);
|
||||
} else if (strcmp(key, "ratescale") == 0) {
|
||||
}
|
||||
else if (strcmp(key, "ratescale") == 0) {
|
||||
rval->ratescale = atoi(val);
|
||||
}
|
||||
}
|
||||
|
@@ -915,7 +915,8 @@ void GPU_paint_update_image(Image *ima, int x, int y, int w, int h)
|
||||
* so we will be using GPU mipmap generation here */
|
||||
if (GPU_get_mipmap()) {
|
||||
glGenerateMipmapEXT(GL_TEXTURE_2D);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
ima->tpageflag &= ~IMA_MIPMAP_COMPLETE;
|
||||
}
|
||||
|
||||
@@ -942,7 +943,8 @@ void GPU_paint_update_image(Image *ima, int x, int y, int w, int h)
|
||||
/* see comment above as to why we are using gpu mipmap generation here */
|
||||
if (GPU_get_mipmap()) {
|
||||
glGenerateMipmapEXT(GL_TEXTURE_2D);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
ima->tpageflag &= ~IMA_MIPMAP_COMPLETE;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user