diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:17:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:21:24 +0300 |
commit | e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch) | |
tree | 8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/freestyle/intern/scene_graph/SceneHash.cpp | |
parent | b3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff) |
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/freestyle/intern/scene_graph/SceneHash.cpp')
-rw-r--r-- | source/blender/freestyle/intern/scene_graph/SceneHash.cpp | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/source/blender/freestyle/intern/scene_graph/SceneHash.cpp b/source/blender/freestyle/intern/scene_graph/SceneHash.cpp index fcecb67cae9..b5d954664e4 100644 --- a/source/blender/freestyle/intern/scene_graph/SceneHash.cpp +++ b/source/blender/freestyle/intern/scene_graph/SceneHash.cpp @@ -26,55 +26,55 @@ namespace Freestyle { string SceneHash::toString() { - stringstream ss; - ss << hex << _sum; - return ss.str(); + stringstream ss; + ss << hex << _sum; + return ss.str(); } -void SceneHash::visitNodeViewLayer(NodeViewLayer& node) +void SceneHash::visitNodeViewLayer(NodeViewLayer &node) { - struct RenderData *r = &node.scene().r; - adler32((unsigned char *)&r->xsch, sizeof(r->xsch)); // resolution_x - adler32((unsigned char *)&r->ysch, sizeof(r->ysch)); // resolution_y - adler32((unsigned char *)&r->size, sizeof(r->size)); // resolution_percentage + struct RenderData *r = &node.scene().r; + adler32((unsigned char *)&r->xsch, sizeof(r->xsch)); // resolution_x + adler32((unsigned char *)&r->ysch, sizeof(r->ysch)); // resolution_y + adler32((unsigned char *)&r->size, sizeof(r->size)); // resolution_percentage - struct FreestyleConfig *config = &node.sceneLayer().freestyle_config; - adler32((unsigned char *)&config->flags, sizeof(config->flags)); - adler32((unsigned char *)&config->crease_angle, sizeof(config->crease_angle)); - adler32((unsigned char *)&config->sphere_radius, sizeof(config->sphere_radius)); - adler32((unsigned char *)&config->dkr_epsilon, sizeof(config->dkr_epsilon)); + struct FreestyleConfig *config = &node.sceneLayer().freestyle_config; + adler32((unsigned char *)&config->flags, sizeof(config->flags)); + adler32((unsigned char *)&config->crease_angle, sizeof(config->crease_angle)); + adler32((unsigned char *)&config->sphere_radius, sizeof(config->sphere_radius)); + adler32((unsigned char *)&config->dkr_epsilon, sizeof(config->dkr_epsilon)); } -void SceneHash::visitNodeCamera(NodeCamera& cam) +void SceneHash::visitNodeCamera(NodeCamera &cam) { - double *proj = cam.projectionMatrix(); - for (int i = 0; i < 16; i++) { - adler32((unsigned char *)&proj[i], sizeof(double)); - } + double *proj = cam.projectionMatrix(); + for (int i = 0; i < 16; i++) { + adler32((unsigned char *)&proj[i], sizeof(double)); + } } -void SceneHash::visitIndexedFaceSet(IndexedFaceSet& ifs) +void SceneHash::visitIndexedFaceSet(IndexedFaceSet &ifs) { - const float *v = ifs.vertices(); - const unsigned n = ifs.vsize(); + const float *v = ifs.vertices(); + const unsigned n = ifs.vsize(); - for (unsigned i = 0; i < n; i++) { - adler32((unsigned char *)&v[i], sizeof(v[i])); - } + for (unsigned i = 0; i < n; i++) { + adler32((unsigned char *)&v[i], sizeof(v[i])); + } } static const int MOD_ADLER = 65521; void SceneHash::adler32(unsigned char *data, int size) { - uint32_t sum1 = _sum & 0xffff; - uint32_t sum2 = (_sum >> 16) & 0xffff; + uint32_t sum1 = _sum & 0xffff; + uint32_t sum2 = (_sum >> 16) & 0xffff; - for (int i = 0; i < size; i++) { - sum1 = (sum1 + data[i]) % MOD_ADLER; - sum2 = (sum1 + sum2) % MOD_ADLER; - } - _sum = sum1 | (sum2 << 16); + for (int i = 0; i < size; i++) { + sum1 = (sum1 + data[i]) % MOD_ADLER; + sum2 = (sum1 + sum2) % MOD_ADLER; + } + _sum = sum1 | (sum2 << 16); } } /* namespace Freestyle */ |