[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47483] trunk/blender/source: style cleanup
Campbell Barton
ideasman42 at gmail.com
Wed Jun 6 00:12:25 CEST 2012
Revision: 47483
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47483
Author: campbellbarton
Date: 2012-06-05 22:12:17 +0000 (Tue, 05 Jun 2012)
Log Message:
-----------
style cleanup
Modified Paths:
--------------
trunk/blender/source/blender/blenkernel/intern/library.c
trunk/blender/source/blender/gpu/shaders/gpu_shader_material.glsl
trunk/blender/source/gameengine/GameLogic/SCA_PropertySensor.cpp
trunk/blender/source/gameengine/GameLogic/SCA_RandomActuator.cpp
trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
trunk/blender/source/gameengine/VideoTexture/FilterColor.h
Modified: trunk/blender/source/blender/blenkernel/intern/library.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/library.c 2012-06-05 21:54:21 UTC (rev 47482)
+++ trunk/blender/source/blender/blenkernel/intern/library.c 2012-06-05 22:12:17 UTC (rev 47483)
@@ -1142,7 +1142,7 @@
* Normally the ID that's being check is already in the ListBase, so ID *id
* points at the new entry. The Python Library module needs to know what
* the name of a datablock will be before it is appended; in this case ID *id
- * id is NULL;
+ * id is NULL
*/
static int check_for_dupid(ListBase *lb, ID *id, char *name)
Modified: trunk/blender/source/blender/gpu/shaders/gpu_shader_material.glsl
===================================================================
--- trunk/blender/source/blender/gpu/shaders/gpu_shader_material.glsl 2012-06-05 21:54:21 UTC (rev 47482)
+++ trunk/blender/source/blender/gpu/shaders/gpu_shader_material.glsl 2012-06-05 22:12:17 UTC (rev 47483)
@@ -1105,7 +1105,7 @@
// It needs to be done because in Blender
// the normal used points inward.
// Should this ever change this negate must be removed.
- vec4 color = texture2D(ima, texco.xy);
+ vec4 color = texture2D(ima, texco.xy);
normal = 2.0*(vec3(-color.r, color.g, color.b) - vec3(-0.5, 0.5, 0.5));
}
@@ -1190,7 +1190,7 @@
}
void mtex_bump_tap3( vec3 texco, sampler2D ima, float hScale,
- out float dBs, out float dBt )
+ out float dBs, out float dBt )
{
vec2 STll = texco.xy;
vec2 STlr = texco.xy + dFdx(texco.xy) ;
@@ -1945,22 +1945,23 @@
float fresnel_dielectric(vec3 Incoming, vec3 Normal, float eta)
{
- /* compute fresnel reflectance without explicitly computing
- the refracted direction */
- float c = abs(dot(Incoming, Normal));
- float g = eta * eta - 1.0 + c * c;
- float result;
+ /* compute fresnel reflectance without explicitly computing
+ * the refracted direction */
+ float c = abs(dot(Incoming, Normal));
+ float g = eta * eta - 1.0 + c * c;
+ float result;
- if(g > 0.0) {
- g = sqrt(g);
- float A =(g - c)/(g + c);
- float B =(c *(g + c)- 1.0)/(c *(g - c)+ 1.0);
- result = 0.5 * A * A *(1.0 + B * B);
- }
- else
- result = 1.0; /* TIR (no refracted component) */
+ if(g > 0.0) {
+ g = sqrt(g);
+ float A =(g - c)/(g + c);
+ float B =(c *(g + c)- 1.0)/(c *(g - c)+ 1.0);
+ result = 0.5 * A * A *(1.0 + B * B);
+ }
+ else {
+ result = 1.0; /* TIR (no refracted component) */
+ }
- return result;
+ return result;
}
float hypot(float x, float y)
@@ -2135,13 +2136,13 @@
void node_tex_image(vec3 co, sampler2D ima, out vec4 color, out float alpha)
{
color = texture2D(ima, co.xy);
- alpha = color.a;
+ alpha = color.a;
}
void node_tex_image_empty(vec3 co, out vec4 color, out float alpha)
{
color = vec4(0.0);
- alpha = 0.0;
+ alpha = 0.0;
}
void node_tex_magic(vec3 p, float scale, float distortion, out vec4 color, out float fac)
Modified: trunk/blender/source/gameengine/GameLogic/SCA_PropertySensor.cpp
===================================================================
--- trunk/blender/source/gameengine/GameLogic/SCA_PropertySensor.cpp 2012-06-05 21:54:21 UTC (rev 47482)
+++ trunk/blender/source/gameengine/GameLogic/SCA_PropertySensor.cpp 2012-06-05 22:12:17 UTC (rev 47483)
@@ -91,10 +91,10 @@
//The context is needed to retrieve the property at runtime but it creates
//loop of references
pars.SetContext(this->AddRef());
- STR_String checkstr = "(" + m_checkpropval + " <= "
- + m_checkpropname + ") && ( "
- + m_checkpropname + " <= "
- + m_checkpropmaxval + ")";
+ STR_String checkstr = ("(" + m_checkpropval + " <= " +
+ m_checkpropname + ") && ( " +
+ m_checkpropname + " <= " +
+ m_checkpropmaxval + ")");
m_range_expr = pars.ProcessText(checkstr);
}
Modified: trunk/blender/source/gameengine/GameLogic/SCA_RandomActuator.cpp
===================================================================
--- trunk/blender/source/gameengine/GameLogic/SCA_RandomActuator.cpp 2012-06-05 21:54:21 UTC (rev 47482)
+++ trunk/blender/source/gameengine/GameLogic/SCA_RandomActuator.cpp 2012-06-05 22:12:17 UTC (rev 47483)
@@ -141,8 +141,7 @@
int res;
/* The [0, 1] interval is projected onto the [min, max+1] domain, */
/* and then rounded. */
- res = (int) floor( ((m_parameter2 - m_parameter1 + 1) * m_base->DrawFloat())
- + m_parameter1);
+ res = (int)floor( ((m_parameter2 - m_parameter1 + 1) * m_base->DrawFloat()) + m_parameter1);
tmpval = new CIntValue(res);
}
break;
@@ -172,8 +171,7 @@
}
break;
case KX_RANDOMACT_FLOAT_UNIFORM: {
- float res = ((m_parameter2 - m_parameter1) * m_base->DrawFloat())
- + m_parameter1;
+ float res = ((m_parameter2 - m_parameter1) * m_base->DrawFloat()) + m_parameter1;
tmpval = new CFloatValue(res);
}
break;
@@ -239,8 +237,7 @@
/* controlling parameter. Using the 'normal' exponent is not very */
/* intuitive... */
/* tmpval = new CFloatValue( (1.0 / m_parameter1) */
- tmpval = new CFloatValue( (m_parameter1)
- * (-log(1.0 - m_base->DrawFloat())) );
+ tmpval = new CFloatValue((m_parameter1) * (-log(1.0 - m_base->DrawFloat())));
}
break;
Modified: trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
===================================================================
--- trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp 2012-06-05 21:54:21 UTC (rev 47482)
+++ trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp 2012-06-05 22:12:17 UTC (rev 47483)
@@ -719,8 +719,8 @@
{
if (ctrl->getConstructionInfo().m_do_fh)
{
- btVector3 lspot = cl_object->getCenterOfMassPosition()
- + rayDirLocal * resultCallback.m_closestHitFraction;
+ btVector3 lspot = cl_object->getCenterOfMassPosition() +
+ rayDirLocal * resultCallback.m_closestHitFraction;
Modified: trunk/blender/source/gameengine/VideoTexture/FilterColor.h
===================================================================
--- trunk/blender/source/gameengine/VideoTexture/FilterColor.h 2012-06-05 21:54:21 UTC (rev 47482)
+++ trunk/blender/source/gameengine/VideoTexture/FilterColor.h 2012-06-05 22:12:17 UTC (rev 47483)
@@ -91,9 +91,9 @@
/// calculate one color component
unsigned char calcColor (unsigned int val, short idx)
{
- return (((m_matrix[idx][0] * (VT_R(val)) + m_matrix[idx][1] * (VT_G(val))
- + m_matrix[idx][2] * (VT_B(val)) + m_matrix[idx][3] * (VT_A(val))
- + m_matrix[idx][4]) >> 8) & 0xFF);
+ return (((m_matrix[idx][0] * (VT_R(val)) + m_matrix[idx][1] * (VT_G(val)) +
+ m_matrix[idx][2] * (VT_B(val)) + m_matrix[idx][3] * (VT_A(val)) +
+ m_matrix[idx][4]) >> 8) & 0xFF);
}
/// filter pixel template, source int buffer
More information about the Bf-blender-cvs
mailing list