diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-03-27 22:15:15 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-03-27 22:15:15 +0300 |
commit | 5ff132182dbb089111cba3a80fa3a8eeb6009ec3 (patch) | |
tree | 016387c6917ce51dbe405489f7f5846b19faab1f /intern/cycles/render | |
parent | 6f43e1dfef3e5632976529a6f678292b15bd5a0c (diff) |
Cycles: Code cleanup, spaces around keywords
This inconsistency drove me totally crazy, it's really confusing
when it's inconsistent especially when you work on both Cycles and
Blender sides.
Shouldn;t cause merge PITA, it's whitespace changes only, Git should
be able to merge it nicely.
Diffstat (limited to 'intern/cycles/render')
-rw-r--r-- | intern/cycles/render/attribute.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/render/blackbody.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/render/camera.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/render/mesh.cpp | 14 | ||||
-rw-r--r-- | intern/cycles/render/nodes.cpp | 16 | ||||
-rw-r--r-- | intern/cycles/render/object.cpp | 10 | ||||
-rw-r--r-- | intern/cycles/render/osl.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/render/session.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/render/sky_model.cpp | 6 | ||||
-rw-r--r-- | intern/cycles/render/tile.cpp | 2 |
10 files changed, 33 insertions, 33 deletions
diff --git a/intern/cycles/render/attribute.cpp b/intern/cycles/render/attribute.cpp index 656420f5dbc..6e94459da55 100644 --- a/intern/cycles/render/attribute.cpp +++ b/intern/cycles/render/attribute.cpp @@ -52,7 +52,7 @@ void Attribute::set(ustring name_, TypeDesc type_, AttributeElement element_) void Attribute::reserve(int numverts, int numtris, int numsteps, int numcurves, int numkeys, bool resize) { - if (resize) { + if(resize) { buffer.resize(buffer_size(numverts, numtris, numsteps, numcurves, numkeys), 0); } else { diff --git a/intern/cycles/render/blackbody.cpp b/intern/cycles/render/blackbody.cpp index 04e6eaf5373..9f77f69a964 100644 --- a/intern/cycles/render/blackbody.cpp +++ b/intern/cycles/render/blackbody.cpp @@ -99,14 +99,14 @@ vector<float> blackbody_table_build() float X, Y, Z; /* ToDo: bring this back to what OSL does with the lastTemperature limit ? */ - for (int i = 0; i <= 317; ++i) { + for(int i = 0; i <= 317; ++i) { double Temperature = pow((double)i, (double)BB_TABLE_XPOWER) * (double)BB_TABLE_SPACING + (double)BB_DRAPER; X = 0; Y = 0; Z = 0; /* from OSL "spectrum_to_XYZ" */ - for (int n = 0; n < 81; ++n) { + for(int n = 0; n < 81; ++n) { float lambda = 380.0f + 5.0f * n; double wlm = lambda * 1e-9f; // Wavelength in meters // N.B. spec_intens returns result in W/m^2 but it's a differential, diff --git a/intern/cycles/render/camera.cpp b/intern/cycles/render/camera.cpp index 74648a71fe0..80101a81bfd 100644 --- a/intern/cycles/render/camera.cpp +++ b/intern/cycles/render/camera.cpp @@ -179,7 +179,7 @@ void Camera::device_update(Device *device, DeviceScene *dscene, Scene *scene) update(); - if (previous_need_motion != need_motion) { + if(previous_need_motion != need_motion) { /* scene's motion model could have been changed since previous device * camera update this could happen for example in case when one render * layer has got motion pass and another not */ @@ -368,7 +368,7 @@ float3 Camera::transform_raster_to_world(float raster_x, float raster_y) */ P += nearclip * D / Pclip.z; } - else if (type == CAMERA_ORTHOGRAPHIC) { + else if(type == CAMERA_ORTHOGRAPHIC) { D = make_float3(0.0f, 0.0f, 1.0f); /* TODO(sergey): Aperture support? */ P = transform_perspective(&rastertocamera, diff --git a/intern/cycles/render/mesh.cpp b/intern/cycles/render/mesh.cpp index c220a126f1a..1d453164aa8 100644 --- a/intern/cycles/render/mesh.cpp +++ b/intern/cycles/render/mesh.cpp @@ -210,11 +210,11 @@ void Mesh::compute_bounds() bnds.grow(float4_to_float3(curve_keys[i]), curve_keys[i].w); Attribute *attr = attributes.find(ATTR_STD_MOTION_VERTEX_POSITION); - if (use_motion_blur && attr) { + if(use_motion_blur && attr) { size_t steps_size = verts.size() * (motion_steps - 1); float3 *vert_steps = attr->data_float3(); - for (size_t i = 0; i < steps_size; i++) + for(size_t i = 0; i < steps_size; i++) bnds.grow(vert_steps[i]); } @@ -223,7 +223,7 @@ void Mesh::compute_bounds() size_t steps_size = curve_keys.size() * (motion_steps - 1); float3 *key_steps = curve_attr->data_float3(); - for (size_t i = 0; i < steps_size; i++) + for(size_t i = 0; i < steps_size; i++) bnds.grow(key_steps[i]); } @@ -237,19 +237,19 @@ void Mesh::compute_bounds() for(size_t i = 0; i < curve_keys_size; i++) bnds.grow_safe(float4_to_float3(curve_keys[i]), curve_keys[i].w); - if (use_motion_blur && attr) { + if(use_motion_blur && attr) { size_t steps_size = verts.size() * (motion_steps - 1); float3 *vert_steps = attr->data_float3(); - for (size_t i = 0; i < steps_size; i++) + for(size_t i = 0; i < steps_size; i++) bnds.grow_safe(vert_steps[i]); } - if (use_motion_blur && curve_attr) { + if(use_motion_blur && curve_attr) { size_t steps_size = curve_keys.size() * (motion_steps - 1); float3 *key_steps = curve_attr->data_float3(); - for (size_t i = 0; i < steps_size; i++) + for(size_t i = 0; i < steps_size; i++) bnds.grow_safe(key_steps[i]); } } diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp index b41f4b511b3..a62634efa42 100644 --- a/intern/cycles/render/nodes.cpp +++ b/intern/cycles/render/nodes.cpp @@ -227,7 +227,7 @@ void ImageTextureNode::attributes(Shader *shader, AttributeRequestSet *attribute #ifdef WITH_PTEX /* todo: avoid loading other texture coordinates when using ptex, * and hide texture coordinate socket in the UI */ - if (shader->has_surface && string_endswith(filename, ".ptx")) { + if(shader->has_surface && string_endswith(filename, ".ptx")) { /* ptex */ attributes->add(ATTR_STD_PTEX_FACE_ID); attributes->add(ATTR_STD_PTEX_UV); @@ -417,7 +417,7 @@ ShaderNode *EnvironmentTextureNode::clone() const void EnvironmentTextureNode::attributes(Shader *shader, AttributeRequestSet *attributes) { #ifdef WITH_PTEX - if (shader->has_surface && string_endswith(filename, ".ptx")) { + if(shader->has_surface && string_endswith(filename, ".ptx")) { /* ptex */ attributes->add(ATTR_STD_PTEX_FACE_ID); attributes->add(ATTR_STD_PTEX_UV); @@ -632,7 +632,7 @@ static void sky_texture_precompute_new(SunSky *sunsky, float3 dir, float turbidi sky_state = arhosek_xyz_skymodelstate_alloc_init(turbidity, ground_albedo, solarElevation); /* Copy values from sky_state to SunSky */ - for (int i = 0; i < 9; ++i) { + for(int i = 0; i < 9; ++i) { sunsky->config_x[i] = (float)sky_state->configs[0][i]; sunsky->config_y[i] = (float)sky_state->configs[1][i]; sunsky->config_z[i] = (float)sky_state->configs[2][i]; @@ -2442,7 +2442,7 @@ void UVMapNode::attributes(Shader *shader, AttributeRequestSet *attributes) if(shader->has_surface) { if(!from_dupli) { if(!output("UV")->links.empty()) { - if (attribute != "") + if(attribute != "") attributes->add(attribute); else attributes->add(ATTR_STD_UV); @@ -2475,7 +2475,7 @@ void UVMapNode::compile(SVMCompiler& compiler) compiler.add_node(texco_node, NODE_TEXCO_DUPLI_UV, out->stack_offset); } else { - if (attribute != "") + if(attribute != "") attr = compiler.attribute(attribute); else attr = compiler.attribute(ATTR_STD_UV); @@ -3987,7 +3987,7 @@ void RGBCurvesNode::compile(OSLCompiler& compiler) { float ramp[RAMP_TABLE_SIZE][3]; - for (int i = 0; i < RAMP_TABLE_SIZE; ++i) { + for(int i = 0; i < RAMP_TABLE_SIZE; ++i) { ramp[i][0] = curves[i].x; ramp[i][1] = curves[i].y; ramp[i][2] = curves[i].z; @@ -4025,7 +4025,7 @@ void VectorCurvesNode::compile(OSLCompiler& compiler) { float ramp[RAMP_TABLE_SIZE][3]; - for (int i = 0; i < RAMP_TABLE_SIZE; ++i) { + for(int i = 0; i < RAMP_TABLE_SIZE; ++i) { ramp[i][0] = curves[i].x; ramp[i][1] = curves[i].y; ramp[i][2] = curves[i].z; @@ -4075,7 +4075,7 @@ void RGBRampNode::compile(OSLCompiler& compiler) float ramp_color[RAMP_TABLE_SIZE][3]; float ramp_alpha[RAMP_TABLE_SIZE]; - for (int i = 0; i < RAMP_TABLE_SIZE; ++i) { + for(int i = 0; i < RAMP_TABLE_SIZE; ++i) { ramp_color[i][0] = ramp[i].x; ramp_color[i][1] = ramp[i].y; ramp_color[i][2] = ramp[i].z; diff --git a/intern/cycles/render/object.cpp b/intern/cycles/render/object.cpp index 840f706f23b..a1d0439c0d7 100644 --- a/intern/cycles/render/object.cpp +++ b/intern/cycles/render/object.cpp @@ -104,11 +104,11 @@ void Object::apply_transform(bool apply_to_motion) if(apply_to_motion) { Attribute *attr = mesh->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION); - if (attr) { + if(attr) { size_t steps_size = mesh->verts.size() * (mesh->motion_steps - 1); float3 *vert_steps = attr->data_float3(); - for (size_t i = 0; i < steps_size; i++) + for(size_t i = 0; i < steps_size; i++) vert_steps[i] = transform_point(&tfm, vert_steps[i]); } @@ -119,7 +119,7 @@ void Object::apply_transform(bool apply_to_motion) size_t steps_size = mesh->verts.size() * (mesh->motion_steps - 1); float3 *normal_steps = attr_N->data_float3(); - for (size_t i = 0; i < steps_size; i++) + for(size_t i = 0; i < steps_size; i++) normal_steps[i] = normalize(transform_direction(&ntfm, normal_steps[i])); } } @@ -146,12 +146,12 @@ void Object::apply_transform(bool apply_to_motion) if(apply_to_motion) { Attribute *curve_attr = mesh->curve_attributes.find(ATTR_STD_MOTION_VERTEX_POSITION); - if (curve_attr) { + if(curve_attr) { /* apply transform to motion curve keys */ size_t steps_size = mesh->curve_keys.size() * (mesh->motion_steps - 1); float4 *key_steps = curve_attr->data_float4(); - for (size_t i = 0; i < steps_size; i++) { + for(size_t i = 0; i < steps_size; i++) { float3 co = transform_point(&tfm, float4_to_float3(key_steps[i])); float radius = key_steps[i].w * scalar; diff --git a/intern/cycles/render/osl.cpp b/intern/cycles/render/osl.cpp index 41844ae219f..679d54d1d1e 100644 --- a/intern/cycles/render/osl.cpp +++ b/intern/cycles/render/osl.cpp @@ -414,7 +414,7 @@ string OSLCompiler::compatible_name(ShaderNode *node, ShaderInput *input) /* if output exists with the same name, add "In" suffix */ foreach(ShaderOutput *output, node->outputs) { - if (strcmp(input->name, output->name)==0) { + if(strcmp(input->name, output->name)==0) { sname += "In"; break; } @@ -434,7 +434,7 @@ string OSLCompiler::compatible_name(ShaderNode *node, ShaderOutput *output) /* if input exists with the same name, add "Out" suffix */ foreach(ShaderInput *input, node->inputs) { - if (strcmp(input->name, output->name)==0) { + if(strcmp(input->name, output->name)==0) { sname += "Out"; break; } diff --git a/intern/cycles/render/session.cpp b/intern/cycles/render/session.cpp index 99826aa4349..65b73eb2ad3 100644 --- a/intern/cycles/render/session.cpp +++ b/intern/cycles/render/session.cpp @@ -889,9 +889,9 @@ bool Session::update_progressive_refine(bool cancel) double current_time = time_dt(); - if (current_time - last_update_time < params.progressive_update_timeout) { + if(current_time - last_update_time < params.progressive_update_timeout) { /* if last sample was processed, we need to write buffers anyway */ - if (!write) + if(!write) return false; } diff --git a/intern/cycles/render/sky_model.cpp b/intern/cycles/render/sky_model.cpp index adb07d9e288..f5fac6be3ed 100644 --- a/intern/cycles/render/sky_model.cpp +++ b/intern/cycles/render/sky_model.cpp @@ -312,7 +312,7 @@ double arhosekskymodel_radiance( { int low_wl = (int)((wavelength - 320.0) / 40.0); - if ( low_wl < 0 || low_wl >= 11 ) + if( low_wl < 0 || low_wl >= 11 ) return 0.0f; double interp = fmod((wavelength - 320.0 ) / 40.0, 1.0); @@ -326,12 +326,12 @@ double arhosekskymodel_radiance( * state->radiances[low_wl] * state->emission_correction_factor_sky[low_wl]; - if ( interp < 1e-6 ) + if( interp < 1e-6 ) return val_low; double result = ( 1.0 - interp ) * val_low; - if ( low_wl+1 < 11 ) + if( low_wl+1 < 11 ) { result += interp diff --git a/intern/cycles/render/tile.cpp b/intern/cycles/render/tile.cpp index b1cad98a852..7e68ce84d94 100644 --- a/intern/cycles/render/tile.cpp +++ b/intern/cycles/render/tile.cpp @@ -235,7 +235,7 @@ bool TileManager::next_tile(Tile& tile, int device) { list<Tile>::iterator tile_it; - if (background) + if(background) tile_it = next_background_tile(device, tile_order); else tile_it = next_viewport_tile(device); |