diff options
Diffstat (limited to 'source/blender/freestyle/intern/scene_graph/SceneHash.h')
-rw-r--r-- | source/blender/freestyle/intern/scene_graph/SceneHash.h | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/source/blender/freestyle/intern/scene_graph/SceneHash.h b/source/blender/freestyle/intern/scene_graph/SceneHash.h index 8f5f847eaab..9da711673f0 100644 --- a/source/blender/freestyle/intern/scene_graph/SceneHash.h +++ b/source/blender/freestyle/intern/scene_graph/SceneHash.h @@ -26,8 +26,12 @@ */ #include "IndexedFaceSet.h" +#include "NodeSceneRenderLayer.h" +#include "NodeCamera.h" #include "SceneVisitor.h" +#include "BLI_sys_types.h" + #ifdef WITH_CXX_GUARDEDALLOC #include "MEM_guardedalloc.h" #endif @@ -39,23 +43,34 @@ class SceneHash : public SceneVisitor public: inline SceneHash() : SceneVisitor() { - _hashcode = 0.0; + _sum = 1; } virtual ~SceneHash() {} + VISIT_DECL(NodeCamera) + VISIT_DECL(NodeSceneRenderLayer) VISIT_DECL(IndexedFaceSet) - inline real getValue() { - return _hashcode; + string toString(); + + inline bool match() { + return _sum == _prevSum; + } + + inline void store() { + _prevSum = _sum; } inline void reset() { - _hashcode = 0.0; + _sum = 1; } private: - real _hashcode; + void adler32(unsigned char *data, int size); + + uint32_t _sum; + uint32_t _prevSum; #ifdef WITH_CXX_GUARDEDALLOC MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:SceneHash") |