diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-11-15 19:19:26 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-11-15 19:19:26 +0300 |
commit | 8610b57271eb792b7fbdf31596ab432794ba7a88 (patch) | |
tree | 054a1e1207d93eb52568604a16609474f96596fb /intern | |
parent | c617fcad10e48e557769a101d2ec382e63840cd0 (diff) |
Cycles: Cleanup, code style
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/blender/blender_session.cpp | 10 | ||||
-rw-r--r-- | intern/cycles/blender/blender_shader.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/blender/blender_sync.cpp | 18 | ||||
-rw-r--r-- | intern/cycles/device/device.cpp | 4 |
4 files changed, 18 insertions, 18 deletions
diff --git a/intern/cycles/blender/blender_session.cpp b/intern/cycles/blender/blender_session.cpp index 17da8b43d29..cbead20488a 100644 --- a/intern/cycles/blender/blender_session.cpp +++ b/intern/cycles/blender/blender_session.cpp @@ -180,12 +180,12 @@ void BlenderSession::reset_session(BL::BlendData& b_data, BL::Depsgraph& b_depsg this->b_depsgraph = b_depsgraph; this->b_scene = b_depsgraph.scene_eval(); - if (preview_osl) { + if(preview_osl) { PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles"); RNA_boolean_set(&cscene, "shading_system", preview_osl); } - if (b_v3d) { + if(b_v3d) { this->b_render = b_scene.render(); } else { @@ -194,11 +194,11 @@ void BlenderSession::reset_session(BL::BlendData& b_data, BL::Depsgraph& b_depsg height = render_resolution_y(b_render); } - if (session == NULL) { + if(session == NULL) { create(); } - if (b_v3d) { + if(b_v3d) { /* NOTE: We need to create session, but all the code from below * will make viewport render to stuck on initialization. */ @@ -1413,7 +1413,7 @@ void BlenderSession::update_resumable_tile_manager(int num_samples) void BlenderSession::free_blender_memory_if_possible() { - if (!background) { + if(!background) { /* During interactive render we can not free anything: attempts to save * memory would cause things to be allocated and evaluated for every * updated sample. diff --git a/intern/cycles/blender/blender_shader.cpp b/intern/cycles/blender/blender_shader.cpp index b89e3004403..604c134a2f7 100644 --- a/intern/cycles/blender/blender_shader.cpp +++ b/intern/cycles/blender/blender_shader.cpp @@ -1236,7 +1236,7 @@ void BlenderSync::sync_materials(BL::Depsgraph& b_depsgraph, bool update_all) BL::Depsgraph::ids_iterator b_id; for(b_depsgraph.ids.begin(b_id); b_id != b_depsgraph.ids.end(); ++b_id) { - if (!b_id->is_a(&RNA_Material)) { + if(!b_id->is_a(&RNA_Material)) { continue; } @@ -1409,7 +1409,7 @@ void BlenderSync::sync_lights(BL::Depsgraph& b_depsgraph, bool update_all) BL::Depsgraph::ids_iterator b_id; for(b_depsgraph.ids.begin(b_id); b_id != b_depsgraph.ids.end(); ++b_id) { - if (!b_id->is_a(&RNA_Light)) { + if(!b_id->is_a(&RNA_Light)) { continue; } diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp index 33c45de8d70..8a9b881b7d4 100644 --- a/intern/cycles/blender/blender_sync.cpp +++ b/intern/cycles/blender/blender_sync.cpp @@ -111,21 +111,21 @@ void BlenderSync::sync_recalc(BL::Depsgraph& b_depsgraph) BL::ID b_id(b_update->id()); /* Material */ - if (b_id.is_a(&RNA_Material)) { + if(b_id.is_a(&RNA_Material)) { BL::Material b_mat(b_id); shader_map.set_recalc(b_mat); } /* Light */ - else if (b_id.is_a(&RNA_Light)) { + else if(b_id.is_a(&RNA_Light)) { BL::Light b_light(b_id); shader_map.set_recalc(b_light); } /* Object */ - else if (b_id.is_a(&RNA_Object)) { + else if(b_id.is_a(&RNA_Object)) { BL::Object b_ob(b_id); const bool updated_geometry = !b_update->is_dirty_geometry(); - if (!b_update->is_dirty_transform()) { + if(!b_update->is_dirty_transform()) { object_map.set_recalc(b_ob); light_map.set_recalc(b_ob); } @@ -151,12 +151,12 @@ void BlenderSync::sync_recalc(BL::Depsgraph& b_depsgraph) } } /* Mesh */ - else if (b_id.is_a(&RNA_Mesh)) { + else if(b_id.is_a(&RNA_Mesh)) { BL::Mesh b_mesh(b_id); mesh_map.set_recalc(b_mesh); } /* World */ - else if (b_id.is_a(&RNA_World)) { + else if(b_id.is_a(&RNA_World)) { BL::World b_world(b_id); if(world_map == b_world.ptr.data) { world_recalc = true; @@ -165,13 +165,13 @@ void BlenderSync::sync_recalc(BL::Depsgraph& b_depsgraph) } /* Updates shader with object dependency if objects changed. */ - if (has_updated_objects) { + if(has_updated_objects) { if(scene->default_background->has_object_dependency) { world_recalc = true; } foreach(Shader *shader, scene->shaders) { - if (shader->has_object_dependency) { + if(shader->has_object_dependency) { shader->need_sync_object = true; } } @@ -619,7 +619,7 @@ void BlenderSync::free_data_after_sync(BL::Depsgraph& b_depsgraph) const bool is_interface_locked = b_engine.render() && b_engine.render().use_lock_interface(); const bool can_free_caches = BlenderSession::headless || is_interface_locked; - if (!can_free_caches) { + if(!can_free_caches) { return; } /* TODO(sergey): We can actually remove the whole dependency graph, diff --git a/intern/cycles/device/device.cpp b/intern/cycles/device/device.cpp index 428cd4158bc..565f8f5404c 100644 --- a/intern/cycles/device/device.cpp +++ b/intern/cycles/device/device.cpp @@ -203,7 +203,7 @@ bool Device::bind_fallback_display_space_shader(const float width, const float h fallback_shader_program = bind_fallback_shader(); fallback_status = FALLBACK_SHADER_STATUS_ERROR; - if (fallback_shader_program == 0) { + if(fallback_shader_program == 0) { return false; } @@ -266,7 +266,7 @@ void Device::draw_pixels( GLint shader_program; if(use_fallback_shader) { - if (!bind_fallback_display_space_shader(dw, dh)) { + if(!bind_fallback_display_space_shader(dw, dh)) { return; } shader_program = fallback_shader_program; |