Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt7
-rw-r--r--SConstruct1
-rw-r--r--build_files/cmake/Modules/FindOpenEXR.cmake2
-rw-r--r--build_files/scons/config/darwin-config.py3
-rw-r--r--build_files/scons/config/freebsd7-config.py2
-rw-r--r--build_files/scons/config/freebsd8-config.py2
-rw-r--r--build_files/scons/config/freebsd9-config.py2
-rw-r--r--build_files/scons/config/linuxcross-config.py2
-rw-r--r--build_files/scons/config/win32-mingw-config.py2
-rw-r--r--build_files/scons/config/win32-vc-config.py2
-rw-r--r--build_files/scons/config/win64-vc-config.py2
-rw-r--r--build_files/scons/tools/btools.py5
-rw-r--r--doc/python_api/rst/info_gotcha.rst8
-rw-r--r--extern/CMakeLists.txt6
-rw-r--r--extern/SConscript5
-rw-r--r--extern/libmv/CMakeLists.txt178
-rw-r--r--extern/libmv/ChangeLog575
-rwxr-xr-xextern/libmv/bundle.sh19
-rw-r--r--extern/libmv/libmv/base/vector.h2
-rw-r--r--extern/libmv/libmv/simple_pipeline/pipeline.cc20
-rw-r--r--extern/libmv/libmv/simple_pipeline/tracks.h20
-rw-r--r--extern/libmv/libmv/tracking/esm_region_tracker.cc1
-rw-r--r--extern/libmv/libmv/tracking/trklt_region_tracker.h2
-rw-r--r--extern/libmv/patches/bundle_tweaks.patch36
-rw-r--r--extern/libmv/patches/config_mac.patch13
-rw-r--r--extern/libmv/patches/detect.patch181
-rw-r--r--extern/libmv/patches/fast.patch24
-rw-r--r--extern/libmv/patches/function_derivative.patch21
-rw-r--r--extern/libmv/patches/high_distortion_crash_fix.patch21
-rw-r--r--extern/libmv/patches/levenberg_marquardt.patch71
-rw-r--r--extern/libmv/patches/mingw.patch171
-rw-r--r--extern/libmv/patches/msvc2010.patch12
-rw-r--r--extern/libmv/patches/overscan.patch182
-rw-r--r--extern/libmv/patches/scaled_distortion.patch261
-rw-r--r--extern/libmv/patches/series11
-rw-r--r--extern/libmv/patches/snrptinf_fix.patch15
-rw-r--r--extern/libmv/patches/v3d_verbosity.patch12
-rw-r--r--extern/libmv/third_party/glog/src/config_freebsd.h2
-rw-r--r--extern/libmv/third_party/glog/src/utilities.h2
-rw-r--r--extern/libredcode/codec.h4
-rw-r--r--extern/libredcode/debayer.h4
-rw-r--r--extern/libredcode/format.h4
-rw-r--r--extern/xdnd/CMakeLists.txt43
-rw-r--r--extern/xdnd/SConscript10
-rw-r--r--extern/xdnd/xdnd.c1599
-rw-r--r--extern/xdnd/xdnd.h221
-rw-r--r--intern/audaspace/FX/AUD_AccumulatorFactory.h6
-rw-r--r--intern/audaspace/FX/AUD_BaseIIRFilterReader.h6
-rw-r--r--intern/audaspace/FX/AUD_ButterworthFactory.h6
-rw-r--r--intern/audaspace/FX/AUD_CallbackIIRFilterReader.h6
-rw-r--r--intern/audaspace/FX/AUD_DelayFactory.h6
-rw-r--r--intern/audaspace/FX/AUD_DelayReader.h6
-rw-r--r--intern/audaspace/FX/AUD_DoubleFactory.h6
-rw-r--r--intern/audaspace/FX/AUD_DoubleReader.h6
-rw-r--r--intern/audaspace/FX/AUD_DynamicIIRFilterFactory.h6
-rw-r--r--intern/audaspace/FX/AUD_DynamicIIRFilterReader.h6
-rw-r--r--intern/audaspace/FX/AUD_EffectFactory.h6
-rw-r--r--intern/audaspace/FX/AUD_EffectReader.h6
-rw-r--r--intern/audaspace/FX/AUD_EnvelopeFactory.h6
-rw-r--r--intern/audaspace/FX/AUD_FaderFactory.h6
-rw-r--r--intern/audaspace/FX/AUD_FaderReader.h6
-rw-r--r--intern/audaspace/FX/AUD_HighpassFactory.h6
-rw-r--r--intern/audaspace/FX/AUD_IIRFilterFactory.h6
-rw-r--r--intern/audaspace/FX/AUD_IIRFilterReader.h6
-rw-r--r--intern/audaspace/FX/AUD_LimiterFactory.h6
-rw-r--r--intern/audaspace/FX/AUD_LimiterReader.h6
-rw-r--r--intern/audaspace/FX/AUD_LoopFactory.h6
-rw-r--r--intern/audaspace/FX/AUD_LoopReader.h6
-rw-r--r--intern/audaspace/FX/AUD_LowpassFactory.h6
-rw-r--r--intern/audaspace/FX/AUD_PingPongFactory.h6
-rw-r--r--intern/audaspace/FX/AUD_PitchFactory.h6
-rw-r--r--intern/audaspace/FX/AUD_PitchReader.h6
-rw-r--r--intern/audaspace/FX/AUD_RectifyFactory.h6
-rw-r--r--intern/audaspace/FX/AUD_ReverseFactory.h6
-rw-r--r--intern/audaspace/FX/AUD_ReverseReader.h6
-rw-r--r--intern/audaspace/FX/AUD_SquareFactory.h6
-rw-r--r--intern/audaspace/FX/AUD_SumFactory.h6
-rw-r--r--intern/audaspace/FX/AUD_SuperposeFactory.h6
-rw-r--r--intern/audaspace/FX/AUD_SuperposeReader.h6
-rw-r--r--intern/audaspace/FX/AUD_VolumeFactory.h6
-rw-r--r--intern/audaspace/OpenAL/AUD_OpenALDevice.h6
-rw-r--r--intern/audaspace/Python/AUD_PyAPI.h6
-rw-r--r--intern/audaspace/SDL/AUD_SDLDevice.h6
-rw-r--r--intern/audaspace/SRC/AUD_SRCResampleFactory.h6
-rw-r--r--intern/audaspace/SRC/AUD_SRCResampleReader.h6
-rw-r--r--intern/audaspace/ffmpeg/AUD_FFMPEGFactory.h6
-rw-r--r--intern/audaspace/ffmpeg/AUD_FFMPEGReader.h6
-rw-r--r--intern/audaspace/ffmpeg/AUD_FFMPEGWriter.h6
-rw-r--r--intern/audaspace/fftw/AUD_BandPassFactory.h6
-rw-r--r--intern/audaspace/fftw/AUD_BandPassReader.h6
-rw-r--r--intern/audaspace/intern/AUD_3DMath.h6
-rw-r--r--intern/audaspace/intern/AUD_AnimateableProperty.h6
-rw-r--r--intern/audaspace/intern/AUD_Buffer.h6
-rw-r--r--intern/audaspace/intern/AUD_BufferReader.h6
-rw-r--r--intern/audaspace/intern/AUD_C-API.h6
-rw-r--r--intern/audaspace/intern/AUD_ChannelMapperFactory.h6
-rw-r--r--intern/audaspace/intern/AUD_ChannelMapperReader.h6
-rw-r--r--intern/audaspace/intern/AUD_ConverterFactory.h6
-rw-r--r--intern/audaspace/intern/AUD_ConverterFunctions.cpp8
-rw-r--r--intern/audaspace/intern/AUD_ConverterFunctions.h6
-rw-r--r--intern/audaspace/intern/AUD_ConverterReader.h6
-rw-r--r--intern/audaspace/intern/AUD_FileFactory.h6
-rw-r--r--intern/audaspace/intern/AUD_FileWriter.h6
-rw-r--r--intern/audaspace/intern/AUD_I3DDevice.h6
-rw-r--r--intern/audaspace/intern/AUD_I3DHandle.h6
-rw-r--r--intern/audaspace/intern/AUD_IDevice.h4
-rw-r--r--intern/audaspace/intern/AUD_IFactory.h6
-rw-r--r--intern/audaspace/intern/AUD_IHandle.h4
-rw-r--r--intern/audaspace/intern/AUD_IReader.h6
-rw-r--r--intern/audaspace/intern/AUD_IWriter.h6
-rw-r--r--intern/audaspace/intern/AUD_JOSResampleFactory.h6
-rw-r--r--intern/audaspace/intern/AUD_JOSResampleReader.cpp2
-rw-r--r--intern/audaspace/intern/AUD_JOSResampleReader.h6
-rw-r--r--intern/audaspace/intern/AUD_LinearResampleFactory.h6
-rw-r--r--intern/audaspace/intern/AUD_LinearResampleReader.h6
-rw-r--r--intern/audaspace/intern/AUD_Mixer.h6
-rw-r--r--intern/audaspace/intern/AUD_MixerFactory.h6
-rw-r--r--intern/audaspace/intern/AUD_NULLDevice.h6
-rw-r--r--intern/audaspace/intern/AUD_PyInit.h6
-rw-r--r--intern/audaspace/intern/AUD_ReadDevice.h6
-rw-r--r--intern/audaspace/intern/AUD_Reference.h6
-rw-r--r--intern/audaspace/intern/AUD_ResampleFactory.h6
-rw-r--r--intern/audaspace/intern/AUD_ResampleReader.h6
-rw-r--r--intern/audaspace/intern/AUD_SequencerEntry.h6
-rw-r--r--intern/audaspace/intern/AUD_SequencerFactory.h6
-rw-r--r--intern/audaspace/intern/AUD_SequencerHandle.h6
-rw-r--r--intern/audaspace/intern/AUD_SequencerReader.h6
-rw-r--r--intern/audaspace/intern/AUD_SilenceFactory.h6
-rw-r--r--intern/audaspace/intern/AUD_SilenceReader.h6
-rw-r--r--intern/audaspace/intern/AUD_SinusFactory.h6
-rw-r--r--intern/audaspace/intern/AUD_SinusReader.h6
-rw-r--r--intern/audaspace/intern/AUD_SoftwareDevice.h6
-rw-r--r--intern/audaspace/intern/AUD_Space.h6
-rw-r--r--intern/audaspace/intern/AUD_StreamBufferFactory.h6
-rw-r--r--intern/audaspace/jack/AUD_JackDevice.h6
-rw-r--r--intern/audaspace/sndfile/AUD_SndFileFactory.h6
-rw-r--r--intern/audaspace/sndfile/AUD_SndFileReader.h6
-rw-r--r--intern/audaspace/sndfile/AUD_SndFileWriter.h6
-rw-r--r--intern/boolop/extern/BOP_Interface.h4
-rw-r--r--intern/boolop/intern/BOP_BBox.h4
-rw-r--r--intern/boolop/intern/BOP_BSPNode.h4
-rw-r--r--intern/boolop/intern/BOP_BSPTree.h4
-rw-r--r--intern/boolop/intern/BOP_Chrono.h4
-rw-r--r--intern/boolop/intern/BOP_Edge.h4
-rw-r--r--intern/boolop/intern/BOP_Face.h4
-rw-r--r--intern/boolop/intern/BOP_Face2Face.h4
-rw-r--r--intern/boolop/intern/BOP_Indexs.h4
-rw-r--r--intern/boolop/intern/BOP_MathUtils.h4
-rw-r--r--intern/boolop/intern/BOP_Merge.h4
-rw-r--r--intern/boolop/intern/BOP_Merge2.h4
-rw-r--r--intern/boolop/intern/BOP_Mesh.h4
-rw-r--r--intern/boolop/intern/BOP_Segment.h4
-rw-r--r--intern/boolop/intern/BOP_Splitter.h4
-rw-r--r--intern/boolop/intern/BOP_Tag.h4
-rw-r--r--intern/boolop/intern/BOP_Triangulator.h4
-rw-r--r--intern/boolop/intern/BOP_Vertex.h4
-rw-r--r--intern/bsp/extern/CSG_BooleanOps.h4
-rw-r--r--intern/bsp/intern/BSP_CSGException.h4
-rw-r--r--intern/bsp/intern/BSP_CSGMesh.h4
-rw-r--r--intern/bsp/intern/BSP_CSGMesh_CFIterator.h4
-rw-r--r--intern/bsp/intern/BSP_MeshPrimitives.h4
-rw-r--r--intern/bsp/test/BSP_GhostTest/BSP_GhostTest3D.h4
-rw-r--r--intern/bsp/test/BSP_GhostTest/BSP_MeshDrawer.h4
-rw-r--r--intern/bsp/test/BSP_GhostTest/BSP_PlyLoader.h4
-rw-r--r--intern/bsp/test/BSP_GhostTest/BSP_TMesh.h4
-rw-r--r--intern/container/CTR_TaggedIndex.h4
-rw-r--r--intern/container/CTR_TaggedSetOps.h4
-rw-r--r--intern/container/CTR_UHeap.h4
-rw-r--r--intern/decimation/extern/LOD_decimation.h6
-rw-r--r--intern/decimation/intern/LOD_DecimationClass.h4
-rw-r--r--intern/decimation/intern/LOD_EdgeCollapser.h4
-rw-r--r--intern/decimation/intern/LOD_ExternBufferEditor.h4
-rw-r--r--intern/decimation/intern/LOD_ExternNormalEditor.h4
-rw-r--r--intern/decimation/intern/LOD_FaceNormalEditor.h4
-rw-r--r--intern/decimation/intern/LOD_ManMesh2.h4
-rw-r--r--intern/decimation/intern/LOD_MeshBounds.h4
-rw-r--r--intern/decimation/intern/LOD_MeshException.h4
-rw-r--r--intern/decimation/intern/LOD_MeshPrimitives.h4
-rw-r--r--intern/decimation/intern/LOD_QSDecimator.h4
-rw-r--r--intern/decimation/intern/LOD_Quadric.h4
-rw-r--r--intern/decimation/intern/LOD_QuadricEditor.h4
-rw-r--r--intern/dualcon/dualcon.h6
-rw-r--r--intern/dualcon/intern/MemoryAllocator.h12
-rw-r--r--intern/dualcon/intern/octree.cpp4259
-rw-r--r--intern/dualcon/intern/octree.h1551
-rw-r--r--intern/ffmpeg/ffmpeg_compat.h7
-rw-r--r--intern/ghost/CMakeLists.txt14
-rw-r--r--intern/ghost/GHOST_C-api.h4
-rw-r--r--intern/ghost/GHOST_IEvent.h6
-rw-r--r--intern/ghost/GHOST_IEventConsumer.h4
-rw-r--r--intern/ghost/GHOST_ISystem.h6
-rw-r--r--intern/ghost/GHOST_ISystemPaths.h4
-rw-r--r--intern/ghost/GHOST_ITimerTask.h6
-rw-r--r--intern/ghost/GHOST_IWindow.h6
-rw-r--r--intern/ghost/GHOST_Path-api.h4
-rw-r--r--intern/ghost/GHOST_Rect.h6
-rw-r--r--intern/ghost/GHOST_Types.h6
-rw-r--r--intern/ghost/SConscript7
-rw-r--r--intern/ghost/intern/GHOST_Buttons.h6
-rw-r--r--intern/ghost/intern/GHOST_CallbackEventConsumer.h6
-rw-r--r--intern/ghost/intern/GHOST_Debug.h6
-rw-r--r--intern/ghost/intern/GHOST_DisplayManager.h6
-rw-r--r--intern/ghost/intern/GHOST_DisplayManagerCarbon.h6
-rw-r--r--intern/ghost/intern/GHOST_DisplayManagerCocoa.h6
-rw-r--r--intern/ghost/intern/GHOST_DisplayManagerNULL.h6
-rw-r--r--intern/ghost/intern/GHOST_DisplayManagerSDL.h6
-rw-r--r--intern/ghost/intern/GHOST_DisplayManagerWin32.h6
-rw-r--r--intern/ghost/intern/GHOST_DisplayManagerX11.h4
-rw-r--r--intern/ghost/intern/GHOST_DropTargetWin32.h6
-rw-r--r--intern/ghost/intern/GHOST_DropTargetX11.cpp310
-rw-r--r--intern/ghost/intern/GHOST_DropTargetX11.h135
-rw-r--r--intern/ghost/intern/GHOST_Event.h6
-rw-r--r--intern/ghost/intern/GHOST_EventButton.h6
-rw-r--r--intern/ghost/intern/GHOST_EventCursor.h6
-rw-r--r--intern/ghost/intern/GHOST_EventDragnDrop.h6
-rw-r--r--intern/ghost/intern/GHOST_EventKey.h6
-rw-r--r--intern/ghost/intern/GHOST_EventManager.h6
-rw-r--r--intern/ghost/intern/GHOST_EventNDOF.h6
-rw-r--r--intern/ghost/intern/GHOST_EventPrinter.h6
-rw-r--r--intern/ghost/intern/GHOST_EventString.h6
-rw-r--r--intern/ghost/intern/GHOST_EventTrackpad.h4
-rw-r--r--intern/ghost/intern/GHOST_EventWheel.h6
-rw-r--r--intern/ghost/intern/GHOST_ModifierKeys.h6
-rw-r--r--intern/ghost/intern/GHOST_NDOFManager.h4
-rw-r--r--intern/ghost/intern/GHOST_NDOFManagerCocoa.h4
-rw-r--r--intern/ghost/intern/GHOST_NDOFManagerWin32.h4
-rw-r--r--intern/ghost/intern/GHOST_NDOFManagerX11.h4
-rw-r--r--intern/ghost/intern/GHOST_System.h6
-rw-r--r--intern/ghost/intern/GHOST_SystemCarbon.h6
-rw-r--r--intern/ghost/intern/GHOST_SystemCocoa.h6
-rw-r--r--intern/ghost/intern/GHOST_SystemNULL.h4
-rw-r--r--intern/ghost/intern/GHOST_SystemPaths.h4
-rw-r--r--intern/ghost/intern/GHOST_SystemPathsCarbon.h9
-rw-r--r--intern/ghost/intern/GHOST_SystemPathsCocoa.h7
-rw-r--r--intern/ghost/intern/GHOST_SystemPathsWin32.h6
-rw-r--r--intern/ghost/intern/GHOST_SystemPathsX11.h4
-rw-r--r--intern/ghost/intern/GHOST_SystemSDL.h4
-rw-r--r--intern/ghost/intern/GHOST_SystemWin32.h6
-rw-r--r--intern/ghost/intern/GHOST_SystemX11.cpp29
-rw-r--r--intern/ghost/intern/GHOST_SystemX11.h18
-rw-r--r--intern/ghost/intern/GHOST_TaskbarWin32.h6
-rw-r--r--intern/ghost/intern/GHOST_TimerManager.h6
-rw-r--r--intern/ghost/intern/GHOST_TimerTask.h6
-rw-r--r--intern/ghost/intern/GHOST_Window.h4
-rw-r--r--intern/ghost/intern/GHOST_WindowCarbon.h6
-rw-r--r--intern/ghost/intern/GHOST_WindowCocoa.h6
-rw-r--r--intern/ghost/intern/GHOST_WindowManager.h6
-rw-r--r--intern/ghost/intern/GHOST_WindowNULL.h6
-rw-r--r--intern/ghost/intern/GHOST_WindowSDL.h6
-rw-r--r--intern/ghost/intern/GHOST_WindowWin32.h6
-rw-r--r--intern/ghost/intern/GHOST_WindowX11.cpp15
-rw-r--r--intern/ghost/intern/GHOST_WindowX11.h19
-rw-r--r--intern/guardedalloc/MEM_guardedalloc.h4
-rw-r--r--intern/guardedalloc/MEM_sys_types.h6
-rw-r--r--intern/guardedalloc/mmap_win.h4
-rw-r--r--intern/iksolver/extern/IK_solver.h6
-rw-r--r--intern/iksolver/intern/IK_QJacobian.h4
-rw-r--r--intern/iksolver/intern/IK_QJacobianSolver.h4
-rw-r--r--intern/iksolver/intern/IK_QSegment.h4
-rw-r--r--intern/iksolver/intern/IK_QTask.h4
-rw-r--r--intern/iksolver/test/ik_glut_test/common/GlutDrawer.h4
-rw-r--r--intern/iksolver/test/ik_glut_test/common/GlutKeyboardManager.h4
-rw-r--r--intern/iksolver/test/ik_glut_test/common/GlutMouseManager.h4
-rw-r--r--intern/iksolver/test/ik_glut_test/intern/ChainDrawer.h4
-rw-r--r--intern/iksolver/test/ik_glut_test/intern/MyGlutKeyHandler.h4
-rw-r--r--intern/iksolver/test/ik_glut_test/intern/MyGlutMouseHandler.h4
-rw-r--r--intern/memutil/MEM_Allocator.h6
-rw-r--r--intern/memutil/MEM_CacheLimiter.h8
-rw-r--r--intern/memutil/MEM_CacheLimiterC-Api.h10
-rw-r--r--intern/memutil/MEM_NonCopyable.h4
-rw-r--r--intern/memutil/MEM_RefCountPtr.h4
-rw-r--r--intern/memutil/MEM_RefCounted.h6
-rw-r--r--intern/memutil/MEM_RefCountedC-Api.h6
-rw-r--r--intern/memutil/MEM_SmartPtr.h4
-rw-r--r--intern/string/STR_HashedString.h6
-rw-r--r--intern/string/STR_String.h6
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py97
-rw-r--r--source/blender/avi/AVI_avi.h6
-rw-r--r--source/blender/avi/intern/avi_intern.h4
-rw-r--r--source/blender/avi/intern/endian.h4
-rw-r--r--source/blender/blenfont/BLF_api.h6
-rw-r--r--source/blender/blenfont/BLF_translation.h6
-rw-r--r--source/blender/blenfont/intern/blf_internal.h6
-rw-r--r--source/blender/blenfont/intern/blf_internal_types.h6
-rw-r--r--source/blender/blenfont/intern/blf_lang.c2
-rw-r--r--source/blender/blenkernel/BKE_DerivedMesh.h4
-rw-r--r--source/blender/blenkernel/BKE_action.h4
-rw-r--r--source/blender/blenkernel/BKE_anim.h4
-rw-r--r--source/blender/blenkernel/BKE_animsys.h6
-rw-r--r--source/blender/blenkernel/BKE_armature.h4
-rw-r--r--source/blender/blenkernel/BKE_blender.h6
-rw-r--r--source/blender/blenkernel/BKE_bmesh.h4
-rw-r--r--source/blender/blenkernel/BKE_bmeshCustomData.h4
-rw-r--r--source/blender/blenkernel/BKE_bmfont.h4
-rw-r--r--source/blender/blenkernel/BKE_bmfont_types.h4
-rw-r--r--source/blender/blenkernel/BKE_boids.h4
-rw-r--r--source/blender/blenkernel/BKE_booleanops_mesh.h4
-rw-r--r--source/blender/blenkernel/BKE_brush.h4
-rw-r--r--source/blender/blenkernel/BKE_bullet.h4
-rw-r--r--source/blender/blenkernel/BKE_bvhutils.h4
-rw-r--r--source/blender/blenkernel/BKE_camera.h4
-rw-r--r--source/blender/blenkernel/BKE_cdderivedmesh.h4
-rw-r--r--source/blender/blenkernel/BKE_cloth.h4
-rw-r--r--source/blender/blenkernel/BKE_collision.h4
-rw-r--r--source/blender/blenkernel/BKE_colortools.h4
-rw-r--r--source/blender/blenkernel/BKE_constraint.h4
-rw-r--r--source/blender/blenkernel/BKE_context.h4
-rw-r--r--source/blender/blenkernel/BKE_curve.h4
-rw-r--r--source/blender/blenkernel/BKE_customdata.h4
-rw-r--r--source/blender/blenkernel/BKE_customdata_file.h6
-rw-r--r--source/blender/blenkernel/BKE_deform.h4
-rw-r--r--source/blender/blenkernel/BKE_depsgraph.h4
-rw-r--r--source/blender/blenkernel/BKE_displist.h4
-rw-r--r--source/blender/blenkernel/BKE_dynamicpaint.h6
-rw-r--r--source/blender/blenkernel/BKE_effect.h4
-rw-r--r--source/blender/blenkernel/BKE_fcurve.h6
-rw-r--r--source/blender/blenkernel/BKE_fluidsim.h4
-rw-r--r--source/blender/blenkernel/BKE_font.h4
-rw-r--r--source/blender/blenkernel/BKE_global.h4
-rw-r--r--source/blender/blenkernel/BKE_gpencil.h6
-rw-r--r--source/blender/blenkernel/BKE_group.h4
-rw-r--r--source/blender/blenkernel/BKE_icons.h6
-rw-r--r--source/blender/blenkernel/BKE_idcode.h4
-rw-r--r--source/blender/blenkernel/BKE_idprop.h6
-rw-r--r--source/blender/blenkernel/BKE_image.h8
-rw-r--r--source/blender/blenkernel/BKE_ipo.h4
-rw-r--r--source/blender/blenkernel/BKE_key.h6
-rw-r--r--source/blender/blenkernel/BKE_lamp.h4
-rw-r--r--source/blender/blenkernel/BKE_lattice.h4
-rw-r--r--source/blender/blenkernel/BKE_library.h4
-rw-r--r--source/blender/blenkernel/BKE_main.h4
-rw-r--r--source/blender/blenkernel/BKE_material.h4
-rw-r--r--source/blender/blenkernel/BKE_mball.h4
-rw-r--r--source/blender/blenkernel/BKE_mesh.h6
-rw-r--r--source/blender/blenkernel/BKE_modifier.h4
-rw-r--r--source/blender/blenkernel/BKE_movieclip.h4
-rw-r--r--source/blender/blenkernel/BKE_multires.h6
-rw-r--r--source/blender/blenkernel/BKE_navmesh_conversion.h4
-rw-r--r--source/blender/blenkernel/BKE_nla.h4
-rw-r--r--source/blender/blenkernel/BKE_node.h4
-rw-r--r--source/blender/blenkernel/BKE_object.h4
-rw-r--r--source/blender/blenkernel/BKE_ocean.h4
-rw-r--r--source/blender/blenkernel/BKE_packedFile.h4
-rw-r--r--source/blender/blenkernel/BKE_paint.h4
-rw-r--r--source/blender/blenkernel/BKE_particle.h4
-rw-r--r--source/blender/blenkernel/BKE_plugin_types.h4
-rw-r--r--source/blender/blenkernel/BKE_pointcache.h4
-rw-r--r--source/blender/blenkernel/BKE_property.h4
-rw-r--r--source/blender/blenkernel/BKE_report.h4
-rw-r--r--source/blender/blenkernel/BKE_sca.h4
-rw-r--r--source/blender/blenkernel/BKE_scene.h4
-rw-r--r--source/blender/blenkernel/BKE_screen.h4
-rw-r--r--source/blender/blenkernel/BKE_script.h6
-rw-r--r--source/blender/blenkernel/BKE_sequencer.h6
-rw-r--r--source/blender/blenkernel/BKE_shrinkwrap.h4
-rw-r--r--source/blender/blenkernel/BKE_sketch.h4
-rw-r--r--source/blender/blenkernel/BKE_smoke.h6
-rw-r--r--source/blender/blenkernel/BKE_softbody.h4
-rw-r--r--source/blender/blenkernel/BKE_sound.h6
-rw-r--r--source/blender/blenkernel/BKE_speaker.h4
-rw-r--r--source/blender/blenkernel/BKE_subsurf.h4
-rw-r--r--source/blender/blenkernel/BKE_suggestions.h4
-rw-r--r--source/blender/blenkernel/BKE_text.h4
-rw-r--r--source/blender/blenkernel/BKE_texture.h4
-rw-r--r--source/blender/blenkernel/BKE_tracking.h4
-rw-r--r--source/blender/blenkernel/BKE_unit.h6
-rw-r--r--source/blender/blenkernel/BKE_utildefines.h6
-rw-r--r--source/blender/blenkernel/BKE_world.h4
-rw-r--r--source/blender/blenkernel/BKE_writeavi.h4
-rw-r--r--source/blender/blenkernel/BKE_writeffmpeg.h4
-rw-r--r--source/blender/blenkernel/BKE_writeframeserver.h4
-rw-r--r--source/blender/blenkernel/depsgraph_private.h4
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c6
-rw-r--r--source/blender/blenkernel/intern/bmesh_private.h4
-rw-r--r--source/blender/blenkernel/intern/pointcache.c2
-rw-r--r--source/blender/blenkernel/intern/sequencer.c24
-rw-r--r--source/blender/blenkernel/intern/writeffmpeg.c2
-rw-r--r--source/blender/blenkernel/nla_private.h6
-rw-r--r--source/blender/blenlib/BLI_args.h4
-rw-r--r--source/blender/blenlib/BLI_blenlib.h4
-rw-r--r--source/blender/blenlib/BLI_boxpack2d.h4
-rw-r--r--source/blender/blenlib/BLI_bpath.h6
-rw-r--r--source/blender/blenlib/BLI_callbacks.h6
-rw-r--r--source/blender/blenlib/BLI_cpu.h4
-rw-r--r--source/blender/blenlib/BLI_dlrbTree.h6
-rw-r--r--source/blender/blenlib/BLI_dynstr.h4
-rw-r--r--source/blender/blenlib/BLI_edgehash.h4
-rw-r--r--source/blender/blenlib/BLI_editVert.h4
-rw-r--r--source/blender/blenlib/BLI_fileops.h4
-rw-r--r--source/blender/blenlib/BLI_fileops_types.h6
-rw-r--r--source/blender/blenlib/BLI_fnmatch.h6
-rw-r--r--source/blender/blenlib/BLI_ghash.h6
-rw-r--r--source/blender/blenlib/BLI_graph.h6
-rw-r--r--source/blender/blenlib/BLI_gsqueue.h6
-rw-r--r--source/blender/blenlib/BLI_heap.h4
-rw-r--r--source/blender/blenlib/BLI_jitter.h4
-rw-r--r--source/blender/blenlib/BLI_kdopbvh.h6
-rw-r--r--source/blender/blenlib/BLI_kdtree.h4
-rw-r--r--source/blender/blenlib/BLI_linklist.h4
-rw-r--r--source/blender/blenlib/BLI_listbase.h4
-rw-r--r--source/blender/blenlib/BLI_math.h6
-rw-r--r--source/blender/blenlib/BLI_math_base.h8
-rw-r--r--source/blender/blenlib/BLI_math_color.h8
-rw-r--r--source/blender/blenlib/BLI_math_geom.h8
-rw-r--r--source/blender/blenlib/BLI_math_inline.h10
-rw-r--r--source/blender/blenlib/BLI_math_matrix.h6
-rw-r--r--source/blender/blenlib/BLI_math_rotation.h6
-rw-r--r--source/blender/blenlib/BLI_math_vector.h8
-rw-r--r--source/blender/blenlib/BLI_md5.h4
-rw-r--r--source/blender/blenlib/BLI_memarena.h4
-rw-r--r--source/blender/blenlib/BLI_mempool.h4
-rw-r--r--source/blender/blenlib/BLI_noise.h4
-rw-r--r--source/blender/blenlib/BLI_path_util.h4
-rw-r--r--source/blender/blenlib/BLI_pbvh.h6
-rw-r--r--source/blender/blenlib/BLI_rand.h4
-rw-r--r--source/blender/blenlib/BLI_rect.h4
-rw-r--r--source/blender/blenlib/BLI_scanfill.h4
-rw-r--r--source/blender/blenlib/BLI_string.h4
-rw-r--r--source/blender/blenlib/BLI_string_utf8.h4
-rw-r--r--source/blender/blenlib/BLI_threads.h4
-rw-r--r--source/blender/blenlib/BLI_utildefines.h17
-rw-r--r--source/blender/blenlib/BLI_uvproject.h4
-rw-r--r--source/blender/blenlib/BLI_vfontdata.h4
-rw-r--r--source/blender/blenlib/BLI_voxel.h6
-rw-r--r--source/blender/blenlib/BLI_winstuff.h6
-rw-r--r--source/blender/blenlib/PIL_time.h6
-rw-r--r--source/blender/blenlib/intern/dynamiclist.h4
-rw-r--r--source/blender/blenlib/intern/math_color_inline.c2
-rw-r--r--source/blender/blenlib/intern/math_vector.c8
-rw-r--r--source/blender/blenloader/BLO_readfile.h4
-rw-r--r--source/blender/blenloader/BLO_runtime.h6
-rw-r--r--source/blender/blenloader/BLO_soundfile.h4
-rw-r--r--source/blender/blenloader/BLO_sys_types.h4
-rw-r--r--source/blender/blenloader/BLO_undofile.h4
-rw-r--r--source/blender/blenloader/BLO_writefile.h4
-rw-r--r--source/blender/blenloader/intern/readfile.c22
-rw-r--r--source/blender/blenloader/intern/readfile.h4
-rw-r--r--source/blender/blenpluginapi/externdef.h6
-rw-r--r--source/blender/blenpluginapi/floatpatch.h6
-rw-r--r--source/blender/blenpluginapi/iff.h6
-rw-r--r--source/blender/blenpluginapi/plugin.h6
-rw-r--r--source/blender/blenpluginapi/util.h6
-rw-r--r--source/blender/collada/AnimationImporter.cpp182
-rw-r--r--source/blender/collada/AnimationImporter.h6
-rw-r--r--source/blender/collada/ArmatureImporter.h4
-rw-r--r--source/blender/collada/MeshImporter.h4
-rw-r--r--source/blender/collada/SkinInfo.h4
-rw-r--r--source/blender/collada/TransformReader.h4
-rw-r--r--source/blender/collada/TransformWriter.cpp30
-rw-r--r--source/blender/collada/collada.h4
-rw-r--r--source/blender/collada/collada_internal.h6
-rw-r--r--source/blender/collada/collada_utils.h4
-rw-r--r--source/blender/editors/animation/anim_intern.h6
-rw-r--r--source/blender/editors/animation/keyframing.c11
-rw-r--r--source/blender/editors/armature/BIF_generate.h6
-rw-r--r--source/blender/editors/armature/BIF_retarget.h6
-rw-r--r--source/blender/editors/armature/armature_intern.h6
-rw-r--r--source/blender/editors/armature/meshlaplacian.c6
-rw-r--r--source/blender/editors/armature/meshlaplacian.h4
-rw-r--r--source/blender/editors/armature/reeb.h6
-rw-r--r--source/blender/editors/curve/curve_intern.h4
-rw-r--r--source/blender/editors/gpencil/gpencil_intern.h6
-rw-r--r--source/blender/editors/include/BIF_gl.h6
-rw-r--r--source/blender/editors/include/BIF_glutil.h6
-rw-r--r--source/blender/editors/include/ED_anim_api.h6
-rw-r--r--source/blender/editors/include/ED_armature.h6
-rw-r--r--source/blender/editors/include/ED_clip.h4
-rw-r--r--source/blender/editors/include/ED_curve.h6
-rw-r--r--source/blender/editors/include/ED_datafiles.h6
-rw-r--r--source/blender/editors/include/ED_fileselect.h6
-rw-r--r--source/blender/editors/include/ED_fluidsim.h6
-rw-r--r--source/blender/editors/include/ED_gpencil.h6
-rw-r--r--source/blender/editors/include/ED_image.h6
-rw-r--r--source/blender/editors/include/ED_info.h6
-rw-r--r--source/blender/editors/include/ED_keyframes_draw.h6
-rw-r--r--source/blender/editors/include/ED_keyframes_edit.h6
-rw-r--r--source/blender/editors/include/ED_keyframing.h6
-rw-r--r--source/blender/editors/include/ED_logic.h6
-rw-r--r--source/blender/editors/include/ED_markers.h6
-rw-r--r--source/blender/editors/include/ED_mball.h4
-rw-r--r--source/blender/editors/include/ED_mesh.h6
-rw-r--r--source/blender/editors/include/ED_node.h6
-rw-r--r--source/blender/editors/include/ED_numinput.h4
-rw-r--r--source/blender/editors/include/ED_object.h6
-rw-r--r--source/blender/editors/include/ED_particle.h6
-rw-r--r--source/blender/editors/include/ED_physics.h6
-rw-r--r--source/blender/editors/include/ED_render.h4
-rw-r--r--source/blender/editors/include/ED_screen.h6
-rw-r--r--source/blender/editors/include/ED_screen_types.h6
-rw-r--r--source/blender/editors/include/ED_sculpt.h4
-rw-r--r--source/blender/editors/include/ED_sequencer.h6
-rw-r--r--source/blender/editors/include/ED_sound.h6
-rw-r--r--source/blender/editors/include/ED_space_api.h6
-rw-r--r--source/blender/editors/include/ED_text.h6
-rw-r--r--source/blender/editors/include/ED_transform.h4
-rw-r--r--source/blender/editors/include/ED_types.h6
-rw-r--r--source/blender/editors/include/ED_util.h6
-rw-r--r--source/blender/editors/include/ED_uvedit.h6
-rw-r--r--source/blender/editors/include/ED_view3d.h6
-rw-r--r--source/blender/editors/include/UI_icons.h4
-rw-r--r--source/blender/editors/include/UI_interface.h6
-rw-r--r--source/blender/editors/include/UI_interface_icons.h6
-rw-r--r--source/blender/editors/include/UI_resources.h4
-rw-r--r--source/blender/editors/include/UI_view2d.h6
-rw-r--r--source/blender/editors/interface/interface_icons.c31
-rw-r--r--source/blender/editors/interface/interface_intern.h4
-rw-r--r--source/blender/editors/interface/interface_layout.c2
-rw-r--r--source/blender/editors/interface/interface_templates.c4
-rw-r--r--source/blender/editors/mesh/editmesh_lib.c2
-rw-r--r--source/blender/editors/mesh/mesh_intern.h6
-rw-r--r--source/blender/editors/metaball/mball_intern.h4
-rw-r--r--source/blender/editors/object/object_intern.h6
-rw-r--r--source/blender/editors/physics/physics_intern.h6
-rw-r--r--source/blender/editors/render/render_intern.h6
-rw-r--r--source/blender/editors/render/render_preview.c103
-rw-r--r--source/blender/editors/screen/screen_intern.h6
-rw-r--r--source/blender/editors/sculpt_paint/paint_intern.h6
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_intern.h4
-rw-r--r--source/blender/editors/sound/sound_intern.h6
-rw-r--r--source/blender/editors/space_action/action_intern.h6
-rw-r--r--source/blender/editors/space_buttons/buttons_intern.h6
-rw-r--r--source/blender/editors/space_clip/clip_intern.h6
-rw-r--r--source/blender/editors/space_console/console_intern.h6
-rw-r--r--source/blender/editors/space_file/file_intern.h6
-rw-r--r--source/blender/editors/space_file/filelist.h4
-rw-r--r--source/blender/editors/space_file/fsmenu.h4
-rw-r--r--source/blender/editors/space_graph/graph_intern.h6
-rw-r--r--source/blender/editors/space_image/image_intern.h6
-rw-r--r--source/blender/editors/space_image/space_image.c6
-rw-r--r--source/blender/editors/space_info/info_intern.h6
-rw-r--r--source/blender/editors/space_logic/logic_intern.h6
-rw-r--r--source/blender/editors/space_nla/nla_intern.h6
-rw-r--r--source/blender/editors/space_node/node_intern.h6
-rw-r--r--source/blender/editors/space_outliner/outliner_intern.h6
-rw-r--r--source/blender/editors/space_script/script_intern.h6
-rw-r--r--source/blender/editors/space_sequencer/sequencer_intern.h6
-rw-r--r--source/blender/editors/space_text/text_intern.h6
-rw-r--r--source/blender/editors/space_time/time_intern.h6
-rw-r--r--source/blender/editors/space_userpref/userpref_intern.h6
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c1
-rw-r--r--source/blender/editors/space_view3d/view3d_header.c29
-rw-r--r--source/blender/editors/space_view3d/view3d_intern.h6
-rw-r--r--source/blender/editors/transform/transform.h4
-rw-r--r--source/blender/editors/util/util_intern.h6
-rw-r--r--source/blender/editors/uvedit/uvedit_intern.h6
-rw-r--r--source/blender/editors/uvedit/uvedit_parametrizer.h6
-rw-r--r--source/blender/gpu/GPU_draw.h4
-rw-r--r--source/blender/gpu/GPU_extensions.h4
-rw-r--r--source/blender/gpu/GPU_material.h6
-rw-r--r--source/blender/ikplugin/BIK_api.h6
-rw-r--r--source/blender/ikplugin/intern/ikplugin_api.h6
-rw-r--r--source/blender/ikplugin/intern/iksolver_plugin.h6
-rw-r--r--source/blender/ikplugin/intern/itasc_plugin.h6
-rw-r--r--source/blender/imbuf/IMB_imbuf.h4
-rw-r--r--source/blender/imbuf/IMB_imbuf_types.h4
-rw-r--r--source/blender/imbuf/IMB_moviecache.h4
-rw-r--r--source/blender/imbuf/IMB_thumbs.h6
-rw-r--r--source/blender/imbuf/intern/IMB_allocimbuf.h4
-rw-r--r--source/blender/imbuf/intern/IMB_anim.h4
-rw-r--r--source/blender/imbuf/intern/IMB_filetype.h6
-rw-r--r--source/blender/imbuf/intern/IMB_filter.h4
-rw-r--r--source/blender/imbuf/intern/IMB_indexer.h4
-rw-r--r--source/blender/imbuf/intern/IMB_metadata.h6
-rw-r--r--source/blender/imbuf/intern/cineon/cineonfile.h6
-rw-r--r--source/blender/imbuf/intern/cineon/cineonlib.h6
-rw-r--r--source/blender/imbuf/intern/cineon/dpxfile.h6
-rw-r--r--source/blender/imbuf/intern/cineon/dpxlib.h6
-rw-r--r--source/blender/imbuf/intern/cineon/logImageCore.h6
-rw-r--r--source/blender/imbuf/intern/cineon/logImageLib.h6
-rw-r--r--source/blender/imbuf/intern/cineon/logmemfile.h6
-rw-r--r--source/blender/imbuf/intern/dds/BlockDXT.h6
-rw-r--r--source/blender/imbuf/intern/dds/Color.h6
-rw-r--r--source/blender/imbuf/intern/dds/ColorBlock.h6
-rw-r--r--source/blender/imbuf/intern/dds/Common.h4
-rw-r--r--source/blender/imbuf/intern/dds/DirectDrawSurface.h6
-rw-r--r--source/blender/imbuf/intern/dds/Image.h6
-rw-r--r--source/blender/imbuf/intern/dds/PixelFormat.h4
-rw-r--r--source/blender/imbuf/intern/dds/Stream.h6
-rw-r--r--source/blender/imbuf/intern/dds/dds_api.h4
-rw-r--r--source/blender/imbuf/intern/imbuf.h6
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_api.h4
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_multi.h4
-rw-r--r--source/blender/makesdna/DNA_ID.h4
-rw-r--r--source/blender/makesdna/DNA_action_types.h4
-rw-r--r--source/blender/makesdna/DNA_actuator_types.h4
-rw-r--r--source/blender/makesdna/DNA_anim_types.h6
-rw-r--r--source/blender/makesdna/DNA_armature_types.h4
-rw-r--r--source/blender/makesdna/DNA_boid_types.h4
-rw-r--r--source/blender/makesdna/DNA_brush_types.h4
-rw-r--r--source/blender/makesdna/DNA_camera_types.h4
-rw-r--r--source/blender/makesdna/DNA_cloth_types.h4
-rw-r--r--source/blender/makesdna/DNA_color_types.h4
-rw-r--r--source/blender/makesdna/DNA_constraint_types.h4
-rw-r--r--source/blender/makesdna/DNA_controller_types.h4
-rw-r--r--source/blender/makesdna/DNA_curve_types.h4
-rw-r--r--source/blender/makesdna/DNA_customdata_types.h4
-rw-r--r--source/blender/makesdna/DNA_defs.h6
-rw-r--r--source/blender/makesdna/DNA_dynamicpaint_types.h4
-rw-r--r--source/blender/makesdna/DNA_effect_types.h4
-rw-r--r--source/blender/makesdna/DNA_fileglobal_types.h4
-rw-r--r--source/blender/makesdna/DNA_genfile.h4
-rw-r--r--source/blender/makesdna/DNA_gpencil_types.h6
-rw-r--r--source/blender/makesdna/DNA_group_types.h4
-rw-r--r--source/blender/makesdna/DNA_image_types.h4
-rw-r--r--source/blender/makesdna/DNA_ipo_types.h4
-rw-r--r--source/blender/makesdna/DNA_key_types.h4
-rw-r--r--source/blender/makesdna/DNA_lamp_types.h6
-rw-r--r--source/blender/makesdna/DNA_lattice_types.h4
-rw-r--r--source/blender/makesdna/DNA_listBase.h4
-rw-r--r--source/blender/makesdna/DNA_material_types.h4
-rw-r--r--source/blender/makesdna/DNA_mesh_types.h4
-rw-r--r--source/blender/makesdna/DNA_meshdata_types.h4
-rw-r--r--source/blender/makesdna/DNA_meta_types.h4
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h4
-rw-r--r--source/blender/makesdna/DNA_movieclip_types.h4
-rw-r--r--source/blender/makesdna/DNA_nla_types.h4
-rw-r--r--source/blender/makesdna/DNA_node_types.h4
-rw-r--r--source/blender/makesdna/DNA_object_fluidsim.h4
-rw-r--r--source/blender/makesdna/DNA_object_force.h4
-rw-r--r--source/blender/makesdna/DNA_object_types.h4
-rw-r--r--source/blender/makesdna/DNA_outliner_types.h4
-rw-r--r--source/blender/makesdna/DNA_packedFile_types.h4
-rw-r--r--source/blender/makesdna/DNA_particle_types.h4
-rw-r--r--source/blender/makesdna/DNA_property_types.h4
-rw-r--r--source/blender/makesdna/DNA_scene_types.h4
-rw-r--r--source/blender/makesdna/DNA_screen_types.h4
-rw-r--r--source/blender/makesdna/DNA_sdna_types.h4
-rw-r--r--source/blender/makesdna/DNA_sensor_types.h4
-rw-r--r--source/blender/makesdna/DNA_sequence_types.h4
-rw-r--r--source/blender/makesdna/DNA_smoke_types.h4
-rw-r--r--source/blender/makesdna/DNA_sound_types.h4
-rw-r--r--source/blender/makesdna/DNA_space_types.h4
-rw-r--r--source/blender/makesdna/DNA_speaker_types.h6
-rw-r--r--source/blender/makesdna/DNA_text_types.h4
-rw-r--r--source/blender/makesdna/DNA_texture_types.h4
-rw-r--r--source/blender/makesdna/DNA_tracking_types.h4
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h4
-rw-r--r--source/blender/makesdna/DNA_vec_types.h4
-rw-r--r--source/blender/makesdna/DNA_vfont_types.h4
-rw-r--r--source/blender/makesdna/DNA_view2d_types.h4
-rw-r--r--source/blender/makesdna/DNA_view3d_types.h4
-rw-r--r--source/blender/makesdna/DNA_windowmanager_types.h6
-rw-r--r--source/blender/makesdna/DNA_world_types.h4
-rw-r--r--source/blender/makesrna/RNA_access.h6
-rw-r--r--source/blender/makesrna/RNA_define.h6
-rw-r--r--source/blender/makesrna/RNA_enum_types.h6
-rw-r--r--source/blender/makesrna/RNA_types.h6
-rw-r--r--source/blender/makesrna/intern/rna_access.c6
-rw-r--r--source/blender/makesrna/intern/rna_internal.h6
-rw-r--r--source/blender/makesrna/intern/rna_internal_types.h6
-rw-r--r--source/blender/makesrna/intern/rna_nodetree_types.h1
-rw-r--r--source/blender/makesrna/intern/rna_ui.c10
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c2
-rw-r--r--source/blender/makesrna/intern/rna_wm.c8
-rw-r--r--source/blender/modifiers/MOD_modifiertypes.h6
-rw-r--r--source/blender/modifiers/intern/MOD_boolean_util.h4
-rw-r--r--source/blender/modifiers/intern/MOD_fluidsim_util.h4
-rw-r--r--source/blender/modifiers/intern/MOD_util.h6
-rw-r--r--source/blender/modifiers/intern/MOD_weightvg_util.h6
-rw-r--r--source/blender/nodes/NOD_composite.h4
-rw-r--r--source/blender/nodes/NOD_shader.h4
-rw-r--r--source/blender/nodes/NOD_socket.h4
-rw-r--r--source/blender/nodes/NOD_texture.h4
-rw-r--r--source/blender/nodes/composite/node_composite_util.h4
-rw-r--r--source/blender/nodes/intern/node_common.h4
-rw-r--r--source/blender/nodes/intern/node_exec.h4
-rw-r--r--source/blender/nodes/intern/node_util.h4
-rw-r--r--source/blender/nodes/shader/node_shader_util.h4
-rw-r--r--source/blender/nodes/texture/node_texture_util.h4
-rw-r--r--source/blender/python/BPY_extern.h6
-rw-r--r--source/blender/python/generic/bgl.h6
-rw-r--r--source/blender/python/generic/bpy_internal_import.h6
-rw-r--r--source/blender/python/generic/idprop_py_api.h6
-rw-r--r--source/blender/python/generic/py_capi_utils.h6
-rw-r--r--source/blender/python/intern/bpy_app.c7
-rw-r--r--source/blender/python/intern/bpy_app.h6
-rw-r--r--source/blender/python/intern/bpy_app_ffmpeg.h6
-rw-r--r--source/blender/python/intern/bpy_app_handlers.h6
-rw-r--r--source/blender/python/intern/bpy_driver.h6
-rw-r--r--source/blender/python/intern/bpy_operator.h4
-rw-r--r--source/blender/python/intern/bpy_operator_wrap.h4
-rw-r--r--source/blender/python/intern/bpy_props.h4
-rw-r--r--source/blender/python/intern/bpy_rna.h4
-rw-r--r--source/blender/python/intern/bpy_traceback.h6
-rw-r--r--source/blender/python/intern/bpy_util.h4
-rw-r--r--source/blender/python/mathutils/mathutils.h6
-rw-r--r--source/blender/python/mathutils/mathutils_Color.h6
-rw-r--r--source/blender/python/mathutils/mathutils_Euler.h6
-rw-r--r--source/blender/python/mathutils/mathutils_Matrix.h6
-rw-r--r--source/blender/python/mathutils/mathutils_Quaternion.h6
-rw-r--r--source/blender/python/mathutils/mathutils_Vector.h6
-rw-r--r--source/blender/python/mathutils/mathutils_geometry.h6
-rw-r--r--source/blender/python/mathutils/mathutils_noise.h6
-rw-r--r--source/blender/quicktime/quicktime_import.h6
-rw-r--r--source/blender/render/extern/include/RE_engine.h6
-rw-r--r--source/blender/render/extern/include/RE_pipeline.h6
-rw-r--r--source/blender/render/extern/include/RE_render_ext.h6
-rw-r--r--source/blender/render/extern/include/RE_shader_ext.h6
-rw-r--r--source/blender/render/intern/include/envmap.h6
-rw-r--r--source/blender/render/intern/include/gammaCorrectionTables.h4
-rw-r--r--source/blender/render/intern/include/initrender.h6
-rw-r--r--source/blender/render/intern/include/occlusion.h4
-rw-r--r--source/blender/render/intern/include/pixelblending.h6
-rw-r--r--source/blender/render/intern/include/pixelshading.h4
-rw-r--r--source/blender/render/intern/include/pointdensity.h6
-rw-r--r--source/blender/render/intern/include/raycounter.h4
-rw-r--r--source/blender/render/intern/include/rayintersection.h6
-rw-r--r--source/blender/render/intern/include/rayobject.h4
-rw-r--r--source/blender/render/intern/include/render_result.h6
-rw-r--r--source/blender/render/intern/include/render_types.h6
-rw-r--r--source/blender/render/intern/include/rendercore.h4
-rw-r--r--source/blender/render/intern/include/renderdatabase.h6
-rw-r--r--source/blender/render/intern/include/renderpipeline.h6
-rw-r--r--source/blender/render/intern/include/shadbuf.h6
-rw-r--r--source/blender/render/intern/include/sss.h6
-rw-r--r--source/blender/render/intern/include/strand.h4
-rw-r--r--source/blender/render/intern/include/sunsky.h6
-rw-r--r--source/blender/render/intern/include/texture.h6
-rw-r--r--source/blender/render/intern/include/voxeldata.h6
-rw-r--r--source/blender/render/intern/include/zbuf.h4
-rw-r--r--source/blender/render/intern/raytrace/bvh.h4
-rw-r--r--source/blender/render/intern/raytrace/rayobject_hint.h4
-rw-r--r--source/blender/render/intern/raytrace/rayobject_internal.h4
-rw-r--r--source/blender/render/intern/raytrace/rayobject_rtbuild.h4
-rw-r--r--source/blender/render/intern/raytrace/svbvh.h4
-rw-r--r--source/blender/render/intern/source/shadeoutput.c2
-rw-r--r--source/blender/windowmanager/WM_api.h6
-rw-r--r--source/blender/windowmanager/WM_keymap.h6
-rw-r--r--source/blender/windowmanager/WM_types.h6
-rw-r--r--source/blender/windowmanager/wm.h6
-rw-r--r--source/blender/windowmanager/wm_cursors.h6
-rw-r--r--source/blender/windowmanager/wm_draw.h6
-rw-r--r--source/blender/windowmanager/wm_event_system.h6
-rw-r--r--source/blender/windowmanager/wm_event_types.h6
-rw-r--r--source/blender/windowmanager/wm_files.h6
-rw-r--r--source/blender/windowmanager/wm_subwindow.h6
-rw-r--r--source/blender/windowmanager/wm_window.h6
-rw-r--r--source/blenderplayer/CMakeLists.txt4
-rw-r--r--source/creator/CMakeLists.txt5
-rw-r--r--source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp2
-rw-r--r--source/gameengine/GamePlayer/common/GPC_Canvas.cpp5
741 files changed, 7331 insertions, 6796 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e0b14b7d640..ae39f7ce5b3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -160,6 +160,11 @@ if(UNIX AND NOT APPLE)
option(WITH_BUILTIN_GLEW "Use GLEW OpenGL wrapper library bundled with blender" ON)
option(WITH_XDG_USER_DIRS "Build with XDG Base Directory Specification (only config and documents for now)" OFF)
mark_as_advanced(WITH_XDG_USER_DIRS)
+
+ # freebsd doesn't seems to support XDND
+ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
+ option(WITH_GHOST_XDND "Enable drag'n'drop support on Linux using XDND protocol" ON)
+ endif()
else()
# not an option for other OS's
set(WITH_BUILTIN_GLEW ON)
@@ -691,7 +696,7 @@ elseif(WIN32)
if(WITH_OPENAL)
set(OPENAL ${LIBDIR}/openal)
set(OPENAL_INCLUDE_DIR ${OPENAL}/include)
- set(OPENAL_LIBRARY OpenAL32)
+ set(OPENAL_LIBRARY wrap_oal)
set(OPENAL_LIBPATH ${OPENAL}/lib)
endif()
diff --git a/SConstruct b/SConstruct
index 0dd59add019..22075b720da 100644
--- a/SConstruct
+++ b/SConstruct
@@ -756,6 +756,7 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
if env['WITH_BF_OPENAL']:
dllsources.append('${LCGDIR}/openal/lib/OpenAL32.dll')
+ dllsources.append('${LCGDIR}/openal/lib/wrap_oal.dll')
if env['WITH_BF_SNDFILE']:
dllsources.append('${LCGDIR}/sndfile/lib/libsndfile-1.dll')
diff --git a/build_files/cmake/Modules/FindOpenEXR.cmake b/build_files/cmake/Modules/FindOpenEXR.cmake
index 546f690dbf6..9f1d6571ef5 100644
--- a/build_files/cmake/Modules/FindOpenEXR.cmake
+++ b/build_files/cmake/Modules/FindOpenEXR.cmake
@@ -8,7 +8,7 @@
# This can also be an environment variable.
# OPENEXR_FOUND, If false, do not try to use OpenEXR.
#
-# For indervidual library access these advanced settings are available
+# For individual library access these advanced settings are available
# OPENEXR_HALF_LIBRARY, Path to Half library
# OPENEXR_IEX_LIBRARY, Path to Half library
# OPENEXR_ILMIMF_LIBRARY, Path to Ilmimf library
diff --git a/build_files/scons/config/darwin-config.py b/build_files/scons/config/darwin-config.py
index 8082c1e6986..17882342a86 100644
--- a/build_files/scons/config/darwin-config.py
+++ b/build_files/scons/config/darwin-config.py
@@ -86,6 +86,9 @@ else :
LIBDIR = '${LCGDIR}'
+if XCODE_CUR_VER >= '4.3': ## since version 4.3, XCode and developer dir are bundled ##
+ MACOSX_SDK = '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform' + MACOSX_SDK
+
#############################################################################
################### Dependency settings ##################
#############################################################################
diff --git a/build_files/scons/config/freebsd7-config.py b/build_files/scons/config/freebsd7-config.py
index 7826ca226f6..8d0d09907bd 100644
--- a/build_files/scons/config/freebsd7-config.py
+++ b/build_files/scons/config/freebsd7-config.py
@@ -164,6 +164,8 @@ BF_EXPAT = '/usr/local'
BF_EXPAT_LIB = 'expat'
BF_EXPAT_LIBPATH = '${BF_EXPAT}/lib'
+WITH_GHOST_XDND = False
+
WITH_BF_OPENMP = True
#Ray trace optimization
diff --git a/build_files/scons/config/freebsd8-config.py b/build_files/scons/config/freebsd8-config.py
index f2d5cf2d0ed..6222d63c271 100644
--- a/build_files/scons/config/freebsd8-config.py
+++ b/build_files/scons/config/freebsd8-config.py
@@ -166,6 +166,8 @@ BF_EXPAT_LIBPATH = '${BF_EXPAT}/lib'
WITH_BF_OPENMP = True
+WITH_GHOST_XDND = False
+
#Ray trace optimization
WITH_BF_RAYOPTIMIZATION = True
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']
diff --git a/build_files/scons/config/freebsd9-config.py b/build_files/scons/config/freebsd9-config.py
index ea321b1a102..76539a330de 100644
--- a/build_files/scons/config/freebsd9-config.py
+++ b/build_files/scons/config/freebsd9-config.py
@@ -166,6 +166,8 @@ BF_EXPAT_LIBPATH = '${BF_EXPAT}/lib'
WITH_BF_OPENMP = True
+WITH_GHOST_XDND = False
+
#Ray trace optimization
WITH_BF_RAYOPTIMIZATION = True
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']
diff --git a/build_files/scons/config/linuxcross-config.py b/build_files/scons/config/linuxcross-config.py
index 7ec27af9ea8..5e2c1d67d1f 100644
--- a/build_files/scons/config/linuxcross-config.py
+++ b/build_files/scons/config/linuxcross-config.py
@@ -13,7 +13,7 @@ WITH_BF_OPENAL = True
WITH_BF_STATICOPENAL = False
BF_OPENAL = LIBDIR + '/openal'
BF_OPENAL_INC = '${BF_OPENAL}/include'
-BF_OPENAL_LIB = 'OpenAL32'
+BF_OPENAL_LIB = 'OpenAL32 wrap_oal'
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
# Warning, this static lib configuration is untested! users of this OS please confirm.
BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
diff --git a/build_files/scons/config/win32-mingw-config.py b/build_files/scons/config/win32-mingw-config.py
index 9fac0a31029..6da32ecd512 100644
--- a/build_files/scons/config/win32-mingw-config.py
+++ b/build_files/scons/config/win32-mingw-config.py
@@ -14,7 +14,7 @@ BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/libpython${BF_PYTHON_VERSION[0]}${BF_PY
WITH_BF_OPENAL = True
BF_OPENAL = LIBDIR + '/openal'
BF_OPENAL_INC = '${BF_OPENAL}/include'
-BF_OPENAL_LIB = 'OpenAL32'
+BF_OPENAL_LIB = 'wrap_oal'
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
WITH_BF_FFMPEG = True
diff --git a/build_files/scons/config/win32-vc-config.py b/build_files/scons/config/win32-vc-config.py
index 2142620f2bf..f9a03372eb2 100644
--- a/build_files/scons/config/win32-vc-config.py
+++ b/build_files/scons/config/win32-vc-config.py
@@ -20,7 +20,7 @@ BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
WITH_BF_OPENAL = True
BF_OPENAL = LIBDIR + '/openal'
BF_OPENAL_INC = '${BF_OPENAL}/include '
-BF_OPENAL_LIB = 'OpenAL32'
+BF_OPENAL_LIB = 'wrap_oal'
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
WITH_BF_ICONV = True
diff --git a/build_files/scons/config/win64-vc-config.py b/build_files/scons/config/win64-vc-config.py
index 794f29c5d46..f6f8f20ced0 100644
--- a/build_files/scons/config/win64-vc-config.py
+++ b/build_files/scons/config/win64-vc-config.py
@@ -20,7 +20,7 @@ BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
WITH_BF_OPENAL = True
BF_OPENAL = LIBDIR + '/openal'
BF_OPENAL_INC = '${BF_OPENAL}/include '
-BF_OPENAL_LIB = 'OpenAL32'
+BF_OPENAL_LIB = 'wrap_oal'
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
WITH_BF_SNDFILE = True
diff --git a/build_files/scons/tools/btools.py b/build_files/scons/tools/btools.py
index fe481d7ef34..f5f013c86fb 100644
--- a/build_files/scons/tools/btools.py
+++ b/build_files/scons/tools/btools.py
@@ -138,6 +138,7 @@ def validate_arguments(args, bc):
'WITH_BF_OPENMP', 'BF_OPENMP', 'BF_OPENMP_LIBPATH',
'WITH_GHOST_COCOA',
'WITH_GHOST_SDL',
+ 'WITH_GHOST_XDND',
'BF_GHOST_DEBUG',
'USE_QTKIT',
'BF_FANCY', 'BF_QUIET', 'BF_LINE_OVERWRITE',
@@ -567,7 +568,9 @@ def read_opts(env, cfg, args):
('BF_BOOST_INC', 'Boost include path', ''),
('BF_BOOST_LIB', 'Boost library', ''),
('BF_BOOST_LIBPATH', 'Boost library path', ''),
- ('BF_BOOST_LIB_STATIC', 'Boost static library', '')
+ ('BF_BOOST_LIB_STATIC', 'Boost static library', ''),
+
+ (BoolVariable('WITH_GHOST_XDND', 'Build with drag-n-drop support on Linux platforms using XDND protocol', True))
) # end of opts.AddOptions()
return localopts
diff --git a/doc/python_api/rst/info_gotcha.rst b/doc/python_api/rst/info_gotcha.rst
index 281f0689044..be11e88b2fa 100644
--- a/doc/python_api/rst/info_gotcha.rst
+++ b/doc/python_api/rst/info_gotcha.rst
@@ -118,14 +118,6 @@ If you insist - yes its possible, but scripts that use this hack wont be conside
bpy.ops.wm.redraw_timer(type='DRAW_WIN_SWAP', iterations=1)
-Matrix multiplication is wrong
-==============================
-
-Every so often users complain that Blenders matrix math is wrong, the confusion comes from mathutils matrices being column-major to match OpenGL and the rest of Blenders matrix operations and stored matrix data.
-
-This is different to **numpy** which is row-major which matches what you would expect when using conventional matrix math notation.
-
-
I can't edit the mesh in edit-mode!
===================================
diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt
index 8442e5d0c71..1d83410a3d7 100644
--- a/extern/CMakeLists.txt
+++ b/extern/CMakeLists.txt
@@ -71,3 +71,9 @@ endif()
if(WITH_CARVE)
add_subdirectory(carve)
endif()
+
+if(WITH_GHOST_XDND)
+ if(UNIX AND NOT APPLE)
+ add_subdirectory(xdnd)
+ endif()
+endif()
diff --git a/extern/SConscript b/extern/SConscript
index 738342b3dcc..67b74e9ee91 100644
--- a/extern/SConscript
+++ b/extern/SConscript
@@ -34,3 +34,8 @@ if env['WITH_BF_LIBMV']:
if env['WITH_BF_CARVE']:
SConscript(['carve/SConscript'])
+
+if env['WITH_GHOST_XDND']:
+ # FreeBSD doesn't seems to support XDND protocol
+ if env['OURPLATFORM'] in ('linux', 'openbsd3', 'sunos5', 'aix4', 'aix5'):
+ SConscript(['xdnd/SConscript'])
diff --git a/extern/libmv/CMakeLists.txt b/extern/libmv/CMakeLists.txt
index 075ff15a798..73c2baa0207 100644
--- a/extern/libmv/CMakeLists.txt
+++ b/extern/libmv/CMakeLists.txt
@@ -41,107 +41,107 @@ set(INC_SYS
set(SRC
libmv-capi.cpp
+ libmv/image/array_nd.cc
+ libmv/image/convolve.cc
+ libmv/multiview/conditioning.cc
+ libmv/multiview/euclidean_resection.cc
+ libmv/multiview/fundamental.cc
+ libmv/multiview/projection.cc
+ libmv/multiview/triangulation.cc
libmv/numeric/numeric.cc
libmv/numeric/poly.cc
+ libmv/simple_pipeline/bundle.cc
libmv/simple_pipeline/callbacks.cc
- libmv/simple_pipeline/reconstruction.cc
- libmv/simple_pipeline/resect.cc
- libmv/simple_pipeline/intersect.cc
- libmv/simple_pipeline/initialize_reconstruction.cc
libmv/simple_pipeline/camera_intrinsics.cc
- libmv/simple_pipeline/pipeline.cc
libmv/simple_pipeline/detect.cc
+ libmv/simple_pipeline/initialize_reconstruction.cc
+ libmv/simple_pipeline/intersect.cc
+ libmv/simple_pipeline/pipeline.cc
+ libmv/simple_pipeline/reconstruction.cc
+ libmv/simple_pipeline/resect.cc
libmv/simple_pipeline/tracks.cc
- libmv/simple_pipeline/bundle.cc
- libmv/image/convolve.cc
- libmv/image/array_nd.cc
- libmv/tracking/pyramid_region_tracker.cc
- libmv/tracking/sad.cc
libmv/tracking/brute_region_tracker.cc
- libmv/tracking/hybrid_region_tracker.cc
libmv/tracking/esm_region_tracker.cc
- libmv/tracking/trklt_region_tracker.cc
+ libmv/tracking/hybrid_region_tracker.cc
libmv/tracking/klt_region_tracker.cc
libmv/tracking/lmicklt_region_tracker.cc
+ libmv/tracking/pyramid_region_tracker.cc
libmv/tracking/retrack_region_tracker.cc
- libmv/multiview/projection.cc
- libmv/multiview/conditioning.cc
- libmv/multiview/fundamental.cc
- libmv/multiview/euclidean_resection.cc
- libmv/multiview/triangulation.cc
+ libmv/tracking/sad.cc
+ libmv/tracking/trklt_region_tracker.cc
- third_party/ssba/Geometry/v3d_metricbundle.cpp
- third_party/ssba/Math/v3d_optimization.cpp
- third_party/gflags/gflags.cc
- third_party/gflags/gflags_reporting.cc
- third_party/gflags/gflags_completions.cc
- third_party/fast/fast_9.c
third_party/fast/fast_10.c
third_party/fast/fast_11.c
third_party/fast/fast_12.c
+ third_party/fast/fast_9.c
third_party/fast/fast.c
third_party/fast/nonmax.c
+ third_party/gflags/gflags.cc
+ third_party/gflags/gflags_completions.cc
+ third_party/gflags/gflags_reporting.cc
third_party/ldl/Source/ldl.c
+ third_party/ssba/Geometry/v3d_metricbundle.cpp
+ third_party/ssba/Math/v3d_optimization.cpp
libmv-capi.h
+ libmv/base/id_generator.h
+ libmv/base/scoped_ptr.h
+ libmv/base/vector.h
+ libmv/base/vector_utils.h
+ libmv/image/array_nd.h
+ libmv/image/convolve.h
+ libmv/image/image.h
+ libmv/image/sample.h
+ libmv/image/tuple.h
libmv/logging/logging.h
+ libmv/multiview/conditioning.h
+ libmv/multiview/euclidean_resection.h
+ libmv/multiview/fundamental.h
+ libmv/multiview/nviewtriangulation.h
+ libmv/multiview/projection.h
+ libmv/multiview/resection.h
+ libmv/multiview/triangulation.h
libmv/numeric/dogleg.h
- libmv/numeric/levenberg_marquardt.h
- libmv/numeric/poly.h
libmv/numeric/function_derivative.h
+ libmv/numeric/levenberg_marquardt.h
libmv/numeric/numeric.h
+ libmv/numeric/poly.h
+ libmv/simple_pipeline/bundle.h
libmv/simple_pipeline/callbacks.h
- libmv/simple_pipeline/resect.h
- libmv/simple_pipeline/reconstruction.h
libmv/simple_pipeline/camera_intrinsics.h
- libmv/simple_pipeline/tracks.h
libmv/simple_pipeline/detect.h
- libmv/simple_pipeline/pipeline.h
- libmv/simple_pipeline/intersect.h
- libmv/simple_pipeline/bundle.h
libmv/simple_pipeline/initialize_reconstruction.h
- libmv/image/convolve.h
- libmv/image/tuple.h
- libmv/image/array_nd.h
- libmv/image/sample.h
- libmv/image/image.h
- libmv/tracking/region_tracker.h
+ libmv/simple_pipeline/intersect.h
+ libmv/simple_pipeline/pipeline.h
+ libmv/simple_pipeline/reconstruction.h
+ libmv/simple_pipeline/resect.h
+ libmv/simple_pipeline/tracks.h
libmv/tracking/brute_region_tracker.h
+ libmv/tracking/esm_region_tracker.h
libmv/tracking/hybrid_region_tracker.h
+ libmv/tracking/klt_region_tracker.h
+ libmv/tracking/lmicklt_region_tracker.h
+ libmv/tracking/pyramid_region_tracker.h
+ libmv/tracking/region_tracker.h
libmv/tracking/retrack_region_tracker.h
libmv/tracking/sad.h
- libmv/tracking/pyramid_region_tracker.h
- libmv/tracking/esm_region_tracker.h
libmv/tracking/trklt_region_tracker.h
- libmv/tracking/klt_region_tracker.h
- libmv/tracking/lmicklt_region_tracker.h
- libmv/base/id_generator.h
- libmv/base/vector.h
- libmv/base/scoped_ptr.h
- libmv/base/vector_utils.h
- libmv/multiview/nviewtriangulation.h
- libmv/multiview/resection.h
- libmv/multiview/euclidean_resection.h
- libmv/multiview/triangulation.h
- libmv/multiview/projection.h
- libmv/multiview/fundamental.h
- libmv/multiview/conditioning.h
- third_party/ssba/Geometry/v3d_metricbundle.h
- third_party/ssba/Geometry/v3d_cameramatrix.h
- third_party/ssba/Geometry/v3d_distortion.h
- third_party/ssba/Math/v3d_linear_utils.h
- third_party/ssba/Math/v3d_optimization.h
- third_party/ssba/Math/v3d_mathutilities.h
- third_party/ssba/Math/v3d_linear.h
- third_party/gflags/gflags_completions.h
- third_party/gflags/mutex.h
+ third_party/fast/fast.h
third_party/gflags/config.h
+ third_party/gflags/gflags_completions.h
third_party/gflags/gflags.h
- third_party/fast/fast.h
+ third_party/gflags/mutex.h
third_party/ldl/Include/ldl.h
- third_party/msinttypes/stdint.h
third_party/msinttypes/inttypes.h
+ third_party/msinttypes/stdint.h
+ third_party/ssba/Geometry/v3d_cameramatrix.h
+ third_party/ssba/Geometry/v3d_distortion.h
+ third_party/ssba/Geometry/v3d_metricbundle.h
+ third_party/ssba/Math/v3d_linear.h
+ third_party/ssba/Math/v3d_linear_utils.h
+ third_party/ssba/Math/v3d_mathutilities.h
+ third_party/ssba/Math/v3d_optimization.h
)
if(WIN32)
@@ -152,23 +152,23 @@ if(WIN32)
third_party/glog/src/vlog_is_on.cc
third_party/glog/src/windows/port.cc
- third_party/glog/src/config.h
- third_party/glog/src/stacktrace.h
+ third_party/glog/src/utilities.h
third_party/glog/src/stacktrace_generic-inl.h
- third_party/glog/src/stacktrace_libunwind-inl.h
- third_party/glog/src/stacktrace_powerpc-inl.h
- third_party/glog/src/stacktrace_x86-inl.h
+ third_party/glog/src/stacktrace.h
third_party/glog/src/stacktrace_x86_64-inl.h
- third_party/glog/src/utilities.h
- third_party/glog/src/base/commandlineflags.h
third_party/glog/src/base/googleinit.h
third_party/glog/src/base/mutex.h
- third_party/glog/src/windows/config.h
- third_party/glog/src/windows/port.h
- third_party/glog/src/windows/glog/log_severity.h
- third_party/glog/src/windows/glog/logging.h
+ third_party/glog/src/base/commandlineflags.h
+ third_party/glog/src/stacktrace_powerpc-inl.h
+ third_party/glog/src/stacktrace_x86-inl.h
+ third_party/glog/src/config.h
+ third_party/glog/src/stacktrace_libunwind-inl.h
third_party/glog/src/windows/glog/raw_logging.h
third_party/glog/src/windows/glog/vlog_is_on.h
+ third_party/glog/src/windows/glog/logging.h
+ third_party/glog/src/windows/glog/log_severity.h
+ third_party/glog/src/windows/port.h
+ third_party/glog/src/windows/config.h
)
list(APPEND INC
@@ -190,34 +190,34 @@ if(WIN32)
endif()
else()
list(APPEND SRC
- third_party/glog/src/utilities.cc
- third_party/glog/src/symbolize.cc
- third_party/glog/src/vlog_is_on.cc
- third_party/glog/src/signalhandler.cc
- third_party/glog/src/logging.cc
third_party/glog/src/demangle.cc
+ third_party/glog/src/logging.cc
third_party/glog/src/raw_logging.cc
+ third_party/glog/src/signalhandler.cc
+ third_party/glog/src/symbolize.cc
+ third_party/glog/src/utilities.cc
+ third_party/glog/src/vlog_is_on.cc
- third_party/glog/src/config.h
+ third_party/glog/src/base/commandlineflags.h
+ third_party/glog/src/base/googleinit.h
+ third_party/glog/src/base/mutex.h
third_party/glog/src/config_freebsd.h
+ third_party/glog/src/config.h
third_party/glog/src/config_linux.h
third_party/glog/src/config_mac.h
third_party/glog/src/demangle.h
- third_party/glog/src/stacktrace.h
+ third_party/glog/src/glog/logging.h
+ third_party/glog/src/glog/log_severity.h
+ third_party/glog/src/glog/raw_logging.h
+ third_party/glog/src/glog/vlog_is_on.h
third_party/glog/src/stacktrace_generic-inl.h
+ third_party/glog/src/stacktrace.h
third_party/glog/src/stacktrace_libunwind-inl.h
third_party/glog/src/stacktrace_powerpc-inl.h
- third_party/glog/src/stacktrace_x86-inl.h
third_party/glog/src/stacktrace_x86_64-inl.h
+ third_party/glog/src/stacktrace_x86-inl.h
third_party/glog/src/symbolize.h
third_party/glog/src/utilities.h
- third_party/glog/src/base/commandlineflags.h
- third_party/glog/src/base/googleinit.h
- third_party/glog/src/base/mutex.h
- third_party/glog/src/glog/log_severity.h
- third_party/glog/src/glog/logging.h
- third_party/glog/src/glog/raw_logging.h
- third_party/glog/src/glog/vlog_is_on.h
)
list(APPEND INC
diff --git a/extern/libmv/ChangeLog b/extern/libmv/ChangeLog
index 7e10abfead6..f49a07de350 100644
--- a/extern/libmv/ChangeLog
+++ b/extern/libmv/ChangeLog
@@ -1,3 +1,359 @@
+commit 75b9af405964ff2c7d3f0a44500e27e63b37c91b
+Author: Sergey Sharybin <sergey.vfx@gmail.com>
+Date: Fri Feb 17 23:29:11 2012 +0600
+
+ _USE_MATH_DEFINES is needed to define constants like M_E when building with msvc
+ Occasionally was removed, but now added comment about this so hopefully it
+ wouldn't removed again.
+
+commit f85b1232a9b929f69443b5eed6e7a39908cd6551
+Author: Sergey Sharybin <sergey.vfx@gmail.com>
+Date: Fri Feb 17 21:34:40 2012 +0600
+
+ Picky edit: corrected mode for ssba readme file.
+
+commit f8c2b223f01551fd81a85f6d5221646165147035
+Author: Sergey Sharybin <sergey.vfx@gmail.com>
+Date: Fri Feb 17 21:32:05 2012 +0600
+
+ Picky edits: corrected EOL
+
+commit 3f2a4205ec5adadcdfa306b161c705c868a7be93
+Author: Sergey Sharybin <sergey.vfx@gmail.com>
+Date: Fri Feb 17 21:30:07 2012 +0600
+
+ Fixed incorrect access to ucontext on linux. Caused by incorrect merge conflict resolve.
+
+commit d360a21a5aa125cf9e83dd26b302508688ff7007
+Author: Sergey Sharybin <sergey.vfx@gmail.com>
+Date: Fri Feb 17 20:54:13 2012 +0600
+
+ More Windows -> Unix EOL conversions
+
+commit 18aeda58bec9556140ba617724e31ada6f5b67c0
+Author: Sergey Sharybin <sergey.vfx@gmail.com>
+Date: Fri Feb 17 20:15:42 2012 +0600
+
+ Looks like this debug output was removed accidentally.
+
+commit 189dc0cacdee3c1eab68c43263ecb038ed244c09
+Author: Sergey Sharybin <sergey.vfx@gmail.com>
+Date: Fri Feb 17 20:11:56 2012 +0600
+
+ Made V3D verbose again by default
+
+commit 8b3422d3eec5e450d76243886bf07fb0a3e83a81
+Author: Sergey Sharybin <sergey.vfx@gmail.com>
+Date: Fri Feb 17 20:08:01 2012 +0600
+
+ SAD tracker now can deal with pattern size any size,
+ Very quick implementation came from Blender before Hybrid tracker was added.
+ Better to be replaced with brute tracker.
+
+commit d547c9cfe37d5d3397d33c8b0e58471e1e1c1634
+Author: Sergey Sharybin <sergey.vfx@gmail.com>
+Date: Fri Feb 17 20:03:52 2012 +0600
+
+ Just convert end of lines to unix style.
+
+commit eb73ddbaec5b9e1ad30331bbf858a6ebc266c4aa
+Author: Sergey Sharybin <sergey.vfx@gmail.com>
+Date: Fri Feb 17 20:02:20 2012 +0600
+
+ Made some function static. Resolves possible linking issues when building with MinGW.
+
+commit 2930681fafd86e4f4a958054b1db8bfff29623d1
+Author: Sergey Sharybin <sergey.vfx@gmail.com>
+Date: Fri Feb 17 19:59:45 2012 +0600
+
+ Missed this in commit with improvements in camera intrinsics.
+
+commit 8d31bc767019b05c5bf8c9f309f9545b3428afa1
+Author: Sergey Sharybin <sergey.vfx@gmail.com>
+Date: Fri Feb 17 19:57:51 2012 +0600
+
+ Another step of syncing codebase with Blender.
+ Mainly fixes for freebsd/osx compilation and aligned memory allocation.
+
+commit 3214a2df5bfd98021f25d0f1a626a86318bb245f
+Author: Sergey Sharybin <sergey.vfx@gmail.com>
+Date: Fri Feb 17 19:48:02 2012 +0600
+
+ Support compilation on FreeBSD platform
+
+commit 0e5abe96f543687ccfb3a923ec639cb8f45d54f8
+Author: Sergey Sharybin <sergey.vfx@gmail.com>
+Date: Fri Feb 17 19:44:18 2012 +0600
+
+ Implementation of basic system for progress reporting into callee stuff
+
+ Implemented by using simple callbacks classes which are getting invoked from
+ places where lots of calculation happens, so applications which are using
+ libmv may display nice progress bar.
+
+commit c5e18fe35464618055e0e9761be8d22fae56db49
+Author: Keir Mierle <mierle@gmail.com>
+Date: Fri Feb 17 19:25:45 2012 +0600
+
+ Add support for detecting tracking failure in the ESM tracker component of
+ libmv. Since both KLT and Hybrid rely on ESM underneath, KLT and Hybrid now
+ have a minimum correlation setting to match. With this fix, track failures
+ should get detected quicker, with the issue that sometimes the tracker will
+ give up too easily. That is fixable by reducing the required correlation (in
+ the track properties).
+
+commit ea0fed736ecdcc8c020227aeef8ef4cd3be5e63d
+Author: Keir Mierle <mierle@gmail.com>
+Date: Fri Feb 17 19:23:50 2012 +0600
+
+ Add a new hybrid region tracker for motion tracking to libmv, and
+ add it as an option (under "Hybrid") in the tracking settings. The
+ region tracker is a combination of brute force tracking for coarse
+ alignment, then refinement with the ESM/KLT algorithm already in
+ libmv that gives excellent subpixel precision (typically 1/50'th
+ of a pixel)
+
+ This also adds a new "brute force" region tracker which does a
+ brute force search through every pixel position in the destination
+ for the pattern in the first frame. It leverages SSE if available,
+ similar to the SAD tracker, to do this quickly. Currently it does
+ some unnecessary conversions to/from floating point that will get
+ fixed later.
+
+ The hybrid tracker glues the two trackers (brute & ESM) together
+ to get an overall better tracker. The algorithm is simple:
+
+ 1. Track from frame 1 to frame 2 with the brute force tracker.
+ This tries every possible pixel position for the pattern from
+ frame 1 in frame 2. The position with the smallest
+ sum-of-absolute-differences is chosen. By definition, this
+ position is only accurate up to 1 pixel or so.
+ 2. Using the result from 1, initialize a track with ESM. This does
+ a least-squares fit with subpixel precision.
+ 3. If the ESM shift was more than 2 pixels, report failure.
+ 4. If the ESM track shifted less than 2 pixels, then the track is
+ good and we're done. The rationale here is that if the
+ refinement stage shifts more than 1 pixel, then the brute force
+ result likely found some random position that's not a good fit.
+
+commit a07fff8431621c01d81ae52595d8dd91a295a776
+Author: Keir Mierle <mierle@gmail.com>
+Date: Fri Feb 17 19:19:58 2012 +0600
+
+ Assorted camera tracker improvements
+
+ - Add support for refining the camera's intrinsic parameters
+ during a solve. Currently, refining supports only the following
+ combinations of intrinsic parameters:
+
+ f
+ f, cx, cy
+ f, cx, cy, k1, k2
+ f, k1
+ f, k1, k2
+
+ This is not the same as autocalibration, since the user must
+ still make a reasonable initial guess about the focal length and
+ other parameters, whereas true autocalibration would eliminate
+ the need for the user specify intrinsic parameters at all.
+
+ However, the solver works well with only rough guesses for the
+ focal length, so perhaps full autocalibation is not that
+ important.
+
+ Adding support for the last two combinations, (f, k1) and (f,
+ k1, k2) required changes to the library libmv depends on for
+ bundle adjustment, SSBA. These changes should get ported
+ upstream not just to libmv but to SSBA as well.
+
+ - Improved the region of convergence for bundle adjustment by
+ increasing the number of Levenberg-Marquardt iterations from 50
+ to 500. This way, the solver is able to crawl out of the bad
+ local minima it gets stuck in when changing from, for example,
+ bundling k1 and k2 to just k1 and resetting k2 to 0.
+
+ - Add several new region tracker implementations. A region tracker
+ is a libmv concept, which refers to tracking a template image
+ pattern through frames. The impact to end users is that tracking
+ should "just work better". I am reserving a more detailed
+ writeup, and maybe a paper, for later.
+
+ - Other libmv tweaks, such as detecting that a tracker is headed
+ outside of the image bounds.
+
+ This includes several changes made directly to the libmv extern
+ code rather expecting to get those changes through normal libmv
+ channels, because I, the libmv BDFL, decided it was faster to work
+ on libmv directly in Blender, then later reverse-port the libmv
+ changes from Blender back into libmv trunk. The interesting part
+ is that I added a full Levenberg-Marquardt loop to the region
+ tracking code, which should lead to a more stable solutions. I
+ also added a hacky implementation of "Efficient Second-Order
+ Minimization" for tracking, which works nicely. A more detailed
+ quantitative evaluation will follow.
+
+commit 0bf66c009d5022eacfc473d247884a73ffeefa8f
+Author: Sergey Sharybin <sergey.vfx@gmail.com>
+Date: Fri Feb 17 19:13:49 2012 +0600
+
+ Rest of compilation fix with FAST library.
+
+commit 71b578ca2ba34c528363c514cd1fcc85791d01f3
+Author: Keir Mierle <mierle@gmail.com>
+Date: Fri Feb 17 19:00:28 2012 +0600
+
+ Improve the KLT tracking behaviour and UI
+
+ - Remove the overly-conservative use of libmv's re-track tracker. The re-track
+ tracker would take a normal tracker such as TRKLT or KLT or pyramid KLT, and
+ track from frame 1 to 2, then back from the position found in 2 back to 1.
+ Then, when the reverse-track doesn't match the original track with high
+ precision, the track is considered "failed". This is a good approach for
+ fully automatic reconstruction, but is too conservative for supervised
+ tracking.
+
+ The retrack-tracker will return when fully automatic tracking is added.
+
+ - Always solve for (dx, dy) in the TRKLT loop even if the linear system is
+ ill-conditioned. The client (Blender in this case) can still use the solved
+ position, even though it is less reliable.
+
+commit 7d8a8762f2bc2e36f95b0b6f4fb4ca996f9f0db7
+Author: Sergey Sharybin <sergey.vfx@gmail.com>
+Date: Fri Feb 17 18:46:24 2012 +0600
+
+ Changes in camera intrinsics distortion/undistortion:
+
+ - Distortion/undistortion of scaled images wasn't happening right,
+ because camera intrinsics are calibrated on an original frame which
+ has got some particular resolution and trying to apply this model on
+ an image with another resolution gives totally wrong result.
+ This is needed to be able to do post-prccessing of render, running
+ distortion on a scene which might be rendered with higher resolution
+ than footage itself and then be scaled down.
+ - Fixed incorrect calculation/applying of precomputed grid when
+ distortion is high high enough and produces pixel offset higher
+ than 127 pixels. This might be still not very distorted image,
+ but if it's a 4K footage "normal" camera will easily give such
+ a distortion.
+ - Added support of overscan distortion/undistortion.
+
+commit ed080785d63bb8e3a13dde51a2dc94fe59b059bb
+Author: Sergey Sharybin <sergey.vfx@gmail.com>
+Date: Fri Feb 17 18:38:51 2012 +0600
+
+ Fast headers now can be included from C++ sources.
+ Was needed to make it working fine when bundling in Blender but might also
+ be needed to bundle into another applications.
+
+commit 5f5a7aa46a2d87b96c8098dfc8682f4d01b5cd40
+Author: Sergey Sharybin <sergey.vfx@gmail.com>
+Date: Fri Feb 17 18:36:16 2012 +0600
+
+ Bring back FAST detector which seems to be working much nicer than Morravec.
+ Both of them are available in API.
+
+commit 2cab13c18216fb684b270cec077f7300262584af
+Author: Sergey Sharybin <sergey.vfx@gmail.com>
+Date: Fri Feb 17 18:27:36 2012 +0600
+
+ Revert "Make CameraIntrinsics (and thus Qt tracker) compilable without linking libmv."
+
+ This reverts commit 81613ee0cc94b315f333c9632b18b95d426aad05.
+
+ That commit made inverting intrinsics totally unworkable, so reverted this and
+ made needed tweaks to qt-tracker project file to make it compilable (was needed
+ to make it linking together with glog).
+
+ Conflicts:
+
+ src/ui/tracker/tracker.cc
+ src/ui/tracker/tracker.pro
+
+commit ec46cae041401b17afb4fe4d9c9343d10797090f
+Author: Sergey Sharybin <sergey.vfx@gmail.com>
+Date: Fri Feb 17 17:59:55 2012 +0600
+
+ Fix compilation error using official MinGW
+
+commit 6fbc370e922c47cfa35381662b6c439f4891ed74
+Author: Sergey Sharybin <sergey.vfx@gmail.com>
+Date: Fri Feb 17 17:38:20 2012 +0600
+
+ Fix compilation error with MSVC 2010 which is more picky for "missed" STL headers
+
+commit be9e6b63691d83b551a085f0766878bd84220767
+Author: Sergey Sharybin <sergey.vfx@gmail.com>
+Date: Fri Feb 17 17:36:18 2012 +0600
+
+ Fix compilation with MSVC where snprintf function is declared as unsafe and _snprintf should be used instead.
+
+ Better to switch to own implementation will ensure string is correctly NULL-terminated.
+
+commit 1847d9e414ed763cd80668775d7d9f79575fc8ca
+Author: Sergey Sharybin <sergey.vfx@gmail.com>
+Date: Fri Feb 17 17:34:45 2012 +0600
+
+ Fix compilation error on OSX caused by incorrect access to ucontext
+
+commit 90579b6ffad07672172a1c240499615b30b25549
+Merge: b9aac30 531c79b
+Author: Sergey Sharybin <sergey.vfx@gmail.com>
+Date: Fri Feb 17 18:32:52 2012 +0600
+
+ Merge remote-tracking branch 'Matthias-Fauconneau/master' into devel
+
+ Conflicts:
+ src/libmv/tracking/CMakeLists.txt
+
+commit b9aac30a9ca6bc8362c09a0e191040964f7c6de2
+Merge: 198894e 6969e1a
+Author: Keir Mierle <mierle@gmail.com>
+Date: Sat Nov 5 17:38:30 2011 -0700
+
+ Merge pull request #3 from nathanwiegand/master
+
+ Just a few tiny cleanups
+
+commit 6969e1a9534291a982749baa5a3672c97bfa506d
+Author: Nathan Wiegand <nathanwiegand@gmail.com>
+Date: Sat Nov 5 14:26:54 2011 -0700
+
+ I've added cleaned up a few style issues here an there. Also, I've updated the CMakeLists.txt file so that it can build the image_io library. Note, it's only been tested on OSX 10.6
+
+commit 4763f851299050140757bfaa069107a0cf639e56
+Author: Nathan Wiegand <nathanwiegand@gmail.com>
+Date: Fri Nov 4 23:59:08 2011 -0700
+
+ Removed a superfulous comment
+
+commit a44577c0162e273681e4a9a3cc5f5b37d4315b67
+Author: Nathan Wiegand <nathanwiegand@gmail.com>
+Date: Fri Nov 4 23:55:52 2011 -0700
+
+ Removed a duplicate entry for an author.
+
+commit 198894e4c4f51c2c1784ad7c02eb45d2d1ada9bc
+Merge: c4c67db 6e797d6
+Author: Keir Mierle <mierle@gmail.com>
+Date: Fri Nov 4 21:47:05 2011 -0700
+
+ Merge pull request #2 from nathanwiegand/master
+
+ CMake changes for OSX
+
+commit 6e797d678c4c19f6a9e21657d66183f412cc995b
+Author: Nathan Wiegand <nathanwiegand@gmail.com>
+Date: Fri Nov 4 21:43:28 2011 -0700
+
+ Uncomment the GUI part of the CMake file
+
+commit 33ef88a33860345d8906f3c9dd22d8dbce3df53e
+Author: Nathan Wiegand <nathanwiegand@gmail.com>
+Date: Fri Nov 4 21:31:22 2011 -0700
+
+ Fixed build error on OSX by adding 'glog' to the dependencies in the tracker CMake
+
commit 531c79bf95fddaaa70707d1abcd4fdafda16bbf0
Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
Date: Sat Aug 20 00:00:42 2011 +0200
@@ -91,222 +447,3 @@ Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
Date: Thu Aug 18 20:51:43 2011 +0200
Fix detect.cc.
-
-commit ec18cc5ea9ae2e641075a847e82d0aacb8415ad8
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Thu Aug 18 17:45:37 2011 +0200
-
- Compute and return Pearson product-moment correlation coefficient between reference and matched pattern.
-
-commit 21d4245c63a01bfc736192d55baf10983e7c9ec7
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Thu Aug 18 16:18:44 2011 +0200
-
- UI and API support for affine tracking.
-
-commit a4876d8c40dcde615b44009c38c49e9a1b1d4698
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Wed Aug 17 20:26:01 2011 +0200
-
- Hack to make sad.cc compile with MSVC on system without support for the SSE instruction set.
-
-commit 0de723dfce5bbe44dbd19be8cd6dd6e9b03b7924
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Wed Aug 17 20:10:46 2011 +0200
-
- Fix slow path (for computers without SSE2).
- Heap allocate scores in detect.cc
-
-commit 65a9d496f81e8b37eae39a4063957b8be9a4e6f0
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Wed Aug 17 19:25:17 2011 +0200
-
- Fix compilation on OSX.
-
-commit d22720e618456329388d2c107422c3b371657cba
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Wed Aug 17 14:14:45 2011 +0200
-
- Improve Detect and SAD Tracker API and documentation.
-
-commit 5d6cd4ad365b061901bad40695b51d568487a0cf
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Wed Aug 17 11:57:29 2011 +0200
-
- MSVC support fixes.
-
-commit 50f0323173c6deebd6aaf9c126f0b51b2a79c3c1
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Tue Aug 16 23:21:37 2011 +0200
-
- Detector can detect features similar to a given pattern.
-
-commit 5734cc27bbf84c2b6edcfcc1ea736798e12d5820
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Tue Aug 16 22:53:54 2011 +0200
-
- Ensure SAD Tracker is C compatible.
- Update Detect API documentation.
-
-commit 701c42842574064fea992f8822e3899cb9066108
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Tue Aug 16 21:56:42 2011 +0200
-
- Remove FAST detector.
- Add Moravec detector.
- This detector is more suited to tracking since it try to choose patterns which are unlikely to drift by computing SAD with neighbouring patches.
- It could be improved to better avoid edges.
-
-commit 9bdf93e13fc880c78b6f34397da673388c16040e
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Tue Aug 16 21:55:08 2011 +0200
-
- Fix Qt Tracker GL to work with AMD drivers.
-
-commit 81613ee0cc94b315f333c9632b18b95d426aad05
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Tue Aug 16 21:54:12 2011 +0200
-
- Make CameraIntrinsics (and thus Qt tracker) compilable without linking libmv.
-
-commit a1d9a8fa8b01ef7cf2a79b3b891633fc333fc9cf
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Tue Aug 16 21:24:51 2011 +0200
-
- Fix SAD tracker. Pattern was transposed by affine pattern sampler.
-
-commit c3b794da2e7fd23f2fbdf90dbd71de0e6b3bc811
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Tue Aug 16 21:19:02 2011 +0200
-
- Fix SAD tracker. Pattern was transposed by affine pattern sampler.
-
-commit a9b61bf3356f27174cdd983f562f99c3a6a2cc35
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Sun Aug 14 09:56:51 2011 +0200
-
- Clarify CameraIntrinsics documentation.
- Edit CameraInstrinsics test to fail.
-
-commit 10bdad9ad2cea2603896263cde5a5339169a9af0
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Fri Aug 12 21:05:32 2011 +0200
-
- Fix out of bound access in warp bilinear sampling.
-
-commit dd9a418db021a28af2c1198d5e5b9e68fe048a03
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Fri Aug 12 19:14:36 2011 +0200
-
- Fix compilation with -funsigned-char.
-
-commit bd1a268ede39b67f2ba4b360f6fc693419e7cd7f
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Fri Aug 12 18:39:27 2011 +0200
-
- CameraIntrinsics fixes.
-
-commit ae513b39fb779632f96ceff7c1e014fb8e68702a
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Tue Aug 9 19:38:58 2011 +0200
-
- Remove stray QDebug include.
-
-commit 1e58f55078ce6009a885be30ae0316aec6ed8239
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Tue Aug 9 14:16:31 2011 +0200
-
- Make API future-proof (for an eventual affine or planar tracker).
-
-commit c2af303e7bf0dddcb02937323ac5846b1801e6cc
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Tue Aug 9 11:13:29 2011 +0200
-
- Remove reconstruction breaking debug code.
-
-commit 8792a633e5c5f1c1f12e164b9e8897ca0790ac59
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Tue Aug 9 10:49:18 2011 +0200
-
- Remove getchar()s.
-
-commit 63a9bdee0cbd1197e0315d01c27bfc2361bd5656
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Tue Aug 9 10:35:07 2011 +0200
-
- Adapt patch to new PipelineRoutines code generation strategy.
-
-commit 096ff1a4070f7212c50fb0a4b2feec7ca9d97158
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Tue Aug 9 09:54:12 2011 +0200
-
- Merge max_image and max_track fix from tomato.
-
-commit d8450cd3c37278a397482cd36b1e2419f154cfb9
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Tue Aug 9 09:38:49 2011 +0200
-
- Synchronize tree with Tomato: Merge patch for better resection, keep deprecated KLT tracker.
-
-commit e9b2dca920cf9575c15150a4988634b00e343a41
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Mon Aug 8 17:07:08 2011 +0200
-
- Fixes, Documentation.
-
-commit 4fc1c57a2d92442808ac4a3676e6d9a25a51e310
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Sun Aug 7 14:35:08 2011 +0200
-
- Improve tracker resilience by penalizing large motion vectors.
-
-commit cc8e7e8e08cd91f75c080a0091461ca9fe969664
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Sun Aug 7 09:28:09 2011 +0200
-
- Leverage SSE2 SAD instruction for 16x speed improvement in integer pixel search resulting in ~1ms per marker for 16x16 pattern on 128x128 region.
-
-commit f362ab4999a768370fca57552464b459eb9fbddc
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Sun Aug 7 09:06:04 2011 +0200
-
- Improve SAD Tracker subpixel precision (avoid drift even when adapting at each frame).
-
-commit fce7a214c561b5f5f0e17115c31fb48814bde2db
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Sat Aug 6 21:57:06 2011 +0200
-
- Track using simple Sum of Absolute Differences matching.
- This method is simpler, more robust, faster and accurate.
-
-commit 620a7a35d9a2818bf6e9dbf5d11debda4be6bc26
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Fri Jul 29 12:35:57 2011 +0200
-
- Add Intersect unit test.
-
-commit a2bf58fa57be11215eb17ff7f7de58f97d480ec3
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Thu Jul 28 11:08:06 2011 +0200
-
- Remove tests depending on dead code.
- Fix CameraIntrinsics test.
- Add Intersect and Resect tests.
-
-commit 19bddee10b4879c8cd2238ccdf5b8f7620cf8384
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Wed Jul 27 12:07:21 2011 +0200
-
- Image Distortion: Fixes and more testing.
-
-commit 0454d97da328fb0eda8c6c50511ac31864a6d3d6
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Wed Jul 27 10:32:37 2011 +0200
-
- Test float image distortion.
-
-commit 8db01595a8721f766d85931a8d92b780461d8741
-Author: Matthias Fauconneau <matthias.fauconneau@gmail.com>
-Date: Wed Jul 27 10:27:07 2011 +0200
-
- Image Distortion: Bilinear sampling, Optimization, Instantiate all variants (Distort/Undistort, float/ubyte, 1-4 channels).
diff --git a/extern/libmv/bundle.sh b/extern/libmv/bundle.sh
index f5cfcc0d488..f259635035e 100755
--- a/extern/libmv/bundle.sh
+++ b/extern/libmv/bundle.sh
@@ -1,7 +1,8 @@
#!/bin/sh
#BRANCH="keir"
-BRANCH="Matthias-Fauconneau"
+#BRANCH="Matthias-Fauconneau"
+BRANCH="Nazg-Gul"
if [ -d ./.svn ]; then
echo "This script is supposed to work only when using git-svn"
@@ -24,7 +25,7 @@ done
rm -rf libmv
rm -rf third_party
-cat "files.txt" | while f=`line`; do
+cat "files.txt" | while read f; do
mkdir -p `dirname $f`
cp $tmp/libmv/src/$f $f
done
@@ -36,14 +37,14 @@ chmod 664 ./third_party/glog/src/windows/*.cc ./third_party/glog/src/windows/*.h
sources=`find ./libmv -type f -iname '*.cc' -or -iname '*.cpp' -or -iname '*.c' | sed -r 's/^\.\//\t/' | sort -d`
headers=`find ./libmv -type f -iname '*.h' | sed -r 's/^\.\//\t/' | sort -d`
-third_sources=`find ./third_party -type f -iname '*.cc' -or -iname '*.cpp' -or -iname '*.c' | grep -v glog | sed -r 's/^\.\//\t/' | sort`
-third_headers=`find ./third_party -type f -iname '*.h' | grep -v glog | sed -r 's/^\.\//\t/' | sort`
+third_sources=`find ./third_party -type f -iname '*.cc' -or -iname '*.cpp' -or -iname '*.c' | grep -v glog | sed -r 's/^\.\//\t/' | sort -d`
+third_headers=`find ./third_party -type f -iname '*.h' | grep -v glog | sed -r 's/^\.\//\t/' | sort -d`
-third_glog_sources=`find ./third_party -type f -iname '*.cc' -or -iname '*.cpp' -or -iname '*.c' | grep glog | grep -v windows | sed -r 's/^\.\//\t\t/' | sort`
-third_glog_headers=`find ./third_party -type f -iname '*.h' | grep glog | grep -v windows | sed -r 's/^\.\//\t\t/' | sort`
+third_glog_sources=`find ./third_party -type f -iname '*.cc' -or -iname '*.cpp' -or -iname '*.c' | grep glog | grep -v windows | sed -r 's/^\.\//\t\t/' | sort -d`
+third_glog_headers=`find ./third_party -type f -iname '*.h' | grep glog | grep -v windows | sed -r 's/^\.\//\t\t/' | sort -d`
-src_dir=`find ./libmv -type f -iname '*.cc' -exec dirname {} \; -or -iname '*.cpp' -exec dirname {} \; -or -iname '*.c' -exec dirname {} \; | sed -r 's/^\.\//\t/' | sort | uniq`
-src_third_dir=`find ./third_party -type f -iname '*.cc' -exec dirname {} \; -or -iname '*.cpp' -exec dirname {} \; -or -iname '*.c' -exec dirname {} \; | sed -r 's/^\.\//\t/' | sort | uniq`
+src_dir=`find ./libmv -type f -iname '*.cc' -exec dirname {} \; -or -iname '*.cpp' -exec dirname {} \; -or -iname '*.c' -exec dirname {} \; | sed -r 's/^\.\//\t/' | sort -d | uniq`
+src_third_dir=`find ./third_party -type f -iname '*.cc' -exec dirname {} \; -or -iname '*.cpp' -exec dirname {} \; -or -iname '*.c' -exec dirname {} \; | sed -r 's/^\.\//\t/' | sort -d | uniq`
src=""
win_src=""
for x in $src_dir $src_third_dir; do
@@ -103,7 +104,7 @@ cat > CMakeLists.txt << EOF
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2011, Blender Foundation
# All rights reserved.
diff --git a/extern/libmv/libmv/base/vector.h b/extern/libmv/libmv/base/vector.h
index 9dc48676629..c2a3298087a 100644
--- a/extern/libmv/libmv/base/vector.h
+++ b/extern/libmv/libmv/base/vector.h
@@ -84,6 +84,8 @@ class vector {
T& front() { return data_[0]; }
const T& operator[](int n) const { return data_[n]; }
T& operator[](int n) { return data_[n]; }
+ const T& at(int n) const { return data_[n]; }
+ T& at(int n) { return data_[n]; }
const T * begin() const { return data_; }
const T * end() const { return data_+size_; }
T * begin() { return data_; }
diff --git a/extern/libmv/libmv/simple_pipeline/pipeline.cc b/extern/libmv/libmv/simple_pipeline/pipeline.cc
index 382365e579f..2e4e5a6491d 100644
--- a/extern/libmv/libmv/simple_pipeline/pipeline.cc
+++ b/extern/libmv/libmv/simple_pipeline/pipeline.cc
@@ -279,25 +279,7 @@ double InternalReprojectionError(const Tracks &image_tracks,
PipelineRoutines::ProjectMarker(*point, *camera, intrinsics);
double ex = reprojected_marker.x - markers[i].x;
double ey = reprojected_marker.y - markers[i].y;
-#if 0
- const int N = 100;
- char line[N];
- snprintf(line, N,
- "image %-3d track %-3d "
- "x %7.1f y %7.1f "
- "rx %7.1f ry %7.1f "
- "ex %7.1f ey %7.1f"
- " e %7.1f",
- markers[i].image,
- markers[i].track,
- markers[i].x,
- markers[i].y,
- reprojected_marker.x,
- reprojected_marker.y,
- ex,
- ey,
- sqrt(ex*ex + ey*ey));
-#endif
+
total_error += sqrt(ex*ex + ey*ey);
}
LG << "Skipped " << num_skipped << " markers.";
diff --git a/extern/libmv/libmv/simple_pipeline/tracks.h b/extern/libmv/libmv/simple_pipeline/tracks.h
index 739c3c4f243..aa0fbaa6e4c 100644
--- a/extern/libmv/libmv/simple_pipeline/tracks.h
+++ b/extern/libmv/libmv/simple_pipeline/tracks.h
@@ -27,13 +27,13 @@ namespace libmv {
/*!
A Marker is the 2D location of a tracked point in an image.
-
+
\a x, \a y is the position of the marker in pixels from the top left corner
in the image identified by \a image. All markers for to the same target
form a track identified by a common \a track number.
-
+
\note Markers are typically aggregated with the help of the \l Tracks class.
-
+
\sa Tracks
*/
struct Marker {
@@ -44,18 +44,18 @@ struct Marker {
/*!
The Tracks class stores \link Marker reconstruction markers \endlink.
-
+
The Tracks container is intended as the store of correspondences between
images, which must get created before any 3D reconstruction can take place.
-
+
The container has several fast lookups for queries typically needed for
structure from motion algorithms, such as \l MarkersForTracksInBothImages().
-
+
\sa Marker
*/
class Tracks {
public:
- Tracks() {}
+ Tracks() { }
// Copy constructor for a tracks object.
Tracks(const Tracks &other);
@@ -67,10 +67,10 @@ class Tracks {
Inserts a marker into the set. If there is already a marker for the given
\a image and \a track, the existing marker is replaced. If there is no
marker for the given \a image and \a track, a new one is added.
-
+
\a image and \a track are the keys used to retrieve the markers with the
other methods in this class.
-
+
\note To get an identifier for a new track, use \l MaxTrack() + 1.
*/
void Insert(int image, int track, double x, double y);
@@ -86,7 +86,7 @@ class Tracks {
/*!
Returns the markers in \a image1 and \a image2 which have a common track.
-
+
This is not the same as the union of the markers in \a image1 and \a
image2; each marker is for a track that appears in both images.
*/
diff --git a/extern/libmv/libmv/tracking/esm_region_tracker.cc b/extern/libmv/libmv/tracking/esm_region_tracker.cc
index 9784b61c068..df9c89a46d4 100644
--- a/extern/libmv/libmv/tracking/esm_region_tracker.cc
+++ b/extern/libmv/libmv/tracking/esm_region_tracker.cc
@@ -18,6 +18,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
+/* needed for M_E when building with msvc */
#define _USE_MATH_DEFINES
#include "libmv/tracking/esm_region_tracker.h"
diff --git a/extern/libmv/libmv/tracking/trklt_region_tracker.h b/extern/libmv/libmv/tracking/trklt_region_tracker.h
index 5046e0f069d..26d0621aa02 100644
--- a/extern/libmv/libmv/tracking/trklt_region_tracker.h
+++ b/extern/libmv/libmv/tracking/trklt_region_tracker.h
@@ -42,7 +42,7 @@ struct TrkltRegionTracker : public RegionTracker {
min_update_squared_distance(1e-6),
sigma(0.9),
lambda(0.05) {}
-
+
virtual ~TrkltRegionTracker() {}
// Tracker interface.
diff --git a/extern/libmv/patches/bundle_tweaks.patch b/extern/libmv/patches/bundle_tweaks.patch
index f7b06b0a2dd..aebc257f7f9 100644
--- a/extern/libmv/patches/bundle_tweaks.patch
+++ b/extern/libmv/patches/bundle_tweaks.patch
@@ -11,6 +11,36 @@ index 067da52..af86c4b 100644
#define LG LOG(INFO)
#define V0 LOG(INFO)
+diff --git a/src/libmv/simple_pipeline/pipeline.cc b/src/libmv/simple_pipeline/pipeline.cc
+index 2459d05..2e4e5a6 100644
+--- a/src/libmv/simple_pipeline/pipeline.cc
++++ b/src/libmv/simple_pipeline/pipeline.cc
+@@ -280,25 +280,6 @@ double InternalReprojectionError(const Tracks &image_tracks,
+ double ex = reprojected_marker.x - markers[i].x;
+ double ey = reprojected_marker.y - markers[i].y;
+
+- const int N = 100;
+- char line[N];
+- snprintf(line, N,
+- "image %-3d track %-3d "
+- "x %7.1f y %7.1f "
+- "rx %7.1f ry %7.1f "
+- "ex %7.1f ey %7.1f"
+- " e %7.1f",
+- markers[i].image,
+- markers[i].track,
+- markers[i].x,
+- markers[i].y,
+- reprojected_marker.x,
+- reprojected_marker.y,
+- ex,
+- ey,
+- sqrt(ex*ex + ey*ey));
+- LG << line;
+-
+ total_error += sqrt(ex*ex + ey*ey);
+ }
+ LG << "Skipped " << num_skipped << " markers.";
diff --git a/src/third_party/glog/src/glog/logging.h b/src/third_party/glog/src/glog/logging.h
index 57615ef..a58d478 100644
--- a/src/third_party/glog/src/glog/logging.h
@@ -65,7 +95,7 @@ index 50c6a71..b179a1e 100644
#ifdef HAVE_STACKTRACE
diff --git a/src/third_party/glog/src/utilities.h b/src/third_party/glog/src/utilities.h
-index ee54f94..2d4e99e 100644
+index c4ae256..5c841a0 100644
--- a/src/third_party/glog/src/utilities.h
+++ b/src/third_party/glog/src/utilities.h
@@ -79,7 +79,7 @@
@@ -106,7 +136,7 @@ index 114762e..682a1b9 100755
/* define if you have libunwind */
#undef HAVE_LIB_UNWIND
diff --git a/src/third_party/glog/src/windows/glog/logging.h b/src/third_party/glog/src/windows/glog/logging.h
-index 7a6df74..de51586 100755
+index 4257375..2f41681 100755
--- a/src/third_party/glog/src/windows/glog/logging.h
+++ b/src/third_party/glog/src/windows/glog/logging.h
@@ -82,8 +82,8 @@
@@ -119,4 +149,4 @@ index 7a6df74..de51586 100755
+#include "third_party/gflags/gflags.h"
#endif
- namespace google {
+ #ifdef __MINGW32__
diff --git a/extern/libmv/patches/config_mac.patch b/extern/libmv/patches/config_mac.patch
deleted file mode 100644
index 5a880155bfa..00000000000
--- a/extern/libmv/patches/config_mac.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/src/third_party/glog/src/config_mac.h b/src/third_party/glog/src/config_mac.h
-index a45575b..5f953d1 100644
---- a/src/third_party/glog/src/config_mac.h
-+++ b/src/third_party/glog/src/config_mac.h
-@@ -131,7 +131,7 @@
- #define PACKAGE_VERSION "0.3.1"
-
- /* How to access the PC from a struct ucontext */
--#define PC_FROM_UCONTEXT uc_mcontext->__ss.__rip
-+#undef PC_FROM_UCONTEXT
-
- /* Define to necessary symbol if this constant uses a non-standard name on
- your system. */
diff --git a/extern/libmv/patches/detect.patch b/extern/libmv/patches/detect.patch
deleted file mode 100644
index 36fea8427db..00000000000
--- a/extern/libmv/patches/detect.patch
+++ /dev/null
@@ -1,181 +0,0 @@
-diff --git a/src/libmv/simple_pipeline/detect.cc b/src/libmv/simple_pipeline/detect.cc
-index 6fc0cdd..8ac42ab 100644
---- a/src/libmv/simple_pipeline/detect.cc
-+++ b/src/libmv/simple_pipeline/detect.cc
-@@ -23,15 +23,89 @@
- ****************************************************************************/
-
- #include "libmv/simple_pipeline/detect.h"
-+#include <third_party/fast/fast.h>
- #include <stdlib.h>
--#include <string.h>
-+#include <memory.h>
-+
-+#ifdef __SSE2__
-+#include <emmintrin.h>
-+#endif
-
- namespace libmv {
-
- typedef unsigned int uint;
-
-+int featurecmp(const void *a_v, const void *b_v)
-+{
-+ Feature *a = (Feature*)a_v;
-+ Feature *b = (Feature*)b_v;
-+
-+ return b->score - a->score;
-+}
-+
-+std::vector<Feature> DetectFAST(const unsigned char* data, int width, int height, int stride,
-+ int min_trackness, int min_distance) {
-+ std::vector<Feature> features;
-+ // TODO(MatthiasF): Support targetting a feature count (binary search trackness)
-+ int num_features;
-+ xy* all = fast9_detect(data, width, height,
-+ stride, min_trackness, &num_features);
-+ if(num_features == 0) {
-+ free(all);
-+ return features;
-+ }
-+ int* scores = fast9_score(data, stride, all, num_features, min_trackness);
-+ // TODO: merge with close feature suppression
-+ xy* nonmax = nonmax_suppression(all, scores, num_features, &num_features);
-+ free(all);
-+ // Remove too close features
-+ // TODO(MatthiasF): A resolution independent parameter would be better than distance
-+ // e.g. a coefficient going from 0 (no minimal distance) to 1 (optimal circle packing)
-+ // FIXME(MatthiasF): this method will not necessarily give all maximum markers
-+ if(num_features) {
-+ Feature *all_features = new Feature[num_features];
-+
-+ for(int i = 0; i < num_features; ++i) {
-+ Feature a = { nonmax[i].x, nonmax[i].y, scores[i], 0 };
-+ all_features[i] = a;
-+ }
-+
-+ qsort((void *)all_features, num_features, sizeof(Feature), featurecmp);
-+
-+ features.reserve(num_features);
-+
-+ int prev_score = all_features[0].score;
-+ for(int i = 0; i < num_features; ++i) {
-+ bool ok = true;
-+ Feature a = all_features[i];
-+ if(a.score>prev_score)
-+ abort();
-+ prev_score = a.score;
-+
-+ // compare each feature against filtered set
-+ for(int j = 0; j < features.size(); j++) {
-+ Feature& b = features[j];
-+ if ( (a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y) < min_distance*min_distance ) {
-+ // already a nearby feature
-+ ok = false;
-+ break;
-+ }
-+ }
-+
-+ if(ok) {
-+ // add the new feature
-+ features.push_back(a);
-+ }
-+ }
-+
-+ delete [] all_features;
-+ }
-+ free(scores);
-+ free(nonmax);
-+ return features;
-+}
-+
- #ifdef __SSE2__
--#include <emmintrin.h>
- static uint SAD(const ubyte* imageA, const ubyte* imageB, int strideA, int strideB) {
- __m128i a = _mm_setzero_si128();
- for(int i = 0; i < 16; i++) {
-@@ -52,7 +126,7 @@ static uint SAD(const ubyte* imageA, const ubyte* imageB, int strideA, int strid
- }
- #endif
-
--void Detect(ubyte* image, int stride, int width, int height, Feature* detected, int* count, int distance, ubyte* pattern) {
-+void DetectMORAVEC(ubyte* image, int stride, int width, int height, Feature* detected, int* count, int distance, ubyte* pattern) {
- unsigned short histogram[256];
- memset(histogram,0,sizeof(histogram));
- ubyte* scores = new ubyte[width*height];
-diff --git a/src/libmv/simple_pipeline/detect.h b/src/libmv/simple_pipeline/detect.h
-index 23b239b..bbe7aed 100644
---- a/src/libmv/simple_pipeline/detect.h
-+++ b/src/libmv/simple_pipeline/detect.h
-@@ -25,27 +25,52 @@
- #ifndef LIBMV_SIMPLE_PIPELINE_DETECT_H_
- #define LIBMV_SIMPLE_PIPELINE_DETECT_H_
-
--#ifdef __cplusplus
-+#include <vector>
-+
- namespace libmv {
--#endif
-
- typedef unsigned char ubyte;
-
- /*!
-- \a Feature is the 2D location of a detected feature in an image.
-+ A Feature is the 2D location of a detected feature in an image.
-
-- \a x, \a y is the position of the center in pixels (from image top-left).
-- \a score is an estimate of how well the pattern will be tracked.
-- \a size can be used as an initial size to track the pattern.
-+ \a x, \a y is the position of the feature in pixels from the top left corner.
-+ \a score is an estimate of how well the feature will be tracked.
-+ \a size can be used as an initial pattern size to track the feature.
-
- \sa Detect
- */
- struct Feature {
-+ /// Position in pixels (from top-left corner)
-+ /// \note libmv might eventually support subpixel precision.
- float x, y;
-+ /// Trackness of the feature
- float score;
-+ /// Size of the feature in pixels
- float size;
- };
-- //radius for non maximal suppression
-+
-+/*!
-+ Detect features in an image.
-+
-+ You need to input a single channel 8-bit image using pointer to image \a data,
-+ \a width, \a height and \a stride (i.e bytes per line).
-+
-+ You can tweak the count of detected features using \a min_trackness, which is
-+ the minimum score to add a feature, and \a min_distance which is the minimal
-+ distance accepted between two featuress.
-+
-+ \note You can binary search over \a min_trackness to get a given feature count.
-+
-+ \note a way to get an uniform distribution of a given feature count is:
-+ \a min_distance = \a width * \a height / desired_feature_count ^ 2
-+
-+ \return All detected feartures matching given parameters
-+*/
-+std::vector<Feature> DetectFAST(const unsigned char* data, int width, int height,
-+ int stride, int min_trackness = 128,
-+ int min_distance = 120);
-+
- /*!
- Detect features in an image.
-
-@@ -63,10 +88,8 @@ struct Feature {
- \note \a You can crop the image (to avoid detecting markers near the borders) without copying:
- image += marginY*stride+marginX, width -= 2*marginX, height -= 2*marginY;
- */
--void Detect(ubyte* image, int stride, int width, int height, Feature* detected, int* count, int distance /*=32*/, ubyte* pattern /*=0*/);
-+void DetectMORAVEC(ubyte* image, int stride, int width, int height, Feature* detected, int* count, int distance /*=32*/, ubyte* pattern /*=0*/);
-
--#ifdef __cplusplus
- }
--#endif
-
- #endif
diff --git a/extern/libmv/patches/fast.patch b/extern/libmv/patches/fast.patch
deleted file mode 100644
index 8e0aeb7e721..00000000000
--- a/extern/libmv/patches/fast.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git a/src/third_party/fast/fast.h b/src/third_party/fast/fast.h
-index 2b3825a..06fa90e 100644
---- a/src/third_party/fast/fast.h
-+++ b/src/third_party/fast/fast.h
-@@ -1,6 +1,10 @@
- #ifndef FAST_H
- #define FAST_H
-
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
- typedef struct { int x, y; } xy;
- typedef unsigned char byte;
-
-@@ -28,4 +32,8 @@ xy* fast12_detect_nonmax(const byte* im, int xsize, int ysize, int stride, int b
- xy* nonmax_suppression(const xy* corners, const int* scores, int num_corners, int* ret_num_nonmax);
-
-
-+#ifdef __cplusplus
-+}
-+#endif
-+
- #endif
diff --git a/extern/libmv/patches/function_derivative.patch b/extern/libmv/patches/function_derivative.patch
deleted file mode 100644
index be7ccfc911a..00000000000
--- a/extern/libmv/patches/function_derivative.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/src/libmv/numeric/function_derivative.h b/src/libmv/numeric/function_derivative.h
-index 0075d23..d7bc437 100644
---- a/src/libmv/numeric/function_derivative.h
-+++ b/src/libmv/numeric/function_derivative.h
-@@ -24,6 +24,7 @@
- #include <cmath>
-
- #include "libmv/numeric/numeric.h"
-+#include "libmv/logging/logging.h"
-
- namespace libmv {
-
-@@ -97,7 +98,7 @@ bool CheckJacobian(const Function &f, const typename Function::XMatrixType &x) {
-
- typename NumericJacobian<Function>::JMatrixType J_numeric = j_numeric(x);
- typename NumericJacobian<Function>::JMatrixType J_analytic = j_analytic(x);
-- //LG << J_numeric - J_analytic;
-+ LG << J_numeric - J_analytic;
- return true;
- }
-
diff --git a/extern/libmv/patches/high_distortion_crash_fix.patch b/extern/libmv/patches/high_distortion_crash_fix.patch
deleted file mode 100644
index 54ab66fa27c..00000000000
--- a/extern/libmv/patches/high_distortion_crash_fix.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff --git a/src/libmv/simple_pipeline/camera_intrinsics.cc b/src/libmv/simple_pipeline/camera_intrinsics.cc
-index 4e88e1f..f9888ff 100644
---- a/src/libmv/simple_pipeline/camera_intrinsics.cc
-+++ b/src/libmv/simple_pipeline/camera_intrinsics.cc
-@@ -160,9 +160,13 @@ void CameraIntrinsics::ComputeLookupGrid(Offset* grid, int width, int height) {
- if( iy < 0 ) { iy = 0, fy = 0; }
- if( ix >= width-2 ) ix = width-2;
- if( iy >= height-2 ) iy = height-2;
-- //assert( ix-x > -128 && ix-x < 128 && iy-y > -128 && iy-y < 128 );
-- Offset offset = { ix-x, iy-y, fx, fy };
-- grid[y*width+x] = offset;
-+ if ( ix-x > -128 && ix-x < 128 && iy-y > -128 && iy-y < 128 ) {
-+ Offset offset = { ix-x, iy-y, fx, fy };
-+ grid[y*width+x] = offset;
-+ } else {
-+ Offset offset = { 0, 0, 0, 0 };
-+ grid[y*width+x] = offset;
-+ }
- }
- }
- }
diff --git a/extern/libmv/patches/levenberg_marquardt.patch b/extern/libmv/patches/levenberg_marquardt.patch
deleted file mode 100644
index 49ef82d73d2..00000000000
--- a/extern/libmv/patches/levenberg_marquardt.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-diff --git a/src/libmv/numeric/levenberg_marquardt.h b/src/libmv/numeric/levenberg_marquardt.h
-index 6a54f66..4473b72 100644
---- a/src/libmv/numeric/levenberg_marquardt.h
-+++ b/src/libmv/numeric/levenberg_marquardt.h
-@@ -33,6 +33,7 @@
-
- #include "libmv/numeric/numeric.h"
- #include "libmv/numeric/function_derivative.h"
-+#include "libmv/logging/logging.h"
-
- namespace libmv {
-
-@@ -123,26 +124,40 @@ class LevenbergMarquardt {
- Parameters dx, x_new;
- int i;
- for (i = 0; results.status == RUNNING && i < params.max_iterations; ++i) {
-- if (dx.norm() <= params.relative_step_threshold * x.norm()) {
-+ VLOG(1) << "iteration: " << i;
-+ VLOG(1) << "||f(x)||: " << f_(x).norm();
-+ VLOG(1) << "max(g): " << g.array().abs().maxCoeff();
-+ VLOG(1) << "u: " << u;
-+ VLOG(1) << "v: " << v;
-+
-+ AMatrixType A_augmented = A + u*AMatrixType::Identity(J.cols(), J.cols());
-+ Solver solver(A_augmented);
-+ dx = solver.solve(g);
-+ bool solved = (A_augmented * dx).isApprox(g);
-+ if (!solved) {
-+ LOG(ERROR) << "Failed to solve";
-+ }
-+ if (solved && dx.norm() <= params.relative_step_threshold * x.norm()) {
- results.status = RELATIVE_STEP_SIZE_TOO_SMALL;
- break;
-- }
-- x_new = x + dx;
-- // Rho is the ratio of the actual reduction in error to the reduction
-- // in error that would be obtained if the problem was linear.
-- // See [1] for details.
-- Scalar rho((error.squaredNorm() - f_(x_new).squaredNorm())
-- / dx.dot(u*dx + g));
-- if (rho > 0) {
-- // Accept the Gauss-Newton step because the linear model fits well.
-- x = x_new;
-- results.status = Update(x, params, &J, &A, &error, &g);
-- Scalar tmp = Scalar(2*rho-1);
-- u = u*std::max(1/3., 1 - (tmp*tmp*tmp));
-- v = 2;
-- continue;
-- }
--
-+ }
-+ if (solved) {
-+ x_new = x + dx;
-+ // Rho is the ratio of the actual reduction in error to the reduction
-+ // in error that would be obtained if the problem was linear.
-+ // See [1] for details.
-+ Scalar rho((error.squaredNorm() - f_(x_new).squaredNorm())
-+ / dx.dot(u*dx + g));
-+ if (rho > 0) {
-+ // Accept the Gauss-Newton step because the linear model fits well.
-+ x = x_new;
-+ results.status = Update(x, params, &J, &A, &error, &g);
-+ Scalar tmp = Scalar(2*rho-1);
-+ u = u*std::max(1/3., 1 - (tmp*tmp*tmp));
-+ v = 2;
-+ continue;
-+ }
-+ }
- // Reject the update because either the normal equations failed to solve
- // or the local linear model was not good (rho < 0). Instead, increase u
- // to move closer to gradient descent.
diff --git a/extern/libmv/patches/mingw.patch b/extern/libmv/patches/mingw.patch
deleted file mode 100644
index 029e7d7f979..00000000000
--- a/extern/libmv/patches/mingw.patch
+++ /dev/null
@@ -1,171 +0,0 @@
-diff --git a/src/libmv/multiview/euclidean_resection.cc b/src/libmv/multiview/euclidean_resection.cc
-index 6d918a1..9286251 100644
---- a/src/libmv/multiview/euclidean_resection.cc
-+++ b/src/libmv/multiview/euclidean_resection.cc
-@@ -32,6 +32,8 @@
- namespace libmv {
- namespace euclidean_resection {
-
-+typedef unsigned int uint;
-+
- bool EuclideanResection(const Mat2X &x_camera,
- const Mat3X &X_world,
- Mat3 *R, Vec3 *t,
-diff --git a/src/libmv/numeric/numeric.h b/src/libmv/numeric/numeric.h
-index f39d126..21e0f06 100644
---- a/src/libmv/numeric/numeric.h
-+++ b/src/libmv/numeric/numeric.h
-@@ -40,7 +40,7 @@
- }
- #endif //_WIN32 || __APPLE__
-
--#if _WIN32
-+#if (defined(WIN32) || defined(WIN64)) && !defined(__MINGW32__)
- inline long lround(double d) {
- return (long)(d>0 ? d+0.5 : ceil(d-0.5));
- }
-diff --git a/src/third_party/glog/src/config.h b/src/third_party/glog/src/config.h
-index ed8d56e..06ed686 100644
---- a/src/third_party/glog/src/config.h
-+++ b/src/third_party/glog/src/config.h
-@@ -4,6 +4,8 @@
- /* Namespace for Google classes */
- #ifdef __APPLE__
- #include "config_mac.h"
-+#elif __MINGW32__
-+ #include "windows/config.h"
- #elif __GNUC__
- #include "config_linux.h"
- #elif _MSC_VER
-diff --git a/src/third_party/glog/src/utilities.h b/src/third_party/glog/src/utilities.h
-index ee54f94..c4ae256 100644
---- a/src/third_party/glog/src/utilities.h
-+++ b/src/third_party/glog/src/utilities.h
-@@ -101,7 +101,9 @@
- // correctly when GetStackTrace() is called with max_depth == 0.
- // Some code may do that.
-
--#if defined(HAVE_LIB_UNWIND)
-+#if __MINGW32__
-+# undef STACKTRACE_H
-+#elif defined(HAVE_LIB_UNWIND)
- # define STACKTRACE_H "stacktrace_libunwind-inl.h"
- #elif !defined(NO_FRAME_POINTER)
- # if defined(__i386__) && __GNUC__ >= 2
-diff --git a/src/third_party/glog/src/windows/glog/logging.h b/src/third_party/glog/src/windows/glog/logging.h
-index 7a6df74..4257375 100755
---- a/src/third_party/glog/src/windows/glog/logging.h
-+++ b/src/third_party/glog/src/windows/glog/logging.h
-@@ -59,7 +59,7 @@
-
- // Annoying stuff for windows -- makes sure clients can import these functions
- #ifndef GOOGLE_GLOG_DLL_DECL
--# if defined(_WIN32) && !defined(__CYGWIN__)
-+# if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__)
- # define GOOGLE_GLOG_DLL_DECL __declspec(dllimport)
- # else
- # define GOOGLE_GLOG_DLL_DECL
-@@ -86,6 +86,15 @@
- #include <gflags/gflags.h>
- #endif
-
-+#ifdef __MINGW32__
-+# include <stdlib.h>
-+# include <unistd.h>
-+# include <stdint.h> // the normal place uint16_t is defined
-+# include <sys/types.h> // the normal place u_int16_t is defined
-+# include <inttypes.h> // a third place for uint16_t or u_int16_t
-+# define _exit(x) exit(x)
-+#endif
-+
- namespace google {
-
- #if 0 // the C99 format
-@@ -98,11 +107,16 @@ typedef int32_t int32;
- typedef u_int32_t uint32;
- typedef int64_t int64;
- typedef u_int64_t uint64;
--#elif 1 // the windows (vc7) format
-+#elif defined(_MSC_VER)
- typedef __int32 int32;
- typedef unsigned __int32 uint32;
- typedef __int64 int64;
- typedef unsigned __int64 uint64;
-+#elif defined(__MINGW32__)
-+typedef int32_t int32;
-+typedef uint32_t uint32;
-+typedef int64_t int64;
-+typedef uint64_t uint64;
- #else
- #error Do not know how to define a 32-bit integer quantity on your system
- #endif
-diff --git a/src/third_party/glog/src/windows/port.h b/src/third_party/glog/src/windows/port.h
-index d093bf5..d507812 100755
---- a/src/third_party/glog/src/windows/port.h
-+++ b/src/third_party/glog/src/windows/port.h
-@@ -59,14 +59,16 @@
- * used by both C and C++ code, so we put all the C++ together.
- */
-
--/* 4244: otherwise we get problems when substracting two size_t's to an int
-- * 4251: it's complaining about a private struct I've chosen not to dllexport
-- * 4355: we use this in a constructor, but we do it safely
-- * 4715: for some reason VC++ stopped realizing you can't return after abort()
-- * 4800: we know we're casting ints/char*'s to bools, and we're ok with that
-- * 4996: Yes, we're ok using "unsafe" functions like fopen() and strerror()
-- */
--#pragma warning(disable:4244 4251 4355 4715 4800 4996)
-+#if _MSC_VER
-+ /* 4244: otherwise we get problems when substracting two size_t's to an int
-+ * 4251: it's complaining about a private struct I've chosen not to dllexport
-+ * 4355: we use this in a constructor, but we do it safely
-+ * 4715: for some reason VC++ stopped realizing you can't return after abort()
-+ * 4800: we know we're casting ints/char*'s to bools, and we're ok with that
-+ * 4996: Yes, we're ok using "unsafe" functions like fopen() and strerror()
-+ */
-+# pragma warning(disable:4244 4251 4355 4715 4800 4996)
-+#endif
-
- /* file I/O */
- #define PATH_MAX 1024
-@@ -108,7 +110,9 @@ extern int snprintf(char *str, size_t size,
- extern int safe_vsnprintf(char *str, size_t size,
- const char *format, va_list ap);
- #define vsnprintf(str, size, format, ap) safe_vsnprintf(str, size, format, ap)
-+#if !defined(__MINGW32__)
- #define va_copy(dst, src) (dst) = (src)
-+#endif
-
- /* Windows doesn't support specifying the number of buckets as a
- * hash_map constructor arg, so we leave this blank.
-@@ -130,13 +134,30 @@ enum { PTHREAD_ONCE_INIT = 0 }; // important that this be 0! for SpinLock
- #define pthread_equal(pthread_t_1, pthread_t_2) ((pthread_t_1)==(pthread_t_2))
-
- inline struct tm* localtime_r(const time_t* timep, struct tm* result) {
-+#if __MINGW32__
-+ struct tm *local_result;
-+ local_result = localtime (timep);
-+
-+ if (local_result == NULL || result == NULL)
-+ return NULL;
-+
-+ memcpy (result, local_result, sizeof (result));
-+
-+ return result;
-+#else
- localtime_s(result, timep);
- return result;
-+#endif
- }
-
- inline char* strerror_r(int errnum, char* buf, size_t buflen) {
-+#if __MINGW32__
-+ strncpy(buf, "Not implemented yet", buflen);
-+ return buf;
-+#else
- strerror_s(buf, buflen, errnum);
- return buf;
-+#endif
- }
-
- #ifndef __cplusplus
diff --git a/extern/libmv/patches/msvc2010.patch b/extern/libmv/patches/msvc2010.patch
deleted file mode 100644
index c090b070628..00000000000
--- a/extern/libmv/patches/msvc2010.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/src/libmv/simple_pipeline/tracks.cc b/src/libmv/simple_pipeline/tracks.cc
-index 0e2a1b6..3fb8ddb 100644
---- a/src/libmv/simple_pipeline/tracks.cc
-+++ b/src/libmv/simple_pipeline/tracks.cc
-@@ -20,6 +20,7 @@
-
- #include <algorithm>
- #include <vector>
-+#include <iterator>
-
- #include "libmv/numeric/numeric.h"
- #include "libmv/simple_pipeline/tracks.h"
diff --git a/extern/libmv/patches/overscan.patch b/extern/libmv/patches/overscan.patch
deleted file mode 100644
index c68f36804ec..00000000000
--- a/extern/libmv/patches/overscan.patch
+++ /dev/null
@@ -1,182 +0,0 @@
-diff --git a/src/libmv/simple_pipeline/camera_intrinsics.cc b/src/libmv/simple_pipeline/camera_intrinsics.cc
-index 110a16d..366129d 100644
---- a/src/libmv/simple_pipeline/camera_intrinsics.cc
-+++ b/src/libmv/simple_pipeline/camera_intrinsics.cc
-@@ -31,6 +31,7 @@ struct Offset {
- struct Grid {
- struct Offset *offset;
- int width, height;
-+ double overscan;
- };
-
- static struct Grid *copyGrid(struct Grid *from)
-@@ -42,6 +43,7 @@ static struct Grid *copyGrid(struct Grid *from)
-
- to->width = from->width;
- to->height = from->height;
-+ to->overscan = from->overscan;
-
- to->offset = new Offset[to->width*to->height];
- memcpy(to->offset, from->offset, sizeof(struct Offset)*to->width*to->height);
-@@ -184,17 +186,19 @@ void CameraIntrinsics::InvertIntrinsics(double image_x,
-
- // TODO(MatthiasF): downsample lookup
- template<typename WarpFunction>
--void CameraIntrinsics::ComputeLookupGrid(Grid* grid, int width, int height) {
-- double aspx = (double)width / image_width_;
-- double aspy = (double)height / image_height_;
-+void CameraIntrinsics::ComputeLookupGrid(Grid* grid, int width, int height, double overscan) {
-+ double w = (double)width / (1 + overscan);
-+ double h = (double)height / (1 + overscan);
-+ double aspx = (double)w / image_width_;
-+ double aspy = (double)h / image_height_;
-
- for (int y = 0; y < height; y++) {
- for (int x = 0; x < width; x++) {
-- double src_x = x / aspx, src_y = y / aspy;
-+ double src_x = (x - 0.5 * overscan * w) / aspx, src_y = (y - 0.5 * overscan * h) / aspy;
- double warp_x, warp_y;
- WarpFunction(this,src_x,src_y,&warp_x,&warp_y);
-- warp_x = warp_x*aspx;
-- warp_y = warp_y*aspy;
-+ warp_x = warp_x*aspx + 0.5 * overscan * w;
-+ warp_y = warp_y*aspy + 0.5 * overscan * h;
- int ix = int(warp_x), iy = int(warp_y);
- int fx = round((warp_x-ix)*256), fy = round((warp_y-iy)*256);
- if(fx == 256) { fx=0; ix++; }
-@@ -264,10 +268,10 @@ struct InvertIntrinsicsFunction {
- }
- };
-
--void CameraIntrinsics::CheckDistortLookupGrid(int width, int height)
-+void CameraIntrinsics::CheckDistortLookupGrid(int width, int height, double overscan)
- {
- if(distort_) {
-- if(distort_->width != width || distort_->height != height) {
-+ if(distort_->width != width || distort_->height != height || distort_->overscan != overscan) {
- delete [] distort_->offset;
- distort_->offset = NULL;
- }
-@@ -278,17 +282,18 @@ void CameraIntrinsics::CheckDistortLookupGrid(int width, int height)
-
- if(!distort_->offset) {
- distort_->offset = new Offset[width*height];
-- ComputeLookupGrid<InvertIntrinsicsFunction>(distort_,width,height);
-+ ComputeLookupGrid<InvertIntrinsicsFunction>(distort_,width,height,overscan);
- }
-
- distort_->width = width;
- distort_->height = height;
-+ distort_->overscan = overscan;
- }
-
--void CameraIntrinsics::CheckUndistortLookupGrid(int width, int height)
-+void CameraIntrinsics::CheckUndistortLookupGrid(int width, int height, double overscan)
- {
- if(undistort_) {
-- if(undistort_->width != width || undistort_->height != height) {
-+ if(undistort_->width != width || undistort_->height != height || undistort_->overscan != overscan) {
- delete [] undistort_->offset;
- undistort_->offset = NULL;
- }
-@@ -299,15 +304,16 @@ void CameraIntrinsics::CheckUndistortLookupGrid(int width, int height)
-
- if(!undistort_->offset) {
- undistort_->offset = new Offset[width*height];
-- ComputeLookupGrid<ApplyIntrinsicsFunction>(undistort_,width,height);
-+ ComputeLookupGrid<ApplyIntrinsicsFunction>(undistort_,width,height,overscan);
- }
-
- undistort_->width = width;
- undistort_->height = height;
-+ undistort_->overscan = overscan;
- }
-
--void CameraIntrinsics::Distort(const float* src, float* dst, int width, int height, int channels) {
-- CheckDistortLookupGrid(width, height);
-+void CameraIntrinsics::Distort(const float* src, float* dst, int width, int height, double overscan, int channels) {
-+ CheckDistortLookupGrid(width, height, overscan);
- if(channels==1) Warp<float,1>(distort_,src,dst,width,height);
- else if(channels==2) Warp<float,2>(distort_,src,dst,width,height);
- else if(channels==3) Warp<float,3>(distort_,src,dst,width,height);
-@@ -315,8 +321,8 @@ void CameraIntrinsics::Distort(const float* src, float* dst, int width, int heig
- //else assert("channels must be between 1 and 4");
- }
-
--void CameraIntrinsics::Distort(const unsigned char* src, unsigned char* dst, int width, int height, int channels) {
-- CheckDistortLookupGrid(width, height);
-+void CameraIntrinsics::Distort(const unsigned char* src, unsigned char* dst, int width, int height, double overscan, int channels) {
-+ CheckDistortLookupGrid(width, height, overscan);
- if(channels==1) Warp<unsigned char,1>(distort_,src,dst,width,height);
- else if(channels==2) Warp<unsigned char,2>(distort_,src,dst,width,height);
- else if(channels==3) Warp<unsigned char,3>(distort_,src,dst,width,height);
-@@ -324,8 +330,8 @@ void CameraIntrinsics::Distort(const unsigned char* src, unsigned char* dst, int
- //else assert("channels must be between 1 and 4");
- }
-
--void CameraIntrinsics::Undistort(const float* src, float* dst, int width, int height, int channels) {
-- CheckUndistortLookupGrid(width, height);
-+void CameraIntrinsics::Undistort(const float* src, float* dst, int width, int height, double overscan, int channels) {
-+ CheckUndistortLookupGrid(width, height, overscan);
- if(channels==1) Warp<float,1>(undistort_,src,dst,width,height);
- else if(channels==2) Warp<float,2>(undistort_,src,dst,width,height);
- else if(channels==3) Warp<float,3>(undistort_,src,dst,width,height);
-@@ -333,8 +339,8 @@ void CameraIntrinsics::Undistort(const float* src, float* dst, int width, int he
- //else assert("channels must be between 1 and 4");
- }
-
--void CameraIntrinsics::Undistort(const unsigned char* src, unsigned char* dst, int width, int height, int channels) {
-- CheckUndistortLookupGrid(width, height);
-+void CameraIntrinsics::Undistort(const unsigned char* src, unsigned char* dst, int width, int height, double overscan, int channels) {
-+ CheckUndistortLookupGrid(width, height, overscan);
- if(channels==1) Warp<unsigned char,1>(undistort_,src,dst,width,height);
- else if(channels==2) Warp<unsigned char,2>(undistort_,src,dst,width,height);
- else if(channels==3) Warp<unsigned char,3>(undistort_,src,dst,width,height);
-diff --git a/src/libmv/simple_pipeline/camera_intrinsics.h b/src/libmv/simple_pipeline/camera_intrinsics.h
-index f525571..f4bf903 100644
---- a/src/libmv/simple_pipeline/camera_intrinsics.h
-+++ b/src/libmv/simple_pipeline/camera_intrinsics.h
-@@ -91,7 +91,7 @@ class CameraIntrinsics {
- \note This is the reference implementation using floating point images.
- */
- void Distort(const float* src, float* dst,
-- int width, int height, int channels);
-+ int width, int height, double overscan, int channels);
- /*!
- Distort an image using the current camera instrinsics
-
-@@ -101,7 +101,7 @@ class CameraIntrinsics {
- \note This version is much faster.
- */
- void Distort(const unsigned char* src, unsigned char* dst,
-- int width, int height, int channels);
-+ int width, int height, double overscan, int channels);
- /*!
- Undistort an image using the current camera instrinsics
-
-@@ -111,7 +111,7 @@ class CameraIntrinsics {
- \note This is the reference implementation using floating point images.
- */
- void Undistort(const float* src, float* dst,
-- int width, int height, int channels);
-+ int width, int height, double overscan, int channels);
- /*!
- Undistort an image using the current camera instrinsics
-
-@@ -121,12 +121,12 @@ class CameraIntrinsics {
- \note This version is much faster.
- */
- void Undistort(const unsigned char* src, unsigned char* dst,
-- int width, int height, int channels);
-+ int width, int height, double overscan, int channels);
-
- private:
-- template<typename WarpFunction> void ComputeLookupGrid(struct Grid* grid, int width, int height);
-- void CheckUndistortLookupGrid(int width, int height);
-- void CheckDistortLookupGrid(int width, int height);
-+ template<typename WarpFunction> void ComputeLookupGrid(struct Grid* grid, int width, int height, double overscan);
-+ void CheckUndistortLookupGrid(int width, int height, double overscan);
-+ void CheckDistortLookupGrid(int width, int height, double overscan);
- void FreeLookupGrid();
-
- // The traditional intrinsics matrix from x = K[R|t]X.
diff --git a/extern/libmv/patches/scaled_distortion.patch b/extern/libmv/patches/scaled_distortion.patch
deleted file mode 100644
index 2da832931d1..00000000000
--- a/extern/libmv/patches/scaled_distortion.patch
+++ /dev/null
@@ -1,261 +0,0 @@
-diff --git a/src/libmv/simple_pipeline/camera_intrinsics.cc b/src/libmv/simple_pipeline/camera_intrinsics.cc
-index f9888ff..110a16d 100644
---- a/src/libmv/simple_pipeline/camera_intrinsics.cc
-+++ b/src/libmv/simple_pipeline/camera_intrinsics.cc
-@@ -23,7 +23,32 @@
-
- namespace libmv {
-
--struct Offset { signed char ix,iy; unsigned char fx,fy; };
-+struct Offset {
-+ signed char ix, iy;
-+ unsigned char fx,fy;
-+};
-+
-+struct Grid {
-+ struct Offset *offset;
-+ int width, height;
-+};
-+
-+static struct Grid *copyGrid(struct Grid *from)
-+{
-+ struct Grid *to = NULL;
-+
-+ if (from) {
-+ to = new Grid;
-+
-+ to->width = from->width;
-+ to->height = from->height;
-+
-+ to->offset = new Offset[to->width*to->height];
-+ memcpy(to->offset, from->offset, sizeof(struct Offset)*to->width*to->height);
-+ }
-+
-+ return to;
-+}
-
- CameraIntrinsics::CameraIntrinsics()
- : K_(Mat3::Identity()),
-@@ -37,9 +62,22 @@ CameraIntrinsics::CameraIntrinsics()
- distort_(0),
- undistort_(0) {}
-
-+CameraIntrinsics::CameraIntrinsics(const CameraIntrinsics &from)
-+ : K_(from.K_),
-+ image_width_(from.image_width_),
-+ image_height_(from.image_height_),
-+ k1_(from.k1_),
-+ k2_(from.k2_),
-+ k3_(from.k3_),
-+ p1_(from.p1_),
-+ p2_(from.p2_)
-+{
-+ distort_ = copyGrid(from.distort_);
-+ undistort_ = copyGrid(from.undistort_);
-+}
-+
- CameraIntrinsics::~CameraIntrinsics() {
-- if(distort_) delete[] distort_;
-- if(undistort_) delete[] undistort_;
-+ FreeLookupGrid();
- }
-
- /// Set the entire calibration matrix at once.
-@@ -146,11 +184,17 @@ void CameraIntrinsics::InvertIntrinsics(double image_x,
-
- // TODO(MatthiasF): downsample lookup
- template<typename WarpFunction>
--void CameraIntrinsics::ComputeLookupGrid(Offset* grid, int width, int height) {
-+void CameraIntrinsics::ComputeLookupGrid(Grid* grid, int width, int height) {
-+ double aspx = (double)width / image_width_;
-+ double aspy = (double)height / image_height_;
-+
- for (int y = 0; y < height; y++) {
- for (int x = 0; x < width; x++) {
-+ double src_x = x / aspx, src_y = y / aspy;
- double warp_x, warp_y;
-- WarpFunction(this,x,y,&warp_x,&warp_y);
-+ WarpFunction(this,src_x,src_y,&warp_x,&warp_y);
-+ warp_x = warp_x*aspx;
-+ warp_y = warp_y*aspy;
- int ix = int(warp_x), iy = int(warp_y);
- int fx = round((warp_x-ix)*256), fy = round((warp_y-iy)*256);
- if(fx == 256) { fx=0; ix++; }
-@@ -162,10 +206,10 @@ void CameraIntrinsics::ComputeLookupGrid(Offset* grid, int width, int height) {
- if( iy >= height-2 ) iy = height-2;
- if ( ix-x > -128 && ix-x < 128 && iy-y > -128 && iy-y < 128 ) {
- Offset offset = { ix-x, iy-y, fx, fy };
-- grid[y*width+x] = offset;
-+ grid->offset[y*width+x] = offset;
- } else {
- Offset offset = { 0, 0, 0, 0 };
-- grid[y*width+x] = offset;
-+ grid->offset[y*width+x] = offset;
- }
- }
- }
-@@ -173,11 +217,11 @@ void CameraIntrinsics::ComputeLookupGrid(Offset* grid, int width, int height) {
-
- // TODO(MatthiasF): cubic B-Spline image sampling, bilinear lookup
- template<typename T,int N>
--static void Warp(const Offset* grid, const T* src, T* dst,
-+static void Warp(const Grid* grid, const T* src, T* dst,
- int width, int height) {
- for (int y = 0; y < height; y++) {
- for (int x = 0; x < width; x++) {
-- Offset offset = grid[y*width+x];
-+ Offset offset = grid->offset[y*width+x];
- const T* s = &src[((y+offset.iy)*width+(x+offset.ix))*N];
- for (int i = 0; i < N; i++) {
- dst[(y*width+x)*N+i] = ((s[ i] * (256-offset.fx) + s[ N+i] * offset.fx) * (256-offset.fy)
-@@ -188,8 +232,17 @@ static void Warp(const Offset* grid, const T* src, T* dst,
- }
-
- void CameraIntrinsics::FreeLookupGrid() {
-- if(distort_) delete distort_, distort_=0;
-- if(undistort_) delete undistort_, undistort_=0;
-+ if(distort_) {
-+ delete distort_->offset;
-+ delete distort_;
-+ distort_ = NULL;
-+ }
-+
-+ if(undistort_) {
-+ delete undistort_->offset;
-+ delete undistort_;
-+ undistort_ = NULL;
-+ }
- }
-
- // FIXME: C++ templates limitations makes thing complicated, but maybe there is a simpler method.
-@@ -211,11 +264,50 @@ struct InvertIntrinsicsFunction {
- }
- };
-
--void CameraIntrinsics::Distort(const float* src, float* dst, int width, int height, int channels) {
-- if(!distort_) {
-- distort_ = new Offset[width*height];
-- ComputeLookupGrid<InvertIntrinsicsFunction>(distort_,width,height);
-+void CameraIntrinsics::CheckDistortLookupGrid(int width, int height)
-+{
-+ if(distort_) {
-+ if(distort_->width != width || distort_->height != height) {
-+ delete [] distort_->offset;
-+ distort_->offset = NULL;
-+ }
-+ } else {
-+ distort_ = new Grid;
-+ distort_->offset = NULL;
-+ }
-+
-+ if(!distort_->offset) {
-+ distort_->offset = new Offset[width*height];
-+ ComputeLookupGrid<InvertIntrinsicsFunction>(distort_,width,height);
- }
-+
-+ distort_->width = width;
-+ distort_->height = height;
-+}
-+
-+void CameraIntrinsics::CheckUndistortLookupGrid(int width, int height)
-+{
-+ if(undistort_) {
-+ if(undistort_->width != width || undistort_->height != height) {
-+ delete [] undistort_->offset;
-+ undistort_->offset = NULL;
-+ }
-+ } else {
-+ undistort_ = new Grid;
-+ undistort_->offset = NULL;
-+ }
-+
-+ if(!undistort_->offset) {
-+ undistort_->offset = new Offset[width*height];
-+ ComputeLookupGrid<ApplyIntrinsicsFunction>(undistort_,width,height);
-+ }
-+
-+ undistort_->width = width;
-+ undistort_->height = height;
-+}
-+
-+void CameraIntrinsics::Distort(const float* src, float* dst, int width, int height, int channels) {
-+ CheckDistortLookupGrid(width, height);
- if(channels==1) Warp<float,1>(distort_,src,dst,width,height);
- else if(channels==2) Warp<float,2>(distort_,src,dst,width,height);
- else if(channels==3) Warp<float,3>(distort_,src,dst,width,height);
-@@ -224,10 +316,7 @@ void CameraIntrinsics::Distort(const float* src, float* dst, int width, int heig
- }
-
- void CameraIntrinsics::Distort(const unsigned char* src, unsigned char* dst, int width, int height, int channels) {
-- if(!distort_) {
-- distort_ = new Offset[width*height];
-- ComputeLookupGrid<InvertIntrinsicsFunction>(distort_,width,height);
-- }
-+ CheckDistortLookupGrid(width, height);
- if(channels==1) Warp<unsigned char,1>(distort_,src,dst,width,height);
- else if(channels==2) Warp<unsigned char,2>(distort_,src,dst,width,height);
- else if(channels==3) Warp<unsigned char,3>(distort_,src,dst,width,height);
-@@ -236,10 +325,7 @@ void CameraIntrinsics::Distort(const unsigned char* src, unsigned char* dst, int
- }
-
- void CameraIntrinsics::Undistort(const float* src, float* dst, int width, int height, int channels) {
-- if(!undistort_) {
-- undistort_ = new Offset[width*height];
-- ComputeLookupGrid<ApplyIntrinsicsFunction>(undistort_,width,height);
-- }
-+ CheckUndistortLookupGrid(width, height);
- if(channels==1) Warp<float,1>(undistort_,src,dst,width,height);
- else if(channels==2) Warp<float,2>(undistort_,src,dst,width,height);
- else if(channels==3) Warp<float,3>(undistort_,src,dst,width,height);
-@@ -248,10 +334,7 @@ void CameraIntrinsics::Undistort(const float* src, float* dst, int width, int he
- }
-
- void CameraIntrinsics::Undistort(const unsigned char* src, unsigned char* dst, int width, int height, int channels) {
-- if(!undistort_) {
-- undistort_ = new Offset[width*height];
-- ComputeLookupGrid<ApplyIntrinsicsFunction>(undistort_,width,height);
-- }
-+ CheckUndistortLookupGrid(width, height);
- if(channels==1) Warp<unsigned char,1>(undistort_,src,dst,width,height);
- else if(channels==2) Warp<unsigned char,2>(undistort_,src,dst,width,height);
- else if(channels==3) Warp<unsigned char,3>(undistort_,src,dst,width,height);
-diff --git a/src/libmv/simple_pipeline/camera_intrinsics.h b/src/libmv/simple_pipeline/camera_intrinsics.h
-index 29bc8a1..f525571 100644
---- a/src/libmv/simple_pipeline/camera_intrinsics.h
-+++ b/src/libmv/simple_pipeline/camera_intrinsics.h
-@@ -26,11 +26,12 @@ typedef Eigen::Matrix<double, 3, 3> Mat3;
-
- namespace libmv {
-
--struct Offset;
-+struct Grid;
-
- class CameraIntrinsics {
- public:
- CameraIntrinsics();
-+ CameraIntrinsics(const CameraIntrinsics &from);
- ~CameraIntrinsics();
-
- const Mat3 &K() const { return K_; }
-@@ -123,7 +124,9 @@ class CameraIntrinsics {
- int width, int height, int channels);
-
- private:
-- template<typename WarpFunction> void ComputeLookupGrid(Offset* grid, int width, int height);
-+ template<typename WarpFunction> void ComputeLookupGrid(struct Grid* grid, int width, int height);
-+ void CheckUndistortLookupGrid(int width, int height);
-+ void CheckDistortLookupGrid(int width, int height);
- void FreeLookupGrid();
-
- // The traditional intrinsics matrix from x = K[R|t]X.
-@@ -140,8 +143,8 @@ class CameraIntrinsics {
- // independent of image size.
- double k1_, k2_, k3_, p1_, p2_;
-
-- Offset* distort_;
-- Offset* undistort_;
-+ struct Grid *distort_;
-+ struct Grid *undistort_;
- };
-
- } // namespace libmv
diff --git a/extern/libmv/patches/series b/extern/libmv/patches/series
index 00a52c1cfaa..ca671122a61 100644
--- a/extern/libmv/patches/series
+++ b/extern/libmv/patches/series
@@ -1,13 +1,2 @@
v3d_verbosity.patch
-snrptinf_fix.patch
bundle_tweaks.patch
-fast.patch
-config_mac.patch
-levenberg_marquardt.patch
-function_derivative.patch
-high_distortion_crash_fix.patch
-mingw.patch
-msvc2010.patch
-scaled_distortion.patch
-overscan.patch
-detect.patch
diff --git a/extern/libmv/patches/snrptinf_fix.patch b/extern/libmv/patches/snrptinf_fix.patch
deleted file mode 100644
index e886a671de0..00000000000
--- a/extern/libmv/patches/snrptinf_fix.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/src/libmv/simple_pipeline/pipeline.cc b/src/libmv/simple_pipeline/pipeline.cc
-index 652d70c..25cd2c2 100644
---- a/src/libmv/simple_pipeline/pipeline.cc
-+++ b/src/libmv/simple_pipeline/pipeline.cc
-@@ -28,6 +28,10 @@
- #include "libmv/simple_pipeline/tracks.h"
- #include "libmv/simple_pipeline/camera_intrinsics.h"
-
-+#ifdef _MSC_VER
-+# define snprintf _snprintf
-+#endif
-+
- namespace libmv {
-
- void CompleteReconstruction(const Tracks &tracks,
diff --git a/extern/libmv/patches/v3d_verbosity.patch b/extern/libmv/patches/v3d_verbosity.patch
index a54f3dc44be..f5c6afbd0b5 100644
--- a/extern/libmv/patches/v3d_verbosity.patch
+++ b/extern/libmv/patches/v3d_verbosity.patch
@@ -1,12 +1,12 @@
diff --git a/src/libmv/simple_pipeline/bundle.cc b/src/libmv/simple_pipeline/bundle.cc
-index 310660d..f819603 100644
+index fa0b6cc..d382cd5 100644
--- a/src/libmv/simple_pipeline/bundle.cc
+++ b/src/libmv/simple_pipeline/bundle.cc
-@@ -141,7 +141,6 @@ void Bundle(const Tracks &tracks, Reconstruction *reconstruction) {
- v3d_distortion.p2 = 0;
+@@ -194,7 +194,6 @@ void EuclideanBundleCommonIntrinsics(const Tracks &tracks,
+ double v3d_inlier_threshold = 500000.0;
// Finally, run the bundle adjustment.
- V3D::optimizerVerbosenessLevel = 1;
- double const inlierThreshold = 500000.0;
- V3D::CommonInternalsMetricBundleOptimizer opt(V3D::FULL_BUNDLE_METRIC,
- inlierThreshold,
+ V3D::CommonInternalsMetricBundleOptimizer opt(v3d_bundle_intrinsics,
+ v3d_inlier_threshold,
+ v3d_K,
diff --git a/extern/libmv/third_party/glog/src/config_freebsd.h b/extern/libmv/third_party/glog/src/config_freebsd.h
index caaef9d998b..28fa1f1c78b 100644
--- a/extern/libmv/third_party/glog/src/config_freebsd.h
+++ b/extern/libmv/third_party/glog/src/config_freebsd.h
@@ -11,7 +11,7 @@
#define HAVE_DLFCN_H 1
/* Define to 1 if you have the <execinfo.h> header file. */
-#define HAVE_EXECINFO_H 1
+#undef HAVE_EXECINFO_H
/* Define if you have the `fcntl' function */
#define HAVE_FCNTL 1
diff --git a/extern/libmv/third_party/glog/src/utilities.h b/extern/libmv/third_party/glog/src/utilities.h
index 5c841a0b90b..bbb0eb0746c 100644
--- a/extern/libmv/third_party/glog/src/utilities.h
+++ b/extern/libmv/third_party/glog/src/utilities.h
@@ -101,7 +101,7 @@
// correctly when GetStackTrace() is called with max_depth == 0.
// Some code may do that.
-#if __MINGW32__
+#if defined(__MINGW32__) || defined(__FreeBSD__)
# undef STACKTRACE_H
#elif defined(HAVE_LIB_UNWIND)
# define STACKTRACE_H "stacktrace_libunwind-inl.h"
diff --git a/extern/libredcode/codec.h b/extern/libredcode/codec.h
index 928cab589ed..dd239180c10 100644
--- a/extern/libredcode/codec.h
+++ b/extern/libredcode/codec.h
@@ -1,5 +1,5 @@
-#ifndef __redcode_codec_h_included__
-#define __redcode_codec_h_included__
+#ifndef __CODEC_H__
+#define __CODEC_H__
struct redcode_frame;
diff --git a/extern/libredcode/debayer.h b/extern/libredcode/debayer.h
index b58c7678671..43564240cc2 100644
--- a/extern/libredcode/debayer.h
+++ b/extern/libredcode/debayer.h
@@ -1,5 +1,5 @@
-#ifndef __redcode_debayer_h_included__
-#define __redcode_debayer_h_included__ 1
+#ifndef __DEBAYER_H__
+#define __DEBAYER_H__
void redcode_ycbcr2rgb_fullscale(
int ** planes, int width, int height, float * out);
diff --git a/extern/libredcode/format.h b/extern/libredcode/format.h
index b2c6b2d885b..3cee804aa9d 100644
--- a/extern/libredcode/format.h
+++ b/extern/libredcode/format.h
@@ -1,5 +1,5 @@
-#ifndef __redcode_format_h_included__
-#define __redcode_format_h_included__
+#ifndef __FORMAT_H__
+#define __FORMAT_H__
struct redcode_handle;
struct redcode_frame {
diff --git a/extern/xdnd/CMakeLists.txt b/extern/xdnd/CMakeLists.txt
new file mode 100644
index 00000000000..f7eded73d42
--- /dev/null
+++ b/extern/xdnd/CMakeLists.txt
@@ -0,0 +1,43 @@
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# The Original Code is Copyright (C) 2012, Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): Sergey Sharybin.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+set(INC
+ .
+)
+
+set(INC_SYS
+
+)
+
+set(SRC
+ xdnd.c
+ xdnd.h
+)
+
+add_definitions(
+ -DHAVE_SYS_TIME_H
+)
+
+blender_add_lib(extern_xdnd "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/extern/xdnd/SConscript b/extern/xdnd/SConscript
new file mode 100644
index 00000000000..6f1fe72cc28
--- /dev/null
+++ b/extern/xdnd/SConscript
@@ -0,0 +1,10 @@
+#!/usr/bin/python
+
+Import('env')
+
+defs = ['HAVE_SYS_TIME_H']
+sources = env.Glob('*.c')
+
+incs = '.'
+
+env.BlenderLib ( 'extern_xdnd', sources, Split(incs), defs, libtype=['extern','player'], priority=[10, 185])
diff --git a/extern/xdnd/xdnd.c b/extern/xdnd/xdnd.c
new file mode 100644
index 00000000000..9bdee89c1ce
--- /dev/null
+++ b/extern/xdnd/xdnd.c
@@ -0,0 +1,1599 @@
+/* xdnd.c, xdnd.h - C program library for handling the Xdnd protocol
+ Copyright (C) 1996-2000 Paul Sheer
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+ */
+
+
+/*
+ Released 1998-08-07
+ Changes:
+
+ 2000-08-08: INCR protocol implemented.
+
+*/
+
+/*
+ DONE:
+ - INCR protocol now implemented
+
+ TODO:
+ - action_choose_dialog not yet supported (never called)
+ - widget_delete_selection not yet supported and DELETE requests are ignored
+ - not yet tested with applications that only supported XDND 0 or 1
+*/
+
+#include <X11/Xlib.h>
+#include <X11/X.h>
+#include <X11/Xatom.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+#include <sys/types.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#ifdef HAVE_SYS_SELECT_H
+# include <sys/select.h>
+#endif
+
+#include "xdnd.h"
+
+static void xdnd_send_enter (DndClass * dnd, Window window, Window from, Atom * typelist);
+static void xdnd_send_position (DndClass * dnd, Window window, Window from, Atom action, int x, int y,
+ unsigned long etime);
+static void xdnd_send_status (DndClass * dnd, Window window, Window from, int will_accept, int want_position,
+ int x, int y, int w, int h, Atom action);
+static void xdnd_send_leave (DndClass * dnd, Window window, Window from);
+static void xdnd_send_drop (DndClass * dnd, Window window, Window from, unsigned long etime);
+static void xdnd_send_finished (DndClass * dnd, Window window, Window from, int error);
+static int xdnd_convert_selection (DndClass * dnd, Window window, Window requester, Atom type);
+static void xdnd_selection_send (DndClass * dnd, XSelectionRequestEvent * request, unsigned char *data,
+ int length);
+static int xdnd_get_selection (DndClass * dnd, Window from, Atom property, Window insert);
+
+
+/* just to remind us : */
+
+#if 0
+typedef struct {
+ int type;
+ unsigned long serial;
+ Bool send_event;
+ Display *display;
+ Window window;
+ Atom message_type;
+ int format;
+ union {
+ char b[20];
+ short s[10];
+ long l[5];
+ } data;
+} XClientMessageEvent;
+XClientMessageEvent xclient;
+#endif
+
+/* #define DND_DEBUG */
+
+#define xdnd_xfree(x) {if (x) { free (x); x = 0; }}
+
+#ifdef DND_DEBUG
+
+#include <sys/time.h>
+#include <unistd.h>
+
+char *xdnd_debug_milliseconds (void)
+{
+ struct timeval tv;
+ static char r[22];
+ gettimeofday (&tv, 0);
+ sprintf (r, "%.2ld.%.3ld", tv.tv_sec % 100L, tv.tv_usec / 1000L);
+ return r;
+}
+
+#define dnd_debug1(a) printf("%s: %d: %s: " a "\n", __FILE__, __LINE__, xdnd_debug_milliseconds ())
+#define dnd_debug2(a,b) printf("%s: %d: %s: " a "\n", __FILE__, __LINE__, xdnd_debug_milliseconds (), b)
+#define dnd_debug3(a,b,c) printf("%s: %d: %s: " a "\n", __FILE__, __LINE__, xdnd_debug_milliseconds (), b, c)
+#define dnd_debug4(a,b,c,d) printf("%s: %d: %s: " a "\n", __FILE__, __LINE__, xdnd_debug_milliseconds (), b, c, d)
+#else
+#define dnd_debug1(a)
+#define dnd_debug2(a,b)
+#define dnd_debug3(a,b,c)
+#define dnd_debug4(a,b,c,d)
+#endif
+
+#define dnd_warning(a) fprintf (stderr, a)
+
+#define dnd_version_at_least(a,b) ((a) >= (b))
+
+static unsigned char dnd_copy_cursor_bits[] =
+{
+ 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x02, 0x00, 0x08, 0x01,
+ 0x02, 0x00, 0x08, 0x01, 0x02, 0x00, 0x08, 0x01, 0x02, 0x00, 0xe8, 0x0f,
+ 0x02, 0x00, 0x08, 0x01, 0x02, 0x00, 0x08, 0x01, 0x02, 0x00, 0x08, 0x01,
+ 0x02, 0x00, 0x08, 0x00, 0x02, 0x04, 0x08, 0x00, 0x02, 0x0c, 0x08, 0x00,
+ 0x02, 0x1c, 0x08, 0x00, 0x02, 0x3c, 0x08, 0x00, 0x02, 0x7c, 0x08, 0x00,
+ 0x02, 0xfc, 0x08, 0x00, 0x02, 0xfc, 0x09, 0x00, 0x02, 0xfc, 0x0b, 0x00,
+ 0x02, 0x7c, 0x08, 0x00, 0xfe, 0x6d, 0x0f, 0x00, 0x00, 0xc4, 0x00, 0x00,
+ 0x00, 0xc0, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
+ 0x00, 0x00, 0x00, 0x00};
+
+static unsigned char dnd_copy_mask_bits[] =
+{
+ 0xff, 0xff, 0x1f, 0x00, 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0x1f,
+ 0x07, 0x00, 0xfc, 0x1f, 0x07, 0x00, 0xfc, 0x1f, 0x07, 0x00, 0xfc, 0x1f,
+ 0x07, 0x00, 0xfc, 0x1f, 0x07, 0x00, 0xfc, 0x1f, 0x07, 0x00, 0xfc, 0x1f,
+ 0x07, 0x06, 0xfc, 0x1f, 0x07, 0x0e, 0xfc, 0x1f, 0x07, 0x1e, 0x1c, 0x00,
+ 0x07, 0x3e, 0x1c, 0x00, 0x07, 0x7e, 0x1c, 0x00, 0x07, 0xfe, 0x1c, 0x00,
+ 0x07, 0xfe, 0x1d, 0x00, 0x07, 0xfe, 0x1f, 0x00, 0x07, 0xfe, 0x1f, 0x00,
+ 0xff, 0xff, 0x1f, 0x00, 0xff, 0xff, 0x1e, 0x00, 0xff, 0xef, 0x1f, 0x00,
+ 0x00, 0xe6, 0x01, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00,
+ 0x00, 0x80, 0x01, 0x00};
+
+static unsigned char dnd_move_cursor_bits[] =
+{
+ 0x00, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0x02, 0x00, 0x08, 0x02, 0x00, 0x08,
+ 0x02, 0x00, 0x08, 0x02, 0x00, 0x08, 0x02, 0x00, 0x08, 0x02, 0x00, 0x08,
+ 0x02, 0x00, 0x08, 0x02, 0x00, 0x08, 0x02, 0x04, 0x08, 0x02, 0x0c, 0x08,
+ 0x02, 0x1c, 0x08, 0x02, 0x3c, 0x08, 0x02, 0x7c, 0x08, 0x02, 0xfc, 0x08,
+ 0x02, 0xfc, 0x09, 0x02, 0xfc, 0x0b, 0x02, 0x7c, 0x08, 0xfe, 0x6d, 0x0f,
+ 0x00, 0xc4, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x80, 0x01, 0x00, 0x80, 0x01,
+ 0x00, 0x00, 0x00};
+
+static unsigned char dnd_move_mask_bits[] =
+{
+ 0xff, 0xff, 0x1f, 0xff, 0xff, 0x1f, 0xff, 0xff, 0x1f, 0x07, 0x00, 0x1c,
+ 0x07, 0x00, 0x1c, 0x07, 0x00, 0x1c, 0x07, 0x00, 0x1c, 0x07, 0x00, 0x1c,
+ 0x07, 0x00, 0x1c, 0x07, 0x06, 0x1c, 0x07, 0x0e, 0x1c, 0x07, 0x1e, 0x1c,
+ 0x07, 0x3e, 0x1c, 0x07, 0x7e, 0x1c, 0x07, 0xfe, 0x1c, 0x07, 0xfe, 0x1d,
+ 0x07, 0xfe, 0x1f, 0x07, 0xfe, 0x1f, 0xff, 0xff, 0x1f, 0xff, 0xff, 0x1e,
+ 0xff, 0xef, 0x1f, 0x00, 0xe6, 0x01, 0x00, 0xc0, 0x03, 0x00, 0xc0, 0x03,
+ 0x00, 0x80, 0x01};
+
+static unsigned char dnd_link_cursor_bits[] =
+{
+ 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x02, 0x00, 0x08, 0x01,
+ 0x02, 0x00, 0x88, 0x00, 0x02, 0x00, 0x48, 0x00, 0x02, 0x00, 0xe8, 0x0f,
+ 0x02, 0x00, 0x48, 0x00, 0x02, 0x00, 0x88, 0x00, 0x02, 0x00, 0x08, 0x01,
+ 0x02, 0x00, 0x08, 0x00, 0x02, 0x04, 0x08, 0x00, 0x02, 0x0c, 0x08, 0x00,
+ 0x02, 0x1c, 0x08, 0x00, 0x02, 0x3c, 0x08, 0x00, 0x02, 0x7c, 0x08, 0x00,
+ 0x02, 0xfc, 0x08, 0x00, 0x02, 0xfc, 0x09, 0x00, 0x02, 0xfc, 0x0b, 0x00,
+ 0x02, 0x7c, 0x08, 0x00, 0xfe, 0x6d, 0x0f, 0x00, 0x00, 0xc4, 0x00, 0x00,
+ 0x00, 0xc0, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
+ 0x00, 0x00, 0x00, 0x00};
+
+static unsigned char dnd_link_mask_bits[] =
+{
+ 0xff, 0xff, 0x1f, 0x00, 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0x1f,
+ 0x07, 0x00, 0xfc, 0x1f, 0x07, 0x00, 0xfc, 0x1f, 0x07, 0x00, 0xfc, 0x1f,
+ 0x07, 0x00, 0xfc, 0x1f, 0x07, 0x00, 0xfc, 0x1f, 0x07, 0x00, 0xfc, 0x1f,
+ 0x07, 0x06, 0xfc, 0x1f, 0x07, 0x0e, 0xfc, 0x1f, 0x07, 0x1e, 0x1c, 0x00,
+ 0x07, 0x3e, 0x1c, 0x00, 0x07, 0x7e, 0x1c, 0x00, 0x07, 0xfe, 0x1c, 0x00,
+ 0x07, 0xfe, 0x1d, 0x00, 0x07, 0xfe, 0x1f, 0x00, 0x07, 0xfe, 0x1f, 0x00,
+ 0xff, 0xff, 0x1f, 0x00, 0xff, 0xff, 0x1e, 0x00, 0xff, 0xef, 0x1f, 0x00,
+ 0x00, 0xe6, 0x01, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00,
+ 0x00, 0x80, 0x01, 0x00};
+
+static unsigned char dnd_ask_cursor_bits[] =
+{
+ 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0x00, 0x02, 0x00, 0x88, 0x03,
+ 0x02, 0x00, 0x48, 0x04, 0x02, 0x00, 0x08, 0x04, 0x02, 0x00, 0x08, 0x02,
+ 0x02, 0x00, 0x08, 0x01, 0x02, 0x00, 0x08, 0x01, 0x02, 0x00, 0x08, 0x00,
+ 0x02, 0x00, 0x08, 0x01, 0x02, 0x04, 0x08, 0x00, 0x02, 0x0c, 0x08, 0x00,
+ 0x02, 0x1c, 0x08, 0x00, 0x02, 0x3c, 0x08, 0x00, 0x02, 0x7c, 0x08, 0x00,
+ 0x02, 0xfc, 0x08, 0x00, 0x02, 0xfc, 0x09, 0x00, 0x02, 0xfc, 0x0b, 0x00,
+ 0x02, 0x7c, 0x08, 0x00, 0xfe, 0x6d, 0x0f, 0x00, 0x00, 0xc4, 0x00, 0x00,
+ 0x00, 0xc0, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
+ 0x00, 0x00, 0x00, 0x00};
+
+static unsigned char dnd_ask_mask_bits[] =
+{
+ 0xff, 0xff, 0x1f, 0x00, 0xff, 0xff, 0xff, 0x1f, 0xff, 0xff, 0xff, 0x1f,
+ 0x07, 0x00, 0xfc, 0x1f, 0x07, 0x00, 0xfc, 0x1f, 0x07, 0x00, 0xfc, 0x1f,
+ 0x07, 0x00, 0xfc, 0x1f, 0x07, 0x00, 0xfc, 0x1f, 0x07, 0x00, 0xfc, 0x1f,
+ 0x07, 0x06, 0xfc, 0x1f, 0x07, 0x0e, 0xfc, 0x1f, 0x07, 0x1e, 0x1c, 0x00,
+ 0x07, 0x3e, 0x1c, 0x00, 0x07, 0x7e, 0x1c, 0x00, 0x07, 0xfe, 0x1c, 0x00,
+ 0x07, 0xfe, 0x1d, 0x00, 0x07, 0xfe, 0x1f, 0x00, 0x07, 0xfe, 0x1f, 0x00,
+ 0xff, 0xff, 0x1f, 0x00, 0xff, 0xff, 0x1e, 0x00, 0xff, 0xef, 0x1f, 0x00,
+ 0x00, 0xe6, 0x01, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00,
+ 0x00, 0x80, 0x01, 0x00};
+
+static DndCursor dnd_cursors[] =
+{
+ {29, 25, 10, 10, dnd_copy_cursor_bits, dnd_copy_mask_bits, "XdndActionCopy", 0, 0, 0, 0},
+ {21, 25, 10, 10, dnd_move_cursor_bits, dnd_move_mask_bits, "XdndActionMove", 0, 0, 0, 0},
+ {29, 25, 10, 10, dnd_link_cursor_bits, dnd_link_mask_bits, "XdndActionLink", 0, 0, 0, 0},
+ {29, 25, 10, 10, dnd_ask_cursor_bits, dnd_ask_mask_bits, "XdndActionAsk", 0, 0, 0, 0},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
+};
+
+void xdnd_reset (DndClass * dnd)
+{
+ dnd->stage = XDND_DROP_STAGE_IDLE;
+ dnd->dragging_version = 0;
+ dnd->internal_drag = 0;
+ dnd->want_position = 0;
+ dnd->ready_to_drop = 0;
+ dnd->will_accept = 0;
+ dnd->rectangle.x = dnd->rectangle.y = 0;
+ dnd->rectangle.width = dnd->rectangle.height = 0;
+ dnd->dropper_window = 0;
+ dnd->dropper_toplevel = 0;
+ dnd->dragger_window = 0;
+ dnd->dragger_typelist = 0;
+ dnd->desired_type = 0;
+ dnd->time = 0;
+}
+
+void xdnd_init (DndClass * dnd, Display * display)
+{
+ DndCursor *cursor;
+ XColor black, white;
+ memset (dnd, 0, sizeof (*dnd));
+
+ dnd->display = display;
+ dnd->root_window = DefaultRootWindow (display);
+ dnd->version = XDND_VERSION;
+
+ dnd->XdndAware = XInternAtom (dnd->display, "XdndAware", False);
+ dnd->XdndSelection = XInternAtom (dnd->display, "XdndSelection", False);
+ dnd->XdndEnter = XInternAtom (dnd->display, "XdndEnter", False);
+ dnd->XdndLeave = XInternAtom (dnd->display, "XdndLeave", False);
+ dnd->XdndPosition = XInternAtom (dnd->display, "XdndPosition", False);
+ dnd->XdndDrop = XInternAtom (dnd->display, "XdndDrop", False);
+ dnd->XdndFinished = XInternAtom (dnd->display, "XdndFinished", False);
+ dnd->XdndStatus = XInternAtom (dnd->display, "XdndStatus", False);
+ dnd->XdndActionCopy = XInternAtom (dnd->display, "XdndActionCopy", False);
+ dnd->XdndActionMove = XInternAtom (dnd->display, "XdndActionMove", False);
+ dnd->XdndActionLink = XInternAtom (dnd->display, "XdndActionLink", False);
+ dnd->XdndActionAsk = XInternAtom (dnd->display, "XdndActionAsk", False);
+ dnd->XdndActionPrivate = XInternAtom (dnd->display, "XdndActionPrivate", False);
+ dnd->XdndTypeList = XInternAtom (dnd->display, "XdndTypeList", False);
+ dnd->XdndActionList = XInternAtom (dnd->display, "XdndActionList", False);
+ dnd->XdndActionDescription = XInternAtom (dnd->display, "XdndActionDescription", False);
+
+ dnd->Xdnd_NON_PROTOCOL_ATOM = XInternAtom (dnd->display, "JXSelectionWindowProperty", False);
+
+ xdnd_reset (dnd);
+
+ dnd->cursors = dnd_cursors;
+
+ black.pixel = BlackPixel (dnd->display, DefaultScreen (dnd->display));
+ white.pixel = WhitePixel (dnd->display, DefaultScreen (dnd->display));
+
+ XQueryColor (dnd->display, DefaultColormap (dnd->display, DefaultScreen (dnd->display)), &black);
+ XQueryColor (dnd->display, DefaultColormap (dnd->display, DefaultScreen (dnd->display)), &white);
+
+ for (cursor = &dnd->cursors[0]; cursor->width; cursor++) {
+ cursor->image_pixmap = XCreateBitmapFromData \
+ (dnd->display, dnd->root_window, (char *) cursor->image_data, cursor->width, cursor->height);
+ cursor->mask_pixmap = XCreateBitmapFromData \
+ (dnd->display, dnd->root_window, (char *) cursor->mask_data, cursor->width, cursor->height);
+ cursor->cursor = XCreatePixmapCursor (dnd->display, cursor->image_pixmap,
+ cursor->mask_pixmap, &black, &white, cursor->x, cursor->y);
+ XFreePixmap (dnd->display, cursor->image_pixmap);
+ XFreePixmap (dnd->display, cursor->mask_pixmap);
+ cursor->action = XInternAtom (dnd->display, cursor->_action, False);
+ }
+}
+
+void xdnd_shut (DndClass * dnd)
+{
+ DndCursor *cursor;
+ for (cursor = &dnd->cursors[0]; cursor->width; cursor++)
+ XFreeCursor (dnd->display, cursor->cursor);
+ memset (dnd, 0, sizeof (*dnd));
+ return;
+}
+
+
+/* typelist is a null terminated array */
+static int array_length (Atom * a)
+{
+ int n;
+ for (n = 0; a[n]; n++);
+ return n;
+}
+
+void xdnd_set_dnd_aware (DndClass * dnd, Window window, Atom * typelist)
+{
+ Window root_return, parent;
+ unsigned int nchildren_return;
+ Window *children_return = 0;
+ int r, s;
+ if(!window) return;
+ if (dnd->widget_exists)
+ if (!(*dnd->widget_exists) (dnd, window))
+ return;
+ s = XChangeProperty (dnd->display, window, dnd->XdndAware, XA_ATOM, 32, PropModeReplace,
+ (unsigned char *) &dnd->version, 1);
+#if 1
+ dnd_debug4 ("XChangeProperty() = %d, window = %ld, widget = %s", s, window, "<WIDGET>");
+#endif
+ if (s && typelist) {
+ int n;
+ n = array_length (typelist);
+ if (n)
+ s = XChangeProperty (dnd->display, window, dnd->XdndAware, XA_ATOM, 32, PropModeAppend,
+ (unsigned char *) typelist, n);
+ }
+ r =
+ XQueryTree (dnd->display, window, &root_return, &parent, &children_return,
+ &nchildren_return);
+ if (children_return)
+ XFree (children_return);
+ if (r)
+ xdnd_set_dnd_aware (dnd, parent, typelist);
+}
+
+int xdnd_is_dnd_aware (DndClass * dnd, Window window, int *version, Atom * typelist)
+{
+ Atom actual;
+ int format;
+ unsigned long count, remaining;
+ unsigned char *data = 0;
+ Atom *types, *t;
+ int result = 1;
+
+ *version = 0;
+ XGetWindowProperty (dnd->display, window, dnd->XdndAware,
+ 0, 0x8000000L, False, XA_ATOM,
+ &actual, &format,
+ &count, &remaining, &data);
+
+ if (actual != XA_ATOM || format != 32 || count == 0 || !data) {
+ dnd_debug2 ("XGetWindowProperty failed in xdnd_is_dnd_aware - XdndAware = %ld", dnd->XdndAware);
+ if (data)
+ XFree (data);
+ return 0;
+ }
+ types = (Atom *) data;
+#if XDND_VERSION >= 3
+ if (types[0] < 3) {
+ if (data)
+ XFree (data);
+ return 0;
+ }
+#endif
+ *version = dnd->version < types[0] ? dnd->version : types[0]; /* minimum */
+ dnd_debug2 ("Using XDND version %d", *version);
+ if (count > 1) {
+ result = 0;
+ for (t = typelist; *t; t++) {
+ int j;
+ for (j = 1; j < count; j++) {
+ if (types[j] == *t) {
+ result = 1;
+ break;
+ }
+ }
+ if (result)
+ break;
+ }
+ }
+ XFree (data);
+ return result;
+}
+
+void xdnd_set_type_list (DndClass * dnd, Window window, Atom * typelist)
+{
+ int n;
+ n = array_length (typelist);
+ XChangeProperty (dnd->display, window, dnd->XdndTypeList, XA_ATOM, 32,
+ PropModeReplace, (unsigned char *) typelist, n);
+}
+
+/* result must be free'd */
+void xdnd_get_type_list (DndClass * dnd, Window window, Atom ** typelist)
+{
+ Atom type, *a;
+ int format, i;
+ unsigned long count, remaining;
+ unsigned char *data = NULL;
+
+ *typelist = 0;
+
+ XGetWindowProperty (dnd->display, window, dnd->XdndTypeList,
+ 0, 0x8000000L, False, XA_ATOM,
+ &type, &format, &count, &remaining, &data);
+
+ if (type != XA_ATOM || format != 32 || count == 0 || !data) {
+ if (data)
+ XFree (data);
+ dnd_debug2 ("XGetWindowProperty failed in xdnd_get_type_list - dnd->XdndTypeList = %ld", dnd->XdndTypeList);
+ return;
+ }
+ *typelist = malloc ((count + 1) * sizeof (Atom));
+ a = (Atom *) data;
+ for (i = 0; i < count; i++)
+ (*typelist)[i] = a[i];
+ (*typelist)[count] = 0;
+
+ XFree (data);
+}
+
+void xdnd_get_three_types (DndClass * dnd, XEvent * xevent, Atom ** typelist)
+{
+ int i;
+ *typelist = malloc ((XDND_THREE + 1) * sizeof (Atom));
+ for (i = 0; i < XDND_THREE; i++)
+ (*typelist)[i] = XDND_ENTER_TYPE (xevent, i);
+ (*typelist)[XDND_THREE] = 0; /* although (*typelist)[1] or (*typelist)[2] may also be set to nill */
+}
+
+/* result must be free'd */
+static char *concat_string_list (char **t, int *bytes)
+{
+ int l, n;
+ char *s;
+ for (l = n = 0;; n++) {
+ if (!t[n])
+ break;
+ if (!t[n][0])
+ break;
+ l += strlen (t[n]) + 1;
+ }
+ s = malloc (l + 1);
+ for (l = n = 0;; n++) {
+ if (!t[n])
+ break;
+ if (!(t[n][0]))
+ break;
+ strcpy (s + l, t[n]);
+ l += strlen (t[n]) + 1;
+ }
+ *bytes = l;
+ s[l] = '\0';
+ return s;
+}
+
+void xdnd_set_actions (DndClass * dnd, Window window, Atom * actions, char **descriptions)
+{
+ int n, l;
+ char *s;
+ n = array_length (actions);
+
+ XChangeProperty (dnd->display, window, dnd->XdndActionList, XA_ATOM, 32,
+ PropModeReplace, (unsigned char *) actions, n);
+
+ s = concat_string_list (descriptions, &l);
+ XChangeProperty (dnd->display, window, dnd->XdndActionList, XA_STRING, 8,
+ PropModeReplace, (unsigned char *) s, l);
+ xdnd_xfree (s);
+}
+
+/* returns 1 on error or no actions, otherwise result must be free'd
+ xdnd_get_actions (window, &actions, &descriptions);
+ free (actions); free (descriptions); */
+int xdnd_get_actions (DndClass * dnd, Window window, Atom ** actions, char ***descriptions)
+{
+ Atom type, *a;
+ int format, i;
+ unsigned long count, dcount, remaining;
+ unsigned char *data = 0, *r;
+
+ *actions = 0;
+ *descriptions = 0;
+ XGetWindowProperty (dnd->display, window, dnd->XdndActionList,
+ 0, 0x8000000L, False, XA_ATOM,
+ &type, &format, &count, &remaining, &data);
+
+ if (type != XA_ATOM || format != 32 || count == 0 || !data) {
+ if (data)
+ XFree (data);
+ return 1;
+ }
+ *actions = malloc ((count + 1) * sizeof (Atom));
+ a = (Atom *) data;
+ for (i = 0; i < count; i++)
+ (*actions)[i] = a[i];
+ (*actions)[count] = 0;
+
+ XFree (data);
+
+ data = 0;
+ XGetWindowProperty (dnd->display, window, dnd->XdndActionDescription,
+ 0, 0x8000000L, False, XA_STRING, &type, &format,
+ &dcount, &remaining, &data);
+
+ if (type != XA_STRING || format != 8 || dcount == 0) {
+ if (data)
+ XFree (data);
+ *descriptions = malloc ((count + 1) * sizeof (char *));
+ dnd_warning ("XGetWindowProperty no property or wrong format for action descriptions");
+ for (i = 0; i < count; i++)
+ (*descriptions)[i] = "";
+ (*descriptions)[count] = 0;
+ } else {
+ int l;
+ l = (count + 1) * sizeof (char *);
+ *descriptions = malloc (l + dcount);
+ memcpy (*descriptions + l, data, dcount);
+ XFree (data);
+ data = (unsigned char *) *descriptions;
+ data += l;
+ l = 0;
+ for (i = 0, r = data;; r += l + 1, i++) {
+ l = strlen ((char *) r);
+ if (!l || i >= count)
+ break;
+ (*descriptions)[i] = (char *) r;
+ }
+ for (; i < count; i++) {
+ (*descriptions)[i] = "";
+ }
+ (*descriptions)[count] = 0;
+ }
+ return 0;
+}
+
+/* returns non-zero on cancel */
+int xdnd_choose_action_dialog (DndClass * dnd, Atom * actions, char **descriptions, Atom * result)
+{
+ if (!actions[0])
+ return 1;
+ if (!dnd->action_choose_dialog) { /* default to return the first action if no dialog set */
+ *result = actions[0];
+ return 0;
+ }
+ return (*dnd->action_choose_dialog) (dnd, descriptions, actions, result);
+}
+
+static void xdnd_send_event (DndClass * dnd, Window window, XEvent * xevent)
+{
+ dnd_debug4 ("xdnd_send_event(), window = %ld, l[0] = %ld, l[4] = %ld",
+ window, xevent->xclient.data.l[0], xevent->xclient.data.l[4]);
+ dnd_debug2 ("xdnd_send_event(), from widget widget %s", (char *) "<WIDGET>");
+ XSendEvent (dnd->display, window, 0, 0, xevent);
+}
+
+static void xdnd_send_enter (DndClass * dnd, Window window, Window from, Atom * typelist)
+{
+ XEvent xevent;
+ int n, i;
+ n = array_length (typelist);
+
+ memset (&xevent, 0, sizeof (xevent));
+
+ xevent.xany.type = ClientMessage;
+ xevent.xany.display = dnd->display;
+ xevent.xclient.window = window;
+ xevent.xclient.message_type = dnd->XdndEnter;
+ xevent.xclient.format = 32;
+
+ XDND_ENTER_SOURCE_WIN (&xevent) = from;
+ XDND_ENTER_THREE_TYPES_SET (&xevent, n > XDND_THREE);
+ XDND_ENTER_VERSION_SET (&xevent, dnd->version);
+ for (i = 0; i < n && i < XDND_THREE; i++)
+ XDND_ENTER_TYPE (&xevent, i) = typelist[i];
+ xdnd_send_event (dnd, window, &xevent);
+}
+
+static void xdnd_send_position (DndClass * dnd, Window window, Window from, Atom action, int x, int y, unsigned long time)
+{
+ XEvent xevent;
+
+ memset (&xevent, 0, sizeof (xevent));
+
+ xevent.xany.type = ClientMessage;
+ xevent.xany.display = dnd->display;
+ xevent.xclient.window = window;
+ xevent.xclient.message_type = dnd->XdndPosition;
+ xevent.xclient.format = 32;
+
+ XDND_POSITION_SOURCE_WIN (&xevent) = from;
+ XDND_POSITION_ROOT_SET (&xevent, x, y);
+ if (dnd_version_at_least (dnd->dragging_version, 1))
+ XDND_POSITION_TIME (&xevent) = time;
+ if (dnd_version_at_least (dnd->dragging_version, 2))
+ XDND_POSITION_ACTION (&xevent) = action;
+
+ xdnd_send_event (dnd, window, &xevent);
+}
+
+static void xdnd_send_status (DndClass * dnd, Window window, Window from, int will_accept, \
+ int want_position, int x, int y, int w, int h, Atom action)
+{
+ XEvent xevent;
+
+ memset (&xevent, 0, sizeof (xevent));
+
+ xevent.xany.type = ClientMessage;
+ xevent.xany.display = dnd->display;
+ xevent.xclient.window = window;
+ xevent.xclient.message_type = dnd->XdndStatus;
+ xevent.xclient.format = 32;
+
+ XDND_STATUS_TARGET_WIN (&xevent) = from;
+ XDND_STATUS_WILL_ACCEPT_SET (&xevent, will_accept);
+ if (will_accept)
+ XDND_STATUS_WANT_POSITION_SET (&xevent, want_position);
+ if (want_position)
+ XDND_STATUS_RECT_SET (&xevent, x, y, w, h);
+ if (dnd_version_at_least (dnd->dragging_version, 2))
+ if (will_accept)
+ XDND_STATUS_ACTION (&xevent) = action;
+
+ xdnd_send_event (dnd, window, &xevent);
+}
+
+static void xdnd_send_leave (DndClass * dnd, Window window, Window from)
+{
+ XEvent xevent;
+
+ memset (&xevent, 0, sizeof (xevent));
+
+ xevent.xany.type = ClientMessage;
+ xevent.xany.display = dnd->display;
+ xevent.xclient.window = window;
+ xevent.xclient.message_type = dnd->XdndLeave;
+ xevent.xclient.format = 32;
+
+ XDND_LEAVE_SOURCE_WIN (&xevent) = from;
+
+ xdnd_send_event (dnd, window, &xevent);
+}
+
+static void xdnd_send_drop (DndClass * dnd, Window window, Window from, unsigned long time)
+{
+ XEvent xevent;
+
+ memset (&xevent, 0, sizeof (xevent));
+
+ xevent.xany.type = ClientMessage;
+ xevent.xany.display = dnd->display;
+ xevent.xclient.window = window;
+ xevent.xclient.message_type = dnd->XdndDrop;
+ xevent.xclient.format = 32;
+
+ XDND_DROP_SOURCE_WIN (&xevent) = from;
+ if (dnd_version_at_least (dnd->dragging_version, 1))
+ XDND_DROP_TIME (&xevent) = time;
+
+ xdnd_send_event (dnd, window, &xevent);
+}
+
+/* error is not actually used, i think future versions of the protocol should return an error status
+ to the calling window with the XdndFinished client message */
+static void xdnd_send_finished (DndClass * dnd, Window window, Window from, int error)
+{
+ XEvent xevent;
+
+ memset (&xevent, 0, sizeof (xevent));
+
+ xevent.xany.type = ClientMessage;
+ xevent.xany.display = dnd->display;
+ xevent.xclient.window = window;
+ xevent.xclient.message_type = dnd->XdndFinished;
+ xevent.xclient.format = 32;
+
+ XDND_FINISHED_TARGET_WIN (&xevent) = from;
+
+ xdnd_send_event (dnd, window, &xevent);
+}
+
+/* returns non-zero on error - i.e. no selection owner set. Type is of course the mime type */
+static int xdnd_convert_selection (DndClass * dnd, Window window, Window requester, Atom type)
+{
+ if (!(window = XGetSelectionOwner (dnd->display, dnd->XdndSelection))) {
+ dnd_debug1 ("xdnd_convert_selection(): XGetSelectionOwner failed");
+ return 1;
+ }
+ XConvertSelection (dnd->display, dnd->XdndSelection, type,
+ dnd->Xdnd_NON_PROTOCOL_ATOM, requester, CurrentTime);
+ return 0;
+}
+
+/* returns non-zero on error */
+static int xdnd_set_selection_owner (DndClass * dnd, Window window, Atom type, Time time)
+{
+ if (!XSetSelectionOwner (dnd->display, dnd->XdndSelection, window, time)) {
+ dnd_debug1 ("xdnd_set_selection_owner(): XSetSelectionOwner failed");
+ return 1;
+ }
+ return 0;
+}
+
+static void xdnd_selection_send (DndClass * dnd, XSelectionRequestEvent * request, unsigned char *data, int length)
+{
+ XEvent xevent;
+ dnd_debug2 (" requestor = %ld", request->requestor);
+ dnd_debug2 (" property = %ld", request->property);
+ dnd_debug2 (" length = %d", length);
+ XChangeProperty (dnd->display, request->requestor, request->property,
+ request->target, 8, PropModeReplace, data, length);
+ xevent.xselection.type = SelectionNotify;
+ xevent.xselection.property = request->property;
+ xevent.xselection.display = request->display;
+ xevent.xselection.requestor = request->requestor;
+ xevent.xselection.selection = request->selection;
+ xevent.xselection.target = request->target;
+ xevent.xselection.time = request->time;
+ xdnd_send_event (dnd, request->requestor, &xevent);
+}
+
+#if 0
+/* respond to a notification that a primary selection has been sent */
+int xdnd_get_selection (DndClass * dnd, Window from, Atom property, Window insert)
+{
+ long read;
+ int error = 0;
+ unsigned long remaining;
+ if (!property)
+ return 1;
+ read = 0;
+ do {
+ unsigned char *s;
+ Atom actual;
+ int format;
+ unsigned long count;
+ if (XGetWindowProperty (dnd->display, insert, property, read / 4, 65536, 1,
+ AnyPropertyType, &actual, &format,
+ &count, &remaining,
+ &s) != Success) {
+ XFree (s);
+ return 1;
+ }
+ read += count;
+ if (dnd->widget_insert_drop && !error)
+ error = (*dnd->widget_insert_drop) (dnd, s, count, remaining, insert, from, actual);
+ XFree (s);
+ } while (remaining);
+ return error;
+}
+#endif
+
+static int paste_prop_internal (DndClass * dnd, Window from, Window insert, unsigned long prop, int delete_prop)
+{
+ long nread = 0;
+ unsigned long nitems;
+ unsigned long bytes_after;
+ int error = 0;
+ do {
+ Atom actual_type;
+ int actual_fmt;
+ unsigned char *s = 0;
+ if (XGetWindowProperty (dnd->display, insert, prop,
+ nread / 4, 65536, delete_prop,
+ AnyPropertyType, &actual_type, &actual_fmt,
+ &nitems, &bytes_after, &s) != Success) {
+ XFree (s);
+ return 1;
+ }
+ nread += nitems;
+ if (dnd->widget_insert_drop && !error)
+ error = (*dnd->widget_insert_drop) (dnd, s, nitems, bytes_after, insert, from, actual_fmt);
+ XFree (s);
+ } while (bytes_after);
+ if (!nread)
+ return 1;
+ return 0;
+}
+
+/*
+ * Respond to a notification that a primary selection has been sent (supports INCR)
+ */
+static int xdnd_get_selection (DndClass * dnd, Window from, Atom prop, Window insert)
+{
+ struct timeval tv, tv_start;
+ unsigned long bytes_after;
+ Atom actual_type;
+ int actual_fmt;
+ unsigned long nitems;
+ unsigned char *s = 0;
+ if (prop == None)
+ return 1;
+ if (XGetWindowProperty
+ (dnd->display, insert, prop, 0, 8, False, AnyPropertyType, &actual_type, &actual_fmt,
+ &nitems, &bytes_after, &s) != Success) {
+ XFree (s);
+ return 1;
+ }
+ XFree (s);
+ if (actual_type != XInternAtom (dnd->display, "INCR", False))
+ return paste_prop_internal (dnd, from, insert, prop, True);
+ XDeleteProperty (dnd->display, insert, prop);
+ gettimeofday (&tv_start, 0);
+ for (;;) {
+ long t;
+ fd_set r;
+ XEvent xe;
+ if (XCheckMaskEvent (dnd->display, PropertyChangeMask, &xe)) {
+ if (xe.type == PropertyNotify && xe.xproperty.state == PropertyNewValue) {
+/* time between arrivals of data */
+ gettimeofday (&tv_start, 0);
+ if (paste_prop_internal (dnd, from, insert, prop, True))
+ break;
+ }
+ } else {
+ tv.tv_sec = 0;
+ tv.tv_usec = 10000;
+ FD_ZERO (&r);
+ FD_SET (ConnectionNumber (dnd->display), &r);
+ select (ConnectionNumber (dnd->display) + 1, &r, 0, 0, &tv);
+ if (FD_ISSET (ConnectionNumber (dnd->display), &r))
+ continue;
+ }
+ gettimeofday (&tv, 0);
+ t = (tv.tv_sec - tv_start.tv_sec) * 1000000L + (tv.tv_usec - tv_start.tv_usec);
+/* no data for five seconds, so quit */
+ if (t > 5000000L)
+ return 1;
+ }
+ return 0;
+}
+
+
+int outside_rectangle (int x, int y, XRectangle * r)
+{
+ return (x < r->x || y < r->y || x >= r->x + r->width || y >= r->y + r->height);
+}
+
+/* avoids linking with the maths library */
+static float xdnd_sqrt (float x)
+{
+ float last_ans, ans = 2, a;
+ if (x <= 0.0)
+ return 0.0;
+ do {
+ last_ans = ans;
+ ans = (ans + x / ans) / 2;
+ a = (ans - last_ans) / ans;
+ if (a < 0.0)
+ a = (-a);
+ } while (a > 0.001);
+ return ans;
+}
+
+#define print_marks print_win_marks(from,__FILE__,__LINE__);
+
+/* returns action on success, 0 otherwise */
+Atom xdnd_drag (DndClass * dnd, Window from, Atom action, Atom * typelist)
+{
+ XEvent xevent, xevent_temp;
+ Window over_window = 0, last_window = 0;
+#if XDND_VERSION >= 3
+ Window last_dropper_toplevel = 0;
+ int internal_dropable = 1;
+#endif
+ int n;
+ DndCursor *cursor;
+ float x_mouse, y_mouse;
+ int result = 0, dnd_aware;
+
+ if (!typelist)
+ dnd_warning ("xdnd_drag() called with typelist = 0");
+
+/* first wait until the mouse moves more than five pixels */
+ do {
+ XNextEvent (dnd->display, &xevent);
+ if (xevent.type == ButtonRelease) {
+ dnd_debug1 ("button release - no motion");
+ XSendEvent (dnd->display, xevent.xany.window, 0, ButtonReleaseMask, &xevent);
+ return 0;
+ }
+ } while (xevent.type != MotionNotify);
+
+ x_mouse = (float) xevent.xmotion.x_root;
+ y_mouse = (float) xevent.xmotion.y_root;
+
+ if (!dnd->drag_threshold)
+ dnd->drag_threshold = 4.0;
+ for (;;) {
+ XNextEvent (dnd->display, &xevent);
+ if (xevent.type == MotionNotify)
+ if (xdnd_sqrt ((x_mouse - xevent.xmotion.x_root) * (x_mouse - xevent.xmotion.x_root) +
+ (y_mouse - xevent.xmotion.y_root) * (y_mouse - xevent.xmotion.y_root)) > dnd->drag_threshold)
+ break;
+ if (xevent.type == ButtonRelease) {
+ XSendEvent (dnd->display, xevent.xany.window, 0, ButtonReleaseMask, &xevent);
+ return 0;
+ }
+ }
+
+ dnd_debug1 ("moved 5 pixels - going to drag");
+
+ n = array_length (typelist);
+ if (n > XDND_THREE)
+ xdnd_set_type_list (dnd, from, typelist);
+
+ xdnd_reset (dnd);
+
+ dnd->stage = XDND_DRAG_STAGE_DRAGGING;
+
+ for (cursor = &dnd->cursors[0]; cursor->width; cursor++)
+ if (cursor->action == action)
+ break;
+ if (!cursor->width)
+ cursor = &dnd->cursors[0];
+
+/* the mouse has been dragged a little, so this is a drag proper */
+ if (XGrabPointer (dnd->display, dnd->root_window, False,
+ ButtonMotionMask | PointerMotionMask | ButtonPressMask | ButtonReleaseMask,
+ GrabModeAsync, GrabModeAsync, None,
+ cursor->cursor, CurrentTime) != GrabSuccess)
+ dnd_debug1 ("Unable to grab pointer");
+
+
+ while (xevent.xany.type != ButtonRelease) {
+ XAllowEvents (dnd->display, SyncPointer, CurrentTime);
+ XNextEvent (dnd->display, &xevent);
+ switch (xevent.type) {
+ case Expose:
+ if (dnd->handle_expose_events)
+ (*dnd->handle_expose_events) (dnd, &xevent);
+ break;
+ case EnterNotify:
+/* this event is not actually reported, so we find out by ourselves from motion events */
+ break;
+ case LeaveNotify:
+/* this event is not actually reported, so we find out by ourselves from motion events */
+ break;
+ case ButtonRelease:
+/* done, but must send a leave event */
+ dnd_debug1 ("ButtonRelease - exiting event loop");
+ break;
+ case MotionNotify:
+ dnd_aware = 0;
+ dnd->dropper_toplevel = 0;
+ memcpy (&xevent_temp, &xevent, sizeof (xevent));
+ xevent.xmotion.subwindow = xevent.xmotion.window;
+ {
+ Window root_return, child_return;
+ int x_temp, y_temp;
+ unsigned int mask_return;
+ while (XQueryPointer (dnd->display, xevent.xmotion.subwindow, &root_return, &child_return,
+ &x_temp, &y_temp, &xevent.xmotion.x,
+ &xevent.xmotion.y, &mask_return)) {
+#if XDND_VERSION >= 3
+ if (!dnd_aware) {
+ if ((dnd_aware = xdnd_is_dnd_aware (dnd, xevent.xmotion.subwindow, &dnd->dragging_version, typelist))) {
+ dnd->dropper_toplevel = xevent.xmotion.subwindow;
+ xevent.xmotion.x_root = x_temp;
+ xevent.xmotion.y_root = y_temp;
+ }
+ }
+#else
+ xevent.xmotion.x_root = x_temp;
+ xevent.xmotion.y_root = y_temp;
+#endif
+ if (!child_return)
+ goto found_descendent;
+ xevent.xmotion.subwindow = child_return;
+ }
+ break;
+ }
+ found_descendent:
+
+/* last_window is just for debug purposes */
+ if (last_window != xevent.xmotion.subwindow) {
+ dnd_debug2 ("window crossing to %ld", xevent.xmotion.subwindow);
+ dnd_debug2 (" current window is %ld", over_window);
+ dnd_debug3 (" last_window = %ld, xmotion.subwindow = %ld", last_window, xevent.xmotion.subwindow);
+#if XDND_VERSION >= 3
+ dnd_debug3 (" dropper_toplevel = %ld, last_dropper_toplevel.subwindow = %ld", dnd->dropper_toplevel, last_dropper_toplevel);
+#endif
+ dnd_debug3 (" dnd_aware = %d, dnd->options & XDND_OPTION_NO_HYSTERESIS = %ld", dnd_aware, (long) dnd->options & XDND_OPTION_NO_HYSTERESIS);
+ }
+
+#if XDND_VERSION < 3
+/* is the new window dnd aware? if not stay in the old window */
+ if (over_window != xevent.xmotion.subwindow &&
+ last_window != xevent.xmotion.subwindow &&
+ (
+ (dnd_aware = xdnd_is_dnd_aware (dnd, xevent.xmotion.subwindow, &dnd->dragging_version, typelist))
+ ||
+ (dnd->options & XDND_OPTION_NO_HYSTERESIS)
+ ))
+#else
+ internal_dropable = 1;
+ if (dnd->widget_exists && (*dnd->widget_exists) (dnd, xevent.xmotion.subwindow))
+ if (!xdnd_is_dnd_aware (dnd, xevent.xmotion.subwindow, &dnd->dragging_version, typelist))
+ internal_dropable = 0;
+ dnd_debug3 ("dnd->dropper_toplevel = %ld, last_dropper_toplevel = %ld\n", dnd->dropper_toplevel, last_dropper_toplevel);
+ if ((dnd->dropper_toplevel != last_dropper_toplevel ||
+ last_window != xevent.xmotion.subwindow) && internal_dropable &&
+ (
+ (dnd_aware)
+ ||
+ (dnd->options & XDND_OPTION_NO_HYSTERESIS)
+ ))
+#endif
+ {
+/* leaving window we were over */
+ if (over_window) {
+ if (dnd->stage == XDND_DRAG_STAGE_ENTERED) {
+ dnd_debug1 ("got leave at right stage");
+ dnd->stage = XDND_DRAG_STAGE_DRAGGING;
+ if (dnd->internal_drag) {
+ dnd_debug1 (" our own widget");
+ if (dnd->widget_apply_leave)
+ (*dnd->widget_apply_leave) (dnd, over_window);
+ } else {
+ dnd_debug1 (" not our widget - sending XdndLeave");
+#if XDND_VERSION < 3
+ xdnd_send_leave (dnd, over_window, from);
+#else
+ if (dnd->dropper_toplevel != last_dropper_toplevel) {
+ xdnd_send_leave (dnd, last_dropper_toplevel, from);
+ } else {
+ dnd_debug1 (" not sending leave --> dnd->dropper_toplevel == last_dropper_toplevel");
+ }
+#endif
+ }
+ dnd->internal_drag = 0;
+ dnd->dropper_window = 0;
+ dnd->ready_to_drop = 0;
+ } else {
+ dnd_debug1 ("got leave at wrong stage - ignoring");
+ }
+ }
+/* entering window we are currently over */
+ over_window = xevent.xmotion.subwindow;
+ if (dnd_aware) {
+ dnd_debug1 (" is dnd aware");
+ dnd->stage = XDND_DRAG_STAGE_ENTERED;
+ if (dnd->widget_exists && (*dnd->widget_exists) (dnd, over_window))
+ dnd->internal_drag = 1;
+ if (dnd->internal_drag) {
+ dnd_debug1 (" our own widget");
+ } else {
+ dnd_debug2 (" not our widget - sending XdndEnter to %ld", over_window);
+#if XDND_VERSION < 3
+ xdnd_send_enter (dnd, over_window, from, typelist);
+#else
+ if (dnd->dropper_toplevel != last_dropper_toplevel)
+ xdnd_send_enter (dnd, dnd->dropper_toplevel, from, typelist);
+#endif
+ }
+ dnd->want_position = 1;
+ dnd->ready_to_drop = 0;
+ dnd->rectangle.width = dnd->rectangle.height = 0;
+ dnd->dropper_window = over_window;
+/* we want an additional motion event in case the pointer enters and then stops */
+ XSendEvent (dnd->display, from, 0, ButtonMotionMask, &xevent_temp);
+ XSync (dnd->display, 0);
+ }
+#if XDND_VERSION >= 3
+ last_dropper_toplevel = dnd->dropper_toplevel;
+#endif
+/* we are now officially in a new window */
+ } else {
+/* got here, so we are just moving `inside' the same window */
+ if (dnd->stage == XDND_DRAG_STAGE_ENTERED) {
+ dnd->supported_action = dnd->XdndActionCopy;
+ dnd_debug1 ("got motion at right stage");
+ dnd->x = xevent.xmotion.x_root;
+ dnd->y = xevent.xmotion.y_root;
+ if (dnd->want_position || outside_rectangle (dnd->x, dnd->y, &dnd->rectangle)) {
+ dnd_debug1 (" want position and outside rectangle");
+ if (dnd->internal_drag) {
+ dnd_debug1 (" our own widget");
+ dnd->ready_to_drop = (*dnd->widget_apply_position) (dnd, over_window, from,
+ action, dnd->x, dnd->y, xevent.xmotion.time, typelist,
+ &dnd->want_position, &dnd->supported_action, &dnd->desired_type, &dnd->rectangle);
+ /* if not ready, keep sending positions, this check is repeated below for XdndStatus from external widgets */
+ if (!dnd->ready_to_drop) {
+ dnd->want_position = 1;
+ dnd->rectangle.width = dnd->rectangle.height = 0;
+ }
+ dnd_debug2 (" return action=%ld", dnd->supported_action);
+ } else {
+#if XDND_VERSION < 3
+ dnd_debug3 (" not our own widget - sending XdndPosition to %ld, action %ld", over_window, action);
+ xdnd_send_position (dnd, over_window, from, action, dnd->x, dnd->y, xevent.xmotion.time);
+#else
+ dnd_debug3 (" not our own widget - sending XdndPosition to %ld, action %ld", dnd->dropper_toplevel, action);
+ xdnd_send_position (dnd, dnd->dropper_toplevel, from, action, dnd->x, dnd->y, xevent.xmotion.time);
+#endif
+ }
+ } else if (dnd->want_position) {
+ dnd_debug1 (" inside rectangle");
+ } else {
+ dnd_debug1 (" doesn't want position");
+ }
+ }
+ }
+ last_window = xevent.xmotion.subwindow;
+ break;
+ case ClientMessage:
+ dnd_debug1 ("ClientMessage recieved");
+ if (xevent.xclient.message_type == dnd->XdndStatus && !dnd->internal_drag) {
+ dnd_debug1 (" XdndStatus recieved");
+ if (dnd->stage == XDND_DRAG_STAGE_ENTERED
+#if XDND_VERSION < 3
+ && XDND_STATUS_TARGET_WIN (&xevent) == dnd->dropper_window
+#endif
+ ) {
+ dnd_debug1 (" XdndStatus stage correct, dropper window correct");
+ dnd->want_position = XDND_STATUS_WANT_POSITION (&xevent);
+ dnd->ready_to_drop = XDND_STATUS_WILL_ACCEPT (&xevent);
+ dnd->rectangle.x = XDND_STATUS_RECT_X (&xevent);
+ dnd->rectangle.y = XDND_STATUS_RECT_Y (&xevent);
+ dnd->rectangle.width = XDND_STATUS_RECT_WIDTH (&xevent);
+ dnd->rectangle.height = XDND_STATUS_RECT_HEIGHT (&xevent);
+ dnd->supported_action = dnd->XdndActionCopy;
+ if (dnd_version_at_least (dnd->dragging_version, 2))
+ dnd->supported_action = XDND_STATUS_ACTION (&xevent);
+ dnd_debug3 (" return action=%ld, ready=%d", dnd->supported_action, dnd->ready_to_drop);
+ /* if not ready, keep sending positions, this check is repeated above for internal widgets */
+ if (!dnd->ready_to_drop) {
+ dnd->want_position = 1;
+ dnd->rectangle.width = dnd->rectangle.height = 0;
+ }
+ dnd_debug3 (" rectangle = (x=%d, y=%d, ", dnd->rectangle.x, dnd->rectangle.y);
+ dnd_debug4 ("w=%d, h=%d), want_position=%d\n", dnd->rectangle.width, dnd->rectangle.height, dnd->want_position);
+ }
+#if XDND_VERSION < 3
+ else if (XDND_STATUS_TARGET_WIN (&xevent) != dnd->dropper_window) {
+ dnd_debug3 (" XdndStatus XDND_STATUS_TARGET_WIN (&xevent) = %ld, dnd->dropper_window = %ld", XDND_STATUS_TARGET_WIN (&xevent), dnd->dropper_window);
+ }
+#endif
+ else {
+ dnd_debug2 (" XdndStatus stage incorrect dnd->stage = %d", dnd->stage);
+ }
+ }
+ break;
+ case SelectionRequest:{
+/* the target widget MAY request data, so wait for SelectionRequest */
+ int length = 0;
+ unsigned char *data = 0;
+ dnd_debug1 ("SelectionRequest - getting widget data");
+
+ (*dnd->widget_get_data) (dnd, from, &data, &length, xevent.xselectionrequest.target);
+ if (data) {
+ dnd_debug1 (" sending selection");
+ xdnd_selection_send (dnd, &xevent.xselectionrequest, data, length);
+ xdnd_xfree (data);
+ }
+ }
+ break;
+ }
+ }
+
+ if (dnd->ready_to_drop) {
+ Time time;
+ dnd_debug1 ("ready_to_drop - sending XdndDrop");
+ time = xevent.xbutton.time;
+ if (dnd->internal_drag) {
+/* we are dealing with our own widget, no need to send drop events, just put the data straight */
+ int length = 0;
+ unsigned char *data = 0;
+ if (dnd->widget_insert_drop) {
+ (*dnd->widget_get_data) (dnd, from, &data, &length, dnd->desired_type);
+ if (data) {
+ if (!(*dnd->widget_insert_drop) (dnd, data, length, 0, dnd->dropper_window, from, dnd->desired_type)) {
+ result = dnd->supported_action; /* success - so return action to caller */
+ dnd_debug1 (" inserted data into widget - success");
+ } else {
+ dnd_debug1 (" inserted data into widget - failed");
+ }
+ xdnd_xfree (data);
+ } else {
+ dnd_debug1 (" got data from widget, but data is null");
+ }
+ }
+ } else {
+ xdnd_set_selection_owner (dnd, from, dnd->desired_type, time);
+#if XDND_VERSION < 3
+ xdnd_send_drop (dnd, dnd->dropper_window, from, time);
+#else
+ xdnd_send_drop (dnd, dnd->dropper_toplevel, from, time);
+#endif
+ }
+ if (!dnd->internal_drag)
+ for (;;) {
+ XAllowEvents (dnd->display, SyncPointer, CurrentTime);
+ XNextEvent (dnd->display, &xevent);
+ if (xevent.type == ClientMessage && xevent.xclient.message_type == dnd->XdndFinished) {
+ dnd_debug1 ("XdndFinished");
+#if XDND_VERSION < 3
+ if (XDND_FINISHED_TARGET_WIN (&xevent) == dnd->dropper_window) {
+#endif
+ dnd_debug2 (" source correct - exiting event loop, action=%ld", dnd->supported_action);
+ result = dnd->supported_action; /* success - so return action to caller */
+ break;
+#if XDND_VERSION < 3
+ }
+#endif
+ } else if (xevent.type == Expose) {
+ if (dnd->handle_expose_events)
+ (*dnd->handle_expose_events) (dnd, &xevent);
+ } else if (xevent.type == MotionNotify) {
+ if (xevent.xmotion.time > time + (dnd->time_out ? dnd->time_out * 1000 : 10000)) { /* allow a ten second timeout as default */
+ dnd_debug1 ("timeout - exiting event loop");
+ break;
+ }
+ } else if (xevent.type == SelectionRequest && xevent.xselectionrequest.selection == dnd->XdndSelection) {
+/* the target widget is going to request data, so check for SelectionRequest events */
+ int length = 0;
+ unsigned char *data = 0;
+
+ dnd_debug1 ("SelectionRequest - getting widget data");
+ (*dnd->widget_get_data) (dnd, from, &data, &length, xevent.xselectionrequest.target);
+ if (data) {
+ dnd_debug1 (" sending selection");
+ xdnd_selection_send (dnd, &xevent.xselectionrequest, data, length);
+ xdnd_xfree (data);
+ }
+/* don't wait for a XdndFinished event */
+ if (!dnd_version_at_least (dnd->dragging_version, 2))
+ break;
+ }
+ }
+ } else {
+ dnd_debug1 ("not ready_to_drop - ungrabbing pointer");
+ }
+ XUngrabPointer (dnd->display, CurrentTime);
+ xdnd_reset (dnd);
+ return result;
+}
+
+/* returns non-zero if event is handled */
+int xdnd_handle_drop_events (DndClass * dnd, XEvent * xevent)
+{
+ int result = 0;
+ if (xevent->type == SelectionNotify) {
+ dnd_debug1 ("got SelectionNotify");
+ if (xevent->xselection.property == dnd->Xdnd_NON_PROTOCOL_ATOM && dnd->stage == XDND_DROP_STAGE_CONVERTING) {
+ int error;
+ dnd_debug1 (" property is Xdnd_NON_PROTOCOL_ATOM - getting selection");
+ error = xdnd_get_selection (dnd, dnd->dragger_window, xevent->xselection.property, xevent->xany.window);
+/* error is not actually used, i think future versions of the protocol maybe should return
+ an error status to the calling window with the XdndFinished client message */
+ if (dnd_version_at_least (dnd->dragging_version, 2)) {
+#if XDND_VERSION >= 3
+ xdnd_send_finished (dnd, dnd->dragger_window, dnd->dropper_toplevel, error);
+#else
+ xdnd_send_finished (dnd, dnd->dragger_window, dnd->dropper_window, error);
+#endif
+ dnd_debug1 (" sending finished");
+ }
+ xdnd_xfree (dnd->dragger_typelist);
+ xdnd_reset (dnd);
+ dnd->stage = XDND_DROP_STAGE_IDLE;
+ result = 1;
+ } else {
+ dnd_debug1 (" property is not Xdnd_NON_PROTOCOL_ATOM - ignoring");
+ }
+ } else if (xevent->type == ClientMessage) {
+ dnd_debug2 ("got ClientMessage to xevent->xany.window = %ld", xevent->xany.window);
+ if (xevent->xclient.message_type == dnd->XdndEnter) {
+ dnd_debug2 (" message_type is XdndEnter, version = %ld", XDND_ENTER_VERSION (xevent));
+#if XDND_VERSION >= 3
+ if (XDND_ENTER_VERSION (xevent) < 3)
+ return 0;
+#endif
+ xdnd_reset (dnd);
+ dnd->dragger_window = XDND_ENTER_SOURCE_WIN (xevent);
+#if XDND_VERSION >= 3
+ dnd->dropper_toplevel = xevent->xany.window;
+ dnd->dropper_window = 0; /* enter goes to the top level window only,
+ so we don't really know what the
+ sub window is yet */
+#else
+ dnd->dropper_window = xevent->xany.window;
+#endif
+ xdnd_xfree (dnd->dragger_typelist);
+ if (XDND_ENTER_THREE_TYPES (xevent)) {
+ dnd_debug1 (" three types only");
+ xdnd_get_three_types (dnd, xevent, &dnd->dragger_typelist);
+ } else {
+ dnd_debug1 (" more than three types - getting list");
+ xdnd_get_type_list (dnd, dnd->dragger_window, &dnd->dragger_typelist);
+ }
+ if (dnd->dragger_typelist)
+ dnd->stage = XDND_DROP_STAGE_ENTERED;
+ else
+ dnd_debug1 (" typelist returned as zero!");
+ dnd->dragging_version = XDND_ENTER_VERSION (xevent);
+ result = 1;
+ } else if (xevent->xclient.message_type == dnd->XdndLeave) {
+#if XDND_VERSION >= 3
+ if (xevent->xany.window == dnd->dropper_toplevel && dnd->dropper_window)
+ xevent->xany.window = dnd->dropper_window;
+#endif
+ dnd_debug1 (" message_type is XdndLeave");
+ if (dnd->dragger_window == XDND_LEAVE_SOURCE_WIN (xevent) && dnd->stage == XDND_DROP_STAGE_ENTERED) {
+ dnd_debug1 (" leaving");
+ if (dnd->widget_apply_leave)
+ (*dnd->widget_apply_leave) (dnd, xevent->xany.window);
+ dnd->stage = XDND_DROP_STAGE_IDLE;
+ xdnd_xfree (dnd->dragger_typelist);
+ result = 1;
+ dnd->dropper_toplevel = dnd->dropper_window = 0;
+ } else {
+ dnd_debug1 (" wrong stage or from wrong window");
+ }
+ } else if (xevent->xclient.message_type == dnd->XdndPosition) {
+ dnd_debug2 (" message_type is XdndPosition to %ld", xevent->xany.window);
+ if (dnd->dragger_window == XDND_POSITION_SOURCE_WIN (xevent) && dnd->stage == XDND_DROP_STAGE_ENTERED) {
+ int want_position;
+ Atom action;
+ XRectangle rectangle;
+ Window last_window;
+ last_window = dnd->dropper_window;
+#if XDND_VERSION >= 3
+/* version 3 gives us the top-level window only. WE have to find the child that the pointer is over: */
+ if (1 || xevent->xany.window != dnd->dropper_toplevel || !dnd->dropper_window) {
+ Window parent, child, new_child = 0;
+ dnd->dropper_toplevel = xevent->xany.window;
+ parent = dnd->root_window;
+ child = dnd->dropper_toplevel;
+ for (;;) {
+ int xd, yd;
+ new_child = 0;
+ if (!XTranslateCoordinates (dnd->display, parent, child,
+ XDND_POSITION_ROOT_X (xevent), XDND_POSITION_ROOT_Y (xevent),
+ &xd, &yd, &new_child))
+ break;
+ if (!new_child)
+ break;
+ child = new_child;
+ }
+ dnd->dropper_window = xevent->xany.window = child;
+ dnd_debug2 (" child window translates to %ld", dnd->dropper_window);
+ } else if (xevent->xany.window == dnd->dropper_toplevel && dnd->dropper_window) {
+ xevent->xany.window = dnd->dropper_window;
+ dnd_debug2 (" child window previously found: %ld", dnd->dropper_window);
+ }
+#endif
+ action = dnd->XdndActionCopy;
+ dnd->supported_action = dnd->XdndActionCopy;
+ dnd->x = XDND_POSITION_ROOT_X (xevent);
+ dnd->y = XDND_POSITION_ROOT_Y (xevent);
+ dnd->time = CurrentTime;
+ if (dnd_version_at_least (dnd->dragging_version, 1))
+ dnd->time = XDND_POSITION_TIME (xevent);
+ if (dnd_version_at_least (dnd->dragging_version, 1))
+ action = XDND_POSITION_ACTION (xevent);
+#if XDND_VERSION >= 3
+ if (last_window && last_window != xevent->xany.window)
+ if (dnd->widget_apply_leave)
+ (*dnd->widget_apply_leave) (dnd, last_window);
+#endif
+ dnd->will_accept = (*dnd->widget_apply_position) (dnd, xevent->xany.window, dnd->dragger_window,
+ action, dnd->x, dnd->y, dnd->time, dnd->dragger_typelist,
+ &want_position, &dnd->supported_action, &dnd->desired_type, &rectangle);
+ dnd_debug2 (" will accept = %d", dnd->will_accept);
+#if XDND_VERSION >= 3
+ dnd_debug2 (" sending status of %ld", dnd->dropper_toplevel);
+ xdnd_send_status (dnd, dnd->dragger_window, dnd->dropper_toplevel, dnd->will_accept,
+ want_position, rectangle.x, rectangle.y, rectangle.width, rectangle.height, dnd->supported_action);
+#else
+ dnd_debug2 (" sending status of %ld", xevent->xany.window);
+ xdnd_send_status (dnd, dnd->dragger_window, xevent->xany.window, dnd->will_accept,
+ want_position, rectangle.x, rectangle.y, rectangle.width, rectangle.height, dnd->supported_action);
+#endif
+ result = 1;
+ } else {
+ dnd_debug1 (" wrong stage or from wrong window");
+ }
+ } else if (xevent->xclient.message_type == dnd->XdndDrop) {
+#if XDND_VERSION >= 3
+ if (xevent->xany.window == dnd->dropper_toplevel && dnd->dropper_window)
+ xevent->xany.window = dnd->dropper_window;
+#endif
+ dnd_debug1 (" message_type is XdndDrop");
+ if (dnd->dragger_window == XDND_DROP_SOURCE_WIN (xevent) && dnd->stage == XDND_DROP_STAGE_ENTERED) {
+ dnd->time = CurrentTime;
+ if (dnd_version_at_least (dnd->dragging_version, 1))
+ dnd->time = XDND_DROP_TIME (xevent);
+ if (dnd->will_accept) {
+ dnd_debug1 (" will_accept is true - converting selectiong");
+ dnd_debug2 (" my window is %ld", dnd->dropper_window);
+ dnd_debug2 (" source window is %ld", dnd->dragger_window);
+ xdnd_convert_selection (dnd, dnd->dragger_window, dnd->dropper_window, dnd->desired_type);
+ dnd->stage = XDND_DROP_STAGE_CONVERTING;
+ } else {
+ dnd_debug1 (" will_accept is false - sending finished");
+ if (dnd_version_at_least (dnd->dragging_version, 2)) {
+#if XDND_VERSION >= 3
+ xdnd_send_finished (dnd, dnd->dragger_window, dnd->dropper_toplevel, 1);
+#else
+ xdnd_send_finished (dnd, dnd->dragger_window, xevent->xany.window, 1);
+#endif
+ }
+ xdnd_xfree (dnd->dragger_typelist);
+ xdnd_reset (dnd);
+ dnd->stage = XDND_DROP_STAGE_IDLE;
+ }
+ result = 1;
+ } else {
+ dnd_debug1 (" wrong stage or from wrong window");
+ }
+ }
+ }
+ return result;
+}
+
+/*
+ Following here is a sample implementation: Suppose we want a window
+ to recieve drops, but do not want to be concerned with setting up all
+ the DndClass methods. All we then do is call xdnd_get_drop() whenever a
+ ClientMessage is recieved. If the message has nothing to do with XDND,
+ xdnd_get_drop quickly returns 0. If it is a XdndEnter message, then
+ xdnd_get_drop enters its own XNextEvent loop and handles all XDND
+ protocol messages internally, returning the action requested.
+
+ You should pass a desired typelist and actionlist to xdnd_get_type.
+ These must be null terminated arrays of atoms, or a null pointer
+ if you would like any action or type to be accepted. If typelist
+ is null then the first type of the dragging widgets typelist will
+ be the one used. If actionlist is null, then only XdndActionCopy will
+ be accepted.
+
+ The result is stored in *data, length, type, x and y.
+ *data must be free'd.
+ */
+
+struct xdnd_get_drop_info {
+ unsigned char *drop_data;
+ int drop_data_length;
+ int x, y;
+ Atom return_type;
+ Atom return_action;
+ Atom *typelist;
+ Atom *actionlist;
+};
+
+static int widget_insert_drop (DndClass * dnd, unsigned char *data, int length, int remaining, Window into, Window from, Atom type)
+{
+ struct xdnd_get_drop_info *i;
+ i = (struct xdnd_get_drop_info *) dnd->user_hook1;
+ if (!i->drop_data) {
+ i->drop_data = malloc (length);
+ if (!i->drop_data)
+ return 1;
+ memcpy (i->drop_data, data, length);
+ i->drop_data_length = length;
+ } else {
+ unsigned char *t;
+ t = malloc (i->drop_data_length + length);
+ if (!t) {
+ free (i->drop_data);
+ i->drop_data = 0;
+ return 1;
+ }
+ memcpy (t, i->drop_data, i->drop_data_length);
+ memcpy (t + i->drop_data_length, data, length);
+ free (i->drop_data);
+ i->drop_data = t;
+ i->drop_data_length += length;
+ }
+ return 0;
+}
+
+static int widget_apply_position (DndClass * dnd, Window widgets_window, Window from,
+ Atom action, int x, int y, Time t, Atom * typelist,
+ int *want_position, Atom * supported_action_return, Atom * desired_type,
+ XRectangle * rectangle)
+{
+ int i, j;
+ struct xdnd_get_drop_info *info;
+ Atom *dropper_typelist, supported_type = 0;
+ Atom *supported_actions, supported_action = 0;
+
+ info = (struct xdnd_get_drop_info *) dnd->user_hook1;
+ dropper_typelist = info->typelist;
+ supported_actions = info->actionlist;
+
+ if (dropper_typelist) {
+/* find a correlation: */
+ for (j = 0; dropper_typelist[j]; j++) {
+ for (i = 0; typelist[i]; i++) {
+ if (typelist[i] == dropper_typelist[j]) {
+ supported_type = typelist[i];
+ break;
+ }
+ }
+ if (supported_type)
+ break;
+ }
+ } else {
+/* user did not specify, so return first type */
+ supported_type = typelist[0];
+ }
+/* not supported, so return false */
+ if (!supported_type)
+ return 0;
+
+ if (supported_actions) {
+ for (j = 0; supported_actions[j]; j++) {
+ if (action == supported_actions[j]) {
+ supported_action = action;
+ break;
+ }
+ }
+ } else {
+/* user did not specify */
+ if (action == dnd->XdndActionCopy)
+ supported_action = action;
+ }
+ if (!supported_action)
+ return 0;
+
+ *want_position = 1;
+ rectangle->x = rectangle->y = 0;
+ rectangle->width = rectangle->height = 0;
+
+ info->return_action = *supported_action_return = supported_action;
+ info->return_type = *desired_type = supported_type;
+ info->x = x;
+ info->y = y;
+
+ return 1;
+}
+
+Atom xdnd_get_drop (Display * display, XEvent * xevent, Atom * typelist, Atom * actionlist,
+ unsigned char **data, int *length, Atom * type, int *x, int *y)
+{
+ Atom action = 0;
+ static int initialised = 0;
+ static DndClass dnd;
+ if (!initialised) {
+ xdnd_init (&dnd, display);
+ initialised = 1;
+ }
+ if (xevent->type != ClientMessage || xevent->xclient.message_type != dnd.XdndEnter) {
+ return 0;
+ } else {
+ struct xdnd_get_drop_info i;
+
+/* setup user structure */
+ memset (&i, 0, sizeof (i));
+ i.actionlist = actionlist;
+ i.typelist = typelist;
+ dnd.user_hook1 = &i;
+
+/* setup methods */
+ dnd.widget_insert_drop = widget_insert_drop;
+ dnd.widget_apply_position = widget_apply_position;
+
+/* main loop */
+ for (;;) {
+ xdnd_handle_drop_events (&dnd, xevent);
+ if (dnd.stage == XDND_DROP_STAGE_IDLE)
+ break;
+ XNextEvent (dnd.display, xevent);
+ }
+
+/* return results */
+ if (i.drop_data) {
+ *length = i.drop_data_length;
+ *data = i.drop_data;
+ action = i.return_action;
+ *type = i.return_type;
+ *x = i.x;
+ *y = i.y;
+ }
+ }
+ return action;
+}
+
+
diff --git a/extern/xdnd/xdnd.h b/extern/xdnd/xdnd.h
new file mode 100644
index 00000000000..c903b51c8d0
--- /dev/null
+++ b/extern/xdnd/xdnd.h
@@ -0,0 +1,221 @@
+/* xdnd.c, xdnd.h - C program library for handling the Xdnd protocol
+ Copyright (C) 1996-2000 Paul Sheer
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+ */
+
+#ifndef _X_DND_H
+#define _X_DND_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* you can set this to either 2 (which support 0 and 1 as well) or 3 */
+/* #define XDND_VERSION 2 */
+#define XDND_VERSION 3
+
+
+/* XdndEnter */
+#define XDND_THREE 3
+#define XDND_ENTER_SOURCE_WIN(e) ((e)->xclient.data.l[0])
+#define XDND_ENTER_THREE_TYPES(e) (((e)->xclient.data.l[1] & 0x1UL) == 0)
+#define XDND_ENTER_THREE_TYPES_SET(e,b) (e)->xclient.data.l[1] = ((e)->xclient.data.l[1] & ~0x1UL) | (((b) == 0) ? 0 : 0x1UL)
+#define XDND_ENTER_VERSION(e) ((e)->xclient.data.l[1] >> 24)
+#define XDND_ENTER_VERSION_SET(e,v) (e)->xclient.data.l[1] = ((e)->xclient.data.l[1] & ~(0xFF << 24)) | ((v) << 24)
+#define XDND_ENTER_TYPE(e,i) ((e)->xclient.data.l[2 + i]) /* i => (0, 1, 2) */
+
+/* XdndPosition */
+#define XDND_POSITION_SOURCE_WIN(e) ((e)->xclient.data.l[0])
+#define XDND_POSITION_ROOT_X(e) ((e)->xclient.data.l[2] >> 16)
+#define XDND_POSITION_ROOT_Y(e) ((e)->xclient.data.l[2] & 0xFFFFUL)
+#define XDND_POSITION_ROOT_SET(e,x,y) (e)->xclient.data.l[2] = ((x) << 16) | ((y) & 0xFFFFUL)
+#define XDND_POSITION_TIME(e) ((e)->xclient.data.l[3])
+#define XDND_POSITION_ACTION(e) ((e)->xclient.data.l[4])
+
+/* XdndStatus */
+#define XDND_STATUS_TARGET_WIN(e) ((e)->xclient.data.l[0])
+#define XDND_STATUS_WILL_ACCEPT(e) ((e)->xclient.data.l[1] & 0x1L)
+#define XDND_STATUS_WILL_ACCEPT_SET(e,b) (e)->xclient.data.l[1] = ((e)->xclient.data.l[1] & ~0x1UL) | (((b) == 0) ? 0 : 0x1UL)
+#define XDND_STATUS_WANT_POSITION(e) ((e)->xclient.data.l[1] & 0x2UL)
+#define XDND_STATUS_WANT_POSITION_SET(e,b) (e)->xclient.data.l[1] = ((e)->xclient.data.l[1] & ~0x2UL) | (((b) == 0) ? 0 : 0x2UL)
+#define XDND_STATUS_RECT_X(e) ((e)->xclient.data.l[2] >> 16)
+#define XDND_STATUS_RECT_Y(e) ((e)->xclient.data.l[2] & 0xFFFFL)
+#define XDND_STATUS_RECT_WIDTH(e) ((e)->xclient.data.l[3] >> 16)
+#define XDND_STATUS_RECT_HEIGHT(e) ((e)->xclient.data.l[3] & 0xFFFFL)
+#define XDND_STATUS_RECT_SET(e,x,y,w,h) {(e)->xclient.data.l[2] = ((x) << 16) | ((y) & 0xFFFFUL); (e)->xclient.data.l[3] = ((w) << 16) | ((h) & 0xFFFFUL); }
+#define XDND_STATUS_ACTION(e) ((e)->xclient.data.l[4])
+
+/* XdndLeave */
+#define XDND_LEAVE_SOURCE_WIN(e) ((e)->xclient.data.l[0])
+
+/* XdndDrop */
+#define XDND_DROP_SOURCE_WIN(e) ((e)->xclient.data.l[0])
+#define XDND_DROP_TIME(e) ((e)->xclient.data.l[2])
+
+/* XdndFinished */
+#define XDND_FINISHED_TARGET_WIN(e) ((e)->xclient.data.l[0])
+
+struct _DndCursor {
+ int width, height;
+ int x, y;
+ unsigned char *image_data, *mask_data;
+ char *_action;
+ Pixmap image_pixmap, mask_pixmap;
+ Cursor cursor;
+ Atom action;
+};
+
+typedef struct _DndCursor DndCursor;
+typedef struct _DndClass DndClass;
+
+struct _DndClass {
+/* insert chars sequentionally into the target widget, type will be the same as `desired_type'
+ returned from widget_apply_position. This may be called several times in succession
+ with sequention blocks of data. Must return non-zero on failure */
+ int (*widget_insert_drop) (DndClass * dnd, unsigned char *data, int length, int remaining, Window into, Window from, Atom type);
+
+/* In response to DELETE requests : FIXME - not yet used */
+ int (*widget_delete_selection) (DndClass * dnd, Window window, Window from);
+
+/* returns 1 if widget exists, zero otherwise. If this method is not
+ set then the code assumes that no widgets have support for recieving drops.
+ In this case none of the widget methods need be set. */
+ int (*widget_exists) (DndClass * dnd, Window window);
+
+/* must update the widgets border to its default appearance */
+ void (*widget_apply_leave) (DndClass * dnd, Window widgets_window);
+
+/* must update the widgets border to give the appearance of being able to recieve a drop,
+ plus return all data to pointers. As per the protocol, if the widget cannot
+ perform the action specified by `action' then it should return either XdndActionPrivate
+ or XdndActionCopy into supported_action (leaving 0 supported_action unchanged is equivalent
+ to XdndActionCopy). Returns 1 if ready to ok drop */
+ int (*widget_apply_position) (DndClass * dnd, Window widgets_window, Window from,
+ Atom action, int x, int y, Time t, Atom * typelist,
+ int *want_position, Atom * supported_action, Atom * desired_type,
+ XRectangle * rectangle);
+
+/* returns drag data of the specified type. This will be one of `typelist' given to xdnd_drag */
+ void (*widget_get_data) (DndClass * dnd, Window window, unsigned char **data, int *length, Atom type);
+
+/* this is called from with the main event loop if an expose event is recieved and is optional */
+ void (*handle_expose_events) (DndClass * dnd, XEvent * xevent);
+
+/* creates a chooser dialog if the action is XdndActionAsk. Returns non-zero on cancel */
+ int (*action_choose_dialog) (DndClass * dnd, char **descriptions, Atom * actions, Atom * result);
+
+#if 0 /* implemented internally */
+/* returns a widget that is dnd aware within a parent widget that lies under the point x, y */
+ Window (*widget_get_child_widget) (DndClass * dnd, Window parent, int x, int y);
+#endif
+
+ void *pad1[8];
+
+ DndCursor *cursors;
+
+ Display *display;
+
+ Atom XdndAware;
+ Atom XdndSelection;
+ Atom XdndEnter;
+ Atom XdndLeave;
+ Atom XdndPosition;
+ Atom XdndDrop;
+ Atom XdndFinished;
+ Atom XdndStatus;
+ Atom XdndActionCopy;
+ Atom XdndActionMove;
+ Atom XdndActionLink;
+ Atom XdndActionAsk;
+ Atom XdndActionPrivate;
+ Atom XdndTypeList;
+ Atom XdndActionList;
+ Atom XdndActionDescription;
+
+ Atom Xdnd_NON_PROTOCOL_ATOM;
+ Atom version;
+
+ Atom pad2[16];
+
+ Window root_window;
+
+#define XDND_DROP_STAGE_IDLE 0
+#define XDND_DRAG_STAGE_DRAGGING 1
+#define XDND_DRAG_STAGE_ENTERED 2
+#define XDND_DROP_STAGE_CONVERTING 3
+#define XDND_DROP_STAGE_ENTERED 4
+ int stage;
+ int dragging_version;
+ int internal_drag;
+ int want_position;
+ int ready_to_drop;
+ int will_accept;
+ XRectangle rectangle;
+ Window dropper_window, dragger_window;
+ Atom *dragger_typelist;
+ Atom desired_type;
+ Atom supported_action;
+ Time time;
+/* drop position from last XdndPosition */
+ int x, y;
+ int pad3[16];
+
+/* move euclidian pixels before considering this to be an actual drag */
+ float drag_threshold;
+
+/* block for only this many seconds on not receiving a XdndFinished from target, default : 10 */
+ int time_out;
+
+#define XDND_OPTION_NO_HYSTERESIS (1<<0)
+ int options;
+
+/* user hooks */
+ void *user_hook1;
+ void *user_hook2;
+ void *user_hook3;
+ Window dropper_toplevel;
+ void *pad4[15];
+};
+
+
+void xdnd_init (DndClass * dnd, Display * display);
+void xdnd_shut (DndClass * dnd);
+/* for nested widgets where parent and child receive drops of different
+types; then always pass typelist as null */
+void xdnd_set_dnd_aware (DndClass * dnd, Window window, Atom * typelist);
+int xdnd_is_dnd_aware (DndClass * dnd, Window window, int *version, Atom * typelist);
+void xdnd_set_type_list (DndClass * dnd, Window window, Atom * typelist);
+void xdnd_set_actions (DndClass * dnd, Window window, Atom * actions, char **descriptions);
+int xdnd_get_actions (DndClass * dnd, Window window, Atom ** actions, char ***descriptions);
+int xdnd_choose_action_dialog (DndClass * dnd, Atom * actions, char **descriptions, Atom * result);
+Atom xdnd_drag (DndClass * dnd, Window from, Atom action, Atom * typelist);
+
+/* Returns 1 if event is handled, This must be placed in the widget
+libraries main event loop and be called if the event type is
+ClientMessage or SelectionNotify */
+int xdnd_handle_drop_events (DndClass * dnd, XEvent * xevent);
+Atom xdnd_get_drop (Display * display, XEvent * xevent, Atom * typelist, Atom * actionlist,
+ unsigned char **data, int *length, Atom * type, int *x, int *y);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !_X_DND_H */
+
+
diff --git a/intern/audaspace/FX/AUD_AccumulatorFactory.h b/intern/audaspace/FX/AUD_AccumulatorFactory.h
index d49d8f71c05..ac73c5aa6ae 100644
--- a/intern/audaspace/FX/AUD_AccumulatorFactory.h
+++ b/intern/audaspace/FX/AUD_AccumulatorFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_ACCUMULATORFACTORY
-#define AUD_ACCUMULATORFACTORY
+#ifndef __AUD_ACCUMULATORFACTORY_H__
+#define __AUD_ACCUMULATORFACTORY_H__
#include "AUD_EffectFactory.h"
class AUD_CallbackIIRFilterReader;
@@ -66,4 +66,4 @@ public:
static sample_t accumulatorFilter(AUD_CallbackIIRFilterReader* reader, void* useless);
};
-#endif //AUD_ACCUMULATORFACTORY
+#endif //__AUD_ACCUMULATORFACTORY_H__
diff --git a/intern/audaspace/FX/AUD_BaseIIRFilterReader.h b/intern/audaspace/FX/AUD_BaseIIRFilterReader.h
index 5b37f83ddee..43970c96a42 100644
--- a/intern/audaspace/FX/AUD_BaseIIRFilterReader.h
+++ b/intern/audaspace/FX/AUD_BaseIIRFilterReader.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_BASEIIRFILTERREADER
-#define AUD_BASEIIRFILTERREADER
+#ifndef __AUD_BASEIIRFILTERREADER_H__
+#define __AUD_BASEIIRFILTERREADER_H__
#include "AUD_EffectReader.h"
#include "AUD_Buffer.h"
@@ -132,4 +132,4 @@ public:
virtual void sampleRateChanged(AUD_SampleRate rate);
};
-#endif //AUD_BASEIIRFILTERREADER
+#endif //__AUD_BASEIIRFILTERREADER_H__
diff --git a/intern/audaspace/FX/AUD_ButterworthFactory.h b/intern/audaspace/FX/AUD_ButterworthFactory.h
index aa302e7e82a..d3606270154 100644
--- a/intern/audaspace/FX/AUD_ButterworthFactory.h
+++ b/intern/audaspace/FX/AUD_ButterworthFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_BUTTERWORTHFACTORY
-#define AUD_BUTTERWORTHFACTORY
+#ifndef __AUD_BUTTERWORTHFACTORY_H__
+#define __AUD_BUTTERWORTHFACTORY_H__
#include "AUD_DynamicIIRFilterFactory.h"
@@ -60,4 +60,4 @@ public:
std::vector<float>& a);
};
-#endif //AUD_BUTTERWORTHFACTORY
+#endif //__AUD_BUTTERWORTHFACTORY_H__
diff --git a/intern/audaspace/FX/AUD_CallbackIIRFilterReader.h b/intern/audaspace/FX/AUD_CallbackIIRFilterReader.h
index 787fd49b600..7ced73844c9 100644
--- a/intern/audaspace/FX/AUD_CallbackIIRFilterReader.h
+++ b/intern/audaspace/FX/AUD_CallbackIIRFilterReader.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_CALLBACKIIRFILTERREADER
-#define AUD_CALLBACKIIRFILTERREADER
+#ifndef __AUD_CALLBACKIIRFILTERREADER_H__
+#define __AUD_CALLBACKIIRFILTERREADER_H__
#include "AUD_BaseIIRFilterReader.h"
#include "AUD_Buffer.h"
@@ -84,4 +84,4 @@ public:
virtual sample_t filter();
};
-#endif //AUD_CALLBACKIIRFILTERREADER
+#endif //__AUD_CALLBACKIIRFILTERREADER_H__
diff --git a/intern/audaspace/FX/AUD_DelayFactory.h b/intern/audaspace/FX/AUD_DelayFactory.h
index c1b114638f6..26855a05d70 100644
--- a/intern/audaspace/FX/AUD_DelayFactory.h
+++ b/intern/audaspace/FX/AUD_DelayFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_DELAYFACTORY
-#define AUD_DELAYFACTORY
+#ifndef __AUD_DELAYFACTORY_H__
+#define __AUD_DELAYFACTORY_H__
#include "AUD_EffectFactory.h"
@@ -63,4 +63,4 @@ public:
virtual AUD_Reference<AUD_IReader> createReader();
};
-#endif //AUD_DELAYFACTORY
+#endif //__AUD_DELAYFACTORY_H__
diff --git a/intern/audaspace/FX/AUD_DelayReader.h b/intern/audaspace/FX/AUD_DelayReader.h
index b23bb1438d1..9d9b6619470 100644
--- a/intern/audaspace/FX/AUD_DelayReader.h
+++ b/intern/audaspace/FX/AUD_DelayReader.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_DELAYREADER
-#define AUD_DELAYREADER
+#ifndef __AUD_DELAYREADER_H__
+#define __AUD_DELAYREADER_H__
#include "AUD_EffectReader.h"
#include "AUD_Buffer.h"
@@ -67,4 +67,4 @@ public:
virtual void read(int& length, bool& eos, sample_t* buffer);
};
-#endif //AUD_DELAYREADER
+#endif //__AUD_DELAYREADER_H__
diff --git a/intern/audaspace/FX/AUD_DoubleFactory.h b/intern/audaspace/FX/AUD_DoubleFactory.h
index 990c605b2fb..e4d8fbfde8f 100644
--- a/intern/audaspace/FX/AUD_DoubleFactory.h
+++ b/intern/audaspace/FX/AUD_DoubleFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_DOUBLEFACTORY
-#define AUD_DOUBLEFACTORY
+#ifndef __AUD_DOUBLEFACTORY_H__
+#define __AUD_DOUBLEFACTORY_H__
#include "AUD_IFactory.h"
@@ -63,4 +63,4 @@ public:
virtual AUD_Reference<AUD_IReader> createReader();
};
-#endif //AUD_DOUBLEFACTORY
+#endif //__AUD_DOUBLEFACTORY_H__
diff --git a/intern/audaspace/FX/AUD_DoubleReader.h b/intern/audaspace/FX/AUD_DoubleReader.h
index 4c82d4f85ca..1489f4eb184 100644
--- a/intern/audaspace/FX/AUD_DoubleReader.h
+++ b/intern/audaspace/FX/AUD_DoubleReader.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_DOUBLEREADER
-#define AUD_DOUBLEREADER
+#ifndef __AUD_DOUBLEREADER_H__
+#define __AUD_DOUBLEREADER_H__
#include "AUD_IReader.h"
#include "AUD_Buffer.h"
@@ -80,4 +80,4 @@ public:
virtual void read(int& length, bool& eos, sample_t* buffer);
};
-#endif //AUD_DOUBLEREADER
+#endif //__AUD_DOUBLEREADER_H__
diff --git a/intern/audaspace/FX/AUD_DynamicIIRFilterFactory.h b/intern/audaspace/FX/AUD_DynamicIIRFilterFactory.h
index 2b63e275f0e..fef379f68b1 100644
--- a/intern/audaspace/FX/AUD_DynamicIIRFilterFactory.h
+++ b/intern/audaspace/FX/AUD_DynamicIIRFilterFactory.h
@@ -26,8 +26,8 @@
* \ingroup audfx
*/
-#ifndef AUD_DYNAMICIIRFILTERFACTORY
-#define AUD_DYNAMICIIRFILTERFACTORY
+#ifndef __AUD_DYNAMICIIRFILTERFACTORY_H__
+#define __AUD_DYNAMICIIRFILTERFACTORY_H__
#include "AUD_EffectFactory.h"
#include <vector>
@@ -60,4 +60,4 @@ public:
std::vector<float>& a)=0;
};
-#endif // AUD_DYNAMICIIRFILTERFACTORY
+#endif // __AUD_DYNAMICIIRFILTERFACTORY_H__
diff --git a/intern/audaspace/FX/AUD_DynamicIIRFilterReader.h b/intern/audaspace/FX/AUD_DynamicIIRFilterReader.h
index 843cf120011..8a53c15b18f 100644
--- a/intern/audaspace/FX/AUD_DynamicIIRFilterReader.h
+++ b/intern/audaspace/FX/AUD_DynamicIIRFilterReader.h
@@ -26,8 +26,8 @@
* \ingroup audfx
*/
-#ifndef AUD_DYNAMICIIRFILTERREADER
-#define AUD_DYNAMICIIRFILTERREADER
+#ifndef __AUD_DYNAMICIIRFILTERREADER_H__
+#define __AUD_DYNAMICIIRFILTERREADER_H__
#include "AUD_IIRFilterReader.h"
#include "AUD_DynamicIIRFilterFactory.h"
@@ -51,4 +51,4 @@ public:
virtual void sampleRateChanged(AUD_SampleRate rate);
};
-#endif // AUD_DYNAMICIIRFILTERREADER
+#endif // __AUD_DYNAMICIIRFILTERREADER_H__
diff --git a/intern/audaspace/FX/AUD_EffectFactory.h b/intern/audaspace/FX/AUD_EffectFactory.h
index 26d66634d7d..c8d26a1daa7 100644
--- a/intern/audaspace/FX/AUD_EffectFactory.h
+++ b/intern/audaspace/FX/AUD_EffectFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_EFFECTFACTORY
-#define AUD_EFFECTFACTORY
+#ifndef __AUD_EFFECTFACTORY_H__
+#define __AUD_EFFECTFACTORY_H__
#include "AUD_IFactory.h"
@@ -79,4 +79,4 @@ public:
AUD_Reference<AUD_IFactory> getFactory() const;
};
-#endif //AUD_EFFECTFACTORY
+#endif //__AUD_EFFECTFACTORY_H__
diff --git a/intern/audaspace/FX/AUD_EffectReader.h b/intern/audaspace/FX/AUD_EffectReader.h
index 707031c55ad..b089ec9a318 100644
--- a/intern/audaspace/FX/AUD_EffectReader.h
+++ b/intern/audaspace/FX/AUD_EffectReader.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_EFFECTREADER
-#define AUD_EFFECTREADER
+#ifndef __AUD_EFFECTREADER_H__
+#define __AUD_EFFECTREADER_H__
#include "AUD_IReader.h"
#include "AUD_Reference.h"
@@ -70,4 +70,4 @@ public:
virtual void read(int& length, bool& eos, sample_t* buffer);
};
-#endif //AUD_EFFECTREADER
+#endif //__AUD_EFFECTREADER_H__
diff --git a/intern/audaspace/FX/AUD_EnvelopeFactory.h b/intern/audaspace/FX/AUD_EnvelopeFactory.h
index 81038f15560..c8f3dc37cd2 100644
--- a/intern/audaspace/FX/AUD_EnvelopeFactory.h
+++ b/intern/audaspace/FX/AUD_EnvelopeFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_ENVELOPEFACTORY
-#define AUD_ENVELOPEFACTORY
+#ifndef __AUD_ENVELOPEFACTORY_H__
+#define __AUD_ENVELOPEFACTORY_H__
#include "AUD_EffectFactory.h"
class AUD_CallbackIIRFilterReader;
@@ -82,4 +82,4 @@ public:
static void endEnvelopeFilter(EnvelopeParameters* param);
};
-#endif //AUD_ENVELOPEFACTORY
+#endif //__AUD_ENVELOPEFACTORY_H__
diff --git a/intern/audaspace/FX/AUD_FaderFactory.h b/intern/audaspace/FX/AUD_FaderFactory.h
index 7a8954d9e48..8fcd4baa623 100644
--- a/intern/audaspace/FX/AUD_FaderFactory.h
+++ b/intern/audaspace/FX/AUD_FaderFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_FADERFACTORY
-#define AUD_FADERFACTORY
+#ifndef __AUD_FADERFACTORY_H__
+#define __AUD_FADERFACTORY_H__
#include "AUD_EffectFactory.h"
@@ -89,4 +89,4 @@ public:
virtual AUD_Reference<AUD_IReader> createReader();
};
-#endif //AUD_FADERFACTORY
+#endif //__AUD_FADERFACTORY_H__
diff --git a/intern/audaspace/FX/AUD_FaderReader.h b/intern/audaspace/FX/AUD_FaderReader.h
index 9cad72618ef..788e8539228 100644
--- a/intern/audaspace/FX/AUD_FaderReader.h
+++ b/intern/audaspace/FX/AUD_FaderReader.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_FADERREADER
-#define AUD_FADERREADER
+#ifndef __AUD_FADERREADER_H__
+#define __AUD_FADERREADER_H__
#include "AUD_EffectReader.h"
#include "AUD_Buffer.h"
@@ -73,4 +73,4 @@ public:
virtual void read(int& length, bool& eos, sample_t* buffer);
};
-#endif //AUD_FADERREADER
+#endif //__AUD_FADERREADER_H__
diff --git a/intern/audaspace/FX/AUD_HighpassFactory.h b/intern/audaspace/FX/AUD_HighpassFactory.h
index c9d8a0b017a..66aa8091234 100644
--- a/intern/audaspace/FX/AUD_HighpassFactory.h
+++ b/intern/audaspace/FX/AUD_HighpassFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_HIGHPASSFACTORY
-#define AUD_HIGHPASSFACTORY
+#ifndef __AUD_HIGHPASSFACTORY_H__
+#define __AUD_HIGHPASSFACTORY_H__
#include "AUD_DynamicIIRFilterFactory.h"
@@ -64,4 +64,4 @@ public:
virtual void recalculateCoefficients(AUD_SampleRate rate, std::vector<float> &b, std::vector<float> &a);
};
-#endif //AUD_HIGHPASSFACTORY
+#endif //__AUD_HIGHPASSFACTORY_H__
diff --git a/intern/audaspace/FX/AUD_IIRFilterFactory.h b/intern/audaspace/FX/AUD_IIRFilterFactory.h
index 0b98f34f748..43256a166aa 100644
--- a/intern/audaspace/FX/AUD_IIRFilterFactory.h
+++ b/intern/audaspace/FX/AUD_IIRFilterFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_IIRFILTERFACTORY
-#define AUD_IIRFILTERFACTORY
+#ifndef __AUD_IIRFILTERFACTORY_H__
+#define __AUD_IIRFILTERFACTORY_H__
#include "AUD_EffectFactory.h"
@@ -67,4 +67,4 @@ public:
virtual AUD_Reference<AUD_IReader> createReader();
};
-#endif //AUD_IIRFILTERFACTORY
+#endif //__AUD_IIRFILTERFACTORY_H__
diff --git a/intern/audaspace/FX/AUD_IIRFilterReader.h b/intern/audaspace/FX/AUD_IIRFilterReader.h
index 01a41385715..d9be52f2919 100644
--- a/intern/audaspace/FX/AUD_IIRFilterReader.h
+++ b/intern/audaspace/FX/AUD_IIRFilterReader.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_IIRFILTERREADER
-#define AUD_IIRFILTERREADER
+#ifndef __AUD_IIRFILTERREADER_H__
+#define __AUD_IIRFILTERREADER_H__
#include "AUD_BaseIIRFilterReader.h"
@@ -70,4 +70,4 @@ public:
const std::vector<float>& a);
};
-#endif //AUD_IIRFILTERREADER
+#endif //__AUD_IIRFILTERREADER_H__
diff --git a/intern/audaspace/FX/AUD_LimiterFactory.h b/intern/audaspace/FX/AUD_LimiterFactory.h
index 7128c6d7334..ddc8183ce7a 100644
--- a/intern/audaspace/FX/AUD_LimiterFactory.h
+++ b/intern/audaspace/FX/AUD_LimiterFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_LIMITERFACTORY
-#define AUD_LIMITERFACTORY
+#ifndef __AUD_LIMITERFACTORY_H__
+#define __AUD_LIMITERFACTORY_H__
#include "AUD_EffectFactory.h"
@@ -76,4 +76,4 @@ public:
virtual AUD_Reference<AUD_IReader> createReader();
};
-#endif //AUD_LIMITERFACTORY
+#endif //__AUD_LIMITERFACTORY_H__
diff --git a/intern/audaspace/FX/AUD_LimiterReader.h b/intern/audaspace/FX/AUD_LimiterReader.h
index 7a2c88e5144..34c4ea7c20e 100644
--- a/intern/audaspace/FX/AUD_LimiterReader.h
+++ b/intern/audaspace/FX/AUD_LimiterReader.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_LIMITERREADER
-#define AUD_LIMITERREADER
+#ifndef __AUD_LIMITERREADER_H__
+#define __AUD_LIMITERREADER_H__
#include "AUD_EffectReader.h"
@@ -68,4 +68,4 @@ public:
virtual void read(int& length, bool& eos, sample_t* buffer);
};
-#endif //AUD_LIMITERREADER
+#endif //__AUD_LIMITERREADER_H__
diff --git a/intern/audaspace/FX/AUD_LoopFactory.h b/intern/audaspace/FX/AUD_LoopFactory.h
index 7d794f313fb..754b780bd99 100644
--- a/intern/audaspace/FX/AUD_LoopFactory.h
+++ b/intern/audaspace/FX/AUD_LoopFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_LOOPFACTORY
-#define AUD_LOOPFACTORY
+#ifndef __AUD_LOOPFACTORY_H__
+#define __AUD_LOOPFACTORY_H__
#include "AUD_EffectFactory.h"
@@ -65,4 +65,4 @@ public:
virtual AUD_Reference<AUD_IReader> createReader();
};
-#endif //AUD_LOOPFACTORY
+#endif //__AUD_LOOPFACTORY_H__
diff --git a/intern/audaspace/FX/AUD_LoopReader.h b/intern/audaspace/FX/AUD_LoopReader.h
index b062a1781a4..fd2dd71d78f 100644
--- a/intern/audaspace/FX/AUD_LoopReader.h
+++ b/intern/audaspace/FX/AUD_LoopReader.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_LOOPREADER
-#define AUD_LOOPREADER
+#ifndef __AUD_LOOPREADER_H__
+#define __AUD_LOOPREADER_H__
#include "AUD_EffectReader.h"
#include "AUD_Buffer.h"
@@ -69,4 +69,4 @@ public:
virtual void read(int& length, bool& eos, sample_t* buffer);
};
-#endif //AUD_LOOPREADER
+#endif //__AUD_LOOPREADER_H__
diff --git a/intern/audaspace/FX/AUD_LowpassFactory.h b/intern/audaspace/FX/AUD_LowpassFactory.h
index 90d6ac5c2d1..7e98720a2db 100644
--- a/intern/audaspace/FX/AUD_LowpassFactory.h
+++ b/intern/audaspace/FX/AUD_LowpassFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_LOWPASSFACTORY
-#define AUD_LOWPASSFACTORY
+#ifndef __AUD_LOWPASSFACTORY_H__
+#define __AUD_LOWPASSFACTORY_H__
#include "AUD_DynamicIIRFilterFactory.h"
@@ -64,4 +64,4 @@ public:
virtual void recalculateCoefficients(AUD_SampleRate rate, std::vector<float> &b, std::vector<float> &a);
};
-#endif //AUD_LOWPASSFACTORY
+#endif //__AUD_LOWPASSFACTORY_H__
diff --git a/intern/audaspace/FX/AUD_PingPongFactory.h b/intern/audaspace/FX/AUD_PingPongFactory.h
index 4a5f3fcf431..f25624a7c5e 100644
--- a/intern/audaspace/FX/AUD_PingPongFactory.h
+++ b/intern/audaspace/FX/AUD_PingPongFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_PINGPONGFACTORY
-#define AUD_PINGPONGFACTORY
+#ifndef __AUD_PINGPONGFACTORY_H__
+#define __AUD_PINGPONGFACTORY_H__
#include "AUD_EffectFactory.h"
@@ -53,4 +53,4 @@ public:
virtual AUD_Reference<AUD_IReader> createReader();
};
-#endif //AUD_PINGPONGFACTORY
+#endif //__AUD_PINGPONGFACTORY_H__
diff --git a/intern/audaspace/FX/AUD_PitchFactory.h b/intern/audaspace/FX/AUD_PitchFactory.h
index c311a9e3446..5ad37ad1a6c 100644
--- a/intern/audaspace/FX/AUD_PitchFactory.h
+++ b/intern/audaspace/FX/AUD_PitchFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_PITCHFACTORY
-#define AUD_PITCHFACTORY
+#ifndef __AUD_PITCHFACTORY_H__
+#define __AUD_PITCHFACTORY_H__
#include "AUD_EffectFactory.h"
@@ -58,4 +58,4 @@ public:
virtual AUD_Reference<AUD_IReader> createReader();
};
-#endif //AUD_PITCHFACTORY
+#endif //__AUD_PITCHFACTORY_H__
diff --git a/intern/audaspace/FX/AUD_PitchReader.h b/intern/audaspace/FX/AUD_PitchReader.h
index dcd23b747fa..3185bfdf30b 100644
--- a/intern/audaspace/FX/AUD_PitchReader.h
+++ b/intern/audaspace/FX/AUD_PitchReader.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_PITCHREADER
-#define AUD_PITCHREADER
+#ifndef __AUD_PITCHREADER_H__
+#define __AUD_PITCHREADER_H__
#include "AUD_EffectReader.h"
@@ -70,4 +70,4 @@ public:
void setPitch(float pitch);
};
-#endif //AUD_PITCHREADER
+#endif //__AUD_PITCHREADER_H__
diff --git a/intern/audaspace/FX/AUD_RectifyFactory.h b/intern/audaspace/FX/AUD_RectifyFactory.h
index 2e3dbd17917..5ad41d424d9 100644
--- a/intern/audaspace/FX/AUD_RectifyFactory.h
+++ b/intern/audaspace/FX/AUD_RectifyFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_RECTIFYFACTORY
-#define AUD_RECTIFYFACTORY
+#ifndef __AUD_RECTIFYFACTORY_H__
+#define __AUD_RECTIFYFACTORY_H__
#include "AUD_EffectFactory.h"
class AUD_CallbackIIRFilterReader;
@@ -55,4 +55,4 @@ public:
static sample_t rectifyFilter(AUD_CallbackIIRFilterReader* reader, void* useless);
};
-#endif //AUD_RECTIFYFACTORY
+#endif //__AUD_RECTIFYFACTORY_H__
diff --git a/intern/audaspace/FX/AUD_ReverseFactory.h b/intern/audaspace/FX/AUD_ReverseFactory.h
index 6305fb5d2af..e2d75dc560a 100644
--- a/intern/audaspace/FX/AUD_ReverseFactory.h
+++ b/intern/audaspace/FX/AUD_ReverseFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_REVERSEFACTORY
-#define AUD_REVERSEFACTORY
+#ifndef __AUD_REVERSEFACTORY_H__
+#define __AUD_REVERSEFACTORY_H__
#include "AUD_EffectFactory.h"
@@ -53,4 +53,4 @@ public:
virtual AUD_Reference<AUD_IReader> createReader();
};
-#endif //AUD_REVERSEFACTORY
+#endif //__AUD_REVERSEFACTORY_H__
diff --git a/intern/audaspace/FX/AUD_ReverseReader.h b/intern/audaspace/FX/AUD_ReverseReader.h
index 1b3dfd7e53f..d1e5179b8ec 100644
--- a/intern/audaspace/FX/AUD_ReverseReader.h
+++ b/intern/audaspace/FX/AUD_ReverseReader.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_REVERSEREADER
-#define AUD_REVERSEREADER
+#ifndef __AUD_REVERSEREADER_H__
+#define __AUD_REVERSEREADER_H__
#include "AUD_EffectReader.h"
#include "AUD_Buffer.h"
@@ -69,4 +69,4 @@ public:
virtual void read(int& length, bool& eos, sample_t* buffer);
};
-#endif //AUD_REVERSEREADER
+#endif //__AUD_REVERSEREADER_H__
diff --git a/intern/audaspace/FX/AUD_SquareFactory.h b/intern/audaspace/FX/AUD_SquareFactory.h
index aff24b0f3d9..9c0dea25d2b 100644
--- a/intern/audaspace/FX/AUD_SquareFactory.h
+++ b/intern/audaspace/FX/AUD_SquareFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_SQUAREFACTORY
-#define AUD_SQUAREFACTORY
+#ifndef __AUD_SQUAREFACTORY_H__
+#define __AUD_SQUAREFACTORY_H__
#include "AUD_EffectFactory.h"
class AUD_CallbackIIRFilterReader;
@@ -67,4 +67,4 @@ public:
static void endSquareFilter(float* threshold);
};
-#endif //AUD_SQUAREFACTORY
+#endif //__AUD_SQUAREFACTORY_H__
diff --git a/intern/audaspace/FX/AUD_SumFactory.h b/intern/audaspace/FX/AUD_SumFactory.h
index c971730258a..ec17faf3fb2 100644
--- a/intern/audaspace/FX/AUD_SumFactory.h
+++ b/intern/audaspace/FX/AUD_SumFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_SUMFACTORY
-#define AUD_SUMFACTORY
+#ifndef __AUD_SUMFACTORY_H__
+#define __AUD_SUMFACTORY_H__
#include "AUD_EffectFactory.h"
@@ -52,4 +52,4 @@ public:
virtual AUD_Reference<AUD_IReader> createReader();
};
-#endif //AUD_SUMFACTORY
+#endif //__AUD_SUMFACTORY_H__
diff --git a/intern/audaspace/FX/AUD_SuperposeFactory.h b/intern/audaspace/FX/AUD_SuperposeFactory.h
index adfb1c23e1d..2da8e34496d 100644
--- a/intern/audaspace/FX/AUD_SuperposeFactory.h
+++ b/intern/audaspace/FX/AUD_SuperposeFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_SUPERPOSEFACTORY
-#define AUD_SUPERPOSEFACTORY
+#ifndef __AUD_SUPERPOSEFACTORY_H__
+#define __AUD_SUPERPOSEFACTORY_H__
#include "AUD_IFactory.h"
@@ -65,4 +65,4 @@ public:
virtual AUD_Reference<AUD_IReader> createReader();
};
-#endif //AUD_SUPERPOSEFACTORY
+#endif //__AUD_SUPERPOSEFACTORY_H__
diff --git a/intern/audaspace/FX/AUD_SuperposeReader.h b/intern/audaspace/FX/AUD_SuperposeReader.h
index 8a1b2698f9c..d0fde13a267 100644
--- a/intern/audaspace/FX/AUD_SuperposeReader.h
+++ b/intern/audaspace/FX/AUD_SuperposeReader.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_SUPERPOSEREADER
-#define AUD_SUPERPOSEREADER
+#ifndef __AUD_SUPERPOSEREADER_H__
+#define __AUD_SUPERPOSEREADER_H__
#include "AUD_IReader.h"
#include "AUD_Buffer.h"
@@ -81,4 +81,4 @@ public:
virtual void read(int& length, bool& eos, sample_t* buffer);
};
-#endif //AUD_SUPERPOSEREADER
+#endif //__AUD_SUPERPOSEREADER_H__
diff --git a/intern/audaspace/FX/AUD_VolumeFactory.h b/intern/audaspace/FX/AUD_VolumeFactory.h
index ecfab6f7299..b12838373b3 100644
--- a/intern/audaspace/FX/AUD_VolumeFactory.h
+++ b/intern/audaspace/FX/AUD_VolumeFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_VOLUMEFACTORY
-#define AUD_VOLUMEFACTORY
+#ifndef __AUD_VOLUMEFACTORY_H__
+#define __AUD_VOLUMEFACTORY_H__
#include "AUD_EffectFactory.h"
@@ -66,4 +66,4 @@ public:
virtual AUD_Reference<AUD_IReader> createReader();
};
-#endif //AUD_VOLUMEFACTORY
+#endif //__AUD_VOLUMEFACTORY_H__
diff --git a/intern/audaspace/OpenAL/AUD_OpenALDevice.h b/intern/audaspace/OpenAL/AUD_OpenALDevice.h
index ff1361c283f..0a409b42462 100644
--- a/intern/audaspace/OpenAL/AUD_OpenALDevice.h
+++ b/intern/audaspace/OpenAL/AUD_OpenALDevice.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_OPENALDEVICE
-#define AUD_OPENALDEVICE
+#ifndef __AUD_OPENALDEVICE_H__
+#define __AUD_OPENALDEVICE_H__
#include "AUD_IDevice.h"
#include "AUD_IHandle.h"
@@ -277,4 +277,4 @@ public:
virtual void setDistanceModel(AUD_DistanceModel model);
};
-#endif //AUD_OPENALDEVICE
+#endif //__AUD_OPENALDEVICE_H__
diff --git a/intern/audaspace/Python/AUD_PyAPI.h b/intern/audaspace/Python/AUD_PyAPI.h
index bcd9e42ede1..7a7e87ec67d 100644
--- a/intern/audaspace/Python/AUD_PyAPI.h
+++ b/intern/audaspace/Python/AUD_PyAPI.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_PYAPI
-#define AUD_PYAPI
+#ifndef __AUD_PYAPI_H__
+#define __AUD_PYAPI_H__
#include "Python.h"
@@ -71,4 +71,4 @@ extern Factory* checkFactory(PyObject* factory);
}
#endif
-#endif //AUD_PYAPI
+#endif //__AUD_PYAPI_H__
diff --git a/intern/audaspace/SDL/AUD_SDLDevice.h b/intern/audaspace/SDL/AUD_SDLDevice.h
index d77d5835086..266edd0dfcc 100644
--- a/intern/audaspace/SDL/AUD_SDLDevice.h
+++ b/intern/audaspace/SDL/AUD_SDLDevice.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_SDLDEVICE
-#define AUD_SDLDEVICE
+#ifndef __AUD_SDLDEVICE_H__
+#define __AUD_SDLDEVICE_H__
#include "AUD_SoftwareDevice.h"
@@ -72,4 +72,4 @@ public:
virtual ~AUD_SDLDevice();
};
-#endif //AUD_SDLDEVICE
+#endif //__AUD_SDLDEVICE_H__
diff --git a/intern/audaspace/SRC/AUD_SRCResampleFactory.h b/intern/audaspace/SRC/AUD_SRCResampleFactory.h
index d061cf9e12b..858bb0c130a 100644
--- a/intern/audaspace/SRC/AUD_SRCResampleFactory.h
+++ b/intern/audaspace/SRC/AUD_SRCResampleFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_SRCRESAMPLEFACTORY
-#define AUD_SRCRESAMPLEFACTORY
+#ifndef __AUD_SRCRESAMPLEFACTORY_H__
+#define __AUD_SRCRESAMPLEFACTORY_H__
#include "AUD_MixerFactory.h"
@@ -54,4 +54,4 @@ public:
virtual AUD_Reference<AUD_IReader> createReader();
};
-#endif //AUD_SRCRESAMPLEFACTORY
+#endif //__AUD_SRCRESAMPLEFACTORY_H__
diff --git a/intern/audaspace/SRC/AUD_SRCResampleReader.h b/intern/audaspace/SRC/AUD_SRCResampleReader.h
index 26f02be9003..891b28b0993 100644
--- a/intern/audaspace/SRC/AUD_SRCResampleReader.h
+++ b/intern/audaspace/SRC/AUD_SRCResampleReader.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_SRCRESAMPLEREADER
-#define AUD_SRCRESAMPLEREADER
+#ifndef __AUD_SRCRESAMPLEREADER_H__
+#define __AUD_SRCRESAMPLEREADER_H__
#include "AUD_ResampleReader.h"
#include "AUD_Buffer.h"
@@ -100,4 +100,4 @@ public:
virtual void read(int& length, bool& eos, sample_t* buffer);
};
-#endif //AUD_SRCRESAMPLEREADER
+#endif //__AUD_SRCRESAMPLEREADER_H__
diff --git a/intern/audaspace/ffmpeg/AUD_FFMPEGFactory.h b/intern/audaspace/ffmpeg/AUD_FFMPEGFactory.h
index 9d79a5fad23..349f55dd7db 100644
--- a/intern/audaspace/ffmpeg/AUD_FFMPEGFactory.h
+++ b/intern/audaspace/ffmpeg/AUD_FFMPEGFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_FFMPEGFACTORY
-#define AUD_FFMPEGFACTORY
+#ifndef __AUD_FFMPEGFACTORY_H__
+#define __AUD_FFMPEGFACTORY_H__
#include "AUD_IFactory.h"
#include "AUD_Reference.h"
@@ -75,4 +75,4 @@ public:
virtual AUD_Reference<AUD_IReader> createReader();
};
-#endif //AUD_FFMPEGFACTORY
+#endif //__AUD_FFMPEGFACTORY_H__
diff --git a/intern/audaspace/ffmpeg/AUD_FFMPEGReader.h b/intern/audaspace/ffmpeg/AUD_FFMPEGReader.h
index 9a19131efe0..2b354b0b2a1 100644
--- a/intern/audaspace/ffmpeg/AUD_FFMPEGReader.h
+++ b/intern/audaspace/ffmpeg/AUD_FFMPEGReader.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_FFMPEGREADER
-#define AUD_FFMPEGREADER
+#ifndef __AUD_FFMPEGREADER_H__
+#define __AUD_FFMPEGREADER_H__
#include "AUD_ConverterFunctions.h"
#include "AUD_IReader.h"
@@ -161,4 +161,4 @@ public:
virtual void read(int& length, bool& eos, sample_t* buffer);
};
-#endif //AUD_FFMPEGREADER
+#endif //__AUD_FFMPEGREADER_H__
diff --git a/intern/audaspace/ffmpeg/AUD_FFMPEGWriter.h b/intern/audaspace/ffmpeg/AUD_FFMPEGWriter.h
index 60200ce363d..17830308fd5 100644
--- a/intern/audaspace/ffmpeg/AUD_FFMPEGWriter.h
+++ b/intern/audaspace/ffmpeg/AUD_FFMPEGWriter.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_FFMPEGWRITER
-#define AUD_FFMPEGWRITER
+#ifndef __AUD_FFMPEGWRITER_H__
+#define __AUD_FFMPEGWRITER_H__
#include "AUD_ConverterFunctions.h"
#include "AUD_Buffer.h"
@@ -135,4 +135,4 @@ public:
virtual void write(unsigned int length, sample_t* buffer);
};
-#endif //AUD_FFMPEGWRITER
+#endif //__AUD_FFMPEGWRITER_H__
diff --git a/intern/audaspace/fftw/AUD_BandPassFactory.h b/intern/audaspace/fftw/AUD_BandPassFactory.h
index 4891947ec3c..75de071403f 100644
--- a/intern/audaspace/fftw/AUD_BandPassFactory.h
+++ b/intern/audaspace/fftw/AUD_BandPassFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_BANDPASSFACTORY
-#define AUD_BANDPASSFACTORY
+#ifndef __AUD_BANDPASSFACTORY_H__
+#define __AUD_BANDPASSFACTORY_H__
#include "AUD_EffectFactory.h"
@@ -89,4 +89,4 @@ public:
virtual AUD_IReader* createReader();
};
-#endif //AUD_BANDPASSFACTORY
+#endif //__AUD_BANDPASSFACTORY_H__
diff --git a/intern/audaspace/fftw/AUD_BandPassReader.h b/intern/audaspace/fftw/AUD_BandPassReader.h
index 155b8d7b0bc..55a950818e0 100644
--- a/intern/audaspace/fftw/AUD_BandPassReader.h
+++ b/intern/audaspace/fftw/AUD_BandPassReader.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_BANDPASSREADER
-#define AUD_BANDPASSREADER
+#ifndef __AUD_BANDPASSREADER_H__
+#define __AUD_BANDPASSREADER_H__
#include <fftw3.h>
@@ -99,4 +99,4 @@ public:
virtual void read(int & length, sample_t* & buffer);
};
-#endif //AUD_BANDPASSREADER
+#endif //__AUD_BANDPASSREADER_H__
diff --git a/intern/audaspace/intern/AUD_3DMath.h b/intern/audaspace/intern/AUD_3DMath.h
index 18594842108..f39566958cd 100644
--- a/intern/audaspace/intern/AUD_3DMath.h
+++ b/intern/audaspace/intern/AUD_3DMath.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_3DMATH
-#define AUD_3DMATH
+#ifndef __AUD_3DMATH_H__
+#define __AUD_3DMATH_H__
#include <cmath>
#include <cstring>
@@ -325,4 +325,4 @@ public:
}
};
-#endif //AUD_3DMATH
+#endif //__AUD_3DMATH_H__
diff --git a/intern/audaspace/intern/AUD_AnimateableProperty.h b/intern/audaspace/intern/AUD_AnimateableProperty.h
index 5b516384a8f..2f25e330ebd 100644
--- a/intern/audaspace/intern/AUD_AnimateableProperty.h
+++ b/intern/audaspace/intern/AUD_AnimateableProperty.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_ANIMATEABLEPROPERTY
-#define AUD_ANIMATEABLEPROPERTY
+#ifndef __AUD_ANIMATEABLEPROPERTY_H__
+#define __AUD_ANIMATEABLEPROPERTY_H__
#include "AUD_Buffer.h"
@@ -103,4 +103,4 @@ public:
bool isAnimated() const;
};
-#endif //AUD_ANIMATEABLEPROPERTY
+#endif //__AUD_ANIMATEABLEPROPERTY_H__
diff --git a/intern/audaspace/intern/AUD_Buffer.h b/intern/audaspace/intern/AUD_Buffer.h
index 7a30d3b02d8..d3207f04f83 100644
--- a/intern/audaspace/intern/AUD_Buffer.h
+++ b/intern/audaspace/intern/AUD_Buffer.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_BUFFER
-#define AUD_BUFFER
+#ifndef __AUD_BUFFER_H__
+#define __AUD_BUFFER_H__
#include "AUD_Space.h"
@@ -90,4 +90,4 @@ public:
void assureSize(int size, bool keep = false);
};
-#endif //AUD_BUFFER
+#endif //__AUD_BUFFER_H__
diff --git a/intern/audaspace/intern/AUD_BufferReader.h b/intern/audaspace/intern/AUD_BufferReader.h
index f648baef30d..0e8c5de9a9d 100644
--- a/intern/audaspace/intern/AUD_BufferReader.h
+++ b/intern/audaspace/intern/AUD_BufferReader.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_BUFFERREADER
-#define AUD_BUFFERREADER
+#ifndef __AUD_BUFFERREADER_H__
+#define __AUD_BUFFERREADER_H__
#include "AUD_IReader.h"
#include "AUD_Reference.h"
@@ -77,4 +77,4 @@ public:
virtual void read(int& length, bool& eos, sample_t* buffer);
};
-#endif //AUD_BUFFERREADER
+#endif //__AUD_BUFFERREADER_H__
diff --git a/intern/audaspace/intern/AUD_C-API.h b/intern/audaspace/intern/AUD_C-API.h
index 2b7c94bcc5b..8388af2170d 100644
--- a/intern/audaspace/intern/AUD_C-API.h
+++ b/intern/audaspace/intern/AUD_C-API.h
@@ -26,8 +26,8 @@
* \ingroup audaspace
*/
-#ifndef AUD_CAPI
-#define AUD_CAPI
+#ifndef __AUD_C_API_H__
+#define __AUD_C_API_H__
#ifdef WITH_PYTHON
#include "Python.h"
@@ -755,4 +755,4 @@ AUD_Reference<AUD_IDevice> AUD_getDevice();
AUD_I3DDevice* AUD_get3DDevice();
#endif
-#endif //AUD_CAPI
+#endif //__AUD_C_API_H__
diff --git a/intern/audaspace/intern/AUD_ChannelMapperFactory.h b/intern/audaspace/intern/AUD_ChannelMapperFactory.h
index 4c88cb85080..b60a32d5510 100644
--- a/intern/audaspace/intern/AUD_ChannelMapperFactory.h
+++ b/intern/audaspace/intern/AUD_ChannelMapperFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_CHANNELMAPPERFACTORY
-#define AUD_CHANNELMAPPERFACTORY
+#ifndef __AUD_CHANNELMAPPERFACTORY_H__
+#define __AUD_CHANNELMAPPERFACTORY_H__
#include "AUD_MixerFactory.h"
@@ -54,4 +54,4 @@ public:
virtual AUD_Reference<AUD_IReader> createReader();
};
-#endif //AUD_CHANNELMAPPERFACTORY
+#endif //__AUD_CHANNELMAPPERFACTORY_H__
diff --git a/intern/audaspace/intern/AUD_ChannelMapperReader.h b/intern/audaspace/intern/AUD_ChannelMapperReader.h
index 8e3ff0d1e9a..32adb058115 100644
--- a/intern/audaspace/intern/AUD_ChannelMapperReader.h
+++ b/intern/audaspace/intern/AUD_ChannelMapperReader.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_CHANNELMAPPERREADER
-#define AUD_CHANNELMAPPERREADER
+#ifndef __AUD_CHANNELMAPPERREADER_H__
+#define __AUD_CHANNELMAPPERREADER_H__
#include "AUD_EffectReader.h"
#include "AUD_Buffer.h"
@@ -133,4 +133,4 @@ public:
virtual void read(int& length, bool& eos, sample_t* buffer);
};
-#endif //AUD_CHANNELMAPPERREADER
+#endif //__AUD_CHANNELMAPPERREADER_H__
diff --git a/intern/audaspace/intern/AUD_ConverterFactory.h b/intern/audaspace/intern/AUD_ConverterFactory.h
index 04dfe9e12d1..3211b607517 100644
--- a/intern/audaspace/intern/AUD_ConverterFactory.h
+++ b/intern/audaspace/intern/AUD_ConverterFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_CONVERTERFACTORY
-#define AUD_CONVERTERFACTORY
+#ifndef __AUD_CONVERTERFACTORY_H__
+#define __AUD_CONVERTERFACTORY_H__
#include "AUD_MixerFactory.h"
@@ -54,4 +54,4 @@ public:
virtual AUD_Reference<AUD_IReader> createReader();
};
-#endif //AUD_CONVERTERFACTORY
+#endif //__AUD_CONVERTERFACTORY_H__
diff --git a/intern/audaspace/intern/AUD_ConverterFunctions.cpp b/intern/audaspace/intern/AUD_ConverterFunctions.cpp
index 53a644e3b90..c20f19a7e67 100644
--- a/intern/audaspace/intern/AUD_ConverterFunctions.cpp
+++ b/intern/audaspace/intern/AUD_ConverterFunctions.cpp
@@ -31,11 +31,11 @@
#include "AUD_Buffer.h"
#define AUD_U8_0 0x80
-#define AUD_S16_MAX 0x7FFF
-#define AUD_S16_MIN 0x8000
+#define AUD_S16_MAX ((int16_t)0x7FFF)
+#define AUD_S16_MIN ((int16_t)0x8000)
#define AUD_S16_FLT 32767.0f
-#define AUD_S32_MAX 0x7FFFFFFF
-#define AUD_S32_MIN 0x80000000
+#define AUD_S32_MAX ((int32_t)0x7FFFFFFF)
+#define AUD_S32_MIN ((int32_t)0x80000000)
#define AUD_S32_FLT 2147483647.0f
#define AUD_FLT_MAX 1.0f
#define AUD_FLT_MIN -1.0f
diff --git a/intern/audaspace/intern/AUD_ConverterFunctions.h b/intern/audaspace/intern/AUD_ConverterFunctions.h
index 35a8012ccd1..1ffcf6c4ef0 100644
--- a/intern/audaspace/intern/AUD_ConverterFunctions.h
+++ b/intern/audaspace/intern/AUD_ConverterFunctions.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_CONVERTERFUNCTIONS
-#define AUD_CONVERTERFUNCTIONS
+#ifndef __AUD_CONVERTERFUNCTIONS_H__
+#define __AUD_CONVERTERFUNCTIONS_H__
#include "AUD_Space.h"
@@ -135,4 +135,4 @@ void AUD_convert_double_s32(data_t* target, data_t* source, int length);
void AUD_convert_double_float(data_t* target, data_t* source, int length);
-#endif //AUD_CONVERTERFUNCTIONS
+#endif //__AUD_CONVERTERFUNCTIONS_H__
diff --git a/intern/audaspace/intern/AUD_ConverterReader.h b/intern/audaspace/intern/AUD_ConverterReader.h
index 984666453e8..2dedbd89180 100644
--- a/intern/audaspace/intern/AUD_ConverterReader.h
+++ b/intern/audaspace/intern/AUD_ConverterReader.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_CONVERTERREADER
-#define AUD_CONVERTERREADER
+#ifndef __AUD_CONVERTERREADER_H__
+#define __AUD_CONVERTERREADER_H__
#include "AUD_EffectReader.h"
#include "AUD_ConverterFunctions.h"
@@ -70,4 +70,4 @@ public:
virtual void read(int& length, bool& eos, sample_t* buffer);
};
-#endif //AUD_CONVERTERREADER
+#endif //__AUD_CONVERTERREADER_H__
diff --git a/intern/audaspace/intern/AUD_FileFactory.h b/intern/audaspace/intern/AUD_FileFactory.h
index b39db27476b..4ea4a9392e9 100644
--- a/intern/audaspace/intern/AUD_FileFactory.h
+++ b/intern/audaspace/intern/AUD_FileFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_FILEFACTORY
-#define AUD_FILEFACTORY
+#ifndef __AUD_FILEFACTORY_H__
+#define __AUD_FILEFACTORY_H__
#include "AUD_IFactory.h"
#include "AUD_Reference.h"
@@ -73,4 +73,4 @@ public:
virtual AUD_Reference<AUD_IReader> createReader();
};
-#endif //AUD_FILEFACTORY
+#endif //__AUD_FILEFACTORY_H__
diff --git a/intern/audaspace/intern/AUD_FileWriter.h b/intern/audaspace/intern/AUD_FileWriter.h
index 9ff083e247f..c9ee2b1ee12 100644
--- a/intern/audaspace/intern/AUD_FileWriter.h
+++ b/intern/audaspace/intern/AUD_FileWriter.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_FILEWRITER
-#define AUD_FILEWRITER
+#ifndef __AUD_FILEWRITER_H__
+#define __AUD_FILEWRITER_H__
#include <string>
@@ -70,4 +70,4 @@ public:
static void writeReader(AUD_Reference<AUD_IReader> reader, AUD_Reference<AUD_IWriter> writer, unsigned int length, unsigned int buffersize);
};
-#endif //AUD_FILEWRITER
+#endif //__AUD_FILEWRITER_H__
diff --git a/intern/audaspace/intern/AUD_I3DDevice.h b/intern/audaspace/intern/AUD_I3DDevice.h
index 68052627842..1df710b7e5b 100644
--- a/intern/audaspace/intern/AUD_I3DDevice.h
+++ b/intern/audaspace/intern/AUD_I3DDevice.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_I3DDEVICE
-#define AUD_I3DDEVICE
+#ifndef __AUD_I3DDEVICE_H__
+#define __AUD_I3DDEVICE_H__
#include "AUD_Space.h"
#include "AUD_3DMath.h"
@@ -119,4 +119,4 @@ public:
virtual void setDistanceModel(AUD_DistanceModel model)=0;
};
-#endif //AUD_I3DDEVICE
+#endif //__AUD_I3DDEVICE_H__
diff --git a/intern/audaspace/intern/AUD_I3DHandle.h b/intern/audaspace/intern/AUD_I3DHandle.h
index 78be55db82c..69ca985630a 100644
--- a/intern/audaspace/intern/AUD_I3DHandle.h
+++ b/intern/audaspace/intern/AUD_I3DHandle.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_I3DHANDLE
-#define AUD_I3DHANDLE
+#ifndef __AUD_I3DHANDLE_H__
+#define __AUD_I3DHANDLE_H__
#include "AUD_Space.h"
#include "AUD_3DMath.h"
@@ -213,4 +213,4 @@ public:
virtual bool setConeVolumeOuter(float volume)=0;
};
-#endif //AUD_I3DHANDLE
+#endif //__AUD_I3DHANDLE_H__
diff --git a/intern/audaspace/intern/AUD_IDevice.h b/intern/audaspace/intern/AUD_IDevice.h
index 28765e9144c..1d6f8ca6efb 100644
--- a/intern/audaspace/intern/AUD_IDevice.h
+++ b/intern/audaspace/intern/AUD_IDevice.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_IDEVICE
-#define AUD_IDEVICE
+#ifndef __AUD_IDEVICE_H__
+#define __AUD_IDEVICE_H__
#include "AUD_Space.h"
#include "AUD_Reference.h"
diff --git a/intern/audaspace/intern/AUD_IFactory.h b/intern/audaspace/intern/AUD_IFactory.h
index a19a5775dc9..a7c214bb5a1 100644
--- a/intern/audaspace/intern/AUD_IFactory.h
+++ b/intern/audaspace/intern/AUD_IFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_IFACTORY
-#define AUD_IFACTORY
+#ifndef __AUD_IFACTORY_H__
+#define __AUD_IFACTORY_H__
#include "AUD_Space.h"
#include "AUD_Reference.h"
@@ -57,4 +57,4 @@ public:
virtual AUD_Reference<AUD_IReader> createReader()=0;
};
-#endif //AUD_IFACTORY
+#endif //__AUD_IFACTORY_H__
diff --git a/intern/audaspace/intern/AUD_IHandle.h b/intern/audaspace/intern/AUD_IHandle.h
index 33c64f509c2..9dcb743693e 100644
--- a/intern/audaspace/intern/AUD_IHandle.h
+++ b/intern/audaspace/intern/AUD_IHandle.h
@@ -26,8 +26,8 @@
* \ingroup audaspaceintern
*/
-#ifndef AUD_IHANDLE
-#define AUD_IHANDLE
+#ifndef __AUD_IHANDLE_H__
+#define __AUD_IHANDLE_H__
//#include "AUD_Space.h"
//#include "AUD_Reference.h"
diff --git a/intern/audaspace/intern/AUD_IReader.h b/intern/audaspace/intern/AUD_IReader.h
index 2c92e75163e..8e0e03dd95d 100644
--- a/intern/audaspace/intern/AUD_IReader.h
+++ b/intern/audaspace/intern/AUD_IReader.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_IREADER
-#define AUD_IREADER
+#ifndef __AUD_IREADER_H__
+#define __AUD_IREADER_H__
#include "AUD_Space.h"
@@ -94,4 +94,4 @@ public:
virtual void read(int& length, bool& eos, sample_t* buffer)=0;
};
-#endif //AUD_IREADER
+#endif //__AUD_IREADER_H__
diff --git a/intern/audaspace/intern/AUD_IWriter.h b/intern/audaspace/intern/AUD_IWriter.h
index 401faea4813..3c92661c75d 100644
--- a/intern/audaspace/intern/AUD_IWriter.h
+++ b/intern/audaspace/intern/AUD_IWriter.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_IWRITER
-#define AUD_IWRITER
+#ifndef __AUD_IWRITER_H__
+#define __AUD_IWRITER_H__
#include "AUD_Space.h"
@@ -64,4 +64,4 @@ public:
virtual void write(unsigned int length, sample_t* buffer)=0;
};
-#endif //AUD_IWRITER
+#endif //__AUD_IWRITER_H__
diff --git a/intern/audaspace/intern/AUD_JOSResampleFactory.h b/intern/audaspace/intern/AUD_JOSResampleFactory.h
index a4a303f944d..6d18150d852 100644
--- a/intern/audaspace/intern/AUD_JOSResampleFactory.h
+++ b/intern/audaspace/intern/AUD_JOSResampleFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_JOSRESAMPLEFACTORY
-#define AUD_JOSRESAMPLEFACTORY
+#ifndef __AUD_JOSRESAMPLEFACTORY_H__
+#define __AUD_JOSRESAMPLEFACTORY_H__
#include "AUD_MixerFactory.h"
@@ -53,4 +53,4 @@ public:
virtual AUD_Reference<AUD_IReader> createReader();
};
-#endif //AUD_JOSRESAMPLEFACTORY
+#endif //__AUD_JOSRESAMPLEFACTORY_H__
diff --git a/intern/audaspace/intern/AUD_JOSResampleReader.cpp b/intern/audaspace/intern/AUD_JOSResampleReader.cpp
index 2fb8b86ce49..0f7a038c88e 100644
--- a/intern/audaspace/intern/AUD_JOSResampleReader.cpp
+++ b/intern/audaspace/intern/AUD_JOSResampleReader.cpp
@@ -200,7 +200,7 @@ void AUD_JOSResampleReader::updateBuffer(int size, double factor, int samplesize
left\
}\
\
- P = -P;\
+ P = 0 - P;\
\
end = (int_to_fp(m_len) - P) / P_increment - 1;\
if(m_cache_valid - m_n - 2 < end)\
diff --git a/intern/audaspace/intern/AUD_JOSResampleReader.h b/intern/audaspace/intern/AUD_JOSResampleReader.h
index c05a160c2da..94524c1db3e 100644
--- a/intern/audaspace/intern/AUD_JOSResampleReader.h
+++ b/intern/audaspace/intern/AUD_JOSResampleReader.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_JOSRESAMPLEREADER
-#define AUD_JOSRESAMPLEREADER
+#ifndef __AUD_JOSRESAMPLEREADER_H__
+#define __AUD_JOSRESAMPLEREADER_H__
#include "AUD_ResampleReader.h"
#include "AUD_Buffer.h"
@@ -132,4 +132,4 @@ public:
virtual void read(int& length, bool& eos, sample_t* buffer);
};
-#endif //AUD_JOSRESAMPLEREADER
+#endif //__AUD_JOSRESAMPLEREADER_H__
diff --git a/intern/audaspace/intern/AUD_LinearResampleFactory.h b/intern/audaspace/intern/AUD_LinearResampleFactory.h
index e1e9cc7ec22..7d9efa01d2d 100644
--- a/intern/audaspace/intern/AUD_LinearResampleFactory.h
+++ b/intern/audaspace/intern/AUD_LinearResampleFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_LINEARRESAMPLEFACTORY
-#define AUD_LINEARRESAMPLEFACTORY
+#ifndef __AUD_LINEARRESAMPLEFACTORY_H__
+#define __AUD_LINEARRESAMPLEFACTORY_H__
#include "AUD_MixerFactory.h"
@@ -53,4 +53,4 @@ public:
virtual AUD_Reference<AUD_IReader> createReader();
};
-#endif //AUD_LINEARRESAMPLEFACTORY
+#endif //__AUD_LINEARRESAMPLEFACTORY_H__
diff --git a/intern/audaspace/intern/AUD_LinearResampleReader.h b/intern/audaspace/intern/AUD_LinearResampleReader.h
index 1370825894b..4f6d422f772 100644
--- a/intern/audaspace/intern/AUD_LinearResampleReader.h
+++ b/intern/audaspace/intern/AUD_LinearResampleReader.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_LINEARRESAMPLEREADER
-#define AUD_LINEARRESAMPLEREADER
+#ifndef __AUD_LINEARRESAMPLEREADER_H__
+#define __AUD_LINEARRESAMPLEREADER_H__
#include "AUD_ResampleReader.h"
#include "AUD_Buffer.h"
@@ -83,4 +83,4 @@ public:
virtual void read(int& length, bool& eos, sample_t* buffer);
};
-#endif //AUD_LINEARRESAMPLEREADER
+#endif //__AUD_LINEARRESAMPLEREADER_H__
diff --git a/intern/audaspace/intern/AUD_Mixer.h b/intern/audaspace/intern/AUD_Mixer.h
index e1b67aca5ff..0de9b7fc7dc 100644
--- a/intern/audaspace/intern/AUD_Mixer.h
+++ b/intern/audaspace/intern/AUD_Mixer.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_MIXER
-#define AUD_MIXER
+#ifndef __AUD_MIXER_H__
+#define __AUD_MIXER_H__
#include "AUD_ConverterFunctions.h"
#include "AUD_Buffer.h"
@@ -108,4 +108,4 @@ public:
void clear(int length);
};
-#endif //AUD_MIXER
+#endif //__AUD_MIXER_H__
diff --git a/intern/audaspace/intern/AUD_MixerFactory.h b/intern/audaspace/intern/AUD_MixerFactory.h
index e3627de5b66..d65eb8ef6ae 100644
--- a/intern/audaspace/intern/AUD_MixerFactory.h
+++ b/intern/audaspace/intern/AUD_MixerFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_MIXERFACTORY
-#define AUD_MIXERFACTORY
+#ifndef __AUD_MIXERFACTORY_H__
+#define __AUD_MIXERFACTORY_H__
#include "AUD_IFactory.h"
@@ -76,4 +76,4 @@ public:
AUD_Reference<AUD_IFactory> getFactory() const;
};
-#endif //AUD_MIXERFACTORY
+#endif //__AUD_MIXERFACTORY_H__
diff --git a/intern/audaspace/intern/AUD_NULLDevice.h b/intern/audaspace/intern/AUD_NULLDevice.h
index 6ac8efd227e..ee97b151ebe 100644
--- a/intern/audaspace/intern/AUD_NULLDevice.h
+++ b/intern/audaspace/intern/AUD_NULLDevice.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_NULLDEVICE
-#define AUD_NULLDEVICE
+#ifndef __AUD_NULLDEVICE_H__
+#define __AUD_NULLDEVICE_H__
#include "AUD_IReader.h"
#include "AUD_IDevice.h"
@@ -81,4 +81,4 @@ public:
virtual void setVolume(float volume);
};
-#endif //AUD_NULLDEVICE
+#endif //__AUD_NULLDEVICE_H__
diff --git a/intern/audaspace/intern/AUD_PyInit.h b/intern/audaspace/intern/AUD_PyInit.h
index dc24571438e..8c045e60f37 100644
--- a/intern/audaspace/intern/AUD_PyInit.h
+++ b/intern/audaspace/intern/AUD_PyInit.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_PYINIT
-#define AUD_PYINIT
+#ifndef __AUD_PYINIT_H__
+#define __AUD_PYINIT_H__
#ifdef WITH_PYTHON
#include "Python.h"
@@ -48,4 +48,4 @@ extern PyObject* AUD_initPython(void);
#endif
-#endif //AUD_PYINIT
+#endif //__AUD_PYINIT_H__
diff --git a/intern/audaspace/intern/AUD_ReadDevice.h b/intern/audaspace/intern/AUD_ReadDevice.h
index 9e362b42d36..0f077fe5d7e 100644
--- a/intern/audaspace/intern/AUD_ReadDevice.h
+++ b/intern/audaspace/intern/AUD_ReadDevice.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_READDEVICE
-#define AUD_READDEVICE
+#ifndef __AUD_READDEVICE_H__
+#define __AUD_READDEVICE_H__
#include "AUD_SoftwareDevice.h"
@@ -85,4 +85,4 @@ public:
void changeSpecs(AUD_Specs specs);
};
-#endif //AUD_READDEVICE
+#endif //__AUD_READDEVICE_H__
diff --git a/intern/audaspace/intern/AUD_Reference.h b/intern/audaspace/intern/AUD_Reference.h
index 0d1c754f908..2e07417154b 100644
--- a/intern/audaspace/intern/AUD_Reference.h
+++ b/intern/audaspace/intern/AUD_Reference.h
@@ -26,8 +26,8 @@
* \ingroup audaspaceintern
*/
-#ifndef AUD_REFERENCE
-#define AUD_REFERENCE
+#ifndef __AUD_REFERENCE_H__
+#define __AUD_REFERENCE_H__
#include <map>
#include <cstddef>
@@ -244,4 +244,4 @@ inline bool operator!=(const AUD_Reference<T>& a, const AUD_Reference<U>& b)
return a.getOriginal() != b.getOriginal();
}
-#endif // AUD_REFERENCE
+#endif // __AUD_REFERENCE_H__
diff --git a/intern/audaspace/intern/AUD_ResampleFactory.h b/intern/audaspace/intern/AUD_ResampleFactory.h
index 34549c16dfa..11f8dc15f03 100644
--- a/intern/audaspace/intern/AUD_ResampleFactory.h
+++ b/intern/audaspace/intern/AUD_ResampleFactory.h
@@ -27,11 +27,11 @@
*/
-#ifndef AUD_RESAMPLEFACTORY
-#define AUD_RESAMPLEFACTORY
+#ifndef __AUD_RESAMPLEFACTORY_H__
+#define __AUD_RESAMPLEFACTORY_H__
#include "AUD_MixerFactory.h"
typedef AUD_MixerFactory AUD_ResampleFactory;
-#endif //AUD_RESAMPLEFACTORY
+#endif //__AUD_RESAMPLEFACTORY_H__
diff --git a/intern/audaspace/intern/AUD_ResampleReader.h b/intern/audaspace/intern/AUD_ResampleReader.h
index 9c3e671f664..c423326489d 100644
--- a/intern/audaspace/intern/AUD_ResampleReader.h
+++ b/intern/audaspace/intern/AUD_ResampleReader.h
@@ -26,8 +26,8 @@
* \ingroup audaspaceintern
*/
-#ifndef AUD_RESAMPLEREADER
-#define AUD_RESAMPLEREADER
+#ifndef __AUD_RESAMPLEREADER_H__
+#define __AUD_RESAMPLEREADER_H__
#include "AUD_EffectReader.h"
@@ -63,4 +63,4 @@ public:
virtual AUD_SampleRate getRate();
};
-#endif // AUD_RESAMPLEREADER
+#endif // __AUD_RESAMPLEREADER_H__
diff --git a/intern/audaspace/intern/AUD_SequencerEntry.h b/intern/audaspace/intern/AUD_SequencerEntry.h
index 3a5a51a41a5..7ff6fffea11 100644
--- a/intern/audaspace/intern/AUD_SequencerEntry.h
+++ b/intern/audaspace/intern/AUD_SequencerEntry.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_SEQUENCERENTRY
-#define AUD_SEQUENCERENTRY
+#ifndef __AUD_SEQUENCERENTRY_H__
+#define __AUD_SEQUENCERENTRY_H__
#include "AUD_Reference.h"
#include "AUD_AnimateableProperty.h"
@@ -315,4 +315,4 @@ public:
void setConeVolumeOuter(float volume);
};
-#endif //AUD_SEQUENCERENTRY
+#endif //__AUD_SEQUENCERENTRY_H__
diff --git a/intern/audaspace/intern/AUD_SequencerFactory.h b/intern/audaspace/intern/AUD_SequencerFactory.h
index 08d18fcc925..38241112020 100644
--- a/intern/audaspace/intern/AUD_SequencerFactory.h
+++ b/intern/audaspace/intern/AUD_SequencerFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_SEQUENCERFACTORY
-#define AUD_SEQUENCERFACTORY
+#ifndef __AUD_SEQUENCERFACTORY_H__
+#define __AUD_SEQUENCERFACTORY_H__
#include "AUD_IFactory.h"
#include "AUD_AnimateableProperty.h"
@@ -210,4 +210,4 @@ public:
virtual AUD_Reference<AUD_IReader> createReader();
};
-#endif //AUD_SEQUENCERFACTORY
+#endif //__AUD_SEQUENCERFACTORY_H__
diff --git a/intern/audaspace/intern/AUD_SequencerHandle.h b/intern/audaspace/intern/AUD_SequencerHandle.h
index c7fd3f026eb..72d3240a103 100644
--- a/intern/audaspace/intern/AUD_SequencerHandle.h
+++ b/intern/audaspace/intern/AUD_SequencerHandle.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_SEQUENCERHANDLE
-#define AUD_SEQUENCERHANDLE
+#ifndef __AUD_SEQUENCERHANDLE_H__
+#define __AUD_SEQUENCERHANDLE_H__
#include "AUD_SequencerEntry.h"
#include "AUD_IHandle.h"
@@ -103,4 +103,4 @@ public:
void seek(float position);
};
-#endif //AUD_SEQUENCERHANDLE
+#endif //__AUD_SEQUENCERHANDLE_H__
diff --git a/intern/audaspace/intern/AUD_SequencerReader.h b/intern/audaspace/intern/AUD_SequencerReader.h
index a4120830e42..b3c3a3ea7a6 100644
--- a/intern/audaspace/intern/AUD_SequencerReader.h
+++ b/intern/audaspace/intern/AUD_SequencerReader.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_SEQUENCERREADER
-#define AUD_SEQUENCERREADER
+#ifndef __AUD_SEQUENCERREADER_H__
+#define __AUD_SEQUENCERREADER_H__
#include "AUD_IReader.h"
#include "AUD_ReadDevice.h"
@@ -96,4 +96,4 @@ public:
virtual void read(int& length, bool& eos, sample_t* buffer);
};
-#endif //AUD_SEQUENCERREADER
+#endif //__AUD_SEQUENCERREADER_H__
diff --git a/intern/audaspace/intern/AUD_SilenceFactory.h b/intern/audaspace/intern/AUD_SilenceFactory.h
index d1b0f9d6550..3bc7fc067ed 100644
--- a/intern/audaspace/intern/AUD_SilenceFactory.h
+++ b/intern/audaspace/intern/AUD_SilenceFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_SILENCEFACTORY
-#define AUD_SILENCEFACTORY
+#ifndef __AUD_SILENCEFACTORY_H__
+#define __AUD_SILENCEFACTORY_H__
#include "AUD_IFactory.h"
@@ -51,4 +51,4 @@ public:
virtual AUD_Reference<AUD_IReader> createReader();
};
-#endif //AUD_SILENCEFACTORY
+#endif //__AUD_SILENCEFACTORY_H__
diff --git a/intern/audaspace/intern/AUD_SilenceReader.h b/intern/audaspace/intern/AUD_SilenceReader.h
index de4f9df51fb..cac56a0861b 100644
--- a/intern/audaspace/intern/AUD_SilenceReader.h
+++ b/intern/audaspace/intern/AUD_SilenceReader.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_SILENCEREADER
-#define AUD_SILENCEREADER
+#ifndef __AUD_SILENCEREADER_H__
+#define __AUD_SILENCEREADER_H__
#include "AUD_IReader.h"
#include "AUD_Buffer.h"
@@ -63,4 +63,4 @@ public:
virtual void read(int& length, bool& eos, sample_t* buffer);
};
-#endif //AUD_SILENCEREADER
+#endif //__AUD_SILENCEREADER_H__
diff --git a/intern/audaspace/intern/AUD_SinusFactory.h b/intern/audaspace/intern/AUD_SinusFactory.h
index f73cdd278b5..d83323c6635 100644
--- a/intern/audaspace/intern/AUD_SinusFactory.h
+++ b/intern/audaspace/intern/AUD_SinusFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_SINUSFACTORY
-#define AUD_SINUSFACTORY
+#ifndef __AUD_SINUSFACTORY_H__
+#define __AUD_SINUSFACTORY_H__
#include "AUD_IFactory.h"
@@ -69,4 +69,4 @@ public:
virtual AUD_Reference<AUD_IReader> createReader();
};
-#endif //AUD_SINUSFACTORY
+#endif //__AUD_SINUSFACTORY_H__
diff --git a/intern/audaspace/intern/AUD_SinusReader.h b/intern/audaspace/intern/AUD_SinusReader.h
index ce79470c83d..50487ea94aa 100644
--- a/intern/audaspace/intern/AUD_SinusReader.h
+++ b/intern/audaspace/intern/AUD_SinusReader.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_SINUSREADER
-#define AUD_SINUSREADER
+#ifndef __AUD_SINUSREADER_H__
+#define __AUD_SINUSREADER_H__
#include "AUD_IReader.h"
#include "AUD_Buffer.h"
@@ -75,4 +75,4 @@ public:
virtual void read(int& length, bool& eos, sample_t* buffer);
};
-#endif //AUD_SINUSREADER
+#endif //__AUD_SINUSREADER_H__
diff --git a/intern/audaspace/intern/AUD_SoftwareDevice.h b/intern/audaspace/intern/AUD_SoftwareDevice.h
index 010f579c86d..c429508b622 100644
--- a/intern/audaspace/intern/AUD_SoftwareDevice.h
+++ b/intern/audaspace/intern/AUD_SoftwareDevice.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_SOFTWAREDEVICE
-#define AUD_SOFTWAREDEVICE
+#ifndef __AUD_SOFTWAREDEVICE_H__
+#define __AUD_SOFTWAREDEVICE_H__
#include "AUD_IDevice.h"
#include "AUD_IHandle.h"
@@ -342,4 +342,4 @@ public:
virtual void setDistanceModel(AUD_DistanceModel model);
};
-#endif //AUD_SOFTWAREDEVICE
+#endif //__AUD_SOFTWAREDEVICE_H__
diff --git a/intern/audaspace/intern/AUD_Space.h b/intern/audaspace/intern/AUD_Space.h
index c018d6e68e7..f42cb1ab018 100644
--- a/intern/audaspace/intern/AUD_Space.h
+++ b/intern/audaspace/intern/AUD_Space.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_SPACE
-#define AUD_SPACE
+#ifndef __AUD_SPACE_H__
+#define __AUD_SPACE_H__
/// The size of a format in bytes.
#define AUD_FORMAT_SIZE(format) (format & 0x0F)
@@ -253,4 +253,4 @@ typedef struct
// void* userData; - for the case it is needed someday
} AUD_Exception;
-#endif //AUD_SPACE
+#endif //__AUD_SPACE_H__
diff --git a/intern/audaspace/intern/AUD_StreamBufferFactory.h b/intern/audaspace/intern/AUD_StreamBufferFactory.h
index f1f1c0f6a66..99795d95d33 100644
--- a/intern/audaspace/intern/AUD_StreamBufferFactory.h
+++ b/intern/audaspace/intern/AUD_StreamBufferFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_STREAMBUFFERFACTORY
-#define AUD_STREAMBUFFERFACTORY
+#ifndef __AUD_STREAMBUFFERFACTORY_H__
+#define __AUD_STREAMBUFFERFACTORY_H__
#include "AUD_IFactory.h"
#include "AUD_Reference.h"
@@ -67,4 +67,4 @@ public:
virtual AUD_Reference<AUD_IReader> createReader();
};
-#endif //AUD_STREAMBUFFERFACTORY
+#endif //__AUD_STREAMBUFFERFACTORY_H__
diff --git a/intern/audaspace/jack/AUD_JackDevice.h b/intern/audaspace/jack/AUD_JackDevice.h
index 6373d4f9d6d..dc90c5249a2 100644
--- a/intern/audaspace/jack/AUD_JackDevice.h
+++ b/intern/audaspace/jack/AUD_JackDevice.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_JACKDEVICE
-#define AUD_JACKDEVICE
+#ifndef __AUD_JACKDEVICE_H__
+#define __AUD_JACKDEVICE_H__
#include "AUD_SoftwareDevice.h"
@@ -205,4 +205,4 @@ public:
bool doesPlayback();
};
-#endif //AUD_JACKDEVICE
+#endif //__AUD_JACKDEVICE_H__
diff --git a/intern/audaspace/sndfile/AUD_SndFileFactory.h b/intern/audaspace/sndfile/AUD_SndFileFactory.h
index bd02a596db3..7039c7a2615 100644
--- a/intern/audaspace/sndfile/AUD_SndFileFactory.h
+++ b/intern/audaspace/sndfile/AUD_SndFileFactory.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_SNDFILEFACTORY
-#define AUD_SNDFILEFACTORY
+#ifndef __AUD_SNDFILEFACTORY_H__
+#define __AUD_SNDFILEFACTORY_H__
#include "AUD_IFactory.h"
#include "AUD_Reference.h"
@@ -73,4 +73,4 @@ public:
virtual AUD_Reference<AUD_IReader> createReader();
};
-#endif //AUD_SNDFILEFACTORY
+#endif //__AUD_SNDFILEFACTORY_H__
diff --git a/intern/audaspace/sndfile/AUD_SndFileReader.h b/intern/audaspace/sndfile/AUD_SndFileReader.h
index b4552a7d0e5..81d8b45120c 100644
--- a/intern/audaspace/sndfile/AUD_SndFileReader.h
+++ b/intern/audaspace/sndfile/AUD_SndFileReader.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_SNDFILEREADER
-#define AUD_SNDFILEREADER
+#ifndef __AUD_SNDFILEREADER_H__
+#define __AUD_SNDFILEREADER_H__
#include "AUD_IReader.h"
#include "AUD_Reference.h"
@@ -125,4 +125,4 @@ public:
virtual void read(int& length, bool& eos, sample_t* buffer);
};
-#endif //AUD_SNDFILEREADER
+#endif //__AUD_SNDFILEREADER_H__
diff --git a/intern/audaspace/sndfile/AUD_SndFileWriter.h b/intern/audaspace/sndfile/AUD_SndFileWriter.h
index 9e29fd1a347..0cadbd19a09 100644
--- a/intern/audaspace/sndfile/AUD_SndFileWriter.h
+++ b/intern/audaspace/sndfile/AUD_SndFileWriter.h
@@ -27,8 +27,8 @@
*/
-#ifndef AUD_SNDFILEWRITER
-#define AUD_SNDFILEWRITER
+#ifndef __AUD_SNDFILEWRITER_H__
+#define __AUD_SNDFILEWRITER_H__
#include "AUD_IWriter.h"
@@ -83,4 +83,4 @@ public:
virtual void write(unsigned int length, sample_t* buffer);
};
-#endif //AUD_SNDFILEWRITER
+#endif //__AUD_SNDFILEWRITER_H__
diff --git a/intern/boolop/extern/BOP_Interface.h b/intern/boolop/extern/BOP_Interface.h
index eee0a2478ca..fbada7dcab5 100644
--- a/intern/boolop/extern/BOP_Interface.h
+++ b/intern/boolop/extern/BOP_Interface.h
@@ -29,8 +29,8 @@
* \ingroup boolop
*/
-#ifndef BOP_INTERFACE_H
-#define BOP_INTERFACE_H
+#ifndef __BOP_INTERFACE_H__
+#define __BOP_INTERFACE_H__
#include "../../bsp/intern/BSP_CSGMesh.h"
diff --git a/intern/boolop/intern/BOP_BBox.h b/intern/boolop/intern/BOP_BBox.h
index 266ffd9b0b4..c58bb704fc3 100644
--- a/intern/boolop/intern/BOP_BBox.h
+++ b/intern/boolop/intern/BOP_BBox.h
@@ -30,8 +30,8 @@
*/
-#ifndef BOP_BBOX_H
-#define BOP_BBOX_H
+#ifndef __BOP_BBOX_H__
+#define __BOP_BBOX_H__
#include "MT_Point3.h"
#include "BOP_MathUtils.h"
diff --git a/intern/boolop/intern/BOP_BSPNode.h b/intern/boolop/intern/BOP_BSPNode.h
index 9f924407b62..e8646cd904c 100644
--- a/intern/boolop/intern/BOP_BSPNode.h
+++ b/intern/boolop/intern/BOP_BSPNode.h
@@ -30,8 +30,8 @@
*/
-#ifndef BOP_BSPNODE_H
-#define BOP_BSPNODE_H
+#ifndef __BOP_BSPNODE_H__
+#define __BOP_BSPNODE_H__
#include "MT_Plane3.h"
#include "BOP_Tag.h"
diff --git a/intern/boolop/intern/BOP_BSPTree.h b/intern/boolop/intern/BOP_BSPTree.h
index 41570de2377..b3abd55bf2a 100644
--- a/intern/boolop/intern/BOP_BSPTree.h
+++ b/intern/boolop/intern/BOP_BSPTree.h
@@ -30,8 +30,8 @@
*/
-#ifndef BOP_BSPTREE_H
-#define BOP_BSPTREE_H
+#ifndef __BOP_BSPTREE_H__
+#define __BOP_BSPTREE_H__
#include "BOP_BSPNode.h"
#include "BOP_Mesh.h"
diff --git a/intern/boolop/intern/BOP_Chrono.h b/intern/boolop/intern/BOP_Chrono.h
index 1adbfa3edb1..8f09eeae82e 100644
--- a/intern/boolop/intern/BOP_Chrono.h
+++ b/intern/boolop/intern/BOP_Chrono.h
@@ -30,8 +30,8 @@
*/
-#ifndef BOP_CHRONO_H
-#define BOP_CHRONO_H
+#ifndef __BOP_CHRONO_H__
+#define __BOP_CHRONO_H__
#include <time.h>
diff --git a/intern/boolop/intern/BOP_Edge.h b/intern/boolop/intern/BOP_Edge.h
index 867ad5df9f1..fd2f53b1aa4 100644
--- a/intern/boolop/intern/BOP_Edge.h
+++ b/intern/boolop/intern/BOP_Edge.h
@@ -30,8 +30,8 @@
*/
-#ifndef BOP_EDGE_H
-#define BOP_EDGE_H
+#ifndef __BOP_EDGE_H__
+#define __BOP_EDGE_H__
#include "BOP_Indexs.h"
#include "BOP_Misc.h"
diff --git a/intern/boolop/intern/BOP_Face.h b/intern/boolop/intern/BOP_Face.h
index 6f79b8b17c0..4f09618e23a 100644
--- a/intern/boolop/intern/BOP_Face.h
+++ b/intern/boolop/intern/BOP_Face.h
@@ -30,8 +30,8 @@
*/
-#ifndef BOP_FACE_H
-#define BOP_FACE_H
+#ifndef __BOP_FACE_H__
+#define __BOP_FACE_H__
#include "BOP_Tag.h"
#include "MT_Plane3.h"
diff --git a/intern/boolop/intern/BOP_Face2Face.h b/intern/boolop/intern/BOP_Face2Face.h
index c4404295610..9809084ce3b 100644
--- a/intern/boolop/intern/BOP_Face2Face.h
+++ b/intern/boolop/intern/BOP_Face2Face.h
@@ -30,8 +30,8 @@
*/
-#ifndef BOP_FACE2FACE_H
-#define BOP_FACE2FACE_H
+#ifndef __BOP_FACE2FACE_H__
+#define __BOP_FACE2FACE_H__
#include "BOP_Mesh.h"
#include "BOP_Segment.h"
diff --git a/intern/boolop/intern/BOP_Indexs.h b/intern/boolop/intern/BOP_Indexs.h
index 4e71c66d4a4..e001f412c9f 100644
--- a/intern/boolop/intern/BOP_Indexs.h
+++ b/intern/boolop/intern/BOP_Indexs.h
@@ -30,8 +30,8 @@
*/
-#ifndef BOP_Indexs_H
-#define BOP_Indexs_H
+#ifndef __BOP_INDEXS_H__
+#define __BOP_INDEXS_H__
#include <vector>
diff --git a/intern/boolop/intern/BOP_MathUtils.h b/intern/boolop/intern/BOP_MathUtils.h
index 27e5e100b8c..38acd98dd3d 100644
--- a/intern/boolop/intern/BOP_MathUtils.h
+++ b/intern/boolop/intern/BOP_MathUtils.h
@@ -32,8 +32,8 @@
*/
-#ifndef BOP_MATHUTILS_H
-#define BOP_MATHUTILS_H
+#ifndef __BOP_MATHUTILS_H__
+#define __BOP_MATHUTILS_H__
#include <math.h>
#include <float.h>
diff --git a/intern/boolop/intern/BOP_Merge.h b/intern/boolop/intern/BOP_Merge.h
index 5a24579e7b5..9d6d7030ba7 100644
--- a/intern/boolop/intern/BOP_Merge.h
+++ b/intern/boolop/intern/BOP_Merge.h
@@ -30,8 +30,8 @@
*/
-#ifndef BOP_MERGE_H
-#define BOP_MERGE_H
+#ifndef __BOP_MERGE_H__
+#define __BOP_MERGE_H__
#include "BOP_Misc.h"
diff --git a/intern/boolop/intern/BOP_Merge2.h b/intern/boolop/intern/BOP_Merge2.h
index 78a4caff7d9..1e26a2576be 100644
--- a/intern/boolop/intern/BOP_Merge2.h
+++ b/intern/boolop/intern/BOP_Merge2.h
@@ -30,8 +30,8 @@
*/
-#ifndef BOP_MERGE2_H
-#define BOP_MERGE2_H
+#ifndef __BOP_MERGE2_H__
+#define __BOP_MERGE2_H__
#include "BOP_Misc.h"
diff --git a/intern/boolop/intern/BOP_Mesh.h b/intern/boolop/intern/BOP_Mesh.h
index 271e97fe454..381557ec58b 100644
--- a/intern/boolop/intern/BOP_Mesh.h
+++ b/intern/boolop/intern/BOP_Mesh.h
@@ -32,8 +32,8 @@
*/
-#ifndef BOP_MESH_H
-#define BOP_MESH_H
+#ifndef __BOP_MESH_H__
+#define __BOP_MESH_H__
#include "BOP_Vertex.h"
#include "BOP_Edge.h"
diff --git a/intern/boolop/intern/BOP_Segment.h b/intern/boolop/intern/BOP_Segment.h
index 4a2b4509846..5a49ae844c4 100644
--- a/intern/boolop/intern/BOP_Segment.h
+++ b/intern/boolop/intern/BOP_Segment.h
@@ -30,8 +30,8 @@
*/
-#ifndef BOP_SEGMENT_H
-#define BOP_SEGMENT_H
+#ifndef __BOP_SEGMENT_H__
+#define __BOP_SEGMENT_H__
#include "BOP_Indexs.h"
#include <iostream>
diff --git a/intern/boolop/intern/BOP_Splitter.h b/intern/boolop/intern/BOP_Splitter.h
index a14f46510d6..8d79b89aa91 100644
--- a/intern/boolop/intern/BOP_Splitter.h
+++ b/intern/boolop/intern/BOP_Splitter.h
@@ -30,8 +30,8 @@
*/
-#ifndef BOP_SPLITTER_H
-#define BOP_SPLITTER_H
+#ifndef __BOP_SPLITTER_H__
+#define __BOP_SPLITTER_H__
#include "BOP_MathUtils.h"
#include "BOP_Segment.h"
diff --git a/intern/boolop/intern/BOP_Tag.h b/intern/boolop/intern/BOP_Tag.h
index 79d13709cd4..b7438275e90 100644
--- a/intern/boolop/intern/BOP_Tag.h
+++ b/intern/boolop/intern/BOP_Tag.h
@@ -33,8 +33,8 @@
#include <string.h>
#include <stdio.h>
-#ifndef BOP_TAG_H
-#define BOP_TAG_H
+#ifndef __BOP_TAG_H__
+#define __BOP_TAG_H__
#define IN_TAG 0x02 // Below the plane
#define ON_TAG 0x00 // On the plane
diff --git a/intern/boolop/intern/BOP_Triangulator.h b/intern/boolop/intern/BOP_Triangulator.h
index 9fb314f894d..55dd51d09c3 100644
--- a/intern/boolop/intern/BOP_Triangulator.h
+++ b/intern/boolop/intern/BOP_Triangulator.h
@@ -30,8 +30,8 @@
*/
-#ifndef BOP_TRIANGULATOR_H
-#define BOP_TRIANGULATOR_H
+#ifndef __BOP_TRIANGULATOR_H__
+#define __BOP_TRIANGULATOR_H__
#include "BOP_MathUtils.h"
#include "BOP_Mesh.h"
diff --git a/intern/boolop/intern/BOP_Vertex.h b/intern/boolop/intern/BOP_Vertex.h
index 3f1780c5081..1aae2207972 100644
--- a/intern/boolop/intern/BOP_Vertex.h
+++ b/intern/boolop/intern/BOP_Vertex.h
@@ -30,8 +30,8 @@
*/
-#ifndef BOP_VERTEX_H
-#define BOP_VERTEX_H
+#ifndef __BOP_VERTEX_H__
+#define __BOP_VERTEX_H__
#include "BOP_Tag.h"
#include "BOP_Indexs.h"
diff --git a/intern/bsp/extern/CSG_BooleanOps.h b/intern/bsp/extern/CSG_BooleanOps.h
index eea0dbc547c..94a74c30536 100644
--- a/intern/bsp/extern/CSG_BooleanOps.h
+++ b/intern/bsp/extern/CSG_BooleanOps.h
@@ -30,8 +30,8 @@
*/
-#ifndef CSG_BOOLEANOPS_H
-#define CSG_BOOLEANOPS_H
+#ifndef __CSG_BOOLEANOPS_H__
+#define __CSG_BOOLEANOPS_H__
/**
diff --git a/intern/bsp/intern/BSP_CSGException.h b/intern/bsp/intern/BSP_CSGException.h
index fc1160d60ee..744359c1078 100644
--- a/intern/bsp/intern/BSP_CSGException.h
+++ b/intern/bsp/intern/BSP_CSGException.h
@@ -30,8 +30,8 @@
*/
-#ifndef NAN_INCLUDED_CSGException_h
-#define NAN_INCLUDED_CSGException_h
+#ifndef __BSP_CSGEXCEPTION_H__
+#define __BSP_CSGEXCEPTION_H__
// stick in more error types as you think of them
diff --git a/intern/bsp/intern/BSP_CSGMesh.h b/intern/bsp/intern/BSP_CSGMesh.h
index 13a38f26689..3fd1f0cebaf 100644
--- a/intern/bsp/intern/BSP_CSGMesh.h
+++ b/intern/bsp/intern/BSP_CSGMesh.h
@@ -30,8 +30,8 @@
*/
-#ifndef NAN_INCLUDED_BSP_CSGMesh_h
-#define NAN_INCLUDED_BSP_CSGMesh_h
+#ifndef __BSP_CSGMESH_H__
+#define __BSP_CSGMESH_H__
#include "BSP_MeshPrimitives.h"
#include "MEM_SmartPtr.h"
diff --git a/intern/bsp/intern/BSP_CSGMesh_CFIterator.h b/intern/bsp/intern/BSP_CSGMesh_CFIterator.h
index 3a1a9dbd433..cadd3df4360 100644
--- a/intern/bsp/intern/BSP_CSGMesh_CFIterator.h
+++ b/intern/bsp/intern/BSP_CSGMesh_CFIterator.h
@@ -30,9 +30,9 @@
*/
-#ifndef BSP_CSGMesh_CFIterator_h
+#ifndef __BSP_CSGMESH_CFITERATOR_H__
-#define BSP_CSGMesh_CFIterator_h
+#define __BSP_CSGMESH_CFITERATOR_H__
#include "BSP_CSGMesh.h"
#include "../extern/CSG_BooleanOps.h"
diff --git a/intern/bsp/intern/BSP_MeshPrimitives.h b/intern/bsp/intern/BSP_MeshPrimitives.h
index 4b795f4cfa2..018677327f4 100644
--- a/intern/bsp/intern/BSP_MeshPrimitives.h
+++ b/intern/bsp/intern/BSP_MeshPrimitives.h
@@ -30,8 +30,8 @@
*/
-#ifndef NAN_INCLUDED_BSP_MeshPrimitives
-#define NAN_INCLUDED_BSP_MeshPrimitives
+#ifndef __BSP_MESHPRIMITIVES_H__
+#define __BSP_MESHPRIMITIVES_H__
#include "CTR_TaggedIndex.h"
#include "MT_Vector3.h"
diff --git a/intern/bsp/test/BSP_GhostTest/BSP_GhostTest3D.h b/intern/bsp/test/BSP_GhostTest/BSP_GhostTest3D.h
index 26db15fd587..8bfa6d061ee 100644
--- a/intern/bsp/test/BSP_GhostTest/BSP_GhostTest3D.h
+++ b/intern/bsp/test/BSP_GhostTest/BSP_GhostTest3D.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BSP_GhostTest_h
-#define BSP_GhostTest_h
+#ifndef __BSP_GHOSTTEST3D_H__
+#define __BSP_GHOSTTEST3D_H__
#include "GHOST_IEventConsumer.h"
#include "MT_Vector3.h"
diff --git a/intern/bsp/test/BSP_GhostTest/BSP_MeshDrawer.h b/intern/bsp/test/BSP_GhostTest/BSP_MeshDrawer.h
index 443c41a7c85..17aeccc603a 100644
--- a/intern/bsp/test/BSP_GhostTest/BSP_MeshDrawer.h
+++ b/intern/bsp/test/BSP_GhostTest/BSP_MeshDrawer.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BSP_MeshDrawer_h
-#define BSP_MeshDrawer_h
+#ifndef __BSP_MESHDRAWER_H__
+#define __BSP_MESHDRAWER_H__
class BSP_TMesh;
class MT_Vector3;
diff --git a/intern/bsp/test/BSP_GhostTest/BSP_PlyLoader.h b/intern/bsp/test/BSP_GhostTest/BSP_PlyLoader.h
index 73803ebf921..8fcac29253b 100644
--- a/intern/bsp/test/BSP_GhostTest/BSP_PlyLoader.h
+++ b/intern/bsp/test/BSP_GhostTest/BSP_PlyLoader.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BSP_PlyLoader_h
-#define BSP_PlyLoader_h
+#ifndef __BSP_PLYLOADER_H__
+#define __BSP_PLYLOADER_H__
#include "MEM_SmartPtr.h"
#include "BSP_TMesh.h"
diff --git a/intern/bsp/test/BSP_GhostTest/BSP_TMesh.h b/intern/bsp/test/BSP_GhostTest/BSP_TMesh.h
index 3de5fd5df4c..ca4ab106664 100644
--- a/intern/bsp/test/BSP_GhostTest/BSP_TMesh.h
+++ b/intern/bsp/test/BSP_GhostTest/BSP_TMesh.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BSP_TMesh_h
-#define BSP_TMesh_h
+#ifndef __BSP_TMESH_H__
+#define __BSP_TMESH_H__
#include "MT_Point3.h"
#include "MT_Vector3.h"
diff --git a/intern/container/CTR_TaggedIndex.h b/intern/container/CTR_TaggedIndex.h
index 00a24d07760..8420414d6c7 100644
--- a/intern/container/CTR_TaggedIndex.h
+++ b/intern/container/CTR_TaggedIndex.h
@@ -36,8 +36,8 @@
* Simple tagged index class.
*/
-#ifndef NAN_INCLUDED_CTR_TaggedIndex_h
-#define NAN_INCLUDED_CTR_TaggedIndex_h
+#ifndef __CTR_TAGGEDINDEX_H__
+#define __CTR_TAGGEDINDEX_H__
/**
* This class is supposed to be a simple tagged index class. If these
diff --git a/intern/container/CTR_TaggedSetOps.h b/intern/container/CTR_TaggedSetOps.h
index 9dc4e4f00db..d30081d2d60 100644
--- a/intern/container/CTR_TaggedSetOps.h
+++ b/intern/container/CTR_TaggedSetOps.h
@@ -30,8 +30,8 @@
*/
-#ifndef NAN_INCLUDED_LOD_TaggedSetOps_h
-#define NAN_INCLUDED_LOD_TaggedSetOps_h
+#ifndef __CTR_TAGGEDSETOPS_H__
+#define __CTR_TAGGEDSETOPS_H__
#include "MEM_NonCopyable.h"
#include <vector>
diff --git a/intern/container/CTR_UHeap.h b/intern/container/CTR_UHeap.h
index 11813c48331..ad3d7d2bb02 100644
--- a/intern/container/CTR_UHeap.h
+++ b/intern/container/CTR_UHeap.h
@@ -44,8 +44,8 @@
*
*/
-#ifndef NAN_INCLUDED_CTR_UHeap_h
-#define NAN_INCLUDED_CTR_UHeap_h
+#ifndef __CTR_UHEAP_H__
+#define __CTR_UHEAP_H__
#include <vector>
diff --git a/intern/decimation/extern/LOD_decimation.h b/intern/decimation/extern/LOD_decimation.h
index 1c31e98f3da..4c52cb18577 100644
--- a/intern/decimation/extern/LOD_decimation.h
+++ b/intern/decimation/extern/LOD_decimation.h
@@ -38,8 +38,8 @@
* This is the external interface for the decimation module.
*/
-#ifndef NAN_INCLUDED_LOD_decimation_h
-#define NAN_INCLUDED_LOD_decimation_h
+#ifndef __LOD_DECIMATION_H__
+#define __LOD_DECIMATION_H__
#ifdef __cplusplus
extern "C" {
@@ -113,5 +113,5 @@ extern int LOD_FreeDecimationData(LOD_Decimation_InfoPtr);
}
#endif
-#endif // NAN_INCLUDED_LOD_decimation_h
+#endif // __LOD_DECIMATION_H__
diff --git a/intern/decimation/intern/LOD_DecimationClass.h b/intern/decimation/intern/LOD_DecimationClass.h
index a91db1a28e6..ecf2e4e6790 100644
--- a/intern/decimation/intern/LOD_DecimationClass.h
+++ b/intern/decimation/intern/LOD_DecimationClass.h
@@ -30,8 +30,8 @@
*/
-#ifndef NAN_INCLUDED_LOD_DecimationClass_h
-#define NAN_INCLUDED_LOD_DecimationClass_h
+#ifndef __LOD_DECIMATIONCLASS_H__
+#define __LOD_DECIMATIONCLASS_H__
#include "MEM_SmartPtr.h"
#include "MEM_NonCopyable.h"
diff --git a/intern/decimation/intern/LOD_EdgeCollapser.h b/intern/decimation/intern/LOD_EdgeCollapser.h
index ae4e9072f5b..75a8b70f672 100644
--- a/intern/decimation/intern/LOD_EdgeCollapser.h
+++ b/intern/decimation/intern/LOD_EdgeCollapser.h
@@ -30,8 +30,8 @@
*/
-#ifndef NAN_INCLDUED_EgdeCollapser_h
-#define NAN_INCLDUED_EgdeCollapser_h
+#ifndef __LOD_EDGECOLLAPSER_H__
+#define __LOD_EDGECOLLAPSER_H__
// This is a helper class that collapses edges of a 2 - manifold mesh.
diff --git a/intern/decimation/intern/LOD_ExternBufferEditor.h b/intern/decimation/intern/LOD_ExternBufferEditor.h
index 3d7665754f7..c903b255812 100644
--- a/intern/decimation/intern/LOD_ExternBufferEditor.h
+++ b/intern/decimation/intern/LOD_ExternBufferEditor.h
@@ -35,8 +35,8 @@
* Copyright (C) 2001 NaN Technologies B.V.
*/
-#ifndef NAN_INCLUDED_LOD_ExternBufferEditor_h
-#define NAN_INCLUDED_LOD_ExternBufferEditor_h
+#ifndef __LOD_EXTERNBUFFEREDITOR_H__
+#define __LOD_EXTERNBUFFEREDITOR_H__
#include "LOD_MeshPrimitives.h"
#include <vector>
diff --git a/intern/decimation/intern/LOD_ExternNormalEditor.h b/intern/decimation/intern/LOD_ExternNormalEditor.h
index 491cccabf1e..1c637453467 100644
--- a/intern/decimation/intern/LOD_ExternNormalEditor.h
+++ b/intern/decimation/intern/LOD_ExternNormalEditor.h
@@ -30,8 +30,8 @@
*/
-#ifndef NAN_INCLUDED_ExternNormalEditor_h
-#define NAN_INCLUDED_ExternNormalEditor_h
+#ifndef __LOD_EXTERNNORMALEDITOR_H__
+#define __LOD_EXTERNNORMALEDITOR_H__
#include "MEM_NonCopyable.h"
#include "LOD_ManMesh2.h"
diff --git a/intern/decimation/intern/LOD_FaceNormalEditor.h b/intern/decimation/intern/LOD_FaceNormalEditor.h
index 6fd65e3db62..b2f941f990f 100644
--- a/intern/decimation/intern/LOD_FaceNormalEditor.h
+++ b/intern/decimation/intern/LOD_FaceNormalEditor.h
@@ -30,8 +30,8 @@
*/
-#ifndef NAN_INCLUDED_FaceNormalEditor_h
-#define NAN_INCLUDED_FaceNormalEditor_h
+#ifndef __LOD_FACENORMALEDITOR_H__
+#define __LOD_FACENORMALEDITOR_H__
#include "MEM_NonCopyable.h"
#include "LOD_ManMesh2.h"
diff --git a/intern/decimation/intern/LOD_ManMesh2.h b/intern/decimation/intern/LOD_ManMesh2.h
index 1377a405ff7..63ea7912c2d 100644
--- a/intern/decimation/intern/LOD_ManMesh2.h
+++ b/intern/decimation/intern/LOD_ManMesh2.h
@@ -30,8 +30,8 @@
*/
-#ifndef NAN_INCLUDED_ManMesh2_h
-#define NAN_INCLUDED_ManMesh2_h
+#ifndef __LOD_MANMESH2_H__
+#define __LOD_MANMESH2_H__
#include "LOD_MeshPrimitives.h"
#include "MEM_SmartPtr.h"
diff --git a/intern/decimation/intern/LOD_MeshBounds.h b/intern/decimation/intern/LOD_MeshBounds.h
index 116c32efed6..c95e6c7b61f 100644
--- a/intern/decimation/intern/LOD_MeshBounds.h
+++ b/intern/decimation/intern/LOD_MeshBounds.h
@@ -30,8 +30,8 @@
*/
-#ifndef NAN_INCLUDED_MeshBounds_h
-#define NAN_INCLUDED_MeshBounds_h
+#ifndef __LOD_MESHBOUNDS_H__
+#define __LOD_MESHBOUNDS_H__
#include "MEM_SmartPtr.h"
#include "LOD_MeshPrimitives.h"
diff --git a/intern/decimation/intern/LOD_MeshException.h b/intern/decimation/intern/LOD_MeshException.h
index 15a88777146..67bd8188c41 100644
--- a/intern/decimation/intern/LOD_MeshException.h
+++ b/intern/decimation/intern/LOD_MeshException.h
@@ -30,8 +30,8 @@
*/
-#ifndef NAN_INCLUDED_MeshExceptions_h
-#define NAN_INCLUDED_MeshExceptions_h
+#ifndef __LOD_MESHEXCEPTION_H__
+#define __LOD_MESHEXCEPTION_H__
class LOD_MeshException {
diff --git a/intern/decimation/intern/LOD_MeshPrimitives.h b/intern/decimation/intern/LOD_MeshPrimitives.h
index e863f27e071..a43e29f3fe7 100644
--- a/intern/decimation/intern/LOD_MeshPrimitives.h
+++ b/intern/decimation/intern/LOD_MeshPrimitives.h
@@ -30,8 +30,8 @@
*/
-#ifndef NAN_INCLUDED_MeshPrimitives_h
-#define NAN_INCLUDED_MeshPrimitives_h
+#ifndef __LOD_MESHPRIMITIVES_H__
+#define __LOD_MESHPRIMITIVES_H__
#include "MT_Vector3.h"
#include "CTR_TaggedIndex.h"
diff --git a/intern/decimation/intern/LOD_QSDecimator.h b/intern/decimation/intern/LOD_QSDecimator.h
index d471186a360..2ac223996f2 100644
--- a/intern/decimation/intern/LOD_QSDecimator.h
+++ b/intern/decimation/intern/LOD_QSDecimator.h
@@ -30,8 +30,8 @@
*/
-#ifndef NAN_INCLUDED_LOD_QSDecimator_H
-#define NAN_INCLUDED_LOD_QSDecimator_H
+#ifndef __LOD_QSDECIMATOR_H__
+#define __LOD_QSDECIMATOR_H__
#include "MEM_NonCopyable.h"
#include "LOD_ManMesh2.h"
diff --git a/intern/decimation/intern/LOD_Quadric.h b/intern/decimation/intern/LOD_Quadric.h
index cb7846da2ca..9dde0502aa3 100644
--- a/intern/decimation/intern/LOD_Quadric.h
+++ b/intern/decimation/intern/LOD_Quadric.h
@@ -30,8 +30,8 @@
*/
-#ifndef NAN_INCLUDED_LOD_Quadric_h
-#define NAN_INCLUDED_LOD_Quadric_h
+#ifndef __LOD_QUADRIC_H__
+#define __LOD_QUADRIC_H__
#include "MT_Vector3.h"
#include "MT_Matrix3x3.h"
diff --git a/intern/decimation/intern/LOD_QuadricEditor.h b/intern/decimation/intern/LOD_QuadricEditor.h
index 0b0c7eead45..0a66d299e15 100644
--- a/intern/decimation/intern/LOD_QuadricEditor.h
+++ b/intern/decimation/intern/LOD_QuadricEditor.h
@@ -30,8 +30,8 @@
*/
-#ifndef NAN_INCLUDED_LOD_QuadricEditor_h
-#define NAN_INCLUDED_LOD_QuadricEditor_h
+#ifndef __LOD_QUADRICEDITOR_H__
+#define __LOD_QUADRICEDITOR_H__
#include "MEM_NonCopyable.h"
#include "LOD_ManMesh2.h"
diff --git a/intern/dualcon/dualcon.h b/intern/dualcon/dualcon.h
index 9346adc99b3..53135a7dcc1 100644
--- a/intern/dualcon/dualcon.h
+++ b/intern/dualcon/dualcon.h
@@ -20,8 +20,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef DUALCON_H
-#define DUALCON_H
+#ifndef __DUALCON_H__
+#define __DUALCON_H__
#ifdef __cplusplus
extern "C" {
@@ -92,4 +92,4 @@ void *dualcon(const DualConInput *input_mesh,
}
#endif
-#endif
+#endif /* __DUALCON_H__ */
diff --git a/intern/dualcon/intern/MemoryAllocator.h b/intern/dualcon/intern/MemoryAllocator.h
index de9dca175a4..a1be0978409 100644
--- a/intern/dualcon/intern/MemoryAllocator.h
+++ b/intern/dualcon/intern/MemoryAllocator.h
@@ -43,8 +43,8 @@
class VirtualMemoryAllocator
{
public:
- virtual UCHAR * allocate( ) = 0 ;
- virtual void deallocate( UCHAR * obj ) = 0 ;
+ virtual void * allocate( ) = 0 ;
+ virtual void deallocate( void * obj ) = 0 ;
virtual void destroy( ) = 0 ;
virtual void printInfo( ) = 0 ;
@@ -161,7 +161,7 @@ public:
/**
* Allocation method
*/
- UCHAR * allocate ( )
+ void * allocate ( )
{
if ( available == 0 )
{
@@ -170,13 +170,13 @@ public:
// printf("Allocating %d\n", header[ allocated ]) ;
available -- ;
- return stack[ available >> HEAP_BASE ][ available & HEAP_MASK ] ;
+ return (void*)stack[ available >> HEAP_BASE ][ available & HEAP_MASK ] ;
}
/**
* De-allocation method
*/
- void deallocate ( UCHAR * obj )
+ void deallocate ( void * obj )
{
if ( available == stacksize )
{
@@ -184,7 +184,7 @@ public:
}
// printf("De-allocating %d\n", ( obj - data ) / N ) ;
- stack[ available >> HEAP_BASE ][ available & HEAP_MASK ] = obj ;
+ stack[ available >> HEAP_BASE ][ available & HEAP_MASK ] = (UCHAR*)obj ;
available ++ ;
// printf("%d %d\n", allocated, header[ allocated ]) ;
}
diff --git a/intern/dualcon/intern/octree.cpp b/intern/dualcon/intern/octree.cpp
index 90dbf5376a2..38b130f979b 100644
--- a/intern/dualcon/intern/octree.cpp
+++ b/intern/dualcon/intern/octree.cpp
@@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * Contributor(s): Tao Ju
+ * Contributor(s): Tao Ju, Nicholas Bishop
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -42,12 +42,12 @@
#define dc_printf(...) do {} while(0)
#endif
-Octree::Octree( ModelReader* mr,
+Octree::Octree(ModelReader* mr,
DualConAllocOutput alloc_output_func,
DualConAddVert add_vert_func,
DualConAddQuad add_quad_func,
DualConFlags flags, DualConMode dualcon_mode, int depth,
- float threshold, float sharpness )
+ float threshold, float sharpness)
: use_flood_fill(flags & DUALCON_FLOOD_FILL),
/* note on `use_manifold':
@@ -72,956 +72,574 @@ Octree::Octree( ModelReader* mr,
add_vert(add_vert_func),
add_quad(add_quad_func)
{
- this->thresh = threshold ;
- this->reader = mr ;
- this->dimen = 1 << GRID_DIMENSION ;
- this->range = reader->getBoundingBox( this->origin ) ;
- this->nodeCount = this->nodeSpace = 0;
- this->maxDepth = depth ;
- this->mindimen = ( dimen >> maxDepth ) ;
- this->minshift = ( GRID_DIMENSION - maxDepth ) ;
- this->buildTable( ) ;
-
- flood_bytes = use_flood_fill ? FLOOD_FILL_BYTES : 0;
- leaf_extra_bytes = flood_bytes + CINDY_BYTES;
-
-#ifdef USE_HERMIT
- leaf_node_bytes = 7 + leaf_extra_bytes;
-#else
- leaf_node_bytes = 3 + leaf_extra_bytes;
-#endif
+ thresh = threshold;
+ reader = mr;
+ dimen = 1 << GRID_DIMENSION;
+ range = reader->getBoundingBox(origin);
+ nodeCount = nodeSpace = 0;
+ maxDepth = depth;
+ mindimen =(dimen >> maxDepth);
+ minshift =(GRID_DIMENSION - maxDepth);
+ buildTable();
-#ifdef QIANYI
- dc_printf("Origin: (%f %f %f), Dimension: %f\n", origin[0], origin[1], origin[2], range) ;
-#endif
-
- this->maxTrianglePerCell = 0 ;
+ maxTrianglePerCell = 0;
// Initialize memory
#ifdef IN_VERBOSE_MODE
- dc_printf("Range: %f origin: %f, %f,%f \n", range, origin[0], origin[1], origin[2] ) ;
- dc_printf("Initialize memory...\n") ;
+ dc_printf("Range: %f origin: %f, %f,%f \n", range, origin[0], origin[1], origin[2]);
+ dc_printf("Initialize memory...\n");
#endif
- initMemory( ) ;
- this->root = createInternal( 0 ) ;
+ initMemory();
+ root = (Node*)createInternal(0);
// Read MC table
#ifdef IN_VERBOSE_MODE
- dc_printf("Reading contour table...\n") ;
+ dc_printf("Reading contour table...\n");
#endif
- this->cubes = new Cubes();
+ cubes = new Cubes();
}
-Octree::~Octree( )
+Octree::~Octree()
{
- freeMemory( ) ;
+ freeMemory();
}
void Octree::scanConvert()
{
// Scan triangles
#if DC_DEBUG
- clock_t start, finish ;
- start = clock( ) ;
+ clock_t start, finish;
+ start = clock();
#endif
- this->addTrian( ) ;
- this->resetMinimalEdges( ) ;
- this->preparePrimalEdgesMask( this->root ) ;
+ addTrian();
+ resetMinimalEdges();
+ preparePrimalEdgesMask(&root->internal);
#if DC_DEBUG
- finish = clock( ) ;
+ finish = clock();
dc_printf("Time taken: %f seconds \n",
- (double)(finish - start) / CLOCKS_PER_SEC ) ;
+ (double)(finish - start) / CLOCKS_PER_SEC);
#endif
// Generate signs
// Find holes
#if DC_DEBUG
- dc_printf("Patching...\n") ;
- start = clock( ) ;
+ dc_printf("Patching...\n");
+ start = clock();
#endif
- this->trace( ) ;
+ trace();
#if DC_DEBUG
- finish = clock( ) ;
- dc_printf("Time taken: %f seconds \n", (double)(finish - start) / CLOCKS_PER_SEC ) ;
+ finish = clock();
+ dc_printf("Time taken: %f seconds \n", (double)(finish - start) / CLOCKS_PER_SEC);
#ifdef IN_VERBOSE_MODE
- dc_printf("Holes: %d Average Length: %f Max Length: %d \n", numRings, (float)totRingLengths / (float) numRings, maxRingLength ) ;
+ dc_printf("Holes: %d Average Length: %f Max Length: %d \n", numRings,(float)totRingLengths /(float) numRings, maxRingLength);
#endif
#endif
// Check again
- int tnumRings = numRings ;
- this->trace( ) ;
+ int tnumRings = numRings;
+ trace();
#ifdef IN_VERBOSE_MODE
- dc_printf("Holes after patching: %d \n", numRings) ;
+ dc_printf("Holes after patching: %d \n", numRings);
#endif
- numRings = tnumRings ;
+ numRings = tnumRings;
#if DC_DEBUG
- dc_printf("Building signs...\n") ;
- start = clock( ) ;
+ dc_printf("Building signs...\n");
+ start = clock();
#endif
- this->buildSigns( ) ;
+ buildSigns();
#if DC_DEBUG
- finish = clock( ) ;
- dc_printf("Time taken: %f seconds \n", (double)(finish - start) / CLOCKS_PER_SEC ) ;
+ finish = clock();
+ dc_printf("Time taken: %f seconds \n", (double)(finish - start) / CLOCKS_PER_SEC);
#endif
if(use_flood_fill) {
/*
- start = clock( ) ;
- this->floodFill( ) ;
+ start = clock();
+ floodFill();
// Check again
- tnumRings = numRings ;
- this->trace( ) ;
- dc_printf("Holes after filling: %d \n", numRings) ;
- numRings = tnumRings ;
- this->buildSigns( ) ;
- finish = clock( ) ;
- dc_printf("Time taken: %f seconds \n", (double)(finish - start) / CLOCKS_PER_SEC ) ;
+ tnumRings = numRings;
+ trace();
+ dc_printf("Holes after filling: %d \n", numRings);
+ numRings = tnumRings;
+ buildSigns();
+ finish = clock();
+ dc_printf("Time taken: %f seconds \n", (double)(finish - start) / CLOCKS_PER_SEC);
*/
#if DC_DEBUG
- start = clock( ) ;
+ start = clock();
dc_printf("Removing components...\n");
#endif
- this->floodFill( ) ;
- this->buildSigns( ) ;
+ floodFill();
+ buildSigns();
// dc_printf("Checking...\n");
- // this->floodFill( ) ;
+ // floodFill();
#if DC_DEBUG
- finish = clock( ) ;
- dc_printf("Time taken: %f seconds \n", (double)(finish - start) / CLOCKS_PER_SEC ) ;
+ finish = clock();
+ dc_printf("Time taken: %f seconds \n",(double)(finish - start) / CLOCKS_PER_SEC);
#endif
}
// Output
-#ifdef OUTPUT_REPAIRED
#if DC_DEBUG
- start = clock( ) ;
+ start = clock();
#endif
writeOut();
#if DC_DEBUG
- finish = clock( ) ;
-#endif
- // dc_printf("Time taken: %f seconds \n", (double)(finish - start) / CLOCKS_PER_SEC ) ;
-#ifdef CINDY
- this->writeTags( "tags.txt" ) ;
- dc_printf("Tags output to tags.txt\n") ;
-#endif
-
+ finish = clock();
#endif
+ // dc_printf("Time taken: %f seconds \n", (double)(finish - start) / CLOCKS_PER_SEC);
// Print info
#ifdef IN_VERBOSE_MODE
- printMemUsage( ) ;
+ printMemUsage();
#endif
}
-#if 0
-void Octree::writeOut( char* fname )
+void Octree::initMemory()
{
- dc_printf( "\n" ) ;
- if ( strstr( fname, ".ply" ) != NULL )
- {
- dc_printf("Writing PLY file format.\n") ;
- this->outType = 1 ;
- writePLY( fname ) ;
- }
- else if ( strstr( fname, ".off" ) != NULL )
- {
- dc_printf("Writing OFF file format.\n") ;
- this->outType = 0 ;
- writeOFF( fname ) ;
- }
- else if ( strstr( fname, ".sof" ) != NULL )
- {
- dc_printf("Writing Signed Octree File format.\n") ;
- this->outType = 2 ;
- writeOctree( fname ) ;
- }
- else if ( strstr( fname, ".dcf" ) != NULL )
- {
-#ifdef USE_HERMIT
- dc_printf("Writing Dual Contouring File format.\n") ;
- this->outType = 3 ;
- writeDCF( fname ) ;
-#else
- dc_printf("Can not write Dual Contouring File format in non-DC mode.\n") ;
-#endif
- }
-#ifdef USE_HERMIT
- else if ( strstr( fname, ".sog" ) != NULL )
- {
- dc_printf("Writing signed octree with geometry.\n") ;
- this->outType = 4 ;
- writeOctreeGeom( fname ) ;
- }
-#endif
- /*
- else if ( strstr( fname, ".sof" ) != NULL )
- {
- dc_printf("Writing SOF file format.\n") ;
- this->outType = 2 ;
- writeOctree( fname ) ;
- }
- */
- else
- {
- dc_printf("Unknown output format.\n") ;
- }
+ leafalloc[0] = new MemoryAllocator<sizeof(LeafNode)>();
+ leafalloc[1] = new MemoryAllocator<sizeof(LeafNode) + sizeof(float) * EDGE_FLOATS>();
+ leafalloc[2] = new MemoryAllocator<sizeof(LeafNode) + sizeof(float) * EDGE_FLOATS * 2>();
+ leafalloc[3] = new MemoryAllocator<sizeof(LeafNode) + sizeof(float) * EDGE_FLOATS * 3>();
+ alloc[0] = new MemoryAllocator<sizeof(InternalNode)>();
+ alloc[1] = new MemoryAllocator<sizeof(InternalNode) + sizeof(Node*)>();
+ alloc[2] = new MemoryAllocator<sizeof(InternalNode) + sizeof(Node*) * 2>();
+ alloc[3] = new MemoryAllocator<sizeof(InternalNode) + sizeof(Node*) * 3>();
+ alloc[4] = new MemoryAllocator<sizeof(InternalNode) + sizeof(Node*) * 4>();
+ alloc[5] = new MemoryAllocator<sizeof(InternalNode) + sizeof(Node*) * 5>();
+ alloc[6] = new MemoryAllocator<sizeof(InternalNode) + sizeof(Node*) * 6>();
+ alloc[7] = new MemoryAllocator<sizeof(InternalNode) + sizeof(Node*) * 7>();
+ alloc[8] = new MemoryAllocator<sizeof(InternalNode) + sizeof(Node*) * 8>();
}
-#endif
-void Octree::initMemory( )
+void Octree::freeMemory()
{
-#ifdef USE_HERMIT
- const int leaf_node_bytes = 7;
-#else
- const int leaf_node_bytes = 3;
-#endif
-
- if(use_flood_fill) {
- const int bytes = leaf_node_bytes + CINDY_BYTES + FLOOD_FILL_BYTES;
- this->leafalloc[ 0 ] = new MemoryAllocator< bytes > ( ) ;
- this->leafalloc[ 1 ] = new MemoryAllocator< bytes + EDGE_BYTES > ( ) ;
- this->leafalloc[ 2 ] = new MemoryAllocator< bytes + EDGE_BYTES * 2 > ( ) ;
- this->leafalloc[ 3 ] = new MemoryAllocator< bytes + EDGE_BYTES * 3 > ( ) ;
- }
- else {
- const int bytes = leaf_node_bytes + CINDY_BYTES;
- this->leafalloc[ 0 ] = new MemoryAllocator< bytes > ( ) ;
- this->leafalloc[ 1 ] = new MemoryAllocator< bytes + EDGE_BYTES > ( ) ;
- this->leafalloc[ 2 ] = new MemoryAllocator< bytes + EDGE_BYTES * 2 > ( ) ;
- this->leafalloc[ 3 ] = new MemoryAllocator< bytes + EDGE_BYTES * 3 > ( ) ;
- }
-
- this->alloc[ 0 ] = new MemoryAllocator< INTERNAL_NODE_BYTES > ( ) ;
- this->alloc[ 1 ] = new MemoryAllocator< INTERNAL_NODE_BYTES + POINTER_BYTES > ( ) ;
- this->alloc[ 2 ] = new MemoryAllocator< INTERNAL_NODE_BYTES + POINTER_BYTES*2 > ( ) ;
- this->alloc[ 3 ] = new MemoryAllocator< INTERNAL_NODE_BYTES + POINTER_BYTES*3 > ( ) ;
- this->alloc[ 4 ] = new MemoryAllocator< INTERNAL_NODE_BYTES + POINTER_BYTES*4 > ( ) ;
- this->alloc[ 5 ] = new MemoryAllocator< INTERNAL_NODE_BYTES + POINTER_BYTES*5 > ( ) ;
- this->alloc[ 6 ] = new MemoryAllocator< INTERNAL_NODE_BYTES + POINTER_BYTES*6 > ( ) ;
- this->alloc[ 7 ] = new MemoryAllocator< INTERNAL_NODE_BYTES + POINTER_BYTES*7 > ( ) ;
- this->alloc[ 8 ] = new MemoryAllocator< INTERNAL_NODE_BYTES + POINTER_BYTES*8 > ( ) ;
-}
-
-void Octree::freeMemory( )
-{
- for ( int i = 0 ; i < 9 ; i ++ )
+ for(int i = 0; i < 9; i ++)
{
- alloc[i]->destroy() ;
- delete alloc[i] ;
+ alloc[i]->destroy();
+ delete alloc[i];
}
- for ( int i = 0 ; i < 4 ; i ++ )
+ for(int i = 0; i < 4; i ++)
{
- leafalloc[i]->destroy() ;
- delete leafalloc[i] ;
+ leafalloc[i]->destroy();
+ delete leafalloc[i];
}
}
-void Octree::printMemUsage( )
+void Octree::printMemUsage()
{
- int totalbytes = 0 ;
- dc_printf("********* Internal nodes: \n") ;
- for ( int i = 0 ; i < 9 ; i ++ )
+ int totalbytes = 0;
+ dc_printf("********* Internal nodes: \n");
+ for(int i = 0; i < 9; i ++)
{
- this->alloc[ i ]->printInfo() ;
+ alloc[i]->printInfo();
- totalbytes += alloc[i]->getAll( ) * alloc[i]->getBytes() ;
+ totalbytes += alloc[i]->getAll() * alloc[i]->getBytes();
}
- dc_printf("********* Leaf nodes: \n") ;
- int totalLeafs = 0 ;
- for ( int i = 0 ; i < 4 ; i ++ )
+ dc_printf("********* Leaf nodes: \n");
+ int totalLeafs = 0;
+ for(int i = 0; i < 4; i ++)
{
- this->leafalloc[ i ]->printInfo() ;
+ leafalloc[i]->printInfo();
- totalbytes += leafalloc[i]->getAll( ) * leafalloc[i]->getBytes() ;
- totalLeafs += leafalloc[i]->getAllocated() ;
+ totalbytes += leafalloc[i]->getAll() * leafalloc[i]->getBytes();
+ totalLeafs += leafalloc[i]->getAllocated();
}
- dc_printf("Total allocated bytes on disk: %d \n", totalbytes) ;
- dc_printf("Total leaf nodes: %d\n", totalLeafs ) ;
-}
-
-void Octree::resetMinimalEdges( )
-{
- this->cellProcParity( this->root, 0, maxDepth ) ;
-}
-
-void Octree::writeModel( char* fname )
-{
- reader->reset() ;
-
- int nFace = reader->getNumTriangles() ;
- Triangle* trian ;
- // int unitcount = 10000;
- int count = 0 ;
- int nVert = nFace * 3 ;
- FILE* modelfout = fopen( "model.off", "w" ) ;
- fprintf( modelfout, "OFF\n" ) ;
- fprintf( modelfout, "%d %d 0\n", nVert, nFace ) ;
-
- //int total = this->reader->getNumTriangles() ;
- dc_printf( "Start writing model to OFF...\n" ) ;
- srand(0) ;
- while ( ( trian = reader->getNextTriangle() ) != NULL )
- {
- // Drop polygons
- {
- int i, j ;
-
- // Blow up the triangle
- float mid[3] = {0, 0, 0} ;
- for ( i = 0 ; i < 3 ; i ++ )
- for ( j = 0 ; j < 3 ; j ++ )
- {
- trian->vt[i][j] = dimen * ( trian->vt[i][j] - origin[j] ) / range ;
-
- mid[j] += trian->vt[i][j] / 3 ;
- }
-
- // Generate projections
- // LONG cube[2][3] = { { 0, 0, 0 }, { dimen, dimen, dimen } } ;
- int trig[3][3] ;
-
- // Blowing up the triangle to the grid
- for ( i = 0 ; i < 3 ; i ++ )
- for ( j = 0 ; j < 3 ; j ++ )
- {
- trig[i][j] = (int) (trian->vt[i][j]) ;
- // Perturb end points, if set so
- }
-
-
- for ( i = 0 ; i < 3 ; i ++ )
- {
- fprintf( modelfout, "%f %f %f\n",
- (float)(((double) trig[i][0] / dimen) * range + origin[0]) ,
- (float)(((double) trig[i][1] / dimen) * range + origin[1]) ,
- (float)(((double) trig[i][2] / dimen) * range + origin[2]) ) ;
- }
- }
- delete trian ;
-
- count ++ ;
-
- }
-
- for ( int i = 0 ; i < nFace ; i ++ )
- {
- fprintf( modelfout, "3 %d %d %d\n", 3 * i + 2, 3 * i + 1, 3 * i ) ;
- }
-
- fclose( modelfout ) ;
-
-}
-
-#ifdef CINDY
-void Octree::writeTags( char* fname )
-{
- FILE* fout = fopen( fname, "w" ) ;
-
- clearCindyBits( root, maxDepth ) ;
- readVertices() ;
- outputTags( root, maxDepth, fout ) ;
-
- fclose ( fout ) ;
-}
-
-void Octree::readVertices( )
-{
- int total = this->reader->getNumVertices() ;
- reader->reset() ;
- float v[3] ;
- int st[3] = {0,0,0};
- int unitcount = 1000 ;
- dc_printf( "\nRead in original %d vertices...\n", total ) ;
-
- for ( int i = 0 ; i < total ; i ++ )
- {
- reader->getNextVertex( v ) ;
- // Blowing up the triangle to the grid
- float mid[3] = {0, 0, 0} ;
- for ( int j = 0 ; j < 3 ; j ++ )
- {
- v[j] = dimen * ( v[j] - origin[j] ) / range ;
- }
-
-// dc_printf("vertex: %f %f %f, dimen: %d\n", v[0], v[1], v[2], dimen ) ;
- readVertex ( root, st, dimen, maxDepth, v, i ) ;
-
-
- if ( i % unitcount == 0 )
- {
- putchar ( 13 ) ;
-
- switch ( ( i / unitcount ) % 4 )
- {
- case 0 : dc_printf("-");
- break ;
- case 1 : dc_printf("/") ;
- break ;
- case 2 : dc_printf("|");
- break ;
- case 3 : dc_printf("\\") ;
- break ;
- }
-
- float percent = (float) i / total ;
- /*
- int totbars = 50 ;
- int bars = (int)( percent * totbars ) ;
- for ( int i = 0 ; i < bars ; i ++ )
- {
- putchar( 219 ) ;
- }
- for ( i = bars ; i < totbars ; i ++ )
- {
- putchar( 176 ) ;
- }
- */
-
- dc_printf(" %d vertices: ", i ) ;
- dc_printf( " %f%% complete.", 100 * percent ) ;
- }
-
- }
- putchar ( 13 ) ;
- dc_printf(" \n");
-}
-
-void Octree::readVertex( UCHAR* node, int st[3], int len, int height, float v[3], int index )
-{
- int nst[3] ;
- nst[0] = ( (int) v[0] / mindimen ) * mindimen ;
- nst[1] = ( (int) v[1] / mindimen ) * mindimen ;
- nst[2] = ( (int) v[2] / mindimen ) * mindimen ;
-
- UCHAR* cell = this->locateLeafCheck( nst ) ;
- if ( cell == NULL )
- {
- dc_printf("Cell %d %d %d is not found!\n", nst[0]/ mindimen, nst[1]/ mindimen, nst[2]/ mindimen) ;
- return ;
- }
-
- setOriginalIndex( cell, index ) ;
-
-
- /*
- int i ;
- if ( height == 0 )
- {
- // Leaf cell, assign index
- dc_printf("Setting: %d\n", index ) ;
- setOriginalIndex( node, index ) ;
- }
- else
- {
- len >>= 1 ;
- // Internal cell, check and recur
- int x = ( v[0] > st[0] + len ) ? 1 : 0 ;
- int y = ( v[1] > st[1] + len ) ? 1 : 0 ;
- int z = ( v[2] > st[2] + len ) ? 1 : 0 ;
- int child = x * 4 + y * 2 + z ;
-
- int count = 0 ;
- for ( i = 0 ; i < 8 ; i ++ )
- {
- if ( i == child && hasChild( node, i ) )
- {
- int nst[3] ;
- nst[0] = st[0] + vertmap[i][0] * len ;
- nst[1] = st[1] + vertmap[i][1] * len ;
- nst[2] = st[2] + vertmap[i][2] * len ;
-
- dc_printf("Depth: %d -- child %d vertex: %f %f %f in %f %f %f\n", height - 1, child, v[0]/mindimen, v[1]/mindimen, v[2]/mindimen,
- nst[0]/mindimen, nst[1]/mindimen, nst[2]/mindimen, len/mindimen ) ;
-
- readVertex( getChild( node, count ), nst, len, height - 1, v, index ) ;
- count ++ ;
- }
- }
- }
- */
-}
-
-void Octree::outputTags( UCHAR* node, int height, FILE* fout )
-{
- int i ;
-
- if ( height == 0 )
- {
- // Leaf cell, generate
- int smask = getSignMask( node ) ;
-
- if(use_manifold) {
- int comps = manifold_table[ smask ].comps ;
- if ( comps != 1 )
- {
- return ;
- }
- }
- else
- {
- if ( smask == 0 || smask == 255 )
- {
- return ;
- }
- }
-
- int rindex = getMinimizerIndex( node ) ;
- int oindex = getOriginalIndex( node ) ;
-
- if ( oindex >= 0 )
- {
- fprintf( fout, "%d: %d\n", rindex, oindex ) ;
- }
-
- }
- else
- {
- // Internal cell, recur
- int count = 0 ;
- for ( i = 0 ; i < 8 ; i ++ )
- {
- if ( hasChild( node, i ) )
- {
- outputTags( getChild( node, count ), height - 1, fout ) ;
- count ++ ;
- }
- }
- }
+ dc_printf("Total allocated bytes on disk: %d \n", totalbytes);
+ dc_printf("Total leaf nodes: %d\n", totalLeafs);
}
-void Octree::clearCindyBits( UCHAR* node, int height )
+void Octree::resetMinimalEdges()
{
- int i;
-
- if ( height == 0 )
- {
- // Leaf cell,
- {
- setOriginalIndex( node, - 1 ) ;
- }
- }
- else
- {
- // Internal cell, recur
- int count = 0 ;
- for ( i = 0 ; i < 8 ; i ++ )
- {
- if ( hasChild( node, i ) )
- {
- clearCindyBits( getChild( node, count ), height - 1 ) ;
- count ++ ;
- }
- }
- }
+ cellProcParity(root, 0, maxDepth);
}
-#endif
-void Octree::addTrian( )
+void Octree::addTrian()
{
- Triangle* trian ;
- int count = 0 ;
+ Triangle* trian;
+ int count = 0;
#if DC_DEBUG
- int total = this->reader->getNumTriangles() ;
- int unitcount = 1000 ;
- dc_printf( "\nScan converting to depth %d...\n", maxDepth ) ;
+ int total = reader->getNumTriangles();
+ int unitcount = 1000;
+ dc_printf("\nScan converting to depth %d...\n", maxDepth);
#endif
- srand(0) ;
+ srand(0);
- while ( ( trian = reader->getNextTriangle() ) != NULL )
+ while((trian = reader->getNextTriangle()) != NULL)
{
// Drop triangles
{
- addTrian ( trian, count ) ;
+ addTrian(trian, count);
}
- delete trian ;
+ delete trian;
- count ++ ;
+ count ++;
#if DC_DEBUG
- if ( count % unitcount == 0 )
+ if(count % unitcount == 0)
{
- putchar ( 13 ) ;
+ putchar(13);
- switch ( ( count / unitcount ) % 4 )
+ switch((count / unitcount) % 4)
{
case 0 : dc_printf("-");
- break ;
- case 1 : dc_printf("/") ;
- break ;
+ break;
+ case 1 : dc_printf("/");
+ break;
case 2 : dc_printf("|");
- break ;
- case 3 : dc_printf("\\") ;
- break ;
+ break;
+ case 3 : dc_printf("\\");
+ break;
}
- float percent = (float) count / total ;
+ float percent =(float) count / total;
/*
- int totbars = 50 ;
- int bars = (int)( percent * totbars ) ;
- for ( int i = 0 ; i < bars ; i ++ )
+ int totbars = 50;
+ int bars =(int)(percent * totbars);
+ for(int i = 0; i < bars; i ++)
{
- putchar( 219 ) ;
+ putchar(219);
}
- for ( i = bars ; i < totbars ; i ++ )
+ for(i = bars; i < totbars; i ++)
{
- putchar( 176 ) ;
+ putchar(176);
}
*/
- dc_printf(" %d triangles: ", count ) ;
- dc_printf( " %f%% complete.", 100 * percent ) ;
+ dc_printf(" %d triangles: ", count);
+ dc_printf(" %f%% complete.", 100 * percent);
}
#endif
}
- putchar ( 13 ) ;
+ putchar(13);
}
-void Octree::addTrian( Triangle* trian, int triind )
+void Octree::addTrian(Triangle* trian, int triind)
{
- int i, j ;
+ int i, j;
// Blowing up the triangle to the grid
- float mid[3] = {0, 0, 0} ;
- for ( i = 0 ; i < 3 ; i ++ )
- for ( j = 0 ; j < 3 ; j ++ )
+ float mid[3] = {0, 0, 0};
+ for(i = 0; i < 3; i ++)
+ for(j = 0; j < 3; j ++)
{
- trian->vt[i][j] = dimen * ( trian->vt[i][j] - origin[j] ) / range ;
- mid[j] += trian->vt[i][j] / 3 ;
+ trian->vt[i][j] = dimen *(trian->vt[i][j] - origin[j]) / range;
+ mid[j] += trian->vt[i][j] / 3;
}
// Generate projections
- LONG cube[2][3] = { { 0, 0, 0 }, { dimen, dimen, dimen } } ;
- LONG trig[3][3] ;
+ LONG cube[2][3] = {{0, 0, 0}, {dimen, dimen, dimen}};
+ LONG trig[3][3];
- for ( i = 0 ; i < 3 ; i ++ )
- for ( j = 0 ; j < 3 ; j ++ )
+ for(i = 0; i < 3; i ++)
+ for( j = 0; j < 3; j ++)
{
- trig[i][j] = (LONG) (trian->vt[i][j]) ;
+ trig[i][j] =(LONG)(trian->vt[i][j]);
// Perturb end points, if set so
}
// Add to the octree
- // int start[3] = { 0, 0, 0 } ;
- LONG errorvec = (LONG) ( 0 ) ;
- Projections* proj = new Projections( cube, trig, errorvec, triind ) ;
- root = addTrian( root, proj, maxDepth ) ;
+ // int start[3] = {0, 0, 0};
+ LONG errorvec =(LONG)(0);
+ Projections* proj = new Projections(cube, trig, errorvec, triind);
+ root = (Node*)addTrian(&root->internal, proj, maxDepth);
- delete proj->inherit ;
- delete proj ;
+ delete proj->inherit;
+ delete proj;
}
-UCHAR* Octree::addTrian( UCHAR* node, Projections* p, int height )
+InternalNode* Octree::addTrian(InternalNode* node, Projections* p, int height)
{
- int i ;
- int vertdiff[8][3] = {{0,0,0},{0,0,1},{0,1,-1},{0,0,1},{1,-1,-1},{0,0,1},{0,1,-1},{0,0,1}} ;
- UCHAR boxmask = p->getBoxMask( ) ;
- Projections* subp = new Projections( p ) ;
+ int i;
+ int vertdiff[8][3] = {{0,0,0},{0,0,1},{0,1,-1},{0,0,1},{1,-1,-1},{0,0,1},{0,1,-1},{0,0,1}};
+ UCHAR boxmask = p->getBoxMask();
+ Projections* subp = new Projections(p);
- int count = 0 ;
- int tempdiff[3] = {0,0,0} ;
- for ( i = 0 ; i < 8 ; i ++ )
+ int count = 0;
+ int tempdiff[3] = {0,0,0};
+ for(i = 0; i < 8; i ++)
{
- tempdiff[0] += vertdiff[i][0] ;
- tempdiff[1] += vertdiff[i][1] ;
- tempdiff[2] += vertdiff[i][2] ;
+ tempdiff[0] += vertdiff[i][0];
+ tempdiff[1] += vertdiff[i][1];
+ tempdiff[2] += vertdiff[i][2];
/* Quick pruning using bounding box */
- if ( boxmask & ( 1 << i ) )
+ if(boxmask &(1 << i))
{
- subp->shift( tempdiff ) ;
- tempdiff[0] = tempdiff[1] = tempdiff[2] = 0 ;
+ subp->shift(tempdiff);
+ tempdiff[0] = tempdiff[1] = tempdiff[2] = 0;
/* Pruning using intersection test */
- if ( subp->isIntersecting() )
- // if ( subp->getIntersectionMasks( cedgemask, edgemask ) )
+ if(subp->isIntersecting())
+ // if(subp->getIntersectionMasks(cedgemask, edgemask))
{
- if ( ! hasChild( node, i ) )
+ if(! hasChild(node, i))
{
- if ( height == 1 )
+ if(height == 1)
{
- node = addLeafChild( node, i, count, createLeaf(0) ) ;
+ node = addLeafChild(node, i, count, createLeaf(0));
}
else
{
- node = addInternalChild( node, i, count, createInternal(0) ) ;
+ node = addInternalChild(node, i, count, createInternal(0));
}
}
- UCHAR* chd = getChild( node, count ) ;
+ Node* chd = getChild(node, count);
- if ( ! isLeaf( node, i ) )
+ if(! isLeaf(node, i))
{
- // setChild( node, count, addTrian ( chd, subp, height - 1, vertmask[i], edgemask ) ) ;
- setChild( node, count, addTrian ( chd, subp, height - 1 ) ) ;
+ // setChild(node, count, addTrian(chd, subp, height - 1, vertmask[i], edgemask));
+ setChild(node, count, (Node*)addTrian(&chd->internal, subp, height - 1));
}
else
{
- setChild( node, count, updateCell( chd, subp ) ) ;
+ setChild(node, count, (Node*)updateCell(&chd->leaf, subp));
}
}
}
- if ( hasChild( node, i ) )
+ if(hasChild(node, i))
{
- count ++ ;
+ count ++;
}
}
- delete subp ;
- return node ;
+ delete subp;
+
+ return node;
}
-UCHAR* Octree::updateCell( UCHAR* node, Projections* p )
+LeafNode* Octree::updateCell(LeafNode* node, Projections* p)
{
- int i ;
+ int i;
// Edge connectivity
- int mask[3] = { 0, 4, 8 } ;
- int oldc = 0, newc = 0 ;
- float offs[3] ;
-#ifdef USE_HERMIT
- float a[3], b[3], c[3] ;
-#endif
+ int mask[3] = {0, 4, 8 };
+ int oldc = 0, newc = 0;
+ float offs[3];
+ float a[3], b[3], c[3];
- for ( i = 0 ; i < 3 ; i ++ )
+ for(i = 0; i < 3; i ++)
{
- if ( ! getEdgeParity( node, mask[i] ) )
+ if(! getEdgeParity(node, mask[i]))
{
- if ( p->isIntersectingPrimary( i ) )
+ if(p->isIntersectingPrimary(i))
{
- // this->actualQuads ++ ;
- setEdge( node, mask[i] ) ;
- offs[ newc ] = p->getIntersectionPrimary( i ) ;
-#ifdef USE_HERMIT
- a[ newc ] = (float) p->inherit->norm[0] ;
- b[ newc ] = (float) p->inherit->norm[1] ;
- c[ newc ] = (float) p->inherit->norm[2] ;
-#endif
- newc ++ ;
+ // actualQuads ++;
+ setEdge(node, mask[i]);
+ offs[newc] = p->getIntersectionPrimary(i);
+ a[newc] =(float) p->inherit->norm[0];
+ b[newc] =(float) p->inherit->norm[1];
+ c[newc] =(float) p->inherit->norm[2];
+ newc ++;
}
}
else
{
-#ifndef USE_HERMIT
- offs[ newc ] = getEdgeOffset( node, oldc ) ;
-#else
- offs[ newc ] = getEdgeOffsetNormal( node, oldc, a[ newc ], b[ newc ], c[ newc ] ) ;
-#endif
+ offs[newc] = getEdgeOffsetNormal(node, oldc, a[newc], b[newc], c[newc]);
-// if ( p->isIntersectingPrimary( i ) )
+// if(p->isIntersectingPrimary(i))
{
- // dc_printf("Multiple intersections!\n") ;
+ // dc_printf("Multiple intersections!\n");
-// setPatchEdge( node, i ) ;
+// setPatchEdge(node, i);
}
- oldc ++ ;
- newc ++ ;
+ oldc ++;
+ newc ++;
}
}
- if ( newc > oldc )
+ if(newc > oldc)
{
// New offsets added, update this node
-#ifndef USE_HERMIT
- node = updateEdgeOffsets( node, oldc, newc, offs ) ;
-#else
- node = updateEdgeOffsetsNormals( node, oldc, newc, offs, a, b, c ) ;
-#endif
+ node = updateEdgeOffsetsNormals(node, oldc, newc, offs, a, b, c);
}
-
-
- return node ;
+ return node;
}
-void Octree::preparePrimalEdgesMask( UCHAR* node )
+void Octree::preparePrimalEdgesMask(InternalNode* node)
{
- int count = 0 ;
- for ( int i = 0 ; i < 8 ; i ++ )
+ int count = 0;
+ for(int i = 0; i < 8; i ++)
{
- if ( hasChild( node, i ) )
+ if(hasChild(node, i))
{
- if ( isLeaf( node, i ) )
- {
- createPrimalEdgesMask( getChild( node, count ) ) ;
- }
+ if(isLeaf(node, i))
+ createPrimalEdgesMask(&getChild(node, count)->leaf);
else
- {
- preparePrimalEdgesMask( getChild( node, count ) ) ;
- }
+ preparePrimalEdgesMask(&getChild(node, count)->internal);
- count ++ ;
+ count ++;
}
}
}
-void Octree::trace( )
+void Octree::trace()
{
- int st[3] = { 0, 0, 0, } ;
- this->numRings = 0 ;
- this->totRingLengths = 0 ;
- this->maxRingLength = 0 ;
+ int st[3] = {0, 0, 0,};
+ numRings = 0;
+ totRingLengths = 0;
+ maxRingLength = 0;
- PathList* chdpath = NULL ;
- this->root = trace( this->root, st, dimen, maxDepth, chdpath ) ;
+ PathList* chdpath = NULL;
+ root = trace(root, st, dimen, maxDepth, chdpath);
- if ( chdpath != NULL )
+ if(chdpath != NULL)
{
- dc_printf("there are incomplete rings.\n") ;
- printPaths( chdpath ) ;
+ dc_printf("there are incomplete rings.\n");
+ printPaths(chdpath);
};
}
-UCHAR* Octree::trace( UCHAR* node, int* st, int len, int depth, PathList*& paths)
+Node* Octree::trace(Node* newnode, int* st, int len, int depth, PathList*& paths)
{
- UCHAR* newnode = node ;
- len >>= 1 ;
- PathList* chdpaths[ 8 ] ;
- UCHAR* chd[ 8 ] ;
- int nst[ 8 ][ 3 ] ;
- int i, j ;
+ len >>= 1;
+ PathList* chdpaths[8];
+ Node* chd[8];
+ int nst[8][3];
+ int i, j;
// Get children paths
- int chdleaf[ 8 ] ;
- fillChildren( newnode, chd, chdleaf ) ;
+ int chdleaf[8];
+ fillChildren(&newnode->internal, chd, chdleaf);
- // int count = 0 ;
- for ( i = 0 ; i < 8 ; i ++ )
+ // int count = 0;
+ for(i = 0; i < 8; i ++)
{
- for ( j = 0 ; j < 3 ; j ++ )
+ for(j = 0; j < 3; j ++)
{
- nst[ i ][ j ] = st[ j ] + len * vertmap[ i ][ j ] ;
+ nst[i][j] = st[j] + len * vertmap[i][j];
}
- if ( chd[ i ] == NULL || isLeaf( node, i ) )
+ if(chd[i] == NULL || isLeaf(&newnode->internal, i))
{
- chdpaths[ i ] = NULL ;
+ chdpaths[i] = NULL;
}
else
{
- trace( chd[ i ], nst[i], len, depth - 1, chdpaths[ i ] ) ;
+ trace(chd[i], nst[i], len, depth - 1, chdpaths[i]);
}
}
// Get connectors on the faces
- PathList* conn[ 12 ] ;
- UCHAR* nf[2] ;
- int lf[2] ;
- int df[2] = { depth - 1, depth - 1 } ;
- int* nstf[ 2 ];
+ PathList* conn[12];
+ Node* nf[2];
+ int lf[2];
+ int df[2] = {depth - 1, depth - 1};
+ int* nstf[2];
- fillChildren( newnode, chd, chdleaf ) ;
+ fillChildren(&newnode->internal, chd, chdleaf);
- for ( i = 0 ; i < 12 ; i ++ )
+ for(i = 0; i < 12; i ++)
{
- int c[ 2 ] = { cellProcFaceMask[ i ][ 0 ], cellProcFaceMask[ i ][ 1 ] };
+ int c[2] = {cellProcFaceMask[i][0], cellProcFaceMask[i][1]};
- for ( int j = 0 ; j < 2 ; j ++ )
+ for(int j = 0; j < 2; j ++)
{
- lf[j] = chdleaf[ c[j] ] ;
- nf[j] = chd[ c[j] ] ;
- nstf[j] = nst[ c[j] ] ;
+ lf[j] = chdleaf[c[j]];
+ nf[j] = chd[c[j]];
+ nstf[j] = nst[c[j]];
}
- conn[ i ] = NULL ;
+ conn[i] = NULL;
- findPaths( nf, lf, df, nstf, depth - 1, cellProcFaceMask[ i ][ 2 ], conn[ i ] ) ;
+ findPaths((Node**)nf, lf, df, nstf, depth - 1, cellProcFaceMask[i][2], conn[i]);
- //if ( conn[i] )
+ //if(conn[i])
//{
- // printPath( conn[i] ) ;
+ // printPath(conn[i]);
//}
}
// Connect paths
- PathList* rings = NULL ;
- combinePaths( chdpaths[0], chdpaths[1], conn[8], rings ) ;
- combinePaths( chdpaths[2], chdpaths[3], conn[9], rings ) ;
- combinePaths( chdpaths[4], chdpaths[5], conn[10], rings ) ;
- combinePaths( chdpaths[6], chdpaths[7], conn[11], rings ) ;
-
- combinePaths( chdpaths[0], chdpaths[2], conn[4], rings ) ;
- combinePaths( chdpaths[4], chdpaths[6], conn[5], rings ) ;
- combinePaths( chdpaths[0], NULL, conn[6], rings ) ;
- combinePaths( chdpaths[4], NULL, conn[7], rings ) ;
-
- combinePaths( chdpaths[0], chdpaths[4], conn[0], rings ) ;
- combinePaths( chdpaths[0], NULL, conn[1], rings ) ;
- combinePaths( chdpaths[0], NULL, conn[2], rings ) ;
- combinePaths( chdpaths[0], NULL, conn[3], rings ) ;
+ PathList* rings = NULL;
+ combinePaths(chdpaths[0], chdpaths[1], conn[8], rings);
+ combinePaths(chdpaths[2], chdpaths[3], conn[9], rings);
+ combinePaths(chdpaths[4], chdpaths[5], conn[10], rings);
+ combinePaths(chdpaths[6], chdpaths[7], conn[11], rings);
+
+ combinePaths(chdpaths[0], chdpaths[2], conn[4], rings);
+ combinePaths(chdpaths[4], chdpaths[6], conn[5], rings);
+ combinePaths(chdpaths[0], NULL, conn[6], rings);
+ combinePaths(chdpaths[4], NULL, conn[7], rings);
+
+ combinePaths(chdpaths[0], chdpaths[4], conn[0], rings);
+ combinePaths(chdpaths[0], NULL, conn[1], rings);
+ combinePaths(chdpaths[0], NULL, conn[2], rings);
+ combinePaths(chdpaths[0], NULL, conn[3], rings);
// By now, only chdpaths[0] and rings have contents
// Process rings
- if ( rings )
+ if(rings)
{
- // printPath( rings ) ;
+ // printPath(rings);
/* Let's count first */
- PathList* trings = rings ;
- while ( trings )
+ PathList* trings = rings;
+ while(trings)
{
- this->numRings ++ ;
- this->totRingLengths += trings->length ;
- if ( trings->length > this->maxRingLength )
+ numRings ++;
+ totRingLengths += trings->length;
+ if(trings->length > maxRingLength)
{
- this->maxRingLength = trings->length ;
+ maxRingLength = trings->length;
}
- trings = trings->next ;
+ trings = trings->next;
}
- // printPath( rings ) ;
- newnode = patch( newnode, st, ( len << 1 ), rings ) ;
+ // printPath(rings);
+ newnode = patch(newnode, st,(len << 1), rings);
}
// Return incomplete paths
- paths = chdpaths[0] ;
- return newnode ;
+ paths = chdpaths[0];
+ return newnode;
}
-void Octree::findPaths( UCHAR* node[2], int leaf[2], int depth[2], int* st[2], int maxdep, int dir, PathList*& paths )
+void Octree::findPaths(Node* node[2], int leaf[2], int depth[2], int* st[2], int maxdep, int dir, PathList*& paths)
{
- if ( ! ( node[0] && node[1] ) )
+ if(!(node[0] && node[1]))
{
- return ;
+ return;
}
- if ( ! ( leaf[0] && leaf[1] ) )
+ if(!(leaf[0] && leaf[1]))
{
// Not at the bottom, recur
// Fill children nodes
- int i, j ;
- UCHAR* chd[ 2 ][ 8 ] ;
- int chdleaf[ 2 ][ 8 ] ;
- int nst[ 2 ][ 8 ][ 3 ] ;
+ int i, j;
+ Node* chd[2][8];
+ int chdleaf[2][8];
+ int nst[2][8][3];
- for ( j = 0 ; j < 2 ; j ++ )
+ for(j = 0; j < 2; j ++)
{
- if ( ! leaf[j] )
+ if(! leaf[j])
{
- fillChildren( node[j], chd[j], chdleaf[j] ) ;
+ fillChildren(&node[j]->internal, chd[j], chdleaf[j]);
- int len = ( dimen >> ( maxDepth - depth[j] + 1 ) ) ;
- for ( i = 0 ; i < 8 ; i ++ )
+ int len =(dimen >>(maxDepth - depth[j] + 1));
+ for(i = 0; i < 8; i ++)
{
- for ( int k = 0 ; k < 3 ; k ++ )
+ for(int k = 0; k < 3; k ++)
{
- nst[ j ][ i ][ k ] = st[ j ][ k ] + len * vertmap[ i ][ k ] ;
+ nst[j][i][k] = st[j][k] + len * vertmap[i][k];
}
}
@@ -1029,2428 +647,1626 @@ void Octree::findPaths( UCHAR* node[2], int leaf[2], int depth[2], int* st[2], i
}
// 4 face calls
- UCHAR* nf[2] ;
- int df[2] ;
- int lf[2] ;
- int* nstf[2] ;
- for ( i = 0 ; i < 4 ; i ++ )
+ Node* nf[2];
+ int df[2];
+ int lf[2];
+ int* nstf[2];
+ for(i = 0; i < 4; i ++)
{
- int c[2] = { faceProcFaceMask[ dir ][ i ][ 0 ], faceProcFaceMask[ dir ][ i ][ 1 ] };
- for ( int j = 0 ; j < 2 ; j ++ )
+ int c[2] = {faceProcFaceMask[dir][i][0], faceProcFaceMask[dir][i][1]};
+ for(int j = 0; j < 2; j ++)
{
- if ( leaf[j] )
+ if(leaf[j])
{
- lf[j] = leaf[j] ;
- nf[j] = node[j] ;
- df[j] = depth[j] ;
- nstf[j] = st[j] ;
+ lf[j] = leaf[j];
+ nf[j] = node[j];
+ df[j] = depth[j];
+ nstf[j] = st[j];
}
else
{
- lf[j] = chdleaf[ j ][ c[j] ] ;
- nf[j] = chd[ j ][ c[j] ] ;
- df[j] = depth[j] - 1 ;
- nstf[j] = nst[ j ][ c[j] ] ;
+ lf[j] = chdleaf[j][c[j]];
+ nf[j] = chd[j][c[j]];
+ df[j] = depth[j] - 1;
+ nstf[j] = nst[j][c[j]];
}
}
- findPaths( nf, lf, df, nstf, maxdep - 1, faceProcFaceMask[ dir ][ i ][ 2 ], paths ) ;
+ findPaths(nf, lf, df, nstf, maxdep - 1, faceProcFaceMask[dir][i][2], paths);
}
}
else
{
// At the bottom, check this face
- int ind = ( depth[0] == maxdep ? 0 : 1 ) ;
- int fcind = 2 * dir + ( 1 - ind ) ;
- if ( getFaceParity( node[ ind ], fcind ) )
+ int ind =(depth[0] == maxdep ? 0 : 1);
+ int fcind = 2 * dir +(1 - ind);
+ if(getFaceParity((LeafNode*)node[ind], fcind))
{
// Add into path
- PathElement* ele1 = new PathElement ;
- PathElement* ele2 = new PathElement ;
+ PathElement* ele1 = new PathElement;
+ PathElement* ele2 = new PathElement;
- ele1->pos[0] = st[0][0] ;
- ele1->pos[1] = st[0][1] ;
- ele1->pos[2] = st[0][2] ;
+ ele1->pos[0] = st[0][0];
+ ele1->pos[1] = st[0][1];
+ ele1->pos[2] = st[0][2];
- ele2->pos[0] = st[1][0] ;
- ele2->pos[1] = st[1][1] ;
- ele2->pos[2] = st[1][2] ;
+ ele2->pos[0] = st[1][0];
+ ele2->pos[1] = st[1][1];
+ ele2->pos[2] = st[1][2];
- ele1->next = ele2 ;
- ele2->next = NULL ;
+ ele1->next = ele2;
+ ele2->next = NULL;
- PathList* lst = new PathList ;
- lst->head = ele1 ;
- lst->tail = ele2 ;
- lst->length = 2 ;
- lst->next = paths ;
- paths = lst ;
+ PathList* lst = new PathList;
+ lst->head = ele1;
+ lst->tail = ele2;
+ lst->length = 2;
+ lst->next = paths;
+ paths = lst;
- // int l = ( dimen >> maxDepth ) ;
+ // int l =(dimen >> maxDepth);
}
}
}
-void Octree::combinePaths( PathList*& list1, PathList* list2, PathList* paths, PathList*& rings )
+void Octree::combinePaths(PathList*& list1, PathList* list2, PathList* paths, PathList*& rings)
{
// Make new list of paths
- PathList* nlist = NULL ;
+ PathList* nlist = NULL;
// Search for each connectors in paths
- PathList* tpaths = paths ;
- PathList* tlist, * pre ;
- while ( tpaths )
+ PathList* tpaths = paths;
+ PathList* tlist, * pre;
+ while(tpaths)
{
- PathList* singlist = tpaths ;
- PathList* templist ;
- tpaths = tpaths->next ;
- singlist->next = NULL ;
+ PathList* singlist = tpaths;
+ PathList* templist;
+ tpaths = tpaths->next;
+ singlist->next = NULL;
// Look for hookup in list1
- tlist = list1 ;
- pre = NULL ;
- while ( tlist )
+ tlist = list1;
+ pre = NULL;
+ while(tlist)
{
- if ( (templist = combineSinglePath( list1, pre, tlist, singlist, NULL, singlist )) != NULL )
+ if((templist = combineSinglePath(list1, pre, tlist, singlist, NULL, singlist)) != NULL)
{
- singlist = templist ;
- continue ;
+ singlist = templist;
+ continue;
}
- pre = tlist ;
- tlist = tlist->next ;
+ pre = tlist;
+ tlist = tlist->next;
}
// Look for hookup in list2
- tlist = list2 ;
- pre = NULL ;
- while ( tlist )
+ tlist = list2;
+ pre = NULL;
+ while(tlist)
{
- if ( (templist = combineSinglePath( list2, pre, tlist, singlist, NULL, singlist )) != NULL )
+ if((templist = combineSinglePath(list2, pre, tlist, singlist, NULL, singlist)) != NULL)
{
- singlist = templist ;
- continue ;
+ singlist = templist;
+ continue;
}
- pre = tlist ;
- tlist = tlist->next ;
+ pre = tlist;
+ tlist = tlist->next;
}
// Look for hookup in nlist
- tlist = nlist ;
- pre = NULL ;
- while ( tlist )
+ tlist = nlist;
+ pre = NULL;
+ while(tlist)
{
- if ( (templist = combineSinglePath( nlist, pre, tlist, singlist, NULL, singlist )) != NULL )
+ if((templist = combineSinglePath(nlist, pre, tlist, singlist, NULL, singlist)) != NULL)
{
- singlist = templist ;
- continue ;
+ singlist = templist;
+ continue;
}
- pre = tlist ;
- tlist = tlist->next ;
+ pre = tlist;
+ tlist = tlist->next;
}
// Add to nlist or rings
- if ( isEqual( singlist->head, singlist->tail ) )
+ if(isEqual(singlist->head, singlist->tail))
{
- PathElement* temp = singlist->head ;
- singlist->head = temp->next ;
- delete temp ;
- singlist->length -- ;
- singlist->tail->next = singlist->head ;
-
- singlist->next = rings ;
- rings = singlist ;
+ PathElement* temp = singlist->head;
+ singlist->head = temp->next;
+ delete temp;
+ singlist->length --;
+ singlist->tail->next = singlist->head;
+
+ singlist->next = rings;
+ rings = singlist;
}
else
{
- singlist->next = nlist ;
- nlist = singlist ;
+ singlist->next = nlist;
+ nlist = singlist;
}
}
// Append list2 and nlist to the end of list1
- tlist = list1 ;
- if ( tlist != NULL )
+ tlist = list1;
+ if(tlist != NULL)
{
- while ( tlist->next != NULL )
+ while(tlist->next != NULL)
{
- tlist = tlist->next ;
+ tlist = tlist->next;
}
- tlist->next = list2 ;
+ tlist->next = list2;
}
else
{
- tlist = list2 ;
- list1 = list2 ;
+ tlist = list2;
+ list1 = list2;
}
- if ( tlist != NULL )
+ if(tlist != NULL)
{
- while ( tlist->next != NULL )
+ while(tlist->next != NULL)
{
- tlist = tlist->next ;
+ tlist = tlist->next;
}
- tlist->next = nlist ;
+ tlist->next = nlist;
}
else
{
- tlist = nlist ;
- list1 = nlist ;
+ tlist = nlist;
+ list1 = nlist;
}
}
-PathList* Octree::combineSinglePath( PathList*& head1, PathList* pre1, PathList*& list1, PathList*& head2, PathList* pre2, PathList*& list2 )
+PathList* Octree::combineSinglePath(PathList*& head1, PathList* pre1, PathList*& list1, PathList*& head2, PathList* pre2, PathList*& list2)
{
- if ( isEqual( list1->head, list2->head ) || isEqual( list1->tail, list2->tail ) )
+ if(isEqual(list1->head, list2->head) || isEqual(list1->tail, list2->tail))
{
// Reverse the list
- if ( list1->length < list2->length )
+ if(list1->length < list2->length)
{
// Reverse list1
- PathElement* prev = list1->head ;
- PathElement* next = prev->next ;
- prev->next = NULL ;
- while ( next != NULL )
+ PathElement* prev = list1->head;
+ PathElement* next = prev->next;
+ prev->next = NULL;
+ while(next != NULL)
{
- PathElement* tnext = next->next ;
- next->next = prev ;
+ PathElement* tnext = next->next;
+ next->next = prev;
- prev = next ;
- next = tnext ;
+ prev = next;
+ next = tnext;
}
- list1->tail = list1->head ;
- list1->head = prev ;
+ list1->tail = list1->head;
+ list1->head = prev;
}
else
{
// Reverse list2
- PathElement* prev = list2->head ;
- PathElement* next = prev->next ;
- prev->next = NULL ;
- while ( next != NULL )
+ PathElement* prev = list2->head;
+ PathElement* next = prev->next;
+ prev->next = NULL;
+ while(next != NULL)
{
- PathElement* tnext = next->next ;
- next->next = prev ;
+ PathElement* tnext = next->next;
+ next->next = prev;
- prev = next ;
- next = tnext ;
+ prev = next;
+ next = tnext;
}
- list2->tail = list2->head ;
- list2->head = prev ;
+ list2->tail = list2->head;
+ list2->head = prev;
}
}
- if ( isEqual( list1->head, list2->tail ) )
+ if(isEqual(list1->head, list2->tail))
{
// Easy case
- PathElement* temp = list1->head->next ;
- delete list1->head ;
- list2->tail->next = temp ;
+ PathElement* temp = list1->head->next;
+ delete list1->head;
+ list2->tail->next = temp;
- PathList* nlist = new PathList ;
- nlist->length = list1->length + list2->length - 1 ;
- nlist->head = list2->head ;
- nlist->tail = list1->tail ;
- nlist->next = NULL ;
+ PathList* nlist = new PathList;
+ nlist->length = list1->length + list2->length - 1;
+ nlist->head = list2->head;
+ nlist->tail = list1->tail;
+ nlist->next = NULL;
- deletePath( head1, pre1, list1 ) ;
- deletePath( head2, pre2, list2 ) ;
+ deletePath(head1, pre1, list1);
+ deletePath(head2, pre2, list2);
- return nlist ;
+ return nlist;
}
- else if ( isEqual( list1->tail, list2->head ) )
+ else if(isEqual(list1->tail, list2->head))
{
// Easy case
- PathElement* temp = list2->head->next ;
- delete list2->head ;
- list1->tail->next = temp ;
+ PathElement* temp = list2->head->next;
+ delete list2->head;
+ list1->tail->next = temp;
- PathList* nlist = new PathList ;
- nlist->length = list1->length + list2->length - 1 ;
- nlist->head = list1->head ;
- nlist->tail = list2->tail ;
- nlist->next = NULL ;
+ PathList* nlist = new PathList;
+ nlist->length = list1->length + list2->length - 1;
+ nlist->head = list1->head;
+ nlist->tail = list2->tail;
+ nlist->next = NULL;
- deletePath( head1, pre1, list1 ) ;
- deletePath( head2, pre2, list2 ) ;
+ deletePath(head1, pre1, list1);
+ deletePath(head2, pre2, list2);
- return nlist ;
+ return nlist;
}
- return NULL ;
+ return NULL;
}
-void Octree::deletePath( PathList*& head, PathList* pre, PathList*& curr )
+void Octree::deletePath(PathList*& head, PathList* pre, PathList*& curr)
{
- PathList* temp = curr ;
- curr = temp->next ;
- delete temp ;
+ PathList* temp = curr;
+ curr = temp->next;
+ delete temp;
- if ( pre == NULL )
+ if(pre == NULL)
{
- head = curr ;
+ head = curr;
}
else
{
- pre->next = curr ;
+ pre->next = curr;
}
}
-void Octree::printElement( PathElement* ele )
+void Octree::printElement(PathElement* ele)
{
- if ( ele != NULL )
+ if(ele != NULL)
{
- dc_printf( " (%d %d %d)", ele->pos[0], ele->pos[1], ele->pos[2] ) ;
+ dc_printf("(%d %d %d)", ele->pos[0], ele->pos[1], ele->pos[2]);
}
}
-void Octree::printPath( PathList* path )
+void Octree::printPath(PathList* path)
{
PathElement* n = path->head;
- int same = 0 ;
+ int same = 0;
#if DC_DEBUG
- int len = ( dimen >> maxDepth ) ;
+ int len =(dimen >> maxDepth);
#endif
- while ( n && ( same == 0 || n != path->head ) )
+ while(n &&(same == 0 || n != path->head))
{
- same ++ ;
- dc_printf( " (%d %d %d)", n->pos[0] / len, n->pos[1] / len, n->pos[2] / len ) ;
- n = n->next ;
+ same ++;
+ dc_printf("(%d %d %d)", n->pos[0] / len, n->pos[1] / len, n->pos[2] / len);
+ n = n->next;
}
- if ( n == path->head )
+ if(n == path->head)
{
- dc_printf(" Ring!\n") ;
+ dc_printf(" Ring!\n");
}
else
{
- dc_printf(" %p end!\n", n) ;
+ dc_printf(" %p end!\n", n);
}
}
-void Octree::printPath( PathElement* path )
+void Octree::printPath(PathElement* path)
{
PathElement *n = path;
- int same = 0 ;
+ int same = 0;
#if DC_DEBUG
- int len = ( dimen >> maxDepth ) ;
+ int len =(dimen >> maxDepth);
#endif
- while ( n && ( same == 0 || n != path ) )
+ while(n &&(same == 0 || n != path))
{
- same ++ ;
- dc_printf( " (%d %d %d)", n->pos[0] / len, n->pos[1] / len, n->pos[2] / len ) ;
- n = n->next ;
+ same ++;
+ dc_printf("(%d %d %d)", n->pos[0] / len, n->pos[1] / len, n->pos[2] / len);
+ n = n->next;
}
- if ( n == path )
+ if(n == path)
{
- dc_printf(" Ring!\n") ;
+ dc_printf(" Ring!\n");
}
else
{
- dc_printf(" %p end!\n", n) ;
+ dc_printf(" %p end!\n", n);
}
}
-void Octree::printPaths( PathList* path )
+void Octree::printPaths(PathList* path)
{
- PathList* iter = path ;
- int i = 0 ;
- while ( iter != NULL )
+ PathList* iter = path;
+ int i = 0;
+ while(iter != NULL)
{
- dc_printf("Path %d:\n", i) ;
- printPath( iter ) ;
- iter = iter->next ;
- i ++ ;
+ dc_printf("Path %d:\n", i);
+ printPath(iter);
+ iter = iter->next;
+ i ++;
}
}
-UCHAR* Octree::patch( UCHAR* node, int st[3], int len, PathList* rings )
+Node* Octree::patch(Node* newnode, int st[3], int len, PathList* rings)
{
#ifdef IN_DEBUG_MODE
dc_printf("Call to PATCH with rings: \n");
- printPaths( rings ) ;
+ printPaths(rings);
#endif
/* Do nothing but couting
- PathList* tlist = rings ;
- PathList* ttlist ;
- PathElement* telem, * ttelem ;
- while ( tlist!= NULL )
+ PathList* tlist = rings;
+ PathList* ttlist;
+ PathElement* telem, * ttelem;
+ while(tlist!= NULL)
{
- // printPath( tlist ) ;
- this->numRings ++ ;
- this->totRingLengths += tlist->length ;
- if ( tlist->length > this->maxRingLength )
+ // printPath(tlist);
+ numRings ++;
+ totRingLengths += tlist->length;
+ if(tlist->length > maxRingLength)
{
- this->maxRingLength = tlist->length ;
+ maxRingLength = tlist->length;
}
- ttlist = tlist ;
- tlist = tlist->next ;
+ ttlist = tlist;
+ tlist = tlist->next;
}
- return node ;
+ return node;
*/
/* Pass onto separate calls in each direction */
- UCHAR* newnode = node ;
- if ( len == mindimen )
+ if(len == mindimen)
{
- dc_printf("Error! should have no list by now.\n") ;
- exit(0) ;
+ dc_printf("Error! should have no list by now.\n");
+ exit(0);
}
// YZ plane
- PathList* xlists[2] ;
- newnode = patchSplit( newnode, st, len, rings, 0, xlists[0], xlists[1] ) ;
+ PathList* xlists[2];
+ newnode = patchSplit(newnode, st, len, rings, 0, xlists[0], xlists[1]);
// XZ plane
- PathList* ylists[4] ;
- newnode = patchSplit( newnode, st, len, xlists[0], 1, ylists[0], ylists[1] ) ;
- newnode = patchSplit( newnode, st, len, xlists[1], 1, ylists[2], ylists[3] ) ;
+ PathList* ylists[4];
+ newnode = patchSplit(newnode, st, len, xlists[0], 1, ylists[0], ylists[1]);
+ newnode = patchSplit(newnode, st, len, xlists[1], 1, ylists[2], ylists[3]);
// XY plane
- PathList* zlists[8] ;
- newnode = patchSplit( newnode, st, len, ylists[0], 2, zlists[0], zlists[1] ) ;
- newnode = patchSplit( newnode, st, len, ylists[1], 2, zlists[2], zlists[3] ) ;
- newnode = patchSplit( newnode, st, len, ylists[2], 2, zlists[4], zlists[5] ) ;
- newnode = patchSplit( newnode, st, len, ylists[3], 2, zlists[6], zlists[7] ) ;
+ PathList* zlists[8];
+ newnode = patchSplit(newnode, st, len, ylists[0], 2, zlists[0], zlists[1]);
+ newnode = patchSplit(newnode, st, len, ylists[1], 2, zlists[2], zlists[3]);
+ newnode = patchSplit(newnode, st, len, ylists[2], 2, zlists[4], zlists[5]);
+ newnode = patchSplit(newnode, st, len, ylists[3], 2, zlists[6], zlists[7]);
// Recur
- len >>= 1 ;
- int count = 0 ;
- for ( int i = 0 ; i < 8 ; i ++ )
+ len >>= 1;
+ int count = 0;
+ for(int i = 0; i < 8; i ++)
{
- if ( zlists[i] != NULL )
+ if(zlists[i] != NULL)
{
- int nori[3] = {
+ int nori[3] = {
st[0] + len * vertmap[i][0] ,
st[1] + len * vertmap[i][1] ,
- st[2] + len * vertmap[i][2] } ;
- patch( getChild( newnode , count ), nori, len, zlists[i] ) ;
+ st[2] + len * vertmap[i][2]};
+ patch(getChild(&newnode->internal , count), nori, len, zlists[i]);
}
- if ( hasChild( newnode, i ) )
+ if(hasChild(&newnode->internal, i))
{
- count ++ ;
+ count ++;
}
}
#ifdef IN_DEBUG_MODE
- dc_printf("Return from PATCH\n") ;
+ dc_printf("Return from PATCH\n");
#endif
- return newnode ;
+ return newnode;
}
-UCHAR* Octree::patchSplit( UCHAR* node, int st[3], int len, PathList* rings, int dir, PathList*& nrings1, PathList*& nrings2 )
+Node* Octree::patchSplit(Node* newnode, int st[3], int len, PathList* rings,
+ int dir, PathList*& nrings1, PathList*& nrings2)
{
#ifdef IN_DEBUG_MODE
dc_printf("Call to PATCHSPLIT with direction %d and rings: \n", dir);
- printPaths( rings ) ;
+ printPaths(rings);
#endif
- UCHAR* newnode = node ;
- nrings1 = NULL ;
- nrings2 = NULL ;
- PathList* tmp ;
- while ( rings != NULL )
+ nrings1 = NULL;
+ nrings2 = NULL;
+ PathList* tmp;
+ while(rings != NULL)
{
// Process this ring
- newnode = patchSplitSingle( newnode, st, len, rings->head, dir, nrings1, nrings2 ) ;
+ newnode = patchSplitSingle(newnode, st, len, rings->head, dir, nrings1, nrings2);
// Delete this ring from the group
- tmp = rings ;
- rings = rings->next ;
- delete tmp ;
+ tmp = rings;
+ rings = rings->next;
+ delete tmp;
}
#ifdef IN_DEBUG_MODE
dc_printf("Return from PATCHSPLIT with \n");
- dc_printf("Rings gourp 1:\n") ;
- printPaths( nrings1 ) ;
- dc_printf("Rings group 2:\n") ;
- printPaths( nrings2 ) ;
+ dc_printf("Rings gourp 1:\n");
+ printPaths(nrings1);
+ dc_printf("Rings group 2:\n");
+ printPaths(nrings2);
#endif
- return newnode ;
+ return newnode;
}
-UCHAR* Octree::patchSplitSingle( UCHAR* node, int st[3], int len, PathElement* head, int dir, PathList*& nrings1, PathList*& nrings2 )
+Node* Octree::patchSplitSingle(Node* newnode, int st[3], int len, PathElement* head, int dir, PathList*& nrings1, PathList*& nrings2)
{
#ifdef IN_DEBUG_MODE
- dc_printf("Call to PATCHSPLITSINGLE with direction %d and path: \n", dir );
- printPath( head ) ;
+ dc_printf("Call to PATCHSPLITSINGLE with direction %d and path: \n", dir);
+ printPath(head);
#endif
- UCHAR* newnode = node ;
-
- if ( head == NULL )
+ if(head == NULL)
{
#ifdef IN_DEBUG_MODE
- dc_printf("Return from PATCHSPLITSINGLE with head==NULL.\n") ;
+ dc_printf("Return from PATCHSPLITSINGLE with head==NULL.\n");
#endif
return newnode;
}
else
{
- // printPath( head ) ;
+ // printPath(head);
}
// Walk along the ring to find pair of intersections
- PathElement* pre1 = NULL ;
- PathElement* pre2 = NULL ;
- int side = findPair ( head, st[ dir ] + len / 2 , dir, pre1, pre2 ) ;
+ PathElement* pre1 = NULL;
+ PathElement* pre2 = NULL;
+ int side = findPair(head, st[dir] + len / 2 , dir, pre1, pre2);
/*
- if ( pre1 == pre2 )
+ if(pre1 == pre2)
{
- int edgelen = ( dimen >> maxDepth ) ;
- dc_printf("Location: %d %d %d Direction: %d Reso: %d\n", st[0]/edgelen, st[1]/edgelen, st[2]/edgelen, dir, len/edgelen) ;
- printPath( head ) ;
- exit( 0 ) ;
+ int edgelen =(dimen >> maxDepth);
+ dc_printf("Location: %d %d %d Direction: %d Reso: %d\n", st[0]/edgelen, st[1]/edgelen, st[2]/edgelen, dir, len/edgelen);
+ printPath(head);
+ exit(0);
}
*/
- if ( side )
+ if(side)
{
// Entirely on one side
- PathList* nring = new PathList( ) ;
- nring->head = head ;
+ PathList* nring = new PathList();
+ nring->head = head;
- if ( side == -1 )
+ if(side == -1)
{
- nring->next = nrings1 ;
- nrings1 = nring ;
+ nring->next = nrings1;
+ nrings1 = nring;
}
else
{
- nring->next = nrings2 ;
- nrings2 = nring ;
+ nring->next = nrings2;
+ nrings2 = nring;
}
}
else
{
// Break into two parts
- PathElement* nxt1 = pre1->next ;
- PathElement* nxt2 = pre2->next ;
- pre1->next = nxt2 ;
- pre2->next = nxt1 ;
+ PathElement* nxt1 = pre1->next;
+ PathElement* nxt2 = pre2->next;
+ pre1->next = nxt2;
+ pre2->next = nxt1;
- newnode = connectFace( newnode, st, len, dir, pre1, pre2 ) ;
+ newnode = connectFace(newnode, st, len, dir, pre1, pre2);
- if ( isEqual( pre1, pre1->next ) )
+ if(isEqual(pre1, pre1->next))
{
- if ( pre1 == pre1->next )
+ if(pre1 == pre1->next)
{
- delete pre1 ;
- pre1 = NULL ;
+ delete pre1;
+ pre1 = NULL;
}
else
{
- PathElement* temp = pre1->next ;
- pre1->next = temp->next ;
- delete temp ;
+ PathElement* temp = pre1->next;
+ pre1->next = temp->next;
+ delete temp;
}
}
- if ( isEqual( pre2, pre2->next ) )
+ if(isEqual(pre2, pre2->next))
{
- if ( pre2 == pre2->next )
+ if(pre2 == pre2->next)
{
- delete pre2 ;
- pre2 = NULL ;
+ delete pre2;
+ pre2 = NULL;
}
else
{
- PathElement* temp = pre2->next ;
- pre2->next = temp->next ;
- delete temp ;
+ PathElement* temp = pre2->next;
+ pre2->next = temp->next;
+ delete temp;
}
}
- compressRing ( pre1 ) ;
- compressRing ( pre2 ) ;
+ compressRing(pre1);
+ compressRing(pre2);
// Recur
- newnode = patchSplitSingle( newnode, st, len, pre1, dir, nrings1, nrings2 ) ;
- newnode = patchSplitSingle( newnode, st, len, pre2, dir, nrings1, nrings2 ) ;
+ newnode = patchSplitSingle(newnode, st, len, pre1, dir, nrings1, nrings2);
+ newnode = patchSplitSingle(newnode, st, len, pre2, dir, nrings1, nrings2);
}
#ifdef IN_DEBUG_MODE
dc_printf("Return from PATCHSPLITSINGLE with \n");
- dc_printf("Rings gourp 1:\n") ;
- printPaths( nrings1 ) ;
- dc_printf("Rings group 2:\n") ;
- printPaths( nrings2 ) ;
+ dc_printf("Rings gourp 1:\n");
+ printPaths(nrings1);
+ dc_printf("Rings group 2:\n");
+ printPaths(nrings2);
#endif
- return newnode ;
+ return newnode;
}
-UCHAR* Octree::connectFace( UCHAR* node, int st[3], int len, int dir, PathElement* f1, PathElement* f2 )
+Node* Octree::connectFace(Node* newnode, int st[3], int len, int dir,
+ PathElement* f1, PathElement* f2)
{
#ifdef IN_DEBUG_MODE
- dc_printf("Call to CONNECTFACE with direction %d and length %d path: \n", dir, len );
- dc_printf("Path (low side): \n" ) ;
- printPath( f1 ) ;
-// checkPath( f1 ) ;
- dc_printf("Path (high side): \n" ) ;
- printPath( f2 ) ;
-// checkPath( f2 ) ;
+ dc_printf("Call to CONNECTFACE with direction %d and length %d path: \n", dir, len);
+ dc_printf("Path(low side): \n");
+ printPath(f1);
+// checkPath(f1);
+ dc_printf("Path(high side): \n");
+ printPath(f2);
+// checkPath(f2);
#endif
- UCHAR* newnode = node ;
-
// Setup 2D
- int pos = st[ dir ] + len / 2 ;
- int xdir = ( dir + 1 ) % 3 ;
- int ydir = ( dir + 2 ) % 3 ;
+ int pos = st[dir] + len / 2;
+ int xdir =(dir + 1) % 3;
+ int ydir =(dir + 2) % 3;
// Use existing intersections on f1 and f2
- int x1, y1, x2, y2 ;
- float p1, q1, p2, q2 ;
+ int x1, y1, x2, y2;
+ float p1, q1, p2, q2;
- getFacePoint( f2->next, dir, x1, y1, p1, q1 ) ;
- getFacePoint( f2, dir, x2, y2, p2, q2 ) ;
+ getFacePoint(f2->next, dir, x1, y1, p1, q1);
+ getFacePoint(f2, dir, x2, y2, p2, q2);
- float dx = x2 + p2 - x1 - p1 ;
- float dy = y2 + q2 - y1 - q1 ;
+ float dx = x2 + p2 - x1 - p1;
+ float dy = y2 + q2 - y1 - q1;
// Do adapted Bresenham line drawing
- float rx = p1, ry = q1 ;
- int incx = 1, incy = 1 ;
- int lx = x1, ly = y1 ;
- int hx = x2, hy = y2 ;
- int choice ;
- if ( x2 < x1 )
+ float rx = p1, ry = q1;
+ int incx = 1, incy = 1;
+ int lx = x1, ly = y1;
+ int hx = x2, hy = y2;
+ int choice;
+ if(x2 < x1)
{
- incx = -1 ;
- rx = 1 - rx ;
- lx = x2 ;
- hx = x1 ;
+ incx = -1;
+ rx = 1 - rx;
+ lx = x2;
+ hx = x1;
}
- if ( y2 < y1 )
+ if(y2 < y1)
{
- incy = -1 ;
- ry = 1 - ry ;
- ly = y2 ;
- hy = y1 ;
+ incy = -1;
+ ry = 1 - ry;
+ ly = y2;
+ hy = y1;
}
- float sx = dx * incx ;
- float sy = dy * incy ;
+ float sx = dx * incx;
+ float sy = dy * incy;
- int ori[3] ;
- ori[ dir ] = pos / mindimen ;
- ori[ xdir ] = x1 ;
- ori[ ydir ] = y1 ;
- int walkdir ;
- int inc ;
- float alpha ;
-
- PathElement* curEleN = f1 ;
- PathElement* curEleP = f2->next ;
- UCHAR *nodeN = NULL, *nodeP = NULL ;
- UCHAR *curN = locateLeaf( newnode, len, f1->pos ) ;
- UCHAR *curP = locateLeaf( newnode, len, f2->next->pos ) ;
- if ( curN == NULL || curP == NULL )
- {
- exit(0) ;
- }
- int stN[3], stP[3] ;
- int lenN, lenP ;
+ int ori[3];
+ ori[dir] = pos / mindimen;
+ ori[xdir] = x1;
+ ori[ydir] = y1;
+ int walkdir;
+ int inc;
+ float alpha;
+
+ PathElement* curEleN = f1;
+ PathElement* curEleP = f2->next;
+ Node *nodeN = NULL, *nodeP = NULL;
+ LeafNode *curN = locateLeaf(&newnode->internal, len, f1->pos);
+ LeafNode *curP = locateLeaf(&newnode->internal, len, f2->next->pos);
+ if(curN == NULL || curP == NULL)
+ {
+ exit(0);
+ }
+ int stN[3], stP[3];
+ int lenN, lenP;
/* Unused code, leaving for posterity
- float stpt[3], edpt[3] ;
- stpt[ dir ] = edpt[ dir ] = (float) pos ;
- stpt[ xdir ] = ( x1 + p1 ) * mindimen ;
- stpt[ ydir ] = ( y1 + q1 ) * mindimen ;
- edpt[ xdir ] = ( x2 + p2 ) * mindimen ;
- edpt[ ydir ] = ( y2 + q2 ) * mindimen ;
+ float stpt[3], edpt[3];
+ stpt[dir] = edpt[dir] =(float) pos;
+ stpt[xdir] =(x1 + p1) * mindimen;
+ stpt[ydir] =(y1 + q1) * mindimen;
+ edpt[xdir] =(x2 + p2) * mindimen;
+ edpt[ydir] =(y2 + q2) * mindimen;
*/
- while( ori[ xdir ] != x2 || ori[ ydir ] != y2 )
+ while(ori[xdir] != x2 || ori[ydir] != y2)
{
- int next ;
- if ( sy * (1 - rx) > sx * (1 - ry) )
+ int next;
+ if(sy *(1 - rx) > sx *(1 - ry))
{
- choice = 1 ;
- next = ori[ ydir ] + incy ;
- if ( next < ly || next > hy )
+ choice = 1;
+ next = ori[ydir] + incy;
+ if(next < ly || next > hy)
{
- choice = 4 ;
- next = ori[ xdir ] + incx ;
+ choice = 4;
+ next = ori[xdir] + incx;
}
}
else
{
- choice = 2 ;
- next = ori[ xdir ] + incx ;
- if ( next < lx || next > hx )
+ choice = 2;
+ next = ori[xdir] + incx;
+ if(next < lx || next > hx)
{
- choice = 3 ;
- next = ori[ ydir ] + incy ;
+ choice = 3;
+ next = ori[ydir] + incy;
}
}
- if ( choice & 1 )
+ if(choice & 1)
{
- ori[ ydir ] = next ;
- if ( choice == 1 )
+ ori[ydir] = next;
+ if(choice == 1)
{
- rx += ( sy == 0 ? 0 : (1 - ry) * sx / sy ) ;
- ry = 0 ;
+ rx +=(sy == 0 ? 0 :(1 - ry) * sx / sy );
+ ry = 0;
}
- walkdir = 2 ;
- inc = incy ;
- alpha = x2 < x1 ? 1 - rx : rx ;
+ walkdir = 2;
+ inc = incy;
+ alpha = x2 < x1 ? 1 - rx : rx;
}
else
{
- ori[ xdir ] = next ;
- if ( choice == 2 )
+ ori[xdir] = next;
+ if(choice == 2)
{
- ry += ( sx == 0 ? 0 : (1 - rx) * sy / sx ) ;
- rx = 0 ;
+ ry +=(sx == 0 ? 0 :(1 - rx) * sy / sx);
+ rx = 0;
}
- walkdir = 1 ;
- inc = incx ;
- alpha = y2 < y1 ? 1 - ry : ry ;
+ walkdir = 1;
+ inc = incx;
+ alpha = y2 < y1 ? 1 - ry : ry;
}
// Get the exact location of the marcher
- int nori[3] = { ori[0] * mindimen, ori[1] * mindimen, ori[2] * mindimen } ;
- float spt[3] = { (float) nori[0], (float) nori[1], (float) nori[2] } ;
- spt[ ( dir + ( 3 - walkdir ) ) % 3 ] += alpha * mindimen ;
- if ( inc < 0 )
+ int nori[3] = {ori[0] * mindimen, ori[1] * mindimen, ori[2] * mindimen};
+ float spt[3] = {(float) nori[0],(float) nori[1],(float) nori[2]};
+ spt[(dir +(3 - walkdir)) % 3] += alpha * mindimen;
+ if(inc < 0)
{
- spt[ ( dir + walkdir ) % 3 ] += mindimen ;
+ spt[(dir + walkdir) % 3] += mindimen;
}
- // dc_printf("new x,y: %d %d\n", ori[ xdir ] / edgelen, ori[ ydir ] / edgelen ) ;
- // dc_printf("nori: %d %d %d alpha: %f walkdir: %d\n", nori[0], nori[1], nori[2], alpha, walkdir ) ;
- // dc_printf("%f %f %f\n", spt[0], spt[1], spt[2] ) ;
+ // dc_printf("new x,y: %d %d\n", ori[xdir] / edgelen, ori[ydir] / edgelen);
+ // dc_printf("nori: %d %d %d alpha: %f walkdir: %d\n", nori[0], nori[1], nori[2], alpha, walkdir);
+ // dc_printf("%f %f %f\n", spt[0], spt[1], spt[2]);
// Locate the current cells on both sides
- newnode = locateCell( newnode, st, len, nori, dir, 1, nodeN, stN, lenN ) ;
- newnode = locateCell( newnode, st, len, nori, dir, 0, nodeP, stP, lenP ) ;
+ newnode = locateCell(&newnode->internal, st, len, nori, dir, 1, nodeN, stN, lenN);
+ newnode = locateCell(&newnode->internal, st, len, nori, dir, 0, nodeP, stP, lenP);
- updateParent( newnode, len, st ) ;
+ updateParent(&newnode->internal, len, st);
- int flag = 0 ;
+ int flag = 0;
// Add the cells to the rings and fill in the patch
- PathElement* newEleN ;
- if ( curEleN->pos[0] != stN[0] || curEleN->pos[1] != stN[1] || curEleN->pos[2] != stN[2] )
+ PathElement* newEleN;
+ if(curEleN->pos[0] != stN[0] || curEleN->pos[1] != stN[1] || curEleN->pos[2] != stN[2])
{
- if ( curEleN->next->pos[0] != stN[0] || curEleN->next->pos[1] != stN[1] || curEleN->next->pos[2] != stN[2] )
+ if(curEleN->next->pos[0] != stN[0] || curEleN->next->pos[1] != stN[1] || curEleN->next->pos[2] != stN[2])
{
- newEleN = new PathElement ;
- newEleN->next = curEleN->next ;
- newEleN->pos[0] = stN[0] ;
- newEleN->pos[1] = stN[1] ;
- newEleN->pos[2] = stN[2] ;
+ newEleN = new PathElement;
+ newEleN->next = curEleN->next;
+ newEleN->pos[0] = stN[0];
+ newEleN->pos[1] = stN[1];
+ newEleN->pos[2] = stN[2];
- curEleN->next = newEleN ;
+ curEleN->next = newEleN;
}
else
{
- newEleN = curEleN->next ;
+ newEleN = curEleN->next;
}
- curN = patchAdjacent( newnode, len, curEleN->pos, curN, newEleN->pos, nodeN, walkdir, inc, dir, 1, alpha ) ;
+ curN = patchAdjacent(&newnode->internal, len, curEleN->pos, curN,
+ newEleN->pos, (LeafNode*)nodeN, walkdir,
+ inc, dir, 1, alpha);
- curEleN = newEleN ;
- flag ++ ;
+ curEleN = newEleN;
+ flag ++;
}
- PathElement* newEleP ;
- if ( curEleP->pos[0] != stP[0] || curEleP->pos[1] != stP[1] || curEleP->pos[2] != stP[2] )
+ PathElement* newEleP;
+ if(curEleP->pos[0] != stP[0] || curEleP->pos[1] != stP[1] || curEleP->pos[2] != stP[2])
{
- if ( f2->pos[0] != stP[0] || f2->pos[1] != stP[1] || f2->pos[2] != stP[2] )
+ if(f2->pos[0] != stP[0] || f2->pos[1] != stP[1] || f2->pos[2] != stP[2])
{
- newEleP = new PathElement ;
- newEleP->next = curEleP ;
- newEleP->pos[0] = stP[0] ;
- newEleP->pos[1] = stP[1] ;
- newEleP->pos[2] = stP[2] ;
+ newEleP = new PathElement;
+ newEleP->next = curEleP;
+ newEleP->pos[0] = stP[0];
+ newEleP->pos[1] = stP[1];
+ newEleP->pos[2] = stP[2];
- f2->next = newEleP ;
+ f2->next = newEleP;
}
else
{
- newEleP = f2 ;
+ newEleP = f2;
}
- curP = patchAdjacent( newnode, len, curEleP->pos, curP, newEleP->pos, nodeP, walkdir, inc, dir, 0, alpha ) ;
+ curP = patchAdjacent(&newnode->internal, len, curEleP->pos, curP,
+ newEleP->pos, (LeafNode*)nodeP, walkdir,
+ inc, dir, 0, alpha);
- curEleP = newEleP ;
- flag ++ ;
+ curEleP = newEleP;
+ flag ++;
}
/*
- if ( flag == 0 )
+ if(flag == 0)
{
- dc_printf("error: non-synchronized patching! at \n") ;
+ dc_printf("error: non-synchronized patching! at \n");
}
*/
}
#ifdef IN_DEBUG_MODE
dc_printf("Return from CONNECTFACE with \n");
- dc_printf("Path (low side):\n") ;
- printPath( f1 ) ;
- checkPath( f1 ) ;
- dc_printf("Path (high side):\n") ;
- printPath( f2 ) ;
- checkPath( f2 ) ;
+ dc_printf("Path(low side):\n");
+ printPath(f1);
+ checkPath(f1);
+ dc_printf("Path(high side):\n");
+ printPath(f2);
+ checkPath(f2);
#endif
- return newnode ;
+ return newnode;
}
-UCHAR* Octree::patchAdjacent( UCHAR* node, int len, int st1[3], UCHAR* leaf1, int st2[3], UCHAR* leaf2, int walkdir, int inc, int dir, int side, float alpha )
+LeafNode* Octree::patchAdjacent(InternalNode* node, int len, int st1[3],
+ LeafNode* leaf1, int st2[3], LeafNode* leaf2,
+ int walkdir, int inc, int dir, int side,
+ float alpha)
{
#ifdef IN_DEBUG_MODE
- dc_printf("Before patching.\n") ;
- printInfo( st1 ) ;
- printInfo( st2 ) ;
- dc_printf("-----------------%d %d %d ; %d %d %d\n", st1[0], st2[1], st1[2], st2[0], st2[1], st2[2] ) ;
+ dc_printf("Before patching.\n");
+ printInfo(st1);
+ printInfo(st2);
+ dc_printf("-----------------%d %d %d; %d %d %d\n", st1[0], st2[1], st1[2], st2[0], st2[1], st2[2]);
#endif
// Get edge index on each leaf
- int edgedir = ( dir + ( 3 - walkdir ) ) % 3 ;
- int incdir = ( dir + walkdir ) % 3 ;
- int ind1 = ( edgedir == 1 ? ( dir + 3 - edgedir ) % 3 - 1 : 2 - ( dir + 3 - edgedir ) % 3 ) ;
- int ind2 = ( edgedir == 1 ? ( incdir + 3 - edgedir ) % 3 - 1 : 2 - ( incdir + 3 - edgedir ) % 3 ) ;
+ int edgedir =(dir +(3 - walkdir)) % 3;
+ int incdir =(dir + walkdir) % 3;
+ int ind1 =(edgedir == 1 ?(dir + 3 - edgedir) % 3 - 1 : 2 -(dir + 3 - edgedir) % 3);
+ int ind2 =(edgedir == 1 ?(incdir + 3 - edgedir) % 3 - 1 : 2 -(incdir + 3 - edgedir) % 3);
- int eind1 = ( ( edgedir << 2 ) | ( side << ind1 ) | ( ( inc > 0 ? 1 : 0 ) << ind2 ) ) ;
- int eind2 = ( ( edgedir << 2 ) | ( side << ind1 ) | ( ( inc > 0 ? 0 : 1 ) << ind2 ) ) ;
+ int eind1 =((edgedir << 2) |(side << ind1) |((inc > 0 ? 1 : 0) << ind2));
+ int eind2 =((edgedir << 2) |(side << ind1) |((inc > 0 ? 0 : 1) << ind2));
#ifdef IN_DEBUG_MODE
- dc_printf("Index 1: %d Alpha 1: %f Index 2: %d Alpha 2: %f\n", eind1, alpha, eind2, alpha ) ;
+ dc_printf("Index 1: %d Alpha 1: %f Index 2: %d Alpha 2: %f\n", eind1, alpha, eind2, alpha);
/*
- if ( alpha < 0 || alpha > 1 )
+ if(alpha < 0 || alpha > 1)
{
- dc_printf("Index 1: %d Alpha 1: %f Index 2: %d Alpha 2: %f\n", eind1, alpha, eind2, alpha ) ;
- printInfo( st1 ) ;
- printInfo( st2 ) ;
+ dc_printf("Index 1: %d Alpha 1: %f Index 2: %d Alpha 2: %f\n", eind1, alpha, eind2, alpha);
+ printInfo(st1);
+ printInfo(st2);
}
*/
#endif
// Flip edge parity
- UCHAR* nleaf1 = flipEdge( leaf1, eind1, alpha ) ;
- UCHAR* nleaf2 = flipEdge( leaf2, eind2, alpha ) ;
+ LeafNode* nleaf1 = flipEdge(leaf1, eind1, alpha);
+ LeafNode* nleaf2 = flipEdge(leaf2, eind2, alpha);
// Update parent link
- updateParent( node, len, st1, nleaf1 ) ;
- updateParent( node, len, st2, nleaf2 ) ;
- // updateParent( nleaf1, mindimen, st1 ) ;
- // updateParent( nleaf2, mindimen, st2 ) ;
+ updateParent(node, len, st1, nleaf1);
+ updateParent(node, len, st2, nleaf2);
+ // updateParent(nleaf1, mindimen, st1);
+ // updateParent(nleaf2, mindimen, st2);
/*
- float m[3] ;
- dc_printf("Adding new point: %f %f %f\n", spt[0], spt[1], spt[2] ) ;
- getMinimizer( leaf1, m ) ;
- dc_printf("Cell %d now has minimizer %f %f %f\n", leaf1, m[0], m[1], m[2] ) ;
- getMinimizer( leaf2, m ) ;
- dc_printf("Cell %d now has minimizer %f %f %f\n", leaf2, m[0], m[1], m[2] ) ;
+ float m[3];
+ dc_printf("Adding new point: %f %f %f\n", spt[0], spt[1], spt[2]);
+ getMinimizer(leaf1, m);
+ dc_printf("Cell %d now has minimizer %f %f %f\n", leaf1, m[0], m[1], m[2]);
+ getMinimizer(leaf2, m);
+ dc_printf("Cell %d now has minimizer %f %f %f\n", leaf2, m[0], m[1], m[2]);
*/
#ifdef IN_DEBUG_MODE
- dc_printf("After patching.\n") ;
- printInfo( st1 ) ;
- printInfo( st2 ) ;
+ dc_printf("After patching.\n");
+ printInfo(st1);
+ printInfo(st2);
#endif
- return nleaf2 ;
+ return nleaf2;
}
-UCHAR* Octree::locateCell( UCHAR* node, int st[3], int len, int ori[3], int dir, int side, UCHAR*& rleaf, int rst[3], int& rlen )
+Node* Octree::locateCell(InternalNode* node, int st[3], int len, int ori[3], int dir, int side, Node*& rleaf, int rst[3], int& rlen)
{
#ifdef IN_DEBUG_MODE
- // dc_printf("Call to LOCATECELL with node ") ;
- // printNode( node ) ;
+ // dc_printf("Call to LOCATECELL with node ");
+ // printNode(node);
#endif
- UCHAR* newnode = node ;
- int i ;
- len >>= 1 ;
- int ind = 0 ;
- for ( i = 0 ; i < 3 ; i ++ )
+
+ int i;
+ len >>= 1;
+ int ind = 0;
+ for(i = 0; i < 3; i ++)
{
- ind <<= 1 ;
- if ( i == dir && side == 1 )
+ ind <<= 1;
+ if(i == dir && side == 1)
{
- ind |= ( ori[ i ] <= ( st[ i ] + len ) ? 0 : 1 ) ;
+ ind |=(ori[i] <=(st[i] + len) ? 0 : 1);
}
else
{
- ind |= ( ori[ i ] < ( st[ i ] + len ) ? 0 : 1 ) ;
+ ind |=(ori[i] <(st[i] + len) ? 0 : 1);
}
}
#ifdef IN_DEBUG_MODE
- // dc_printf("In LOCATECELL index of ori (%d %d %d) with dir %d side %d in st (%d %d %d, %d) is: %d\n",
- // ori[0], ori[1], ori[2], dir, side, st[0], st[1], st[2], len, ind ) ;
+ // dc_printf("In LOCATECELL index of ori(%d %d %d) with dir %d side %d in st(%d %d %d, %d) is: %d\n",
+ // ori[0], ori[1], ori[2], dir, side, st[0], st[1], st[2], len, ind);
#endif
- rst[0] = st[0] + vertmap[ ind ][ 0 ] * len ;
- rst[1] = st[1] + vertmap[ ind ][ 1 ] * len ;
- rst[2] = st[2] + vertmap[ ind ][ 2 ] * len ;
+ rst[0] = st[0] + vertmap[ind][0] * len;
+ rst[1] = st[1] + vertmap[ind][1] * len;
+ rst[2] = st[2] + vertmap[ind][2] * len;
- if ( hasChild( newnode, ind ) )
+ if(hasChild(node, ind))
{
- int count = getChildCount( newnode, ind ) ;
- UCHAR* chd = getChild( newnode, count ) ;
- if ( isLeaf( newnode, ind ) )
+ int count = getChildCount(node, ind);
+ Node* chd = getChild(node, count);
+ if(isLeaf(node, ind))
{
- rleaf = chd ;
- rlen = len ;
+ rleaf = chd;
+ rlen = len;
}
else
{
// Recur
- setChild( newnode, count, locateCell( chd, rst, len, ori, dir, side, rleaf, rst, rlen ) ) ;
+ setChild(node, count, locateCell(&chd->internal, rst, len, ori, dir, side, rleaf, rst, rlen));
}
}
else
{
// Create a new child here
- if ( len == this->mindimen )
+ if(len == mindimen)
{
- UCHAR* chd = createLeaf( 0 ) ;
- newnode = addChild( newnode, ind, chd, 1 ) ;
- rleaf = chd ;
- rlen = len ;
+ LeafNode* chd = createLeaf(0);
+ node = addChild(node, ind, (Node*)chd, 1);
+ rleaf = (Node*)chd;
+ rlen = len;
}
else
{
// Subdivide the empty cube
- UCHAR* chd = createInternal( 0 ) ;
- newnode = addChild( newnode, ind, locateCell( chd, rst, len, ori, dir, side, rleaf, rst, rlen ), 0 ) ;
+ InternalNode* chd = createInternal(0);
+ node = addChild(node, ind,
+ locateCell(chd, rst, len, ori, dir, side, rleaf, rst, rlen), 0);
}
}
#ifdef IN_DEBUG_MODE
- // dc_printf("Return from LOCATECELL with node ") ;
- // printNode( newnode ) ;
+ // dc_printf("Return from LOCATECELL with node ");
+ // printNode(newnode);
#endif
- return newnode ;
+ return (Node*)node;
}
-void Octree::checkElement( PathElement* ele )
+void Octree::checkElement(PathElement* ele)
{
/*
- if ( ele != NULL && locateLeafCheck( ele->pos ) != ele->node )
+ if(ele != NULL && locateLeafCheck(ele->pos) != ele->node)
{
dc_printf("Screwed! at pos: %d %d %d\n", ele->pos[0]>>minshift, ele->pos[1]>>minshift, ele->pos[2]>>minshift);
- exit( 0 ) ;
+ exit(0);
}
*/
}
-void Octree::checkPath( PathElement* path )
+void Octree::checkPath(PathElement* path)
{
- PathElement *n = path ;
- int same = 0 ;
- while ( n && ( same == 0 || n != path ) )
+ PathElement *n = path;
+ int same = 0;
+ while(n &&(same == 0 || n != path))
{
- same ++ ;
- checkElement( n ) ;
- n = n->next ;
+ same ++;
+ checkElement(n);
+ n = n->next;
}
}
-void Octree::testFacePoint( PathElement* e1, PathElement* e2 )
+void Octree::testFacePoint(PathElement* e1, PathElement* e2)
{
- int i ;
- PathElement * e = NULL ;
- for ( i = 0 ; i < 3 ; i ++ )
+ int i;
+ PathElement * e = NULL;
+ for(i = 0; i < 3; i ++)
{
- if ( e1->pos[i] != e2->pos[i] )
+ if(e1->pos[i] != e2->pos[i])
{
- if ( e1->pos[i] < e2->pos[i] )
+ if(e1->pos[i] < e2->pos[i])
{
- e = e2 ;
+ e = e2;
}
else
{
- e = e1 ;
+ e = e1;
}
- break ;
+ break;
}
}
- int x, y ;
- float p, q ;
- dc_printf("Test.") ;
- getFacePoint( e, i, x, y, p, q ) ;
+ int x, y;
+ float p, q;
+ dc_printf("Test.");
+ getFacePoint(e, i, x, y, p, q);
}
-void Octree::getFacePoint( PathElement* leaf, int dir, int& x, int& y, float& p, float& q )
+void Octree::getFacePoint(PathElement* leaf, int dir, int& x, int& y, float& p, float& q)
{
// Find average intersections
- float avg[3] = {0, 0, 0} ;
- float off[3] ;
- int num = 0, num2 = 0 ;
+ float avg[3] = {0, 0, 0};
+ float off[3];
+ int num = 0, num2 = 0;
- UCHAR* leafnode = locateLeaf( leaf->pos ) ;
- for ( int i = 0 ; i < 4 ; i ++ )
+ LeafNode* leafnode = locateLeaf(leaf->pos);
+ for(int i = 0; i < 4; i ++)
{
- int edgeind = faceMap[ dir * 2 ][ i ] ;
- int nst[3] ;
- for ( int j = 0 ; j < 3 ; j ++ )
+ int edgeind = faceMap[dir * 2][i];
+ int nst[3];
+ for(int j = 0; j < 3; j ++)
{
- nst[j] = leaf->pos[j] + mindimen * vertmap[ edgemap[ edgeind][ 0 ] ][ j ] ;
+ nst[j] = leaf->pos[j] + mindimen * vertmap[edgemap[edgeind][0]][j];
}
- if ( getEdgeIntersectionByIndex( nst, edgeind / 4, off, 1 ) )
+ if(getEdgeIntersectionByIndex(nst, edgeind / 4, off, 1))
{
- avg[0] += off[0] ;
- avg[1] += off[1] ;
- avg[2] += off[2] ;
- num ++ ;
+ avg[0] += off[0];
+ avg[1] += off[1];
+ avg[2] += off[2];
+ num ++;
}
- if ( getEdgeParity( leafnode, edgeind ) )
+ if(getEdgeParity(leafnode, edgeind))
{
- num2 ++ ;
+ num2 ++;
}
}
- if ( num == 0 )
+ if(num == 0)
{
dc_printf("Wrong! dir: %d pos: %d %d %d num: %d\n", dir, leaf->pos[0]>>minshift, leaf->pos[1]>>minshift, leaf->pos[2]>>minshift, num2);
- avg[0] = (float) leaf->pos[0] ;
- avg[1] = (float) leaf->pos[1] ;
- avg[2] = (float) leaf->pos[2] ;
+ avg[0] =(float) leaf->pos[0];
+ avg[1] =(float) leaf->pos[1];
+ avg[2] =(float) leaf->pos[2];
}
else
{
- avg[0] /= num ;
- avg[1] /= num ;
- avg[2] /= num ;
+ avg[0] /= num;
+ avg[1] /= num;
+ avg[2] /= num;
- //avg[0] = (float) leaf->pos[0];
- //avg[1] = (float) leaf->pos[1];
- //avg[2] = (float) leaf->pos[2];
+ //avg[0] =(float) leaf->pos[0];
+ //avg[1] =(float) leaf->pos[1];
+ //avg[2] =(float) leaf->pos[2];
}
- int xdir = ( dir + 1 ) % 3 ;
- int ydir = ( dir + 2 ) % 3 ;
+ int xdir =(dir + 1) % 3;
+ int ydir =(dir + 2) % 3;
- float xf = avg[ xdir ] ;
- float yf = avg[ ydir ] ;
+ float xf = avg[xdir];
+ float yf = avg[ydir];
#ifdef IN_DEBUG_MODE
// Is it outside?
- // PathElement* leaf = leaf1->len < leaf2->len ? leaf1 : leaf2 ;
+ // PathElement* leaf = leaf1->len < leaf2->len ? leaf1 : leaf2;
/*
- float* m = ( leaf == leaf1 ? m1 : m2 ) ;
- if ( xf < leaf->pos[ xdir ] ||
- yf < leaf->pos[ ydir ] ||
- xf > leaf->pos[ xdir ] + leaf->len ||
- yf > leaf->pos[ ydir ] + leaf->len)
+ float* m =(leaf == leaf1 ? m1 : m2);
+ if(xf < leaf->pos[xdir] ||
+ yf < leaf->pos[ydir] ||
+ xf > leaf->pos[xdir] + leaf->len ||
+ yf > leaf->pos[ydir] + leaf->len)
{
- dc_printf("Outside cube (%d %d %d), %d : %d %d %f %f\n", leaf->pos[ 0 ], leaf->pos[1], leaf->pos[2], leaf->len,
- pos, dir, xf, yf) ;
+ dc_printf("Outside cube(%d %d %d), %d : %d %d %f %f\n", leaf->pos[0], leaf->pos[1], leaf->pos[2], leaf->len,
+ pos, dir, xf, yf);
// For now, snap to cell
- xf = m[ xdir ] ;
- yf = m[ ydir ] ;
+ xf = m[xdir];
+ yf = m[ydir];
}
*/
/*
- if ( alpha < 0 || alpha > 1 ||
+ if(alpha < 0 || alpha > 1 ||
xf < leaf->pos[xdir] || xf > leaf->pos[xdir] + leaf->len ||
- yf < leaf->pos[ydir] || yf > leaf->pos[ydir] + leaf->len )
+ yf < leaf->pos[ydir] || yf > leaf->pos[ydir] + leaf->len)
{
- dc_printf("Alpha: %f Address: %d and %d\n", alpha, leaf1->node, leaf2->node ) ;
- dc_printf("GETFACEPOINT result: (%d %d %d) %d min: (%f %f %f) ;(%d %d %d) %d min: (%f %f %f).\n",
+ dc_printf("Alpha: %f Address: %d and %d\n", alpha, leaf1->node, leaf2->node);
+ dc_printf("GETFACEPOINT result:(%d %d %d) %d min:(%f %f %f);(%d %d %d) %d min:(%f %f %f).\n",
leaf1->pos[0], leaf1->pos[1], leaf1->pos[2], leaf1->len, m1[0], m1[1], m1[2],
leaf2->pos[0], leaf2->pos[1], leaf2->pos[2], leaf2->len, m2[0], m2[1], m2[2]);
- dc_printf("Face point at dir %d pos %d: %f %f\n", dir, pos, xf, yf ) ;
+ dc_printf("Face point at dir %d pos %d: %f %f\n", dir, pos, xf, yf);
}
*/
#endif
// Get the integer and float part
- x = ( ( leaf->pos[ xdir ] ) >> minshift ) ;
- y = ( ( leaf->pos[ ydir ] ) >> minshift ) ;
+ x =((leaf->pos[xdir]) >> minshift);
+ y =((leaf->pos[ydir]) >> minshift);
- p = ( xf - leaf->pos[ xdir ] ) / mindimen ;
- q = ( yf - leaf->pos[ ydir ] ) / mindimen ;
+ p =(xf - leaf->pos[xdir]) / mindimen;
+ q =(yf - leaf->pos[ydir]) / mindimen;
#ifdef IN_DEBUG_MODE
- dc_printf("Face point at dir %d : %f %f\n", dir, xf, yf ) ;
+ dc_printf("Face point at dir %d : %f %f\n", dir, xf, yf);
#endif
}
-int Octree::findPair( PathElement* head, int pos, int dir, PathElement*& pre1, PathElement*& pre2 )
+int Octree::findPair(PathElement* head, int pos, int dir, PathElement*& pre1, PathElement*& pre2)
{
- int side = getSide ( head, pos, dir ) ;
- PathElement* cur = head ;
- PathElement* anchor ;
- PathElement* ppre1, *ppre2 ;
+ int side = getSide(head, pos, dir);
+ PathElement* cur = head;
+ PathElement* anchor;
+ PathElement* ppre1, *ppre2;
// Start from this face, find a pair
- anchor = cur ;
- ppre1 = cur ;
- cur = cur->next ;
- while ( cur != anchor && ( getSide( cur, pos, dir ) == side ) )
+ anchor = cur;
+ ppre1 = cur;
+ cur = cur->next;
+ while(cur != anchor &&(getSide(cur, pos, dir) == side))
{
- ppre1 = cur ;
- cur = cur->next ;
+ ppre1 = cur;
+ cur = cur->next;
}
- if ( cur == anchor )
+ if(cur == anchor)
{
// No pair found
- return side ;
+ return side;
}
- side = getSide( cur, pos, dir ) ;
- ppre2 = cur ;
- cur = cur->next ;
- while ( getSide( cur, pos, dir ) == side )
+ side = getSide(cur, pos, dir);
+ ppre2 = cur;
+ cur = cur->next;
+ while(getSide(cur, pos, dir) == side)
{
- ppre2 = cur ;
- cur = cur->next ;
+ ppre2 = cur;
+ cur = cur->next;
}
// Switch pre1 and pre2 if we start from the higher side
- if ( side == -1 )
+ if(side == -1)
{
- cur = ppre1 ;
- ppre1 = ppre2 ;
- ppre2 = cur ;
+ cur = ppre1;
+ ppre1 = ppre2;
+ ppre2 = cur;
}
- pre1 = ppre1 ;
- pre2 = ppre2 ;
+ pre1 = ppre1;
+ pre2 = ppre2;
- return 0 ;
+ return 0;
}
-int Octree::getSide( PathElement* e, int pos, int dir )
+int Octree::getSide(PathElement* e, int pos, int dir)
{
- return ( e->pos[ dir ] < pos ? -1 : 1 ) ;
+ return (e->pos[dir] < pos ? -1 : 1);
}
-int Octree::isEqual( PathElement* e1, PathElement* e2 )
+int Octree::isEqual(PathElement* e1, PathElement* e2)
{
- return ( e1->pos[0] == e2->pos[0] && e1->pos[1] == e2->pos[1] && e1->pos[2] == e2->pos[2] ) ;
+ return (e1->pos[0] == e2->pos[0] && e1->pos[1] == e2->pos[1] && e1->pos[2] == e2->pos[2]);
}
-void Octree::compressRing( PathElement*& ring )
+void Octree::compressRing(PathElement*& ring)
{
- if ( ring == NULL )
+ if(ring == NULL)
{
- return ;
+ return;
}
#ifdef IN_DEBUG_MODE
- dc_printf("Call to COMPRESSRING with path: \n" );
- printPath( ring ) ;
+ dc_printf("Call to COMPRESSRING with path: \n");
+ printPath(ring);
#endif
- PathElement* cur = ring->next->next ;
- PathElement* pre = ring->next ;
- PathElement* prepre = ring ;
- PathElement* anchor = prepre ;
+ PathElement* cur = ring->next->next;
+ PathElement* pre = ring->next;
+ PathElement* prepre = ring;
+ PathElement* anchor = prepre;
do
{
- while ( isEqual( cur, prepre ) )
+ while(isEqual(cur, prepre))
{
// Delete
- if ( cur == prepre )
+ if(cur == prepre)
{
// The ring has shrinked to a point
- delete pre ;
- delete cur ;
- anchor = NULL ;
- break ;
+ delete pre;
+ delete cur;
+ anchor = NULL;
+ break;
}
else
{
- prepre->next = cur->next ;
- delete pre ;
- delete cur ;
- pre = prepre->next ;
- cur = pre->next ;
- anchor = prepre ;
+ prepre->next = cur->next;
+ delete pre;
+ delete cur;
+ pre = prepre->next;
+ cur = pre->next;
+ anchor = prepre;
}
}
- if ( anchor == NULL )
+ if(anchor == NULL)
{
- break ;
+ break;
}
- prepre = pre ;
- pre = cur ;
- cur = cur->next ;
- } while ( prepre != anchor ) ;
+ prepre = pre;
+ pre = cur;
+ cur = cur->next;
+ } while(prepre != anchor);
- ring = anchor ;
+ ring = anchor;
#ifdef IN_DEBUG_MODE
- dc_printf("Return from COMPRESSRING with path: \n" );
- printPath( ring ) ;
+ dc_printf("Return from COMPRESSRING with path: \n");
+ printPath(ring);
#endif
}
-void Octree::buildSigns( )
+void Octree::buildSigns()
{
// First build a lookup table
- // dc_printf("Building up look up table...\n") ;
- int size = 1 << 12 ;
- unsigned char table[ 1 << 12 ] ;
- for ( int i = 0 ; i < size ; i ++ )
+ // dc_printf("Building up look up table...\n");
+ int size = 1 << 12;
+ unsigned char table[1 << 12];
+ for(int i = 0; i < size; i ++)
{
- table[i] = 0 ;
+ table[i] = 0;
}
- for ( int i = 0 ; i < 256 ; i ++ )
+ for(int i = 0; i < 256; i ++)
{
- int ind = 0 ;
- for ( int j = 11 ; j >= 0 ; j -- )
+ int ind = 0;
+ for(int j = 11; j >= 0; j --)
{
- ind <<= 1 ;
- if ( ( ( i >> edgemap[j][0] ) & 1 ) ^ ( ( i >> edgemap[j][1] ) & 1 ) )
+ ind <<= 1;
+ if(((i >> edgemap[j][0]) & 1) ^((i >> edgemap[j][1]) & 1))
{
- ind |= 1 ;
+ ind |= 1;
}
}
- table[ ind ] = i ;
+ table[ind] = i;
}
// Next, traverse the grid
- int sg = 1 ;
- int cube[8] ;
- buildSigns( table, this->root, 0, sg, cube ) ;
+ int sg = 1;
+ int cube[8];
+ buildSigns(table, root, 0, sg, cube);
}
-void Octree::buildSigns( unsigned char table[], UCHAR* node, int isLeaf, int sg, int rvalue[8] )
+void Octree::buildSigns(unsigned char table[], Node* node, int isLeaf, int sg, int rvalue[8])
{
- if ( node == NULL )
+ if(node == NULL)
{
- for ( int i = 0 ; i < 8 ; i ++ )
+ for(int i = 0; i < 8; i ++)
{
- rvalue[i] = sg ;
+ rvalue[i] = sg;
}
- return ;
+ return;
}
- if ( isLeaf == 0 )
+ if(isLeaf == 0)
{
// Internal node
- UCHAR* chd[8] ;
- int leaf[8] ;
- fillChildren( node, chd, leaf ) ;
+ Node* chd[8];
+ int leaf[8];
+ fillChildren(&node->internal, chd, leaf);
// Get the signs at the corners of the first cube
- rvalue[0] = sg ;
- int oris[8] ;
- buildSigns( table, chd[0], leaf[0], sg, oris ) ;
+ rvalue[0] = sg;
+ int oris[8];
+ buildSigns(table, chd[0], leaf[0], sg, oris);
// Get the rest
- int cube[8] ;
- for ( int i = 1 ; i < 8 ; i ++ )
+ int cube[8];
+ for(int i = 1; i < 8; i ++)
{
- buildSigns( table, chd[i], leaf[i], oris[i], cube ) ;
- rvalue[i] = cube[i] ;
+ buildSigns(table, chd[i], leaf[i], oris[i], cube);
+ rvalue[i] = cube[i];
}
}
else
{
// Leaf node
- generateSigns( node, table, sg ) ;
+ generateSigns(&node->leaf, table, sg);
- for ( int i = 0 ; i < 8 ; i ++ )
+ for(int i = 0; i < 8; i ++)
{
- rvalue[i] = getSign( node, i ) ;
+ rvalue[i] = getSign(&node->leaf, i);
}
}
}
-void Octree::floodFill( )
+void Octree::floodFill()
{
- // int threshold = (int) ((dimen/mindimen) * (dimen/mindimen) * 0.5f) ;
- int st[3] = { 0, 0, 0 } ;
+ // int threshold =(int)((dimen/mindimen) *(dimen/mindimen) * 0.5f);
+ int st[3] = {0, 0, 0};
// First, check for largest component
// size stored in -threshold
- this->clearProcessBits( root, maxDepth ) ;
- int threshold = this->floodFill( root, st, dimen, maxDepth, 0 ) ;
+ clearProcessBits(root, maxDepth);
+ int threshold = floodFill(root, st, dimen, maxDepth, 0);
// Next remove
dc_printf("Largest component: %d\n", threshold);
- threshold *= thresh ;
- dc_printf("Removing all components smaller than %d\n", threshold) ;
+ threshold *= thresh;
+ dc_printf("Removing all components smaller than %d\n", threshold);
- int st2[3] = { 0, 0, 0 } ;
- this->clearProcessBits( root, maxDepth ) ;
- this->floodFill( root, st2, dimen, maxDepth, threshold ) ;
+ int st2[3] = {0, 0, 0};
+ clearProcessBits(root, maxDepth);
+ floodFill(root, st2, dimen, maxDepth, threshold);
}
-void Octree::clearProcessBits( UCHAR* node, int height )
+void Octree::clearProcessBits(Node* node, int height)
{
int i;
- if ( height == 0 )
+ if(height == 0)
{
// Leaf cell,
- for ( i = 0 ; i < 12 ; i ++ )
+ for(i = 0; i < 12; i ++)
{
- setOutProcess( node, i ) ;
+ setOutProcess(&node->leaf, i);
}
}
else
{
// Internal cell, recur
- int count = 0 ;
- for ( i = 0 ; i < 8 ; i ++ )
+ int count = 0;
+ for(i = 0; i < 8; i ++)
{
- if ( hasChild( node, i ) )
+ if(hasChild(&node->internal, i))
{
- clearProcessBits( getChild( node, count ), height - 1 ) ;
- count ++ ;
+ clearProcessBits(getChild(&node->internal, count), height - 1);
+ count ++;
}
}
}
}
-/*
-void Octree::floodFill( UCHAR* node, int st[3], int len, int height, int threshold )
+int Octree::floodFill(LeafNode* leaf, int st[3], int len, int height, int threshold)
{
int i, j;
-
- if ( height == 0 )
- {
- // Leaf cell,
- int par, inp ;
-
- // Test if the leaf has intersection edges
- for ( i = 0 ; i < 12 ; i ++ )
- {
- par = getEdgeParity( node, i ) ;
- inp = isInProcess( node, i ) ;
-
- if ( par == 1 && inp == 0 )
- {
- // Intersection edge, hasn't been processed
- // Let's start filling
- GridQueue* queue = new GridQueue() ;
- int total = 1 ;
-
- // Set to in process
- int mst[3] ;
- mst[0] = st[0] + vertmap[edgemap[i][0]][0] * len ;
- mst[1] = st[1] + vertmap[edgemap[i][0]][1] * len ;
- mst[2] = st[2] + vertmap[edgemap[i][0]][2] * len;
- int mdir = i / 4 ;
- setInProcessAll( mst, mdir ) ;
-
- // Put this edge into queue
- queue->pushQueue( mst, mdir ) ;
-
- // Queue processing
- int nst[3], dir ;
- while ( queue->popQueue( nst, dir ) == 1 )
- {
- // dc_printf("nst: %d %d %d, dir: %d\n", nst[0]/mindimen, nst[1]/mindimen, nst[2]/mindimen, dir) ;
- // locations
- int stMask[3][3] = {
- { 0, 0 - len, 0 - len },
- { 0 - len, 0, 0 - len },
- { 0 - len, 0 - len, 0 }
- };
- int cst[2][3] ;
- for ( j = 0 ; j < 3 ; j ++ )
- {
- cst[0][j] = nst[j] ;
- cst[1][j] = nst[j] + stMask[ dir ][ j ] ;
- }
-
- // cells
- UCHAR* cs[2] ;
- for ( j = 0 ; j < 2 ; j ++ )
- {
- cs[ j ] = locateLeaf( cst[j] ) ;
- }
-
- // Middle sign
- int s = getSign( cs[0], 0 ) ;
-
- // Masks
- int fcCells[4] = {1,0,1,0};
- int fcEdges[3][4][3] = {
- {{9,2,11},{8,1,10},{5,1,7},{4,2,6}},
- {{10,6,11},{8,5,9},{1,5,3},{0,6,2}},
- {{6,10,7},{4,9,5},{2,9,3},{0,10,1}}
- };
-
- // Search for neighboring connected intersection edges
- for ( int find = 0 ; find < 4 ; find ++ )
- {
- int cind = fcCells[find] ;
- int eind, edge ;
- if ( s == 0 )
- {
- // Original order
- for ( eind = 0 ; eind < 3 ; eind ++ )
- {
- edge = fcEdges[dir][find][eind] ;
- if ( getEdgeParity( cs[cind], edge ) == 1 )
- {
- break ;
- }
- }
- }
- else
- {
- // Inverse order
- for ( eind = 2 ; eind >= 0 ; eind -- )
- {
- edge = fcEdges[dir][find][eind] ;
- if ( getEdgeParity( cs[cind], edge ) == 1 )
- {
- break ;
- }
- }
- }
-
- if ( eind == 3 || eind == -1 )
- {
- dc_printf("Wrong! this is not a consistent sign. %d\n", eind );
- }
- else
- {
- int est[3] ;
- est[0] = cst[cind][0] + vertmap[edgemap[edge][0]][0] * len ;
- est[1] = cst[cind][1] + vertmap[edgemap[edge][0]][1] * len ;
- est[2] = cst[cind][2] + vertmap[edgemap[edge][0]][2] * len ;
- int edir = edge / 4 ;
-
- if ( isInProcess( cs[cind], edge ) == 0 )
- {
- setInProcessAll( est, edir ) ;
- queue->pushQueue( est, edir ) ;
- // dc_printf("Pushed: est: %d %d %d, edir: %d\n", est[0]/len, est[1]/len, est[2]/len, edir) ;
- total ++ ;
- }
- else
- {
- // dc_printf("Processed, not pushed: est: %d %d %d, edir: %d\n", est[0]/len, est[1]/len, est[2]/len, edir) ;
- }
- }
-
- }
-
+ int maxtotal = 0;
+
+ // Leaf cell,
+ int par, inp;
+
+ // Test if the leaf has intersection edges
+ for(i = 0; i < 12; i ++) {
+ par = getEdgeParity(leaf, i);
+ inp = isInProcess(leaf, i);
+
+ if(par == 1 && inp == 0) {
+ // Intersection edge, hasn't been processed
+ // Let's start filling
+ GridQueue* queue = new GridQueue();
+ int total = 1;
+
+ // Set to in process
+ int mst[3];
+ mst[0] = st[0] + vertmap[edgemap[i][0]][0] * len;
+ mst[1] = st[1] + vertmap[edgemap[i][0]][1] * len;
+ mst[2] = st[2] + vertmap[edgemap[i][0]][2] * len;
+ int mdir = i / 4;
+ setInProcessAll(mst, mdir);
+
+ // Put this edge into queue
+ queue->pushQueue(mst, mdir);
+
+ // Queue processing
+ int nst[3], dir;
+ while(queue->popQueue(nst, dir) == 1) {
+ // dc_printf("nst: %d %d %d, dir: %d\n", nst[0]/mindimen, nst[1]/mindimen, nst[2]/mindimen, dir);
+ // locations
+ int stMask[3][3] = {
+ {0, 0 - len, 0 - len},
+ {0 - len, 0, 0 - len},
+ {0 - len, 0 - len, 0}
+ };
+ int cst[2][3];
+ for(j = 0; j < 3; j ++) {
+ cst[0][j] = nst[j];
+ cst[1][j] = nst[j] + stMask[dir][j];
}
- dc_printf("Size of component: %d ", total) ;
-
- if ( total > threshold )
- {
- dc_printf("Maintained.\n") ;
- continue ;
+ // cells
+ LeafNode* cs[2];
+ for(j = 0; j < 2; j ++) {
+ cs[j] = locateLeaf(cst[j]);
}
- dc_printf("Less then %d, removing...\n", threshold) ;
-
- // We have to remove this noise
-
- // Flip parity
- // setOutProcessAll( mst, mdir ) ;
- flipParityAll( mst, mdir ) ;
-
- // Put this edge into queue
- queue->pushQueue( mst, mdir ) ;
-
- // Queue processing
- while ( queue->popQueue( nst, dir ) == 1 )
- {
- // dc_printf("nst: %d %d %d, dir: %d\n", nst[0]/mindimen, nst[1]/mindimen, nst[2]/mindimen, dir) ;
- // locations
- int stMask[3][3] = {
- { 0, 0 - len, 0 - len },
- { 0 - len, 0, 0 - len },
- { 0 - len, 0 - len, 0 }
- };
- int cst[2][3] ;
- for ( j = 0 ; j < 3 ; j ++ )
- {
- cst[0][j] = nst[j] ;
- cst[1][j] = nst[j] + stMask[ dir ][ j ] ;
- }
- // cells
- UCHAR* cs[2] ;
- for ( j = 0 ; j < 2 ; j ++ )
- {
- cs[ j ] = locateLeaf( cst[j] ) ;
- }
-
- // Middle sign
- int s = getSign( cs[0], 0 ) ;
-
- // Masks
- int fcCells[4] = {1,0,1,0};
- int fcEdges[3][4][3] = {
- {{9,2,11},{8,1,10},{5,1,7},{4,2,6}},
- {{10,6,11},{8,5,9},{1,5,3},{0,6,2}},
- {{6,10,7},{4,9,5},{2,9,3},{0,10,1}}
- };
-
- // Search for neighboring connected intersection edges
- for ( int find = 0 ; find < 4 ; find ++ )
- {
- int cind = fcCells[find] ;
- int eind, edge ;
- if ( s == 0 )
- {
- // Original order
- for ( eind = 0 ; eind < 3 ; eind ++ )
- {
- edge = fcEdges[dir][find][eind] ;
- if ( isInProcess( cs[cind], edge ) == 1 )
- {
- break ;
- }
- }
- }
- else
- {
- // Inverse order
- for ( eind = 2 ; eind >= 0 ; eind -- )
- {
- edge = fcEdges[dir][find][eind] ;
- if ( isInProcess( cs[cind], edge ) == 1 )
- {
- break ;
- }
- }
- }
-
- if ( eind == 3 || eind == -1 )
- {
- dc_printf("Wrong! this is not a consistent sign. %d\n", eind );
- }
- else
- {
- int est[3] ;
- est[0] = cst[cind][0] + vertmap[edgemap[edge][0]][0] * len ;
- est[1] = cst[cind][1] + vertmap[edgemap[edge][0]][1] * len ;
- est[2] = cst[cind][2] + vertmap[edgemap[edge][0]][2] * len ;
- int edir = edge / 4 ;
-
- if ( getEdgeParity( cs[cind], edge ) == 1 )
- {
- flipParityAll( est, edir ) ;
- queue->pushQueue( est, edir ) ;
- // dc_printf("Pushed: est: %d %d %d, edir: %d\n", est[0]/len, est[1]/len, est[2]/len, edir) ;
- total ++ ;
- }
- else
- {
- // dc_printf("Processed, not pushed: est: %d %d %d, edir: %d\n", est[0]/len, est[1]/len, est[2]/len, edir) ;
+ // Middle sign
+ int s = getSign(cs[0], 0);
+
+ // Masks
+ int fcCells[4] = {1,0,1,0};
+ int fcEdges[3][4][3] = {
+ {{9,2,11},{8,1,10},{5,1,7},{4,2,6}},
+ {{10,6,11},{8,5,9},{1,5,3},{0,6,2}},
+ {{6,10,7},{4,9,5},{2,9,3},{0,10,1}}
+ };
+
+ // Search for neighboring connected intersection edges
+ for(int find = 0; find < 4; find ++) {
+ int cind = fcCells[find];
+ int eind, edge;
+ if(s == 0) {
+ // Original order
+ for(eind = 0; eind < 3; eind ++) {
+ edge = fcEdges[dir][find][eind];
+ if(getEdgeParity(cs[cind], edge) == 1) {
+ break;
}
}
-
}
-
- }
-
- }
- }
- }
- else
- {
- // Internal cell, recur
- int count = 0 ;
- len >>= 1 ;
- for ( i = 0 ; i < 8 ; i ++ )
- {
- if ( hasChild( node, i ) )
- {
- int nst[3] ;
- nst[0] = st[0] + vertmap[i][0] * len ;
- nst[1] = st[1] + vertmap[i][1] * len ;
- nst[2] = st[2] + vertmap[i][2] * len ;
-
- floodFill( getChild( node, count ), nst, len, height - 1, threshold ) ;
- count ++ ;
- }
- }
- }
-}
-*/
-
-int Octree::floodFill( UCHAR* node, int st[3], int len, int height, int threshold )
-{
- int i, j;
- int maxtotal = 0 ;
-
- if ( height == 0 )
- {
- // Leaf cell,
- int par, inp ;
-
- // Test if the leaf has intersection edges
- for ( i = 0 ; i < 12 ; i ++ )
- {
- par = getEdgeParity( node, i ) ;
- inp = isInProcess( node, i ) ;
-
- if ( par == 1 && inp == 0 )
- {
- // Intersection edge, hasn't been processed
- // Let's start filling
- GridQueue* queue = new GridQueue() ;
- int total = 1 ;
-
- // Set to in process
- int mst[3] ;
- mst[0] = st[0] + vertmap[edgemap[i][0]][0] * len ;
- mst[1] = st[1] + vertmap[edgemap[i][0]][1] * len ;
- mst[2] = st[2] + vertmap[edgemap[i][0]][2] * len;
- int mdir = i / 4 ;
- setInProcessAll( mst, mdir ) ;
-
- // Put this edge into queue
- queue->pushQueue( mst, mdir ) ;
-
- // Queue processing
- int nst[3], dir ;
- while ( queue->popQueue( nst, dir ) == 1 )
- {
- // dc_printf("nst: %d %d %d, dir: %d\n", nst[0]/mindimen, nst[1]/mindimen, nst[2]/mindimen, dir) ;
- // locations
- int stMask[3][3] = {
- { 0, 0 - len, 0 - len },
- { 0 - len, 0, 0 - len },
- { 0 - len, 0 - len, 0 }
- };
- int cst[2][3] ;
- for ( j = 0 ; j < 3 ; j ++ )
- {
- cst[0][j] = nst[j] ;
- cst[1][j] = nst[j] + stMask[ dir ][ j ] ;
- }
-
- // cells
- UCHAR* cs[2] ;
- for ( j = 0 ; j < 2 ; j ++ )
- {
- cs[ j ] = locateLeaf( cst[j] ) ;
- }
-
- // Middle sign
- int s = getSign( cs[0], 0 ) ;
-
- // Masks
- int fcCells[4] = {1,0,1,0};
- int fcEdges[3][4][3] = {
- {{9,2,11},{8,1,10},{5,1,7},{4,2,6}},
- {{10,6,11},{8,5,9},{1,5,3},{0,6,2}},
- {{6,10,7},{4,9,5},{2,9,3},{0,10,1}}
- };
-
- // Search for neighboring connected intersection edges
- for ( int find = 0 ; find < 4 ; find ++ )
- {
- int cind = fcCells[find] ;
- int eind, edge ;
- if ( s == 0 )
- {
- // Original order
- for ( eind = 0 ; eind < 3 ; eind ++ )
- {
- edge = fcEdges[dir][find][eind] ;
- if ( getEdgeParity( cs[cind], edge ) == 1 )
- {
- break ;
- }
- }
- }
- else
- {
- // Inverse order
- for ( eind = 2 ; eind >= 0 ; eind -- )
- {
- edge = fcEdges[dir][find][eind] ;
- if ( getEdgeParity( cs[cind], edge ) == 1 )
- {
- break ;
- }
+ else {
+ // Inverse order
+ for(eind = 2; eind >= 0; eind --) {
+ edge = fcEdges[dir][find][eind];
+ if(getEdgeParity(cs[cind], edge) == 1) {
+ break;
}
}
+ }
- if ( eind == 3 || eind == -1 )
- {
- dc_printf("Wrong! this is not a consistent sign. %d\n", eind );
- }
- else
- {
- int est[3] ;
- est[0] = cst[cind][0] + vertmap[edgemap[edge][0]][0] * len ;
- est[1] = cst[cind][1] + vertmap[edgemap[edge][0]][1] * len ;
- est[2] = cst[cind][2] + vertmap[edgemap[edge][0]][2] * len ;
- int edir = edge / 4 ;
+ if(eind == 3 || eind == -1) {
+ dc_printf("Wrong! this is not a consistent sign. %d\n", eind);
+ }
+ else {
+ int est[3];
+ est[0] = cst[cind][0] + vertmap[edgemap[edge][0]][0] * len;
+ est[1] = cst[cind][1] + vertmap[edgemap[edge][0]][1] * len;
+ est[2] = cst[cind][2] + vertmap[edgemap[edge][0]][2] * len;
+ int edir = edge / 4;
- if ( isInProcess( cs[cind], edge ) == 0 )
- {
- setInProcessAll( est, edir ) ;
- queue->pushQueue( est, edir ) ;
- // dc_printf("Pushed: est: %d %d %d, edir: %d\n", est[0]/len, est[1]/len, est[2]/len, edir) ;
- total ++ ;
- }
- else
- {
- // dc_printf("Processed, not pushed: est: %d %d %d, edir: %d\n", est[0]/len, est[1]/len, est[2]/len, edir) ;
- }
+ if(isInProcess(cs[cind], edge) == 0) {
+ setInProcessAll(est, edir);
+ queue->pushQueue(est, edir);
+ // dc_printf("Pushed: est: %d %d %d, edir: %d\n", est[0]/len, est[1]/len, est[2]/len, edir);
+ total ++;
}
-
}
-
}
+ }
- dc_printf("Size of component: %d ", total) ;
+ dc_printf("Size of component: %d ", total);
- if ( threshold == 0 )
- {
- // Measuring stage
- if ( total > maxtotal )
- {
- maxtotal = total ;
- }
- dc_printf(".\n") ;
- continue ;
+ if(threshold == 0) {
+ // Measuring stage
+ if(total > maxtotal) {
+ maxtotal = total;
}
+ dc_printf(".\n");
+ continue;
+ }
- if ( total >= threshold )
- {
- dc_printf("Maintained.\n") ;
- continue ;
+ if(total >= threshold) {
+ dc_printf("Maintained.\n");
+ continue;
+ }
+ dc_printf("Less then %d, removing...\n", threshold);
+
+ // We have to remove this noise
+
+ // Flip parity
+ // setOutProcessAll(mst, mdir);
+ flipParityAll(mst, mdir);
+
+ // Put this edge into queue
+ queue->pushQueue(mst, mdir);
+
+ // Queue processing
+ while(queue->popQueue(nst, dir) == 1) {
+ // dc_printf("nst: %d %d %d, dir: %d\n", nst[0]/mindimen, nst[1]/mindimen, nst[2]/mindimen, dir);
+ // locations
+ int stMask[3][3] = {
+ {0, 0 - len, 0 - len},
+ {0 - len, 0, 0 - len},
+ {0 - len, 0 - len, 0}
+ };
+ int cst[2][3];
+ for(j = 0; j < 3; j ++) {
+ cst[0][j] = nst[j];
+ cst[1][j] = nst[j] + stMask[dir][j];
}
- dc_printf("Less then %d, removing...\n", threshold) ;
- // We have to remove this noise
-
- // Flip parity
- // setOutProcessAll( mst, mdir ) ;
- flipParityAll( mst, mdir ) ;
-
- // Put this edge into queue
- queue->pushQueue( mst, mdir ) ;
-
- // Queue processing
- while ( queue->popQueue( nst, dir ) == 1 )
- {
- // dc_printf("nst: %d %d %d, dir: %d\n", nst[0]/mindimen, nst[1]/mindimen, nst[2]/mindimen, dir) ;
- // locations
- int stMask[3][3] = {
- { 0, 0 - len, 0 - len },
- { 0 - len, 0, 0 - len },
- { 0 - len, 0 - len, 0 }
- };
- int cst[2][3] ;
- for ( j = 0 ; j < 3 ; j ++ )
- {
- cst[0][j] = nst[j] ;
- cst[1][j] = nst[j] + stMask[ dir ][ j ] ;
- }
-
- // cells
- UCHAR* cs[2] ;
- for ( j = 0 ; j < 2 ; j ++ )
- {
- cs[ j ] = locateLeaf( cst[j] ) ;
- }
-
- // Middle sign
- int s = getSign( cs[0], 0 ) ;
-
- // Masks
- int fcCells[4] = {1,0,1,0};
- int fcEdges[3][4][3] = {
- {{9,2,11},{8,1,10},{5,1,7},{4,2,6}},
- {{10,6,11},{8,5,9},{1,5,3},{0,6,2}},
- {{6,10,7},{4,9,5},{2,9,3},{0,10,1}}
- };
-
- // Search for neighboring connected intersection edges
- for ( int find = 0 ; find < 4 ; find ++ )
- {
- int cind = fcCells[find] ;
- int eind, edge ;
- if ( s == 0 )
- {
- // Original order
- for ( eind = 0 ; eind < 3 ; eind ++ )
- {
- edge = fcEdges[dir][find][eind] ;
- if ( isInProcess( cs[cind], edge ) == 1 )
- {
- break ;
- }
+ // cells
+ LeafNode* cs[2];
+ for(j = 0; j < 2; j ++)
+ cs[j] = locateLeaf(cst[j]);
+
+ // Middle sign
+ int s = getSign(cs[0], 0);
+
+ // Masks
+ int fcCells[4] = {1,0,1,0};
+ int fcEdges[3][4][3] = {
+ {{9,2,11},{8,1,10},{5,1,7},{4,2,6}},
+ {{10,6,11},{8,5,9},{1,5,3},{0,6,2}},
+ {{6,10,7},{4,9,5},{2,9,3},{0,10,1}}
+ };
+
+ // Search for neighboring connected intersection edges
+ for(int find = 0; find < 4; find ++) {
+ int cind = fcCells[find];
+ int eind, edge;
+ if(s == 0) {
+ // Original order
+ for(eind = 0; eind < 3; eind ++) {
+ edge = fcEdges[dir][find][eind];
+ if(isInProcess(cs[cind], edge) == 1) {
+ break;
}
}
- else
- {
- // Inverse order
- for ( eind = 2 ; eind >= 0 ; eind -- )
- {
- edge = fcEdges[dir][find][eind] ;
- if ( isInProcess( cs[cind], edge ) == 1 )
- {
- break ;
- }
+ }
+ else {
+ // Inverse order
+ for(eind = 2; eind >= 0; eind --) {
+ edge = fcEdges[dir][find][eind];
+ if(isInProcess(cs[cind], edge) == 1) {
+ break;
}
}
+ }
- if ( eind == 3 || eind == -1 )
- {
- dc_printf("Wrong! this is not a consistent sign. %d\n", eind );
- }
- else
- {
- int est[3] ;
- est[0] = cst[cind][0] + vertmap[edgemap[edge][0]][0] * len ;
- est[1] = cst[cind][1] + vertmap[edgemap[edge][0]][1] * len ;
- est[2] = cst[cind][2] + vertmap[edgemap[edge][0]][2] * len ;
- int edir = edge / 4 ;
+ if(eind == 3 || eind == -1) {
+ dc_printf("Wrong! this is not a consistent sign. %d\n", eind);
+ }
+ else {
+ int est[3];
+ est[0] = cst[cind][0] + vertmap[edgemap[edge][0]][0] * len;
+ est[1] = cst[cind][1] + vertmap[edgemap[edge][0]][1] * len;
+ est[2] = cst[cind][2] + vertmap[edgemap[edge][0]][2] * len;
+ int edir = edge / 4;
- if ( getEdgeParity( cs[cind], edge ) == 1 )
- {
- flipParityAll( est, edir ) ;
- queue->pushQueue( est, edir ) ;
- // dc_printf("Pushed: est: %d %d %d, edir: %d\n", est[0]/len, est[1]/len, est[2]/len, edir) ;
- total ++ ;
- }
- else
- {
- // dc_printf("Processed, not pushed: est: %d %d %d, edir: %d\n", est[0]/len, est[1]/len, est[2]/len, edir) ;
- }
+ if(getEdgeParity(cs[cind], edge) == 1) {
+ flipParityAll(est, edir);
+ queue->pushQueue(est, edir);
+ // dc_printf("Pushed: est: %d %d %d, edir: %d\n", est[0]/len, est[1]/len, est[2]/len, edir);
+ total ++;
}
-
}
-
}
-
}
}
-
}
- else
- {
- // Internal cell, recur
- int count = 0 ;
- len >>= 1 ;
- for ( i = 0 ; i < 8 ; i ++ )
- {
- if ( hasChild( node, i ) )
- {
- int nst[3] ;
- nst[0] = st[0] + vertmap[i][0] * len ;
- nst[1] = st[1] + vertmap[i][1] * len ;
- nst[2] = st[2] + vertmap[i][2] * len ;
-
- int d = floodFill( getChild( node, count ), nst, len, height - 1, threshold ) ;
- if ( d > maxtotal)
- {
- maxtotal = d ;
- }
- count ++ ;
- }
- }
- }
-
-
- return maxtotal ;
-
-}
-
-void Octree::writeOut()
-{
- int numQuads = 0 ;
- int numVertices = 0 ;
- int numEdges = 0 ;
-#ifdef USE_HERMIT
- countIntersection( root, maxDepth, numQuads, numVertices, numEdges ) ;
-#else
- countIntersection( root, maxDepth, numQuads, numVertices ) ;
- numEdges = numQuads * 3 / 2 ;
-#endif
- dc_printf("Vertices counted: %d Polys counted: %d \n", numVertices, numQuads ) ;
- output_mesh = alloc_output(numVertices, numQuads);
- int offset = 0 ;
- int st[3] = { 0, 0, 0 } ;
-
- // First, output vertices
- offset = 0 ;
- actualVerts = 0 ;
- actualQuads = 0 ;
-#ifdef USE_HERMIT
- generateMinimizer( root, st, dimen, maxDepth, offset ) ;
- cellProcContour( this->root, 0, maxDepth ) ;
- dc_printf("Vertices written: %d Quads written: %d \n", offset, actualQuads ) ;
-#else
- writeVertex( root, st, dimen, maxDepth, offset, out ) ;
- writeQuad( root, st, dimen, maxDepth, out ) ;
- dc_printf("Vertices written: %d Triangles written: %d \n", offset, actualQuads ) ;
-#endif
-}
-
-#if 0
-void Octree::writePLY( char* fname )
-{
- int numQuads = 0 ;
- int numVertices = 0 ;
- int numEdges = 0 ;
-#ifdef USE_HERMIT
- countIntersection( root, maxDepth, numQuads, numVertices, numEdges ) ;
-#else
- countIntersection( root, maxDepth, numQuads, numVertices ) ;
- numEdges = numQuads * 3 / 2 ;
-#endif
- // int euler = numVertices + numQuads - numEdges ;
- // int genus = ( 2 - euler ) / 2 ;
- // dc_printf("%d vertices %d quads %d edges\n", numVertices, numQuads, numEdges ) ;
- // dc_printf("Genus: %d Euler: %d\n", genus, euler ) ;
-
- FILE* fout = fopen ( fname, "wb" ) ;
- dc_printf("Vertices counted: %d Polys counted: %d \n", numVertices, numQuads ) ;
- PLYWriter::writeHeader( fout, numVertices, numQuads ) ;
- int offset = 0 ;
- int st[3] = { 0, 0, 0 } ;
-
- // First, output vertices
- offset = 0 ;
- actualVerts = 0 ;
- actualQuads = 0 ;
-#ifdef USE_HERMIT
- generateMinimizer( root, st, dimen, maxDepth, offset, fout ) ;
-#ifdef TESTMANIFOLD
- testfout = fopen("test.txt", "w");
- fprintf(testfout, "{");
-#endif
- cellProcContour( this->root, 0, maxDepth, fout ) ;
-#ifdef TESTMANIFOLD
- fprintf(testfout, "}");
- fclose( testfout ) ;
-#endif
- dc_printf("Vertices written: %d Quads written: %d \n", offset, actualQuads ) ;
-#else
- writeVertex( root, st, dimen, maxDepth, offset, fout ) ;
- writeQuad( root, st, dimen, maxDepth, fout ) ;
- dc_printf("Vertices written: %d Triangles written: %d \n", offset, actualQuads ) ;
-#endif
-
-
- fclose( fout ) ;
-}
-#endif
-
-void Octree::writeOctree( char* fname )
-{
- FILE* fout = fopen ( fname, "wb" ) ;
- int sized = ( 1 << maxDepth ) ;
- fwrite( &sized, sizeof( int ), 1, fout ) ;
- writeOctree( fout, root, maxDepth ) ;
- dc_printf("Grid dimension: %d\n", sized ) ;
-
-
- fclose( fout ) ;
-}
-void Octree::writeOctree( FILE* fout, UCHAR* node, int depth )
-{
- char type ;
- if ( depth > 0 )
- {
- type = 0 ;
- fwrite( &type, sizeof( char ), 1, fout ) ;
-
- // Get sign at the center
- char sg = (char) getSign( getChild( node, 0 ), depth - 1, 7 - getChildIndex( node, 0 ) ) ;
-
- int t = 0 ;
- for ( int i = 0 ; i < 8 ; i ++ )
- {
- if ( hasChild( node, i ) )
- {
- writeOctree( fout, getChild( node, t ), depth - 1 ) ;
- t ++ ;
- }
- else
- {
- type = 1 ;
- fwrite( &type, sizeof( char ), 1, fout ) ;
- fwrite( &sg, sizeof( char ), 1, fout ) ;
- }
- }
- }
- else
- {
- type = 2 ;
- fwrite( &type, sizeof( char ), 1, fout ) ;
- fwrite( &(node[2]), sizeof ( UCHAR ), 1, fout );
- }
+ return maxtotal;
}
-#ifdef USE_HERMIT
-#if 0
-void Octree::writeOctreeGeom( char* fname )
+int Octree::floodFill(Node* node, int st[3], int len, int height, int threshold)
{
- FILE* fout = fopen ( fname, "wb" ) ;
-
- // Write header
- char header[]="SOG.Format 1.0";
- int nlen = 128 - 4 * 4 - strlen(header) - 1 ;
- char* header2 = new char[ nlen ];
- for ( int i = 0 ; i < nlen ; i ++ )
- {
- header2[i] = '\0';
- }
- fwrite( header, sizeof( char ), strlen(header) + 1, fout ) ;
- fwrite( origin, sizeof( float ), 3, fout ) ;
- fwrite( &range, sizeof( float ), 1, fout ) ;
- fwrite( header2, sizeof( char ), nlen, fout ) ;
-
-
- int sized = ( 1 << maxDepth ) ;
- int st[3] = {0,0,0};
- fwrite( &sized, sizeof( int ), 1, fout ) ;
-
- writeOctreeGeom( fout, root, st, dimen, maxDepth ) ;
- dc_printf("Grid dimension: %d\n", sized ) ;
-
-
- fclose( fout ) ;
-}
-#endif
-void Octree::writeOctreeGeom( FILE* fout, UCHAR* node, int st[3], int len, int depth )
-{
- char type ;
- if ( depth > 0 )
- {
- type = 0 ;
- fwrite( &type, sizeof( char ), 1, fout ) ;
-
- // Get sign at the center
- char sg = (char) getSign( getChild( node, 0 ), depth - 1, 7 - getChildIndex( node, 0 ) ) ;
-
- int t = 0 ;
- len >>= 1 ;
- for ( int i = 0 ; i < 8 ; i ++ )
- {
- if ( hasChild( node, i ) )
- {
- int nst[3] ;
- nst[0] = st[0] + vertmap[i][0] * len ;
- nst[1] = st[1] + vertmap[i][1] * len ;
- nst[2] = st[2] + vertmap[i][2] * len ;
- writeOctreeGeom( fout, getChild( node, t ), nst, len, depth - 1 ) ;
- t ++ ;
- }
- else
- {
- type = 1 ;
- fwrite( &type, sizeof( char ), 1, fout ) ;
- fwrite( &sg, sizeof( char ), 1, fout ) ;
- }
- }
- }
- else
- {
- type = 2 ;
- fwrite( &type, sizeof( char ), 1, fout ) ;
- fwrite( &(node[2]), sizeof ( UCHAR ), 1, fout );
-
- // Compute minimizer
- // First, find minimizer
- float rvalue[3] ;
- rvalue[0] = (float) st[0] + len / 2 ;
- rvalue[1] = (float) st[1] + len / 2 ;
- rvalue[2] = (float) st[2] + len / 2 ;
- computeMinimizer( node, st, len, rvalue ) ;
-
- // Update
- // float flen = len * range / dimen ;
- for ( int j = 0 ; j < 3 ; j ++ )
- {
- rvalue[ j ] = rvalue[ j ] * range / dimen + origin[ j ] ;
- }
-
- fwrite( rvalue, sizeof ( float ), 3, fout );
- }
-}
-#endif
-
-#ifdef USE_HERMIT
-void Octree::writeDCF( char* fname )
-{
- FILE* fout = fopen ( fname, "wb" ) ;
-
- // Writing out version
- char version[10] = "multisign";
- fwrite ( &version, sizeof ( char ), 10, fout );
-
- // Writing out size
- int sized = ( 1 << maxDepth ) ;
- fwrite( &sized, sizeof( int ), 1, fout ) ;
- fwrite( &sized, sizeof( int ), 1, fout ) ;
- fwrite( &sized, sizeof( int ), 1, fout ) ;
-
- int st[3] = {0, 0, 0} ;
- writeDCF( fout, root, maxDepth, st, dimen ) ;
-
- dc_printf("Grid dimension: %d\n", sized ) ;
- fclose( fout ) ;
-}
+ int i;
+ int maxtotal = 0;
-void Octree::writeDCF( FILE* fout, UCHAR* node, int height, int st[3], int len )
-{
- nodetype type ;
- if ( height > 0 )
+ if(height == 0)
{
- type = 0 ;
- len >>= 1 ;
- fwrite( &type, sizeof( nodetype ), 1, fout ) ;
-
- // Get sign at the center
- signtype sg = 1 - (signtype) getSign( getChild( node, 0 ), height - 1, 7 - getChildIndex( node, 0 ) ) ;
-
- int t = 0 ;
- for ( int i = 0 ; i < 8 ; i ++ )
- {
- if ( hasChild( node, i ) )
- {
- int nst[3] ;
- nst[0] = st[0] + vertmap[i][0] * len ;
- nst[1] = st[1] + vertmap[i][1] * len ;
- nst[2] = st[2] + vertmap[i][2] * len ;
-
-
- writeDCF( fout, getChild( node, t ), height - 1, nst, len ) ;
- t ++ ;
- }
- else
- {
- type = 1 ;
- fwrite( &type, sizeof( nodetype ), 1, fout ) ;
- fwrite ( &(sg), sizeof ( signtype ), 1, fout );
- }
- }
+ maxtotal = floodFill(&node->leaf, st, len, height, threshold);
}
else
{
- type = 2 ;
- fwrite( &type, sizeof( nodetype ), 1, fout ) ;
-
- // Write signs
- signtype sgn[8] ;
- for ( int i = 0 ; i < 8 ; i ++ )
- {
- sgn[ i ] = 1 - (signtype) getSign( node, i ) ;
- }
- fwrite (sgn, sizeof (signtype), 8, fout );
-
- // Write edge data
- float pts[12], norms[12][3] ;
- int parity[12] ;
- fillEdgeOffsetsNormals( node, st, len, pts, norms, parity ) ;
-
- numtype zero = 0, one = 1 ;
- for ( int i = 0 ; i < 12 ; i ++ )
+ // Internal cell, recur
+ int count = 0;
+ len >>= 1;
+ for(i = 0; i < 8; i ++)
{
- int par = getEdgeParity( node, i ) ;
- // Let's check first
- if ( par )
- {
- if ( sgn[ edgemap[i][0] ] == sgn[ edgemap[i][1] ] )
- {
- dc_printf("Wrong! Parity: %d Sign: %d %d\n", parity[i], sgn[ edgemap[i][0] ], sgn[ edgemap[i][1] ]);
- exit(0) ;
- }
- if ( parity[ i ] == 0 )
- {
- dc_printf("Wrong! No intersection found.\n");
- exit(0) ;
- }
- fwrite( &one, sizeof ( numtype ) , 1, fout ) ;
- fwrite( &(pts[i]), sizeof( float ), 1, fout ) ;
- fwrite( norms[i], sizeof( float ), 3, fout ) ;
-
- }
- else
+ if(hasChild((InternalNode*)node, i))
{
- if ( sgn[ edgemap[i][0] ] != sgn[ edgemap[i][1] ] )
+ int nst[3];
+ nst[0] = st[0] + vertmap[i][0] * len;
+ nst[1] = st[1] + vertmap[i][1] * len;
+ nst[2] = st[2] + vertmap[i][2] * len;
+
+ int d = floodFill(getChild((InternalNode*)node, count), nst, len, height - 1, threshold);
+ if(d > maxtotal)
{
- dc_printf("Wrong! Parity: %d Sign: %d %d\n", parity[i], sgn[ edgemap[i][0] ], sgn[ edgemap[i][1] ]);
- exit(0) ;
+ maxtotal = d;
}
- fwrite ( &zero, sizeof ( numtype ) , 1, fout );
+ count ++;
}
}
}
-}
-#endif
-
-void Octree::writeOpenEdges( FILE* fout )
-{
- // Total number of rings
- fprintf( fout, "%d\n", numRings ) ;
- dc_printf("Number of rings to write: %d\n", numRings) ;
-
- // Write each ring
- PathList* tlist = ringList ;
- for ( int i = 0 ; i < numRings ; i ++ )
- {
- fprintf(fout, "%d\n", tlist->length) ;
- // dc_printf("Ring length: %d\n", tlist->length ) ;
- PathElement* cur = tlist->head ;
- for ( int j = 0 ; j < tlist->length ; j ++ )
- {
- float cent[3] ;
- float flen = mindimen * range / dimen ;
- for ( int k = 0 ; k < 3 ; k ++ )
- {
- cent[ k ] = cur->pos[ k ] * range / dimen + origin[ k ] + flen / 2 ;
- }
- fprintf(fout, "%f %f %f\n", cent[0], cent[1], cent[2]) ;
- cur = cur->next ;
- }
-
- tlist = tlist->next ;
- }
-}
-#ifndef USE_HERMIT
-void Octree::countIntersection( UCHAR* node, int height, int& nquad, int& nvert )
-{
- if ( height > 0 )
- {
- int total = getNumChildren( node ) ;
- for ( int i = 0 ; i < total ; i ++ )
- {
- countIntersection( getChild( node, i ), height - 1, nquad, nvert ) ;
- }
- }
- else
- {
- int mask = getSignMask( node ) ;
- nvert += getNumEdges2( node ) ;
- nquad += cubes->getNumTriangle( mask ) ;
+ return maxtotal;
- }
}
-void Octree::writeVertex( UCHAR* node, int st[3], int len, int height, int& offset, FILE* fout )
+void Octree::writeOut()
{
- int i ;
-
- if ( height == 0 )
- {
- // Leaf cell, generate
- int emap[] = { 0, 4, 8 } ;
- for ( int i = 0 ; i < 3 ; i ++ )
- {
- if ( getEdgeParity( node, emap[i] ) )
- {
- // Get intersection location
- int count = getEdgeCount( node, i ) ;
- float off = getEdgeOffset( node, count ) ;
-
- float rvalue[3] ;
- rvalue[0] = (float) st[0] ;
- rvalue[1] = (float) st[1] ;
- rvalue[2] = (float) st[2] ;
- rvalue[i] += off * mindimen ;
-
- // Update
- float fnst[3] ;
- float flen = len * range / dimen ;
- for ( int j = 0 ; j < 3 ; j ++ )
- {
- rvalue[ j ] = rvalue[ j ] * range / dimen + origin[ j ] ;
- fnst[ j ] = st[ j ] * range / dimen + origin[ j ] ;
- }
-
- if ( this->outType == 0 )
- {
- fprintf( fout, "%f %f %f\n", rvalue[0], rvalue[1], rvalue[2] ) ;
- }
- else if ( this->outType == 1 )
- {
- PLYWriter::writeVertex( fout, rvalue ) ;
- }
-
- // Store the index
- setEdgeIntersectionIndex( node, count, offset ) ;
- offset ++ ;
- }
- }
+ int numQuads = 0;
+ int numVertices = 0;
+ int numEdges = 0;
- }
- else
- {
- // Internal cell, recur
- int count = 0 ;
- len >>= 1 ;
- for ( i = 0 ; i < 8 ; i ++ )
- {
- if ( hasChild( node, i ) )
- {
- int nst[3] ;
- nst[0] = st[0] + vertmap[i][0] * len ;
- nst[1] = st[1] + vertmap[i][1] * len ;
- nst[2] = st[2] + vertmap[i][2] * len ;
-
- writeVertex( getChild( node, count ), nst, len, height - 1, offset, fout ) ;
- count ++ ;
- }
- }
- }
-}
+ countIntersection(root, maxDepth, numQuads, numVertices, numEdges);
-void Octree::writeQuad( UCHAR* node, int st[3], int len, int height, FILE* fout )
-{
- int i ;
- if ( height == 0 )
- {
- int mask = getSignMask( node ) ;
- int num = cubes->getNumTriangle( mask ) ;
- int indices[12] ;
- fillEdgeIntersectionIndices( node, st, len, indices ) ;
- int einds[3], ind[3] ;
-
- //int flag1 = 0 ;
- //int flag2 = 0 ;
- for ( i = 0 ; i < num ; i ++ )
- {
- int color = 0 ;
- cubes->getTriangle( mask, i, einds ) ;
- // dc_printf("(%d %d %d) ", einds[0], einds[1], einds[2] ) ;
-
- for ( int j = 0 ; j < 3 ; j ++ )
- {
- ind[j] = indices[ einds[j] ] ;
- /*
- if ( ind[j] == 78381 )
- {
- flag1 = 1 ;
- }
- if ( ind[j] == 78384 )
- {
- flag2 = 1 ;
- }
- */
- }
+ dc_printf("Vertices counted: %d Polys counted: %d \n", numVertices, numQuads);
+ output_mesh = alloc_output(numVertices, numQuads);
+ int offset = 0;
+ int st[3] = {0, 0, 0};
- if ( this->outType == 0 )
- {
- // OFF
- int numpoly = ( color ? -3 : 3 ) ;
- fprintf(fout, "%d %d %d %d\n", numpoly, ind[0], ind[1], ind[2] ) ;
- actualQuads ++ ;
- }
- else if ( this->outType == 1 )
- {
- // PLY
- PLYWriter::writeFace( fout, 3, ind ) ;
- actualQuads ++ ;
- }
- }
+ // First, output vertices
+ offset = 0;
+ actualVerts = 0;
+ actualQuads = 0;
- /*
- if (flag1 && flag2)
- {
- dc_printf("%d\n", mask);
- cubes->printTriangles( mask ) ;
- }
- */
- }
- else
- {
- // Internal cell, recur
- int count = 0 ;
- len >>= 1 ;
- for ( i = 0 ; i < 8 ; i ++ )
- {
- if ( hasChild( node, i ) )
- {
- int nst[3] ;
- nst[0] = st[0] + vertmap[i][0] * len ;
- nst[1] = st[1] + vertmap[i][1] * len ;
- nst[2] = st[2] + vertmap[i][2] * len ;
-
- writeQuad( getChild( node, count ), nst, len, height - 1, fout ) ;
- count ++ ;
- }
- }
- }
+ generateMinimizer(root, st, dimen, maxDepth, offset);
+ cellProcContour(root, 0, maxDepth);
+ dc_printf("Vertices written: %d Quads written: %d \n", offset, actualQuads);
}
-#endif
-
-
-#ifdef USE_HERMIT
-void Octree::countIntersection( UCHAR* node, int height, int& nedge, int& ncell, int& nface )
+void Octree::countIntersection(Node* node, int height, int& nedge, int& ncell, int& nface)
{
- if ( height > 0 )
+ if(height > 0)
{
- int total = getNumChildren( node ) ;
- for ( int i = 0 ; i < total ; i ++ )
+ int total = getNumChildren(&node->internal);
+ for(int i = 0; i < total; i ++)
{
- countIntersection( getChild( node, i ), height - 1, nedge, ncell, nface ) ;
+ countIntersection(getChild(&node->internal, i), height - 1, nedge, ncell, nface);
}
}
else
{
- nedge += getNumEdges2( node ) ;
+ nedge += getNumEdges2(&node->leaf);
- int smask = getSignMask( node ) ;
+ int smask = getSignMask(&node->leaf);
if(use_manifold)
{
- int comps = manifold_table[ smask ].comps ;
- ncell += comps ;
+ int comps = manifold_table[smask].comps;
+ ncell += comps;
}
else {
- if ( smask > 0 && smask < 255 )
+ if(smask > 0 && smask < 255)
{
- ncell ++ ;
+ ncell ++;
}
}
- for ( int i = 0 ; i < 3 ; i ++ )
+ for(int i = 0; i < 3; i ++)
{
- if ( getFaceEdgeNum( node, i * 2 ) )
+ if(getFaceEdgeNum(&node->leaf, i * 2))
{
- nface ++ ;
+ nface ++;
}
}
}
@@ -3497,213 +2313,203 @@ void solve_least_squares(const float halfA[], const float b[],
void minimize(float rvalue[3], float mp[3], const float pts[12][3],
const float norms[12][3], const int parity[12])
{
- float ata[6] = { 0, 0, 0, 0, 0, 0 };
- float atb[3] = { 0, 0, 0 } ;
- int ec = 0 ;
+ float ata[6] = {0, 0, 0, 0, 0, 0};
+ float atb[3] = {0, 0, 0};
+ int ec = 0;
- for ( int i = 0 ; i < 12 ; i ++ )
+ for(int i = 0; i < 12; i ++)
{
- // if ( getEdgeParity( leaf, i) )
- if ( parity[ i ] )
+ // if(getEdgeParity(leaf, i))
+ if(parity[i])
{
- const float* norm = norms[i] ;
- const float* p = pts[i] ;
+ const float* norm = norms[i];
+ const float* p = pts[i];
// QEF
- ata[ 0 ] += (float) ( norm[ 0 ] * norm[ 0 ] );
- ata[ 1 ] += (float) ( norm[ 0 ] * norm[ 1 ] );
- ata[ 2 ] += (float) ( norm[ 0 ] * norm[ 2 ] );
- ata[ 3 ] += (float) ( norm[ 1 ] * norm[ 1 ] );
- ata[ 4 ] += (float) ( norm[ 1 ] * norm[ 2 ] );
- ata[ 5 ] += (float) ( norm[ 2 ] * norm[ 2 ] );
+ ata[0] +=(float)(norm[0] * norm[0]);
+ ata[1] +=(float)(norm[0] * norm[1]);
+ ata[2] +=(float)(norm[0] * norm[2]);
+ ata[3] +=(float)(norm[1] * norm[1]);
+ ata[4] +=(float)(norm[1] * norm[2]);
+ ata[5] +=(float)(norm[2] * norm[2]);
- double pn = p[0] * norm[0] + p[1] * norm[1] + p[2] * norm[2] ;
+ double pn = p[0] * norm[0] + p[1] * norm[1] + p[2] * norm[2];
- atb[ 0 ] += (float) ( norm[ 0 ] * pn ) ;
- atb[ 1 ] += (float) ( norm[ 1 ] * pn ) ;
- atb[ 2 ] += (float) ( norm[ 2 ] * pn ) ;
+ atb[0] +=(float)(norm[0] * pn);
+ atb[1] +=(float)(norm[1] * pn);
+ atb[2] +=(float)(norm[2] * pn);
// Minimizer
- mp[0] += p[0] ;
- mp[1] += p[1] ;
- mp[2] += p[2] ;
+ mp[0] += p[0];
+ mp[1] += p[1];
+ mp[2] += p[2];
- ec ++ ;
+ ec ++;
}
}
- if ( ec == 0 )
+ if(ec == 0)
{
- return ;
+ return;
}
- mp[0] /= ec ;
- mp[1] /= ec ;
- mp[2] /= ec ;
+ mp[0] /= ec;
+ mp[1] /= ec;
+ mp[2] /= ec;
// Solve least squares
solve_least_squares(ata, atb, mp, rvalue);
}
-void Octree::computeMinimizer( UCHAR* leaf, int st[3], int len, float rvalue[3] )
+void Octree::computeMinimizer(LeafNode* leaf, int st[3], int len, float rvalue[3])
{
// First, gather all edge intersections
- float pts[12][3], norms[12][3] ;
- // fillEdgeIntersections( leaf, st, len, pts, norms ) ;
- int parity[12] ;
- fillEdgeIntersections( leaf, st, len, pts, norms, parity ) ;
+ float pts[12][3], norms[12][3];
+ int parity[12];
+ fillEdgeIntersections(leaf, st, len, pts, norms, parity);
// Next, construct QEF and minimizer
float mp[3] = {0, 0, 0};
minimize(rvalue, mp, pts, norms, parity);
/* Restraining the location of the minimizer */
- float nh1 = hermite_num * len ;
- float nh2 = ( 1 + hermite_num ) * len ;
+ float nh1 = hermite_num * len;
+ float nh2 =(1 + hermite_num) * len;
if((mode == DUALCON_MASS_POINT || mode == DUALCON_CENTROID) ||
- ( rvalue[0] < st[0] - nh1 || rvalue[1] < st[1] - nh1 || rvalue[2] < st[2] - nh1 ||
- rvalue[0] > st[0] + nh2 || rvalue[1] > st[1] + nh2 || rvalue[2] > st[2] + nh2 ))
+ (rvalue[0] < st[0] - nh1 || rvalue[1] < st[1] - nh1 || rvalue[2] < st[2] - nh1 ||
+ rvalue[0] > st[0] + nh2 || rvalue[1] > st[1] + nh2 || rvalue[2] > st[2] + nh2))
{
if(mode == DUALCON_CENTROID) {
// Use centroids
- rvalue[0] = (float) st[0] + len / 2 ;
- rvalue[1] = (float) st[1] + len / 2 ;
- rvalue[2] = (float) st[2] + len / 2 ;
+ rvalue[0] =(float) st[0] + len / 2;
+ rvalue[1] =(float) st[1] + len / 2;
+ rvalue[2] =(float) st[2] + len / 2;
}
else {
// Use mass point instead
- rvalue[0] = mp[0] ;
- rvalue[1] = mp[1] ;
- rvalue[2] = mp[2] ;
+ rvalue[0] = mp[0];
+ rvalue[1] = mp[1];
+ rvalue[2] = mp[2];
}
}
}
-void Octree::generateMinimizer( UCHAR* node, int st[3], int len, int height, int& offset )
+void Octree::generateMinimizer(Node* node, int st[3], int len, int height, int& offset)
{
- int i, j ;
+ int i, j;
- if ( height == 0 )
+ if(height == 0)
{
// Leaf cell, generate
// First, find minimizer
- float rvalue[3] ;
- rvalue[0] = (float) st[0] + len / 2 ;
- rvalue[1] = (float) st[1] + len / 2 ;
- rvalue[2] = (float) st[2] + len / 2 ;
- computeMinimizer( node, st, len, rvalue ) ;
+ float rvalue[3];
+ rvalue[0] =(float) st[0] + len / 2;
+ rvalue[1] =(float) st[1] + len / 2;
+ rvalue[2] =(float) st[2] + len / 2;
+ computeMinimizer(&node->leaf, st, len, rvalue);
// Update
- //float fnst[3] ;
- for ( j = 0 ; j < 3 ; j ++ )
+ //float fnst[3];
+ for(j = 0; j < 3; j ++)
{
- rvalue[ j ] = rvalue[ j ] * range / dimen + origin[ j ] ;
- //fnst[ j ] = st[ j ] * range / dimen + origin[ j ] ;
+ rvalue[j] = rvalue[j] * range / dimen + origin[j];
+ //fnst[j] = st[j] * range / dimen + origin[j];
}
- int mult = 0, smask = getSignMask( node ) ;
+ int mult = 0, smask = getSignMask(&node->leaf);
if(use_manifold)
{
- mult = manifold_table[ smask ].comps ;
+ mult = manifold_table[smask].comps;
}
else
{
- if ( smask > 0 && smask < 255 )
+ if(smask > 0 && smask < 255)
{
- mult = 1 ;
+ mult = 1;
}
}
- for ( j = 0 ; j < mult ; j ++ )
+ for(j = 0; j < mult; j ++)
{
add_vert(output_mesh, rvalue);
}
// Store the index
- setMinimizerIndex( node, offset ) ;
+ setMinimizerIndex(&node->leaf, offset);
- offset += mult ;
+ offset += mult;
}
else
{
// Internal cell, recur
- int count = 0 ;
- len >>= 1 ;
- for ( i = 0 ; i < 8 ; i ++ )
+ int count = 0;
+ len >>= 1;
+ for(i = 0; i < 8; i ++)
{
- if ( hasChild( node, i ) )
+ if(hasChild(&node->internal, i))
{
- int nst[3] ;
- nst[0] = st[0] + vertmap[i][0] * len ;
- nst[1] = st[1] + vertmap[i][1] * len ;
- nst[2] = st[2] + vertmap[i][2] * len ;
+ int nst[3];
+ nst[0] = st[0] + vertmap[i][0] * len;
+ nst[1] = st[1] + vertmap[i][1] * len;
+ nst[2] = st[2] + vertmap[i][2] * len;
- generateMinimizer( getChild( node, count ), nst, len, height - 1, offset ) ;
- count ++ ;
+ generateMinimizer(getChild(&node->internal, count),
+ nst, len, height - 1, offset);
+ count ++;
}
}
}
}
-void Octree::processEdgeWrite( UCHAR* node[4], int depth[4], int maxdep, int dir )
+void Octree::processEdgeWrite(Node* node[4], int depth[4], int maxdep, int dir)
{
- //int color = 0 ;
+ //int color = 0;
- int i = 3 ;
+ int i = 3;
{
- if ( getEdgeParity( node[i], processEdgeMask[dir][i] ) )
+ if(getEdgeParity((LeafNode*)(node[i]), processEdgeMask[dir][i]))
{
- int flip = 0 ;
- int edgeind = processEdgeMask[dir][i] ;
- if ( getSign( node[i], edgemap[ edgeind ][ 1 ] ) > 0 )
+ int flip = 0;
+ int edgeind = processEdgeMask[dir][i];
+ if(getSign((LeafNode*)node[i], edgemap[edgeind][1]) > 0)
{
- flip = 1 ;
+ flip = 1;
}
- int num = 0 ;
+ int num = 0;
{
int ind[8];
if(use_manifold)
{
/* Deprecated
int ind[4] = {
- getMinimizerIndex( node[0], processEdgeMask[dir][0] ),
- getMinimizerIndex( node[1], processEdgeMask[dir][1] ),
- getMinimizerIndex( node[3], processEdgeMask[dir][3] ),
- getMinimizerIndex( node[2], processEdgeMask[dir][2] )
- } ;
- num = 4 ;
+ getMinimizerIndex(node[0], processEdgeMask[dir][0]),
+ getMinimizerIndex(node[1], processEdgeMask[dir][1]),
+ getMinimizerIndex(node[3], processEdgeMask[dir][3]),
+ getMinimizerIndex(node[2], processEdgeMask[dir][2])
+ };
+ num = 4;
*/
- int vind[2] ;
+ int vind[2];
int seq[4] = {0,1,3,2};
- for ( int k = 0 ; k < 4 ; k ++ )
+ for(int k = 0; k < 4; k ++)
{
- getMinimizerIndices( node[seq[k]], processEdgeMask[dir][seq[k]], vind ) ;
- ind[num] = vind[0] ;
- num ++ ;
+ getMinimizerIndices((LeafNode*)(node[seq[k]]), processEdgeMask[dir][seq[k]], vind);
+ ind[num] = vind[0];
+ num ++;
- if ( vind[1] != -1 )
+ if(vind[1] != -1)
{
- ind[num] = vind[1] ;
- num ++ ;
- if ( flip == 0 )
+ ind[num] = vind[1];
+ num ++;
+ if(flip == 0)
{
- ind[num-1] = vind[0] ;
- ind[num-2] = vind[1] ;
+ ind[num-1] = vind[0];
+ ind[num-2] = vind[1];
}
}
}
-#ifdef TESTMANIFOLD
- if ( num != 4 )
- {
- dc_printf("Polygon: %d\n", num);
- }
- for ( k = 0 ; k < num ; k ++ )
- {
- fprintf(testfout, "{%d,%d},", ind[k], ind[(k+1)%num] );
- }
-#endif
/* we don't use the manifold option, but if it is
ever enabled again note that it can output
@@ -3711,498 +2517,505 @@ void Octree::processEdgeWrite( UCHAR* node[4], int depth[4], int maxdep, int dir
}
else {
if(flip) {
- ind[0] = getMinimizerIndex( node[2] );
- ind[1] = getMinimizerIndex( node[3] );
- ind[2] = getMinimizerIndex( node[1] );
- ind[3] = getMinimizerIndex( node[0] );
+ ind[0] = getMinimizerIndex((LeafNode*)(node[2]));
+ ind[1] = getMinimizerIndex((LeafNode*)(node[3]));
+ ind[2] = getMinimizerIndex((LeafNode*)(node[1]));
+ ind[3] = getMinimizerIndex((LeafNode*)(node[0]));
}
else {
- ind[0] = getMinimizerIndex( node[0] );
- ind[1] = getMinimizerIndex( node[1] );
- ind[2] = getMinimizerIndex( node[3] );
- ind[3] = getMinimizerIndex( node[2] );
+ ind[0] = getMinimizerIndex((LeafNode*)(node[0]));
+ ind[1] = getMinimizerIndex((LeafNode*)(node[1]));
+ ind[2] = getMinimizerIndex((LeafNode*)(node[3]));
+ ind[3] = getMinimizerIndex((LeafNode*)(node[2]));
}
add_quad(output_mesh, ind);
}
/*
- if ( this->outType == 0 )
+ if(outType == 0)
{
// OFF
- num = ( color ? -num : num ) ;
+ num =(color ? -num : num);
fprintf(fout, "%d ", num);
- if ( flip )
+ if(flip)
{
- for ( int k = num - 1 ; k >= 0 ; k -- )
+ for(int k = num - 1; k >= 0; k --)
{
- fprintf(fout, "%d ", ind[k] ) ;
+ fprintf(fout, "%d ", ind[k]);
}
}
else
{
- for ( int k = 0 ; k < num ; k ++ )
+ for(int k = 0; k < num; k ++)
{
- fprintf(fout, "%d ", ind[k] ) ;
+ fprintf(fout, "%d ", ind[k]);
}
}
- fprintf( fout, "\n") ;
+ fprintf(fout, "\n");
- actualQuads ++ ;
+ actualQuads ++;
}
- else if ( this->outType == 1 )
+ else if(outType == 1)
{
// PLY
- if ( flip )
+ if(flip)
{
int tind[8];
- for ( int k = num - 1 ; k >= 0 ; k -- )
+ for(int k = num - 1; k >= 0; k --)
{
- tind[k] = ind[num-1-k] ;
+ tind[k] = ind[num-1-k];
}
- // PLYWriter::writeFace( fout, num, tind ) ;
+ // PLYWriter::writeFace(fout, num, tind);
}
else
{
- // PLYWriter::writeFace( fout, num, ind ) ;
+ // PLYWriter::writeFace(fout, num, ind);
}
- actualQuads ++ ;
+ actualQuads ++;
}*/
}
- return ;
+ return;
}
else
{
- return ;
+ return;
}
}
}
-void Octree::edgeProcContour( UCHAR* node[4], int leaf[4], int depth[4], int maxdep, int dir )
+void Octree::edgeProcContour(Node* node[4], int leaf[4], int depth[4], int maxdep, int dir)
{
- if ( ! ( node[0] && node[1] && node[2] && node[3] ) )
+ if(!(node[0] && node[1] && node[2] && node[3]))
{
- return ;
+ return;
}
- if ( leaf[0] && leaf[1] && leaf[2] && leaf[3] )
+ if(leaf[0] && leaf[1] && leaf[2] && leaf[3])
{
- processEdgeWrite( node, depth, maxdep, dir ) ;
+ processEdgeWrite(node, depth, maxdep, dir);
}
else
{
- int i, j ;
- UCHAR* chd[ 4 ][ 8 ] ;
- for ( j = 0 ; j < 4 ; j ++ )
+ int i, j;
+ Node* chd[4][8];
+ for(j = 0; j < 4; j ++)
{
- for ( i = 0 ; i < 8 ; i ++ )
+ for(i = 0; i < 8; i ++)
{
- chd[ j ][ i ] = ((!leaf[j]) && hasChild( node[j], i ) )? getChild( node[j], getChildCount( node[j], i ) ) : NULL ;
+ chd[j][i] = ((!leaf[j]) && hasChild(&node[j]->internal, i)) ?
+ getChild(&node[j]->internal,
+ getChildCount(&node[j]->internal, i)) : NULL;
}
}
// 2 edge calls
- UCHAR* ne[4] ;
- int le[4] ;
- int de[4] ;
- for ( i = 0 ; i < 2 ; i ++ )
+ Node* ne[4];
+ int le[4];
+ int de[4];
+ for(i = 0; i < 2; i ++)
{
- int c[ 4 ] = { edgeProcEdgeMask[ dir ][ i ][ 0 ],
- edgeProcEdgeMask[ dir ][ i ][ 1 ],
- edgeProcEdgeMask[ dir ][ i ][ 2 ],
- edgeProcEdgeMask[ dir ][ i ][ 3 ] } ;
+ int c[4] = {edgeProcEdgeMask[dir][i][0],
+ edgeProcEdgeMask[dir][i][1],
+ edgeProcEdgeMask[dir][i][2],
+ edgeProcEdgeMask[dir][i][3]};
- for ( int j = 0 ; j < 4 ; j ++ )
+ for(int j = 0; j < 4; j ++)
{
- if ( leaf[j] )
+ if(leaf[j])
{
- le[j] = leaf[j] ;
- ne[j] = node[j] ;
- de[j] = depth[j] ;
+ le[j] = leaf[j];
+ ne[j] = node[j];
+ de[j] = depth[j];
}
else
{
- le[j] = isLeaf( node[j], c[j] ) ;
- ne[j] = chd[ j ][ c[j] ] ;
- de[j] = depth[j] - 1 ;
+ le[j] = isLeaf(&node[j]->internal, c[j]);
+ ne[j] = chd[j][c[j]];
+ de[j] = depth[j] - 1;
}
}
- edgeProcContour( ne, le, de, maxdep - 1, edgeProcEdgeMask[ dir ][ i ][ 4 ] ) ;
+ edgeProcContour(ne, le, de, maxdep - 1, edgeProcEdgeMask[dir][i][4]);
}
}
}
-void Octree::faceProcContour( UCHAR* node[2], int leaf[2], int depth[2], int maxdep, int dir )
+void Octree::faceProcContour(Node* node[2], int leaf[2], int depth[2], int maxdep, int dir)
{
- if ( ! ( node[0] && node[1] ) )
+ if(!(node[0] && node[1]))
{
- return ;
+ return;
}
- if ( ! ( leaf[0] && leaf[1] ) )
+ if(!(leaf[0] && leaf[1]))
{
- int i, j ;
+ int i, j;
// Fill children nodes
- UCHAR* chd[ 2 ][ 8 ] ;
- for ( j = 0 ; j < 2 ; j ++ )
+ Node* chd[2][8];
+ for(j = 0; j < 2; j ++)
{
- for ( i = 0 ; i < 8 ; i ++ )
+ for(i = 0; i < 8; i ++)
{
- chd[ j ][ i ] = ((!leaf[j]) && hasChild( node[j], i )) ? getChild( node[j], getChildCount( node[j], i ) ) : NULL ;
+ chd[j][i] =((!leaf[j]) && hasChild(&node[j]->internal, i)) ?
+ getChild(&node[j]->internal,
+ getChildCount(&node[j]->internal, i)) : NULL;
}
}
// 4 face calls
- UCHAR* nf[2] ;
- int df[2] ;
- int lf[2] ;
- for ( i = 0 ; i < 4 ; i ++ )
+ Node* nf[2];
+ int df[2];
+ int lf[2];
+ for(i = 0; i < 4; i ++)
{
- int c[2] = { faceProcFaceMask[ dir ][ i ][ 0 ], faceProcFaceMask[ dir ][ i ][ 1 ] };
- for ( int j = 0 ; j < 2 ; j ++ )
+ int c[2] = {faceProcFaceMask[dir][i][0], faceProcFaceMask[dir][i][1]};
+ for(int j = 0; j < 2; j ++)
{
- if ( leaf[j] )
+ if(leaf[j])
{
- lf[j] = leaf[j] ;
- nf[j] = node[j] ;
- df[j] = depth[j] ;
+ lf[j] = leaf[j];
+ nf[j] = node[j];
+ df[j] = depth[j];
}
else
{
- lf[j] = isLeaf( node[j], c[j] ) ;
- nf[j] = chd[ j ][ c[j] ] ;
- df[j] = depth[j] - 1 ;
+ lf[j] = isLeaf(&node[j]->internal, c[j]);
+ nf[j] = chd[j][c[j]];
+ df[j] = depth[j] - 1;
}
}
- faceProcContour( nf, lf, df, maxdep - 1, faceProcFaceMask[ dir ][ i ][ 2 ] ) ;
+ faceProcContour(nf, lf, df, maxdep - 1, faceProcFaceMask[dir][i][2]);
}
// 4 edge calls
- int orders[2][4] = {{ 0, 0, 1, 1 }, { 0, 1, 0, 1 }} ;
- UCHAR* ne[4] ;
- int le[4] ;
- int de[4] ;
+ int orders[2][4] = {{0, 0, 1, 1}, {0, 1, 0, 1}};
+ Node* ne[4];
+ int le[4];
+ int de[4];
- for ( i = 0 ; i < 4 ; i ++ )
+ for(i = 0; i < 4; i ++)
{
- int c[4] = { faceProcEdgeMask[ dir ][ i ][ 1 ], faceProcEdgeMask[ dir ][ i ][ 2 ],
- faceProcEdgeMask[ dir ][ i ][ 3 ], faceProcEdgeMask[ dir ][ i ][ 4 ] };
- int* order = orders[ faceProcEdgeMask[ dir ][ i ][ 0 ] ] ;
+ int c[4] = {faceProcEdgeMask[dir][i][1], faceProcEdgeMask[dir][i][2],
+ faceProcEdgeMask[dir][i][3], faceProcEdgeMask[dir][i][4]};
+ int* order = orders[faceProcEdgeMask[dir][i][0]];
- for ( int j = 0 ; j < 4 ; j ++ )
+ for(int j = 0; j < 4; j ++)
{
- if ( leaf[order[j]] )
+ if(leaf[order[j]])
{
- le[j] = leaf[order[j]] ;
- ne[j] = node[order[j]] ;
- de[j] = depth[order[j]] ;
+ le[j] = leaf[order[j]];
+ ne[j] = node[order[j]];
+ de[j] = depth[order[j]];
}
else
{
- le[j] = isLeaf( node[order[j]], c[j] ) ;
- ne[j] = chd[ order[ j ] ][ c[j] ] ;
- de[j] = depth[order[j]] - 1 ;
+ le[j] = isLeaf(&node[order[j]]->internal, c[j]);
+ ne[j] = chd[order[j]][c[j]];
+ de[j] = depth[order[j]] - 1;
}
}
- edgeProcContour( ne, le, de, maxdep - 1, faceProcEdgeMask[ dir ][ i ][ 5 ] ) ;
+ edgeProcContour(ne, le, de, maxdep - 1, faceProcEdgeMask[dir][i][5]);
}
}
}
-void Octree::cellProcContour( UCHAR* node, int leaf, int depth )
+void Octree::cellProcContour(Node* node, int leaf, int depth)
{
- if ( node == NULL )
+ if(node == NULL)
{
- return ;
+ return;
}
- if ( ! leaf )
+ if(! leaf)
{
- int i ;
+ int i;
// Fill children nodes
- UCHAR* chd[ 8 ] ;
- for ( i = 0 ; i < 8 ; i ++ )
+ Node* chd[8];
+ for(i = 0; i < 8; i ++)
{
- chd[ i ] = ((!leaf) && hasChild( node, i )) ? getChild( node, getChildCount( node, i ) ) : NULL ;
+ chd[i] =((!leaf) && hasChild(&node->internal, i)) ?
+ getChild(&node->internal,
+ getChildCount(&node->internal, i)) : NULL;
}
// 8 Cell calls
- for ( i = 0 ; i < 8 ; i ++ )
+ for(i = 0; i < 8; i ++)
{
- cellProcContour( chd[ i ], isLeaf( node, i ), depth - 1 ) ;
+ cellProcContour(chd[i], isLeaf(&node->internal, i), depth - 1);
}
// 12 face calls
- UCHAR* nf[2] ;
- int lf[2] ;
- int df[2] = { depth - 1, depth - 1 } ;
- for ( i = 0 ; i < 12 ; i ++ )
+ Node* nf[2];
+ int lf[2];
+ int df[2] = {depth - 1, depth - 1};
+ for(i = 0; i < 12; i ++)
{
- int c[ 2 ] = { cellProcFaceMask[ i ][ 0 ], cellProcFaceMask[ i ][ 1 ] };
+ int c[2] = {cellProcFaceMask[i][0], cellProcFaceMask[i][1]};
- lf[0] = isLeaf( node, c[0] ) ;
- lf[1] = isLeaf( node, c[1] ) ;
+ lf[0] = isLeaf(&node->internal, c[0]);
+ lf[1] = isLeaf(&node->internal, c[1]);
- nf[0] = chd[ c[0] ] ;
- nf[1] = chd[ c[1] ] ;
+ nf[0] = chd[c[0]];
+ nf[1] = chd[c[1]];
- faceProcContour( nf, lf, df, depth - 1, cellProcFaceMask[ i ][ 2 ] ) ;
+ faceProcContour(nf, lf, df, depth - 1, cellProcFaceMask[i][2]);
}
// 6 edge calls
- UCHAR* ne[4] ;
- int le[4] ;
- int de[4] = { depth - 1, depth - 1, depth - 1, depth - 1 } ;
- for ( i = 0 ; i < 6 ; i ++ )
+ Node* ne[4];
+ int le[4];
+ int de[4] = {depth - 1, depth - 1, depth - 1, depth - 1};
+ for(i = 0; i < 6; i ++)
{
- int c[ 4 ] = { cellProcEdgeMask[ i ][ 0 ], cellProcEdgeMask[ i ][ 1 ], cellProcEdgeMask[ i ][ 2 ], cellProcEdgeMask[ i ][ 3 ] };
+ int c[4] = {cellProcEdgeMask[i][0], cellProcEdgeMask[i][1], cellProcEdgeMask[i][2], cellProcEdgeMask[i][3]};
- for ( int j = 0 ; j < 4 ; j ++ )
+ for(int j = 0; j < 4; j ++)
{
- le[j] = isLeaf( node, c[j] ) ;
- ne[j] = chd[ c[j] ] ;
+ le[j] = isLeaf(&node->internal, c[j]);
+ ne[j] = chd[c[j]];
}
- edgeProcContour( ne, le, de, depth - 1, cellProcEdgeMask[ i ][ 4 ] ) ;
+ edgeProcContour(ne, le, de, depth - 1, cellProcEdgeMask[i][4]);
}
}
}
-#endif
-
-
-
-void Octree::processEdgeParity( UCHAR* node[4], int depth[4], int maxdep, int dir )
+void Octree::processEdgeParity(LeafNode* node[4], int depth[4], int maxdep, int dir)
{
- int con = 0 ;
- for ( int i = 0 ; i < 4 ; i ++ )
+ int con = 0;
+ for(int i = 0; i < 4; i ++)
{
// Minimal cell
- // if ( op == 0 )
+ // if(op == 0)
{
- if ( getEdgeParity( node[i], processEdgeMask[dir][i] ) )
+ if(getEdgeParity(node[i], processEdgeMask[dir][i]))
{
- con = 1 ;
- break ;
+ con = 1;
+ break;
}
}
}
- if ( con == 1 )
+ if(con == 1)
{
- for ( int i = 0 ; i < 4 ; i ++ )
+ for(int i = 0; i < 4; i ++)
{
- setEdge( node[ i ], processEdgeMask[dir][i] ) ;
+ setEdge(node[i], processEdgeMask[dir][i]);
}
}
}
-void Octree::edgeProcParity( UCHAR* node[4], int leaf[4], int depth[4], int maxdep, int dir )
+void Octree::edgeProcParity(Node* node[4], int leaf[4], int depth[4], int maxdep, int dir)
{
- if ( ! ( node[0] && node[1] && node[2] && node[3] ) )
+ if(!(node[0] && node[1] && node[2] && node[3]))
{
- return ;
+ return;
}
- if ( leaf[0] && leaf[1] && leaf[2] && leaf[3] )
+ if(leaf[0] && leaf[1] && leaf[2] && leaf[3])
{
- processEdgeParity( node, depth, maxdep, dir ) ;
+ processEdgeParity((LeafNode**)node, depth, maxdep, dir);
}
else
{
- int i, j ;
- UCHAR* chd[ 4 ][ 8 ] ;
- for ( j = 0 ; j < 4 ; j ++ )
+ int i, j;
+ Node* chd[4][8];
+ for(j = 0; j < 4; j ++)
{
- for ( i = 0 ; i < 8 ; i ++ )
+ for(i = 0; i < 8; i ++)
{
- chd[ j ][ i ] = ((!leaf[j]) && hasChild( node[j], i ) )? getChild( node[j], getChildCount( node[j], i ) ) : NULL ;
+ chd[j][i] =((!leaf[j]) && hasChild(&node[j]->internal, i)) ?
+ getChild(&node[j]->internal, getChildCount(&node[j]->internal, i)) : NULL;
}
}
// 2 edge calls
- UCHAR* ne[4] ;
- int le[4] ;
- int de[4] ;
- for ( i = 0 ; i < 2 ; i ++ )
+ Node* ne[4];
+ int le[4];
+ int de[4];
+ for(i = 0; i < 2; i ++)
{
- int c[ 4 ] = { edgeProcEdgeMask[ dir ][ i ][ 0 ],
- edgeProcEdgeMask[ dir ][ i ][ 1 ],
- edgeProcEdgeMask[ dir ][ i ][ 2 ],
- edgeProcEdgeMask[ dir ][ i ][ 3 ] } ;
+ int c[4] = {edgeProcEdgeMask[dir][i][0],
+ edgeProcEdgeMask[dir][i][1],
+ edgeProcEdgeMask[dir][i][2],
+ edgeProcEdgeMask[dir][i][3]};
- // int allleaf = 1 ;
- for ( int j = 0 ; j < 4 ; j ++ )
+ // int allleaf = 1;
+ for(int j = 0; j < 4; j ++)
{
- if ( leaf[j] )
+ if(leaf[j])
{
- le[j] = leaf[j] ;
- ne[j] = node[j] ;
- de[j] = depth[j] ;
+ le[j] = leaf[j];
+ ne[j] = node[j];
+ de[j] = depth[j];
}
else
{
- le[j] = isLeaf( node[j], c[j] ) ;
- ne[j] = chd[ j ][ c[j] ] ;
- de[j] = depth[j] - 1 ;
+ le[j] = isLeaf(&node[j]->internal, c[j]);
+ ne[j] = chd[j][c[j]];
+ de[j] = depth[j] - 1;
}
}
- edgeProcParity( ne, le, de, maxdep - 1, edgeProcEdgeMask[ dir ][ i ][ 4 ] ) ;
+ edgeProcParity(ne, le, de, maxdep - 1, edgeProcEdgeMask[dir][i][4]);
}
}
}
-void Octree::faceProcParity( UCHAR* node[2], int leaf[2], int depth[2], int maxdep, int dir )
+void Octree::faceProcParity(Node* node[2], int leaf[2], int depth[2], int maxdep, int dir)
{
- if ( ! ( node[0] && node[1] ) )
+ if(!(node[0] && node[1]))
{
- return ;
+ return;
}
- if ( ! ( leaf[0] && leaf[1] ) )
+ if(!(leaf[0] && leaf[1]))
{
- int i, j ;
+ int i, j;
// Fill children nodes
- UCHAR* chd[ 2 ][ 8 ] ;
- for ( j = 0 ; j < 2 ; j ++ )
+ Node* chd[2][8];
+ for(j = 0; j < 2; j ++)
{
- for ( i = 0 ; i < 8 ; i ++ )
+ for(i = 0; i < 8; i ++)
{
- chd[ j ][ i ] = ((!leaf[j]) && hasChild( node[j], i )) ? getChild( node[j], getChildCount( node[j], i ) ) : NULL ;
+ chd[j][i] =((!leaf[j]) && hasChild(&node[j]->internal, i)) ?
+ getChild(&node[j]->internal,
+ getChildCount(&node[j]->internal, i)) : NULL;
}
}
// 4 face calls
- UCHAR* nf[2] ;
- int df[2] ;
- int lf[2] ;
- for ( i = 0 ; i < 4 ; i ++ )
+ Node* nf[2];
+ int df[2];
+ int lf[2];
+ for(i = 0; i < 4; i ++)
{
- int c[2] = { faceProcFaceMask[ dir ][ i ][ 0 ], faceProcFaceMask[ dir ][ i ][ 1 ] };
- for ( int j = 0 ; j < 2 ; j ++ )
+ int c[2] = {faceProcFaceMask[dir][i][0], faceProcFaceMask[dir][i][1]};
+ for(int j = 0; j < 2; j ++)
{
- if ( leaf[j] )
+ if(leaf[j])
{
- lf[j] = leaf[j] ;
- nf[j] = node[j] ;
- df[j] = depth[j] ;
+ lf[j] = leaf[j];
+ nf[j] = node[j];
+ df[j] = depth[j];
}
else
{
- lf[j] = isLeaf( node[j], c[j] ) ;
- nf[j] = chd[ j ][ c[j] ] ;
- df[j] = depth[j] - 1 ;
+ lf[j] = isLeaf(&node[j]->internal, c[j]);
+ nf[j] = chd[j][c[j]];
+ df[j] = depth[j] - 1;
}
}
- faceProcParity( nf, lf, df, maxdep - 1, faceProcFaceMask[ dir ][ i ][ 2 ] ) ;
+ faceProcParity(nf, lf, df, maxdep - 1, faceProcFaceMask[dir][i][2]);
}
// 4 edge calls
- int orders[2][4] = {{ 0, 0, 1, 1 }, { 0, 1, 0, 1 }} ;
- UCHAR* ne[4] ;
- int le[4] ;
- int de[4] ;
+ int orders[2][4] = {{0, 0, 1, 1}, {0, 1, 0, 1}};
+ Node* ne[4];
+ int le[4];
+ int de[4];
- for ( i = 0 ; i < 4 ; i ++ )
+ for(i = 0; i < 4; i ++)
{
- int c[4] = { faceProcEdgeMask[ dir ][ i ][ 1 ], faceProcEdgeMask[ dir ][ i ][ 2 ],
- faceProcEdgeMask[ dir ][ i ][ 3 ], faceProcEdgeMask[ dir ][ i ][ 4 ] };
- int* order = orders[ faceProcEdgeMask[ dir ][ i ][ 0 ] ] ;
+ int c[4] = {faceProcEdgeMask[dir][i][1], faceProcEdgeMask[dir][i][2],
+ faceProcEdgeMask[dir][i][3], faceProcEdgeMask[dir][i][4]};
+ int* order = orders[faceProcEdgeMask[dir][i][0]];
- for ( int j = 0 ; j < 4 ; j ++ )
+ for(int j = 0; j < 4; j ++)
{
- if ( leaf[order[j]] )
+ if(leaf[order[j]])
{
- le[j] = leaf[order[j]] ;
- ne[j] = node[order[j]] ;
- de[j] = depth[order[j]] ;
+ le[j] = leaf[order[j]];
+ ne[j] = node[order[j]];
+ de[j] = depth[order[j]];
}
else
{
- le[j] = isLeaf( node[order[j]], c[j] ) ;
- ne[j] = chd[ order[ j ] ][ c[j] ] ;
- de[j] = depth[order[j]] - 1 ;
+ le[j] = isLeaf((InternalNode*)(node[order[j]]), c[j]);
+ ne[j] = chd[order[j]][c[j]];
+ de[j] = depth[order[j]] - 1;
}
}
- edgeProcParity( ne, le, de, maxdep - 1, faceProcEdgeMask[ dir ][ i ][ 5 ] ) ;
+ edgeProcParity(ne, le, de, maxdep - 1, faceProcEdgeMask[dir][i][5]);
}
}
}
-void Octree::cellProcParity( UCHAR* node, int leaf, int depth )
+void Octree::cellProcParity(Node* node, int leaf, int depth)
{
- if ( node == NULL )
+ if(node == NULL)
{
- return ;
+ return;
}
- if ( ! leaf )
+ if(! leaf)
{
- int i ;
+ int i;
// Fill children nodes
- UCHAR* chd[ 8 ] ;
- for ( i = 0 ; i < 8 ; i ++ )
+ Node* chd[8];
+ for(i = 0; i < 8; i ++)
{
- chd[ i ] = ((!leaf) && hasChild( node, i )) ? getChild( node, getChildCount( node, i ) ) : NULL ;
+ chd[i] =((!leaf) && hasChild((InternalNode*)node, i)) ?
+ getChild((InternalNode*)node,
+ getChildCount((InternalNode*)node, i)) : NULL;
}
// 8 Cell calls
- for ( i = 0 ; i < 8 ; i ++ )
+ for(i = 0; i < 8; i ++)
{
- cellProcParity( chd[ i ], isLeaf( node, i ), depth - 1 ) ;
+ cellProcParity(chd[i], isLeaf((InternalNode*)node, i), depth - 1);
}
// 12 face calls
- UCHAR* nf[2] ;
- int lf[2] ;
- int df[2] = { depth - 1, depth - 1 } ;
- for ( i = 0 ; i < 12 ; i ++ )
+ Node* nf[2];
+ int lf[2];
+ int df[2] = {depth - 1, depth - 1};
+ for(i = 0; i < 12; i ++)
{
- int c[ 2 ] = { cellProcFaceMask[ i ][ 0 ], cellProcFaceMask[ i ][ 1 ] };
+ int c[2] = {cellProcFaceMask[i][0], cellProcFaceMask[i][1]};
- lf[0] = isLeaf( node, c[0] ) ;
- lf[1] = isLeaf( node, c[1] ) ;
+ lf[0] = isLeaf((InternalNode*)node, c[0]);
+ lf[1] = isLeaf((InternalNode*)node, c[1]);
- nf[0] = chd[ c[0] ] ;
- nf[1] = chd[ c[1] ] ;
+ nf[0] = chd[c[0]];
+ nf[1] = chd[c[1]];
- faceProcParity( nf, lf, df, depth - 1, cellProcFaceMask[ i ][ 2 ] ) ;
+ faceProcParity(nf, lf, df, depth - 1, cellProcFaceMask[i][2]);
}
// 6 edge calls
- UCHAR* ne[4] ;
- int le[4] ;
- int de[4] = { depth - 1, depth - 1, depth - 1, depth - 1 } ;
- for ( i = 0 ; i < 6 ; i ++ )
+ Node* ne[4];
+ int le[4];
+ int de[4] = {depth - 1, depth - 1, depth - 1, depth - 1};
+ for(i = 0; i < 6; i ++)
{
- int c[ 4 ] = { cellProcEdgeMask[ i ][ 0 ], cellProcEdgeMask[ i ][ 1 ], cellProcEdgeMask[ i ][ 2 ], cellProcEdgeMask[ i ][ 3 ] };
+ int c[4] = {cellProcEdgeMask[i][0], cellProcEdgeMask[i][1], cellProcEdgeMask[i][2], cellProcEdgeMask[i][3]};
- for ( int j = 0 ; j < 4 ; j ++ )
+ for(int j = 0; j < 4; j ++)
{
- le[j] = isLeaf( node, c[j] ) ;
- ne[j] = chd[ c[j] ] ;
+ le[j] = isLeaf((InternalNode*)node, c[j]);
+ ne[j] = chd[c[j]];
}
- edgeProcParity( ne, le, de, depth - 1, cellProcEdgeMask[ i ][ 4 ] ) ;
+ edgeProcParity(ne, le, de, depth - 1, cellProcEdgeMask[i][4]);
}
}
diff --git a/intern/dualcon/intern/octree.h b/intern/dualcon/intern/octree.h
index 7b5a626bddc..aac09549ee6 100644
--- a/intern/dualcon/intern/octree.h
+++ b/intern/dualcon/intern/octree.h
@@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
- * Contributor(s): Tao Ju
+ * Contributor(s): Tao Ju, Nicholas Bishop
*
* ***** END GPL LICENSE BLOCK *****
*/
@@ -23,6 +23,8 @@
#ifndef OCTREE_H
#define OCTREE_H
+#include <cassert>
+#include <cstring>
#include <stdio.h>
#include <math.h>
#include "GeoCommon.h"
@@ -50,52 +52,56 @@
// #define IN_VERBOSE_MODE
/* Set scan convert params */
-// Uncomment to use Dual Contouring on Hermit representation
-// for better sharp feature reproduction, but more mem is required
-// The number indicates how far do we allow the minimizer to shoot
-// outside the cell
-#define USE_HERMIT 1.0f
-
-#ifdef USE_HERMIT
-//#define CINDY
-#endif
-///#define QIANYI
+#define EDGE_FLOATS 4
-//#define TESTMANIFOLD
+union Node;
+struct InternalNode {
+ /* Treat as bitfield, bit N indicates whether child N exists or not */
+ unsigned char has_child;
+ /* Treat as bitfield, bit N indicates whether child N is a leaf or not */
+ unsigned char child_is_leaf;
-/* Set output options */
-// Comment out to prevent writing output files
-#define OUTPUT_REPAIRED
+ /* Can have up to eight children */
+ Node *children[0];
+};
-/* Set node bytes */
-#ifdef USE_HERMIT
-#define EDGE_BYTES 16
-#define EDGE_FLOATS 4
-#else
-#define EDGE_BYTES 4
-#define EDGE_FLOATS 1
-#endif
+/**
+ * Bits order
+ *
+ * Leaf node:
+ * Byte 0,1(0-11): edge parity
+ * Byte 1(4,5,6): mask of primary edges intersections stored
+ * Byte 1(7): in flood fill mode, whether the cell is in process
+ * Byte 2(0-8): signs
+ * Byte 3,4: in coloring mode, the mask for edges
+ * Byte 5: edge intersections(4 bytes per inter, or 12 bytes if USE_HERMIT)
+ */
+struct LeafNode /* TODO: remove this attribute once everything is fixed */ {
+ unsigned short edge_parity : 12;
+ unsigned short primary_edge_intersections : 3;
-#define CINDY_BYTES 0
+ /* XXX: maybe actually unused? */
+ unsigned short in_process : 1;
-/*#define LEAF_EXTRA_BYTES FLOOD_BYTES + CINDY_BYTES
+ /* bitfield */
+ char signs;
-#ifdef USE_HERMIT
-#define LEAF_NODE_BYTES 7 + LEAF_EXTRA_BYTES
-#else
-#define LEAF_NODE_BYTES 3 + LEAF_EXTRA_BYTES
-#endif*/
+ int minimizer_index;
+
+ unsigned short flood_fill;
-#define INTERNAL_NODE_BYTES 2
-#define POINTER_BYTES 8
-#define FLOOD_FILL_BYTES 2
+ float edge_intersections[0];
+};
-#define signtype short
-#define nodetype int
-#define numtype int
+/* Doesn't get directly allocated anywhere, just used for passing
+ pointers to nodes that could be internal or leaf. */
+union Node {
+ InternalNode internal;
+ LeafNode leaf;
+};
/* Global variables */
extern const int edgemask[3];
@@ -116,23 +122,23 @@ extern const int dirEdge[3][4];
struct PathElement
{
// Origin
- int pos[3] ;
+ int pos[3];
// link
- PathElement* next ;
+ PathElement* next;
};
struct PathList
{
// Head
- PathElement* head ;
- PathElement* tail ;
+ PathElement* head;
+ PathElement* tail;
// Length of the list
- int length ;
+ int length;
// Next list
- PathList* next ;
+ PathList* next;
};
@@ -145,78 +151,71 @@ public:
/* Public members */
/// Memory allocators
- VirtualMemoryAllocator * alloc[ 9 ] ;
- VirtualMemoryAllocator * leafalloc[ 4 ] ;
+ VirtualMemoryAllocator * alloc[9];
+ VirtualMemoryAllocator * leafalloc[4];
/// Root node
- UCHAR* root ;
+ Node* root;
/// Model reader
- ModelReader* reader ;
+ ModelReader* reader;
/// Marching cubes table
- Cubes* cubes ;
+ Cubes* cubes;
/// Length of grid
- int dimen ;
- int mindimen, minshift ;
+ int dimen;
+ int mindimen, minshift;
/// Maximum depth
- int maxDepth ;
+ int maxDepth;
/// The lower corner of the bounding box and the size
float origin[3];
float range;
/// Counting information
- int nodeCount ;
- int nodeSpace ;
- int nodeCounts[ 9 ] ;
+ int nodeCount;
+ int nodeSpace;
+ int nodeCounts[9];
- int actualQuads, actualVerts ;
+ int actualQuads, actualVerts;
- PathList* ringList ;
+ PathList* ringList;
- int maxTrianglePerCell ;
- int outType ; // 0 for OFF, 1 for PLY, 2 for VOL
+ int maxTrianglePerCell;
+ int outType; // 0 for OFF, 1 for PLY, 2 for VOL
// For flood filling
int use_flood_fill;
- float thresh ;
+ float thresh;
int use_manifold;
- // testing
- FILE* testfout ;
-
float hermite_num;
DualConMode mode;
- int leaf_node_bytes;
- int leaf_extra_bytes;
- int flood_bytes;
-
public:
/**
* Construtor
*/
- Octree ( ModelReader* mr,
+ Octree(ModelReader* mr,
DualConAllocOutput alloc_output_func,
DualConAddVert add_vert_func,
DualConAddQuad add_quad_func,
DualConFlags flags, DualConMode mode, int depth,
- float threshold, float hermite_num ) ;
+ float threshold, float hermite_num);
/**
* Destructor
*/
- ~Octree ( ) ;
+ ~Octree();
/**
* Scan convert
*/
- void scanConvert() ;
+ void scanConvert();
void *getOutputMesh() { return output_mesh; }
@@ -226,164 +225,129 @@ private:
/**
* Initialize memory allocators
*/
- void initMemory ( ) ;
+ void initMemory();
/**
* Release memory
*/
- void freeMemory ( ) ;
+ void freeMemory();
/**
* Print memory usage
*/
- void printMemUsage( ) ;
+ void printMemUsage();
/**
* Methods to set / restore minimum edges
*/
- void resetMinimalEdges( ) ;
+ void resetMinimalEdges();
- void cellProcParity ( UCHAR* node, int leaf, int depth ) ;
- void faceProcParity ( UCHAR* node[2], int leaf[2], int depth[2], int maxdep, int dir ) ;
- void edgeProcParity ( UCHAR* node[4], int leaf[4], int depth[4], int maxdep, int dir ) ;
+ void cellProcParity(Node* node, int leaf, int depth);
+ void faceProcParity(Node* node[2], int leaf[2], int depth[2], int maxdep, int dir);
+ void edgeProcParity(Node* node[4], int leaf[4], int depth[4], int maxdep, int dir);
- void processEdgeParity ( UCHAR* node[4], int depths[4], int maxdep, int dir ) ;
+ void processEdgeParity(LeafNode* node[4], int depths[4], int maxdep, int dir);
/**
* Add triangles to the tree
*/
- void addTrian ( );
- void addTrian ( Triangle* trian, int triind );
- UCHAR* addTrian ( UCHAR* node, Projections* p, int height );
+ void addTrian();
+ void addTrian(Triangle* trian, int triind);
+ InternalNode* addTrian(InternalNode* node, Projections* p, int height);
/**
* Method to update minimizer in a cell: update edge intersections instead
*/
- UCHAR* updateCell( UCHAR* node, Projections* p ) ;
+ LeafNode* updateCell(LeafNode* node, Projections* p);
/* Routines to detect and patch holes */
- int numRings ;
- int totRingLengths ;
- int maxRingLength ;
+ int numRings;
+ int totRingLengths;
+ int maxRingLength;
/**
* Entry routine.
*/
- void trace ( ) ;
+ void trace();
/**
* Trace the given node, find patches and fill them in
*/
- UCHAR* trace ( UCHAR* node, int* st, int len, int depth, PathList*& paths ) ;
+ Node* trace(Node* node, int* st, int len, int depth, PathList*& paths);
/**
* Look for path on the face and add to paths
*/
- void findPaths ( UCHAR* node[2], int leaf[2], int depth[2], int* st[2], int maxdep, int dir, PathList*& paths ) ;
+ void findPaths(Node* node[2], int leaf[2], int depth[2], int* st[2], int maxdep, int dir, PathList*& paths);
/**
* Combine two list1 and list2 into list1 using connecting paths list3,
* while closed paths are appended to rings
*/
- void combinePaths ( PathList*& list1, PathList* list2, PathList* paths, PathList*& rings ) ;
+ void combinePaths(PathList*& list1, PathList* list2, PathList* paths, PathList*& rings);
/**
* Helper function: combine current paths in list1 and list2 to a single path and append to list3
*/
- PathList* combineSinglePath ( PathList*& head1, PathList* pre1, PathList*& list1, PathList*& head2, PathList* pre2, PathList*& list2 ) ;
+ PathList* combineSinglePath(PathList*& head1, PathList* pre1, PathList*& list1, PathList*& head2, PathList* pre2, PathList*& list2);
/**
* Functions to patch rings in a node
*/
- UCHAR* patch ( UCHAR* node, int st[3], int len, PathList* rings ) ;
- UCHAR* patchSplit ( UCHAR* node, int st[3], int len, PathList* rings, int dir, PathList*& nrings1, PathList*& nrings2 ) ;
- UCHAR* patchSplitSingle ( UCHAR* node, int st[3], int len, PathElement* head, int dir, PathList*& nrings1, PathList*& nrings2 ) ;
- UCHAR* connectFace ( UCHAR* node, int st[3], int len, int dir, PathElement* f1, PathElement* f2 ) ;
- UCHAR* locateCell( UCHAR* node, int st[3], int len, int ori[3], int dir, int side, UCHAR*& rleaf, int rst[3], int& rlen ) ;
- void compressRing ( PathElement*& ring ) ;
- void getFacePoint( PathElement* leaf, int dir, int& x, int& y, float& p, float& q ) ;
- UCHAR* patchAdjacent( UCHAR* node, int len, int st1[3], UCHAR* leaf1, int st2[3], UCHAR* leaf2, int walkdir, int inc, int dir, int side, float alpha ) ;
- int findPair ( PathElement* head, int pos, int dir, PathElement*& pre1, PathElement*& pre2 ) ;
- int getSide( PathElement* e, int pos, int dir ) ;
- int isEqual( PathElement* e1, PathElement* e2 ) ;
- void preparePrimalEdgesMask( UCHAR* node ) ;
- void testFacePoint( PathElement* e1, PathElement* e2 ) ;
+ Node* patch(Node* node, int st[3], int len, PathList* rings);
+ Node* patchSplit(Node* node, int st[3], int len, PathList* rings, int dir, PathList*& nrings1, PathList*& nrings2);
+ Node* patchSplitSingle(Node* node, int st[3], int len, PathElement* head, int dir, PathList*& nrings1, PathList*& nrings2);
+ Node* connectFace(Node* node, int st[3], int len, int dir, PathElement* f1, PathElement* f2);
+ Node* locateCell(InternalNode* node, int st[3], int len, int ori[3], int dir, int side, Node*& rleaf, int rst[3], int& rlen);
+ void compressRing(PathElement*& ring);
+ void getFacePoint(PathElement* leaf, int dir, int& x, int& y, float& p, float& q);
+ LeafNode* patchAdjacent(InternalNode* node, int len, int st1[3], LeafNode* leaf1, int st2[3], LeafNode* leaf2, int walkdir, int inc, int dir, int side, float alpha);
+ int findPair(PathElement* head, int pos, int dir, PathElement*& pre1, PathElement*& pre2);
+ int getSide(PathElement* e, int pos, int dir);
+ int isEqual(PathElement* e1, PathElement* e2) ;
+ void preparePrimalEdgesMask(InternalNode* node);
+ void testFacePoint(PathElement* e1, PathElement* e2);
/**
* Path-related functions
*/
- void deletePath ( PathList*& head, PathList* pre, PathList*& curr ) ;
- void printPath( PathList* path ) ;
- void printPath( PathElement* path ) ;
- void printElement( PathElement* ele ) ;
- void printPaths( PathList* path ) ;
- void checkElement ( PathElement* ele ) ;
- void checkPath( PathElement* path ) ;
+ void deletePath(PathList*& head, PathList* pre, PathList*& curr);
+ void printPath(PathList* path);
+ void printPath(PathElement* path);
+ void printElement(PathElement* ele);
+ void printPaths(PathList* path);
+ void checkElement(PathElement* ele);
+ void checkPath(PathElement* path);
/**
* Routines to build signs to create a partitioned volume
- * (after patching rings)
+ *(after patching rings)
*/
- void buildSigns( ) ;
- void buildSigns( unsigned char table[], UCHAR* node, int isLeaf, int sg, int rvalue[8] ) ;
+ void buildSigns();
+ void buildSigns(unsigned char table[], Node* node, int isLeaf, int sg, int rvalue[8]);
/************************************************************************/
/* To remove disconnected components */
/************************************************************************/
- void floodFill( ) ;
- void clearProcessBits( UCHAR* node, int height ) ;
- int floodFill( UCHAR* node, int st[3], int len, int height, int threshold ) ;
+ void floodFill();
+ void clearProcessBits(Node* node, int height);
+ int floodFill(LeafNode* leaf, int st[3], int len, int height, int threshold);
+ int floodFill(Node* node, int st[3], int len, int height, int threshold);
/**
* Write out polygon file
*/
void writeOut();
- void writeOFF ( char* fname ) ;
- void writePLY ( char* fname ) ;
- void writeOpenEdges( FILE* fout ) ;
- void writeAllEdges( FILE* fout, int mode ) ;
- void writeAllEdges( FILE* fout, UCHAR* node, int height, int st[3], int len, int mode ) ;
- void writeOctree( char* fname ) ;
- void writeOctree( FILE* fout, UCHAR* node, int depth ) ;
-#ifdef USE_HERMIT
- void writeOctreeGeom( char* fname ) ;
- void writeOctreeGeom( FILE* fout, UCHAR* node, int st[3], int len, int depth ) ;
-#endif
-#ifdef USE_HERMIT
- void writeDCF ( char* fname ) ;
- void writeDCF ( FILE* fout, UCHAR* node, int height, int st[3], int len ) ;
- void countEdges ( UCHAR* node, int height, int& nedge, int mode ) ;
- void countIntersection( UCHAR* node, int height, int& nedge, int& ncell, int& nface ) ;
- void generateMinimizer( UCHAR* node, int st[3], int len, int height, int& offset ) ;
- void computeMinimizer( UCHAR* leaf, int st[3], int len, float rvalue[3] ) ;
+ void countIntersection(Node* node, int height, int& nedge, int& ncell, int& nface);
+ void generateMinimizer(Node* node, int st[3], int len, int height, int& offset);
+ void computeMinimizer(LeafNode* leaf, int st[3], int len, float rvalue[3]);
/**
* Traversal functions to generate polygon model
* op: 0 for counting, 1 for writing OBJ, 2 for writing OFF, 3 for writing PLY
*/
- void cellProcContour ( UCHAR* node, int leaf, int depth ) ;
- void faceProcContour ( UCHAR* node[2], int leaf[2], int depth[2], int maxdep, int dir ) ;
- void edgeProcContour ( UCHAR* node[4], int leaf[4], int depth[4], int maxdep, int dir ) ;
- void processEdgeWrite ( UCHAR* node[4], int depths[4], int maxdep, int dir ) ;
-#else
- void countIntersection( UCHAR* node, int height, int& nquad, int& nvert ) ;
- void writeVertex( UCHAR* node, int st[3], int len, int height, int& offset, FILE* fout ) ;
- void writeQuad( UCHAR* node, int st[3], int len, int height, FILE* fout ) ;
-#endif
-
- /**
- * Write out original model
- */
- void writeModel( char* fname ) ;
-
- /************************************************************************/
- /* Write out original vertex tags */
- /************************************************************************/
-#ifdef CINDY
- void writeTags( char* fname ) ;
- void readVertices( ) ;
- void readVertex( UCHAR* node, int st[3], int len, int height, float v[3], int index ) ;
- void outputTags( UCHAR* node, int height, FILE* fout ) ;
- void clearCindyBits( UCHAR* node, int height ) ;
-#endif
+ void cellProcContour(Node* node, int leaf, int depth);
+ void faceProcContour(Node* node[2], int leaf[2], int depth[2], int maxdep, int dir);
+ void edgeProcContour(Node* node[4], int leaf[4], int depth[4], int maxdep, int dir);
+ void processEdgeWrite(Node* node[4], int depths[4], int maxdep, int dir);
/* output callbacks/data */
DualConAllocOutput alloc_output;
@@ -394,858 +358,753 @@ private:
private:
/************ Operators for all nodes ************/
- /**
- * Bits order
- *
- * Leaf node:
- * Byte 0,1 (0-11): edge parity
- * Byte 1 (4,5,6): mask of primary edges intersections stored
- * Byte 1 (7): in flood fill mode, whether the cell is in process
- * Byte 2 (0-8): signs
- * Byte 3 (or 5) -- : edge intersections ( 4 bytes per inter, or 12 bytes if USE_HERMIT )
- * Byte 3,4: in coloring mode, the mask for edges
- *
- * Internal node:
- * Byte 0: child mask
- * Byte 1: leaf child mask
- */
-
/// Lookup table
- int numChildrenTable[ 256 ] ;
- int childrenCountTable[ 256 ][ 8 ] ;
- int childrenIndexTable[ 256 ][ 8 ] ;
- int numEdgeTable[ 8 ] ;
- int edgeCountTable[ 8 ][ 3 ] ;
+ int numChildrenTable[256];
+ int childrenCountTable[256][8];
+ int childrenIndexTable[256][8];
+ int numEdgeTable[8];
+ int edgeCountTable[8][3];
/// Build up lookup table
- void buildTable ( )
+ void buildTable()
{
- for ( int i = 0 ; i < 256 ; i ++ )
+ for(int i = 0; i < 256; i ++)
{
- numChildrenTable[ i ] = 0 ;
- int count = 0 ;
- for ( int j = 0 ; j < 8 ; j ++ )
+ numChildrenTable[i] = 0;
+ int count = 0;
+ for(int j = 0; j < 8; j ++)
{
- numChildrenTable[ i ] += ( ( i >> j ) & 1 ) ;
- childrenCountTable[ i ][ j ] = count ;
- childrenIndexTable[ i ][ count ] = j ;
- count += ( ( i >> j ) & 1 ) ;
+ numChildrenTable[i] +=((i >> j) & 1);
+ childrenCountTable[i][j] = count;
+ childrenIndexTable[i][count] = j;
+ count +=((i >> j) & 1);
}
}
- for ( int i = 0 ; i < 8 ; i ++ )
+ for(int i = 0; i < 8; i ++)
{
- numEdgeTable[ i ] = 0 ;
- int count = 0 ;
- for ( int j = 0 ; j < 3 ; j ++ )
+ numEdgeTable[i] = 0;
+ int count = 0;
+ for(int j = 0; j < 3; j ++)
{
- numEdgeTable[ i ] += ( ( i >> j ) & 1 ) ;
- edgeCountTable[ i ][ j ] = count ;
- count += ( ( i >> j ) & 1 ) ;
+ numEdgeTable[i] +=((i >> j) & 1);
+ edgeCountTable[i][j] = count;
+ count +=((i >> j) & 1);
}
}
- };
+ }
- int getSign( UCHAR* node, int height, int index )
+ int getSign(Node* node, int height, int index)
{
- if ( height == 0 )
+ if(height == 0)
{
- return getSign( node, index ) ;
+ return getSign(&node->leaf, index);
}
else
{
- if ( hasChild( node, index ) )
+ if(hasChild(&node->internal, index))
{
- return getSign( getChild( node, getChildCount( node, index ) ), height - 1, index ) ;
+ return getSign(getChild(&node->internal, getChildCount(&node->internal, index)),
+ height - 1,
+ index);
}
else
{
- return getSign( getChild( node, 0 ), height - 1, 7 - getChildIndex( node, 0 ) ) ;
+ return getSign(getChild(&node->internal, 0),
+ height - 1,
+ 7 - getChildIndex(&node->internal, 0));
}
}
}
/************ Operators for leaf nodes ************/
- void printInfo( int st[3] )
+ void printInfo(int st[3])
{
- printf("INFO AT: %d %d %d\n", st[0] >> minshift, st[1] >>minshift, st[2] >> minshift ) ;
- UCHAR* leaf = locateLeafCheck( st ) ;
- if ( leaf == NULL )
- {
- printf("Leaf not exists!\n") ;
- }
+ printf("INFO AT: %d %d %d\n", st[0] >> minshift, st[1] >>minshift, st[2] >> minshift);
+ LeafNode* leaf = (LeafNode*)locateLeafCheck(st);
+ if(leaf)
+ printInfo(leaf);
else
- {
- printInfo( leaf ) ;
- }
+ printf("Leaf not exists!\n");
}
- void printInfo( UCHAR* leaf )
+ void printInfo(const LeafNode* leaf)
{
/*
- printf("Edge mask: ") ;
- for ( int i = 0 ; i < 12 ; i ++ )
+ printf("Edge mask: ");
+ for(int i = 0; i < 12; i ++)
{
- printf("%d ", getEdgeParity( leaf, i ) ) ;
+ printf("%d ", getEdgeParity(leaf, i));
}
- printf("\n") ;
- printf("Stored edge mask: ") ;
- for ( i = 0 ; i < 3 ; i ++ )
+ printf("\n");
+ printf("Stored edge mask: ");
+ for(i = 0; i < 3; i ++)
{
- printf("%d ", getStoredEdgesParity( leaf, i ) ) ;
+ printf("%d ", getStoredEdgesParity(leaf, i));
}
- printf("\n") ;
+ printf("\n");
*/
- printf("Sign mask: ") ;
- for ( int i = 0 ; i < 8 ; i ++ )
+ printf("Sign mask: ");
+ for(int i = 0; i < 8; i ++)
{
- printf("%d ", getSign( leaf, i ) ) ;
+ printf("%d ", getSign(leaf, i));
}
- printf("\n") ;
+ printf("\n");
}
/// Retrieve signs
- int getSign ( UCHAR* leaf, int index )
+ int getSign(const LeafNode* leaf, int index)
{
- return (( leaf[2] >> index ) & 1 );
- };
+ return ((leaf->signs >> index) & 1);
+ }
/// Set sign
- void setSign ( UCHAR* leaf, int index )
+ void setSign(LeafNode* leaf, int index)
{
- leaf[2] |= ( 1 << index ) ;
- };
+ leaf->signs |= (1 << index);
+ }
- void setSign ( UCHAR* leaf, int index, int sign )
+ void setSign(LeafNode* leaf, int index, int sign)
{
- leaf[2] &= ( ~ ( 1 << index ) ) ;
- leaf[2] |= ( ( sign & 1 ) << index ) ;
- };
+ leaf->signs &= (~(1 << index));
+ leaf->signs |= ((sign & 1) << index);
+ }
- int getSignMask( UCHAR* leaf )
+ int getSignMask(const LeafNode* leaf)
{
- return leaf[2] ;
+ return leaf->signs;
}
- void setInProcessAll( int st[3], int dir )
+ void setInProcessAll(int st[3], int dir)
{
- int nst[3], eind ;
- for ( int i = 0 ; i < 4 ; i ++ )
+ int nst[3], eind;
+ for(int i = 0; i < 4; i ++)
{
- nst[0] = st[0] + dirCell[dir][i][0] * mindimen ;
- nst[1] = st[1] + dirCell[dir][i][1] * mindimen ;
- nst[2] = st[2] + dirCell[dir][i][2] * mindimen ;
- eind = dirEdge[dir][i] ;
+ nst[0] = st[0] + dirCell[dir][i][0] * mindimen;
+ nst[1] = st[1] + dirCell[dir][i][1] * mindimen;
+ nst[2] = st[2] + dirCell[dir][i][2] * mindimen;
+ eind = dirEdge[dir][i];
- UCHAR* cell = locateLeafCheck( nst ) ;
- if ( cell == NULL )
- {
- printf("Wrong!\n") ;
- }
- setInProcess( cell, eind ) ;
+ LeafNode* cell = locateLeafCheck(nst);
+ assert(cell);
+
+ setInProcess(cell, eind);
}
}
- void flipParityAll( int st[3], int dir )
+ void flipParityAll(int st[3], int dir)
{
- int nst[3], eind ;
- for ( int i = 0 ; i < 4 ; i ++ )
+ int nst[3], eind;
+ for(int i = 0; i < 4; i ++)
{
- nst[0] = st[0] + dirCell[dir][i][0] * mindimen ;
- nst[1] = st[1] + dirCell[dir][i][1] * mindimen ;
- nst[2] = st[2] + dirCell[dir][i][2] * mindimen ;
- eind = dirEdge[dir][i] ;
+ nst[0] = st[0] + dirCell[dir][i][0] * mindimen;
+ nst[1] = st[1] + dirCell[dir][i][1] * mindimen;
+ nst[2] = st[2] + dirCell[dir][i][2] * mindimen;
+ eind = dirEdge[dir][i];
- UCHAR* cell = locateLeaf( nst ) ;
- flipEdge( cell, eind ) ;
+ LeafNode* cell = locateLeaf(nst);
+ flipEdge(cell, eind);
}
}
- void setInProcess( UCHAR* leaf, int eind )
- {
- // leaf[1] |= ( 1 << 7 ) ;
- ( (USHORT*) (leaf + leaf_node_bytes - (flood_bytes + CINDY_BYTES)))[0] |= ( 1 << eind ) ;
- }
- void setOutProcess( UCHAR* leaf, int eind )
- {
- // leaf[1] &= ( ~ ( 1 << 7 ) ) ;
- ( (USHORT*) (leaf + leaf_node_bytes - (flood_bytes + CINDY_BYTES)))[0] &= ( ~ ( 1 << eind ) ) ;
- }
-
- int isInProcess( UCHAR* leaf, int eind )
+ void setInProcess(LeafNode* leaf, int eind)
{
- //int a = ( ( leaf[1] >> 7 ) & 1 ) ;
- int a = ( ( ( (USHORT*) (leaf + leaf_node_bytes - (flood_bytes + CINDY_BYTES)))[0] >> eind ) & 1 ) ;
- return a ;
- }
+ assert(eind >= 0 && eind <= 11);
-#ifndef USE_HERMIT
- /// Set minimizer index
- void setEdgeIntersectionIndex( UCHAR* leaf, int count, int index )
- {
- ((int *)( leaf + leaf_node_bytes ))[ count ] = index ;
+ leaf->flood_fill |= (1 << eind);
}
-
- /// Get minimizer index
- int getEdgeIntersectionIndex( UCHAR* leaf, int count )
+
+ void setOutProcess(LeafNode* leaf, int eind)
{
- return ((int *)( leaf + leaf_node_bytes ))[ count ] ;
+ assert(eind >= 0 && eind <= 11);
+
+ leaf->flood_fill &= ~(1 << eind);
}
- /// Get all intersection indices associated with a cell
- void fillEdgeIntersectionIndices( UCHAR* leaf, int st[3], int len, int inds[12] )
+ int isInProcess(LeafNode* leaf, int eind)
{
- int i ;
-
- // The three primal edges are easy
- int pmask[3] = { 0, 4, 8 } ;
- for ( i = 0 ; i < 3 ; i ++ )
- {
- if ( getEdgeParity( leaf, pmask[i] ) )
- {
- inds[pmask[i]] = getEdgeIntersectionIndex( leaf, getEdgeCount( leaf, i ) ) ;
- }
- }
+ assert(eind >= 0 && eind <= 11);
- // 3 face adjacent cubes
- int fmask[3][2] = {{6,10},{2,9},{1,5}} ;
- int femask[3][2] = {{1,2},{0,2},{0,1}} ;
- for ( i = 0 ; i < 3 ; i ++ )
- {
- int e1 = getEdgeParity( leaf, fmask[i][0] ) ;
- int e2 = getEdgeParity( leaf, fmask[i][1] ) ;
- if ( e1 || e2 )
- {
- int nst[3] = {st[0], st[1], st[2]} ;
- nst[ i ] += len ;
- // int nstt[3] = {0, 0, 0} ;
- // nstt[ i ] += 1 ;
- UCHAR* node = locateLeaf( nst ) ;
-
- if ( e1 )
- {
- inds[ fmask[i][0] ] = getEdgeIntersectionIndex( node, getEdgeCount( node, femask[i][0] ) ) ;
- }
- if ( e2 )
- {
- inds[ fmask[i][1] ] = getEdgeIntersectionIndex( node, getEdgeCount( node, femask[i][1] ) ) ;
- }
- }
- }
-
- // 3 edge adjacent cubes
- int emask[3] = {3, 7, 11} ;
- int eemask[3] = {0, 1, 2} ;
- for ( i = 0 ; i < 3 ; i ++ )
- {
- if ( getEdgeParity( leaf, emask[i] ) )
- {
- int nst[3] = {st[0] + len, st[1] + len, st[2] + len} ;
- nst[ i ] -= len ;
- // int nstt[3] = {1, 1, 1} ;
- // nstt[ i ] -= 1 ;
- UCHAR* node = locateLeaf( nst ) ;
-
- inds[ emask[i] ] = getEdgeIntersectionIndex( node, getEdgeCount( node, eemask[i] ) ) ;
- }
- }
+ return (leaf->flood_fill >> eind) & 1;
}
-
-#endif
-
/// Generate signs at the corners from the edge parity
- void generateSigns ( UCHAR* leaf, UCHAR table[], int start )
+ void generateSigns(LeafNode* leaf, unsigned char table[], int start)
{
- leaf[2] = table[ ( ((USHORT *) leaf)[ 0 ] ) & ( ( 1 << 12 ) - 1 ) ] ;
+ leaf->signs = table[leaf->edge_parity];
- if ( ( start ^ leaf[2] ) & 1 )
+ if((start ^ leaf->signs) & 1)
{
- leaf[2] = ~ ( leaf[2] ) ;
+ leaf->signs = ~(leaf->signs);
}
}
/// Get edge parity
- int getEdgeParity( UCHAR* leaf, int index )
+ int getEdgeParity(LeafNode* leaf, int index)
{
- int a = ( ( ((USHORT *) leaf)[ 0 ] >> index ) & 1 ) ;
- return a ;
- };
+ assert(index >= 0 && index <= 11);
+
+ return (leaf->edge_parity >> index) & 1;
+ }
/// Get edge parity on a face
- int getFaceParity ( UCHAR* leaf, int index )
+ int getFaceParity(LeafNode* leaf, int index)
{
- int a = getEdgeParity( leaf, faceMap[ index ][ 0 ] ) +
- getEdgeParity( leaf, faceMap[ index ][ 1 ] ) +
- getEdgeParity( leaf, faceMap[ index ][ 2 ] ) +
- getEdgeParity( leaf, faceMap[ index ][ 3 ] ) ;
- return ( a & 1 ) ;
+ int a = getEdgeParity(leaf, faceMap[index][0]) +
+ getEdgeParity(leaf, faceMap[index][1]) +
+ getEdgeParity(leaf, faceMap[index][2]) +
+ getEdgeParity(leaf, faceMap[index][3]);
+ return (a & 1);
}
- int getFaceEdgeNum ( UCHAR* leaf, int index )
+ int getFaceEdgeNum(LeafNode* leaf, int index)
{
- int a = getEdgeParity( leaf, faceMap[ index ][ 0 ] ) +
- getEdgeParity( leaf, faceMap[ index ][ 1 ] ) +
- getEdgeParity( leaf, faceMap[ index ][ 2 ] ) +
- getEdgeParity( leaf, faceMap[ index ][ 3 ] ) ;
- return a ;
+ int a = getEdgeParity(leaf, faceMap[index][0]) +
+ getEdgeParity(leaf, faceMap[index][1]) +
+ getEdgeParity(leaf, faceMap[index][2]) +
+ getEdgeParity(leaf, faceMap[index][3]);
+ return a;
}
/// Set edge parity
- void flipEdge( UCHAR* leaf, int index )
+ void flipEdge(LeafNode* leaf, int index)
{
- ((USHORT *) leaf)[ 0 ] ^= ( 1 << index ) ;
- };
+ assert(index >= 0 && index <= 11);
+
+ leaf->edge_parity ^= (1 << index);
+ }
+
/// Set 1
- void setEdge( UCHAR* leaf, int index )
+ void setEdge(LeafNode* leaf, int index)
{
- ((USHORT *) leaf)[ 0 ] |= ( 1 << index ) ;
- };
+ assert(index >= 0 && index <= 11);
+
+ leaf->edge_parity |= (1 << index);
+ }
+
/// Set 0
- void resetEdge( UCHAR* leaf, int index )
+ void resetEdge(LeafNode* leaf, int index)
{
- ((USHORT *) leaf)[ 0 ] &= ( ~ ( 1 << index ) ) ;
- };
+ assert(index >= 0 && index <= 11);
+
+ leaf->edge_parity &= ~(1 << index);
+ }
/// Flipping with a new intersection offset
- void createPrimalEdgesMask( UCHAR* leaf )
+ void createPrimalEdgesMask(LeafNode* leaf)
{
- int mask = (( leaf[0] & 1 ) | ( (leaf[0] >> 3) & 2 ) | ( (leaf[1] & 1) << 2 ) ) ;
- leaf[1] |= ( mask << 4 ) ;
-
+ leaf->primary_edge_intersections = getPrimalEdgesMask2(leaf);
}
- void setStoredEdgesParity( UCHAR* leaf, int pindex )
+ void setStoredEdgesParity(LeafNode* leaf, int pindex)
{
- leaf[1] |= ( 1 << ( 4 + pindex ) ) ;
+ assert(pindex <= 2 && pindex >= 0);
+
+ leaf->primary_edge_intersections |= (1 << pindex);
}
- int getStoredEdgesParity( UCHAR* leaf, int pindex )
+ int getStoredEdgesParity(LeafNode* leaf, int pindex)
{
- return ( ( leaf[1] >> ( 4 + pindex ) ) & 1 ) ;
+ assert(pindex <= 2 && pindex >= 0);
+
+ return (leaf->primary_edge_intersections >> pindex) & 1;
}
- UCHAR* flipEdge( UCHAR* leaf, int index, float alpha )
+ LeafNode* flipEdge(LeafNode* leaf, int index, float alpha)
{
- flipEdge( leaf, index ) ;
+ flipEdge(leaf, index);
- if ( ( index & 3 ) == 0 )
+ if((index & 3) == 0)
{
- int ind = index / 4 ;
- if ( getEdgeParity( leaf, index ) && ! getStoredEdgesParity( leaf, ind ) )
+ int ind = index / 4;
+ if(getEdgeParity(leaf, index) && ! getStoredEdgesParity(leaf, ind))
{
// Create a new node
- int num = getNumEdges( leaf ) + 1 ;
- setStoredEdgesParity( leaf, ind ) ;
- int count = getEdgeCount( leaf, ind ) ;
- UCHAR* nleaf = createLeaf( num ) ;
- for ( int i = 0 ; i < leaf_node_bytes ; i ++ )
- {
- nleaf[i] = leaf[i] ;
- }
+ int num = getNumEdges(leaf) + 1;
+ setStoredEdgesParity(leaf, ind);
+ int count = getEdgeCount(leaf, ind);
+ LeafNode* nleaf = createLeaf(num);
+ *nleaf = *leaf;
- setEdgeOffset( nleaf, alpha, count ) ;
+ setEdgeOffset(nleaf, alpha, count);
- if ( num > 1 )
+ if(num > 1)
{
- float * pts = ( float * ) ( leaf + leaf_node_bytes ) ;
- float * npts = ( float * ) ( nleaf + leaf_node_bytes ) ;
- for ( int i = 0 ; i < count ; i ++ )
+ float *pts = leaf->edge_intersections;
+ float *npts = nleaf->edge_intersections;
+ for(int i = 0; i < count; i ++)
{
- for ( int j = 0 ; j < EDGE_FLOATS ; j ++ )
+ for(int j = 0; j < EDGE_FLOATS; j ++)
{
- npts[i * EDGE_FLOATS + j] = pts[i * EDGE_FLOATS + j] ;
+ npts[i * EDGE_FLOATS + j] = pts[i * EDGE_FLOATS + j];
}
}
- for ( int i = count + 1 ; i < num ; i ++ )
+ for(int i = count + 1; i < num; i ++)
{
- for ( int j = 0 ; j < EDGE_FLOATS ; j ++ )
+ for(int j = 0; j < EDGE_FLOATS; j ++)
{
- npts[i * EDGE_FLOATS + j] = pts[ (i - 1) * EDGE_FLOATS + j] ;
+ npts[i * EDGE_FLOATS + j] = pts[(i - 1) * EDGE_FLOATS + j];
}
}
}
- removeLeaf( num-1, leaf ) ;
- leaf = nleaf ;
+ removeLeaf(num-1, (LeafNode*)leaf);
+ leaf = nleaf;
}
}
- return leaf ;
- };
+ return leaf;
+ }
/// Update parent link
- void updateParent( UCHAR* node, int len, int st[3], UCHAR* leaf )
+ void updateParent(InternalNode* node, int len, int st[3], LeafNode* leaf)
{
// First, locate the parent
- int count ;
- UCHAR* parent = locateParent( node, len, st, count ) ;
+ int count;
+ InternalNode* parent = locateParent(node, len, st, count);
- // UPdate
- setChild( parent, count, leaf ) ;
+ // Update
+ setChild(parent, count, (Node*)leaf);
}
- void updateParent( UCHAR* node, int len, int st[3] )
+ void updateParent(InternalNode* node, int len, int st[3])
{
- if ( len == dimen )
+ if(len == dimen)
{
- root = node ;
- return ;
+ root = (Node*)node;
+ return;
}
// First, locate the parent
- int count ;
- UCHAR* parent = locateParent( len, st, count ) ;
+ int count;
+ InternalNode* parent = locateParent(len, st, count);
// UPdate
- setChild( parent, count, node ) ;
+ setChild(parent, count, (Node*)node);
}
/// Find edge intersection on a given edge
- int getEdgeIntersectionByIndex( int st[3], int index, float pt[3], int check )
+ int getEdgeIntersectionByIndex(int st[3], int index, float pt[3], int check)
{
// First, locat the leaf
- UCHAR* leaf ;
- if ( check )
+ LeafNode* leaf;
+ if(check)
{
- leaf = locateLeafCheck( st ) ;
+ leaf = locateLeafCheck(st);
}
else
{
- leaf = locateLeaf( st ) ;
+ leaf = locateLeaf(st);
}
- if ( leaf && getStoredEdgesParity( leaf, index ) )
+ if(leaf && getStoredEdgesParity(leaf, index))
{
- float off = getEdgeOffset( leaf, getEdgeCount( leaf, index ) ) ;
- pt[0] = (float) st[0] ;
- pt[1] = (float) st[1] ;
- pt[2] = (float) st[2] ;
- pt[index] += off * mindimen ;
+ float off = getEdgeOffset(leaf, getEdgeCount(leaf, index));
+ pt[0] =(float) st[0];
+ pt[1] =(float) st[1];
+ pt[2] =(float) st[2];
+ pt[index] += off * mindimen;
- return 1 ;
+ return 1;
}
else
{
- return 0 ;
+ return 0;
}
}
/// Retrieve number of edges intersected
- int getPrimalEdgesMask( UCHAR* leaf )
+ int getPrimalEdgesMask(LeafNode* leaf)
{
- // return (( leaf[0] & 1 ) | ( (leaf[0] >> 3) & 2 ) | ( (leaf[1] & 1) << 2 ) ) ;
- return ( ( leaf[1] >> 4 ) & 7 ) ;
+ return leaf->primary_edge_intersections;
}
- int getPrimalEdgesMask2( UCHAR* leaf )
+ int getPrimalEdgesMask2(LeafNode* leaf)
{
- return (( leaf[0] & 1 ) | ( (leaf[0] >> 3) & 2 ) | ( (leaf[1] & 1) << 2 ) ) ;
+ return (((leaf->edge_parity & 0x1) >> 0) |
+ ((leaf->edge_parity & 0x10) >> 3) |
+ ((leaf->edge_parity & 0x100) >> 6));
}
/// Get the count for a primary edge
- int getEdgeCount( UCHAR* leaf, int index )
+ int getEdgeCount(LeafNode* leaf, int index)
{
- return edgeCountTable[ getPrimalEdgesMask( leaf ) ][ index ] ;
+ return edgeCountTable[getPrimalEdgesMask(leaf)][index];
}
- int getNumEdges( UCHAR* leaf )
+ int getNumEdges(LeafNode* leaf)
{
- return numEdgeTable[ getPrimalEdgesMask( leaf ) ] ;
+ return numEdgeTable[getPrimalEdgesMask(leaf)];
}
- int getNumEdges2( UCHAR* leaf )
+ int getNumEdges2(LeafNode* leaf)
{
- return numEdgeTable[ getPrimalEdgesMask2( leaf ) ] ;
+ return numEdgeTable[getPrimalEdgesMask2(leaf)];
}
/// Set edge intersection
- void setEdgeOffset( UCHAR* leaf, float pt, int count )
- {
- float * pts = ( float * ) ( leaf + leaf_node_bytes ) ;
-#ifdef USE_HERMIT
- pts[ EDGE_FLOATS * count ] = pt ;
- pts[ EDGE_FLOATS * count + 1 ] = 0 ;
- pts[ EDGE_FLOATS * count + 2 ] = 0 ;
- pts[ EDGE_FLOATS * count + 3 ] = 0 ;
-#else
- pts[ count ] = pt ;
-#endif
+ void setEdgeOffset(LeafNode* leaf, float pt, int count)
+ {
+ float *pts = leaf->edge_intersections;
+ pts[EDGE_FLOATS * count] = pt;
+ pts[EDGE_FLOATS * count + 1] = 0;
+ pts[EDGE_FLOATS * count + 2] = 0;
+ pts[EDGE_FLOATS * count + 3] = 0;
}
/// Set multiple edge intersections
- void setEdgeOffsets( UCHAR* leaf, float pt[3], int len )
+ void setEdgeOffsets(LeafNode* leaf, float pt[3], int len)
{
- float * pts = ( float * ) ( leaf + leaf_node_bytes ) ;
- for ( int i = 0 ; i < len ; i ++ )
+ float * pts = leaf->edge_intersections;
+ for(int i = 0; i < len; i ++)
{
- pts[i] = pt[i] ;
+ pts[i] = pt[i];
}
}
/// Retrieve edge intersection
- float getEdgeOffset( UCHAR* leaf, int count )
+ float getEdgeOffset(LeafNode* leaf, int count)
{
-#ifdef USE_HERMIT
- return (( float * ) ( leaf + leaf_node_bytes ))[ 4 * count ] ;
-#else
- return (( float * ) ( leaf + leaf_node_bytes ))[ count ] ;
-#endif
+ return leaf->edge_intersections[4 * count];
}
/// Update method
- UCHAR* updateEdgeOffsets( UCHAR* leaf, int oldlen, int newlen, float offs[3] )
+ LeafNode* updateEdgeOffsets(LeafNode* leaf, int oldlen, int newlen, float offs[3])
{
// First, create a new leaf node
- UCHAR* nleaf = createLeaf( newlen ) ;
- for ( int i = 0 ; i < leaf_node_bytes ; i ++ )
- {
- nleaf[i] = leaf[i] ;
- }
+ LeafNode* nleaf = createLeaf(newlen);
+ *nleaf = *leaf;
// Next, fill in the offsets
- setEdgeOffsets( nleaf, offs, newlen ) ;
+ setEdgeOffsets(nleaf, offs, newlen);
// Finally, delete the old leaf
- removeLeaf( oldlen, leaf ) ;
+ removeLeaf(oldlen, leaf);
- return nleaf ;
+ return nleaf;
}
- /// Set original vertex index
- void setOriginalIndex( UCHAR* leaf, int index )
- {
- ((int *)( leaf + leaf_node_bytes ))[ 0 ] = index ;
- }
- int getOriginalIndex( UCHAR* leaf )
- {
- return ((int *)( leaf + leaf_node_bytes ))[ 0 ] ;
- }
-#ifdef USE_HERMIT
/// Set minimizer index
- void setMinimizerIndex( UCHAR* leaf, int index )
+ void setMinimizerIndex(LeafNode* leaf, int index)
{
- ((int *)( leaf + leaf_node_bytes - leaf_extra_bytes - 4 ))[ 0 ] = index ;
+ leaf->minimizer_index = index;
}
/// Get minimizer index
- int getMinimizerIndex( UCHAR* leaf )
+ int getMinimizerIndex(LeafNode* leaf)
{
- return ((int *)( leaf + leaf_node_bytes - leaf_extra_bytes - 4 ))[ 0 ] ;
+ return leaf->minimizer_index;
}
- int getMinimizerIndex( UCHAR* leaf, int eind )
+ int getMinimizerIndex(LeafNode* leaf, int eind)
{
- int add = manifold_table[ getSignMask( leaf ) ].pairs[ eind ][ 0 ] - 1 ;
- if ( add < 0 )
- {
- printf("Manifold components wrong!\n") ;
- }
- return ((int *)( leaf + leaf_node_bytes - leaf_extra_bytes - 4 ))[ 0 ] + add ;
+ int add = manifold_table[getSignMask(leaf)].pairs[eind][0] - 1;
+ assert(add >= 0);
+ return leaf->minimizer_index + add;
}
- void getMinimizerIndices( UCHAR* leaf, int eind, int inds[2] )
+ void getMinimizerIndices(LeafNode* leaf, int eind, int inds[2])
{
- const int* add = manifold_table[ getSignMask( leaf ) ].pairs[ eind ] ;
- inds[0] = ((int *)( leaf + leaf_node_bytes - leaf_extra_bytes - 4 ))[ 0 ] + add[0] - 1 ;
- if ( add[0] == add[1] )
+ const int* add = manifold_table[getSignMask(leaf)].pairs[eind];
+ inds[0] = leaf->minimizer_index + add[0] - 1;
+ if(add[0] == add[1])
{
- inds[1] = -1 ;
+ inds[1] = -1;
}
else
{
- inds[1] = ((int *)( leaf + leaf_node_bytes - leaf_extra_bytes - 4 ))[ 0 ] + add[1] - 1 ;
+ inds[1] = leaf->minimizer_index + add[1] - 1;
}
}
/// Set edge intersection
- void setEdgeOffsetNormal( UCHAR* leaf, float pt, float a, float b, float c, int count )
+ void setEdgeOffsetNormal(LeafNode* leaf, float pt, float a, float b, float c, int count)
{
- float * pts = ( float * ) ( leaf + leaf_node_bytes ) ;
- pts[ 4 * count ] = pt ;
- pts[ 4 * count + 1 ] = a ;
- pts[ 4 * count + 2 ] = b ;
- pts[ 4 * count + 3 ] = c ;
+ float * pts = leaf->edge_intersections;
+ pts[4 * count] = pt;
+ pts[4 * count + 1] = a;
+ pts[4 * count + 2] = b;
+ pts[4 * count + 3] = c;
}
- float getEdgeOffsetNormal( UCHAR* leaf, int count, float& a, float& b, float& c )
+ float getEdgeOffsetNormal(LeafNode* leaf, int count, float& a, float& b, float& c)
{
- float * pts = ( float * ) ( leaf + leaf_node_bytes ) ;
- a = pts[ 4 * count + 1 ] ;
- b = pts[ 4 * count + 2 ] ;
- c = pts[ 4 * count + 3 ] ;
- return pts[ 4 * count ] ;
+ float * pts = leaf->edge_intersections;
+ a = pts[4 * count + 1];
+ b = pts[4 * count + 2];
+ c = pts[4 * count + 3];
+ return pts[4 * count];
}
/// Set multiple edge intersections
- void setEdgeOffsetsNormals( UCHAR* leaf, float pt[], float a[], float b[], float c[], int len )
+ void setEdgeOffsetsNormals(LeafNode* leaf, float pt[], float a[], float b[], float c[], int len)
{
- float * pts = ( float * ) ( leaf + leaf_node_bytes ) ;
- for ( int i = 0 ; i < len ; i ++ )
+ float *pts = leaf->edge_intersections;
+ for(int i = 0; i < len; i ++)
{
- if ( pt[i] > 1 || pt[i] < 0 )
+ if(pt[i] > 1 || pt[i] < 0)
{
- printf("\noffset: %f\n", pt[i]) ;
+ printf("\noffset: %f\n", pt[i]);
}
- pts[ i * 4 ] = pt[i] ;
- pts[ i * 4 + 1 ] = a[i] ;
- pts[ i * 4 + 2 ] = b[i] ;
- pts[ i * 4 + 3 ] = c[i] ;
+ pts[i * 4] = pt[i];
+ pts[i * 4 + 1] = a[i];
+ pts[i * 4 + 2] = b[i];
+ pts[i * 4 + 3] = c[i];
}
}
/// Retrieve complete edge intersection
- void getEdgeIntersectionByIndex( UCHAR* leaf, int index, int st[3], int len, float pt[3], float nm[3] )
+ void getEdgeIntersectionByIndex(LeafNode* leaf, int index, int st[3], int len, float pt[3], float nm[3])
{
- int count = getEdgeCount( leaf, index ) ;
- float * pts = ( float * ) ( leaf + leaf_node_bytes ) ;
+ int count = getEdgeCount(leaf, index);
+ float *pts = leaf->edge_intersections;
- float off = pts[ 4 * count ] ;
+ float off = pts[4 * count];
- pt[0] = (float) st[0] ;
- pt[1] = (float) st[1] ;
- pt[2] = (float) st[2] ;
- pt[ index ] += ( off * len ) ;
-
- nm[0] = pts[ 4 * count + 1 ] ;
- nm[1] = pts[ 4 * count + 2 ] ;
- nm[2] = pts[ 4 * count + 3 ] ;
+ pt[0] = (float) st[0];
+ pt[1] = (float) st[1];
+ pt[2] = (float) st[2];
+ pt[index] +=(off * len);
+
+ nm[0] = pts[4 * count + 1];
+ nm[1] = pts[4 * count + 2];
+ nm[2] = pts[4 * count + 3];
}
- float getEdgeOffsetNormalByIndex( UCHAR* leaf, int index, float nm[3] )
+ float getEdgeOffsetNormalByIndex(LeafNode* leaf, int index, float nm[3])
{
- int count = getEdgeCount( leaf, index ) ;
- float * pts = ( float * ) ( leaf + leaf_node_bytes ) ;
+ int count = getEdgeCount(leaf, index);
+ float *pts = leaf->edge_intersections;
- float off = pts[ 4 * count ] ;
+ float off = pts[4 * count];
- nm[0] = pts[ 4 * count + 1 ] ;
- nm[1] = pts[ 4 * count + 2 ] ;
- nm[2] = pts[ 4 * count + 3 ] ;
+ nm[0] = pts[4 * count + 1];
+ nm[1] = pts[4 * count + 2];
+ nm[2] = pts[4 * count + 3];
- return off ;
+ return off;
}
- void fillEdgeIntersections( UCHAR* leaf, int st[3], int len, float pts[12][3], float norms[12][3] )
+ void fillEdgeIntersections(LeafNode* leaf, int st[3], int len, float pts[12][3], float norms[12][3])
{
- int i ;
- // int stt[3] = { 0, 0, 0 } ;
+ int i;
+ // int stt[3] = {0, 0, 0};
// The three primal edges are easy
- int pmask[3] = { 0, 4, 8 } ;
- for ( i = 0 ; i < 3 ; i ++ )
+ int pmask[3] = {0, 4, 8};
+ for(i = 0; i < 3; i ++)
{
- if ( getEdgeParity( leaf, pmask[i] ) )
+ if(getEdgeParity(leaf, pmask[i]))
{
- // getEdgeIntersectionByIndex( leaf, i, stt, 1, pts[ pmask[i] ], norms[ pmask[i] ] ) ;
- getEdgeIntersectionByIndex( leaf, i, st, len, pts[ pmask[i] ], norms[ pmask[i] ] ) ;
+ // getEdgeIntersectionByIndex(leaf, i, stt, 1, pts[pmask[i]], norms[pmask[i]]);
+ getEdgeIntersectionByIndex(leaf, i, st, len, pts[pmask[i]], norms[pmask[i]]);
}
}
// 3 face adjacent cubes
- int fmask[3][2] = {{6,10},{2,9},{1,5}} ;
- int femask[3][2] = {{1,2},{0,2},{0,1}} ;
- for ( i = 0 ; i < 3 ; i ++ )
+ int fmask[3][2] = {{6,10},{2,9},{1,5}};
+ int femask[3][2] = {{1,2},{0,2},{0,1}};
+ for(i = 0; i < 3; i ++)
{
- int e1 = getEdgeParity( leaf, fmask[i][0] ) ;
- int e2 = getEdgeParity( leaf, fmask[i][1] ) ;
- if ( e1 || e2 )
+ int e1 = getEdgeParity(leaf, fmask[i][0]);
+ int e2 = getEdgeParity(leaf, fmask[i][1]);
+ if(e1 || e2)
{
- int nst[3] = {st[0], st[1], st[2]} ;
- nst[ i ] += len ;
- // int nstt[3] = {0, 0, 0} ;
- // nstt[ i ] += 1 ;
- UCHAR* node = locateLeaf( nst ) ;
+ int nst[3] = {st[0], st[1], st[2]};
+ nst[i] += len;
+ // int nstt[3] = {0, 0, 0};
+ // nstt[i] += 1;
+ LeafNode* node = locateLeaf(nst);
- if ( e1 )
+ if(e1)
{
- // getEdgeIntersectionByIndex( node, femask[i][0], nstt, 1, pts[ fmask[i][0] ], norms[ fmask[i][0] ] ) ;
- getEdgeIntersectionByIndex( node, femask[i][0], nst, len, pts[ fmask[i][0] ], norms[ fmask[i][0] ] ) ;
+ // getEdgeIntersectionByIndex(node, femask[i][0], nstt, 1, pts[fmask[i][0]], norms[fmask[i][0]]);
+ getEdgeIntersectionByIndex(node, femask[i][0], nst, len, pts[fmask[i][0]], norms[fmask[i][0]]);
}
- if ( e2 )
+ if(e2)
{
- // getEdgeIntersectionByIndex( node, femask[i][1], nstt, 1, pts[ fmask[i][1] ], norms[ fmask[i][1] ] ) ;
- getEdgeIntersectionByIndex( node, femask[i][1], nst, len, pts[ fmask[i][1] ], norms[ fmask[i][1] ] ) ;
+ // getEdgeIntersectionByIndex(node, femask[i][1], nstt, 1, pts[fmask[i][1]], norms[fmask[i][1]]);
+ getEdgeIntersectionByIndex(node, femask[i][1], nst, len, pts[fmask[i][1]], norms[fmask[i][1]]);
}
}
}
// 3 edge adjacent cubes
- int emask[3] = {3, 7, 11} ;
- int eemask[3] = {0, 1, 2} ;
- for ( i = 0 ; i < 3 ; i ++ )
+ int emask[3] = {3, 7, 11};
+ int eemask[3] = {0, 1, 2};
+ for(i = 0; i < 3; i ++)
{
- if ( getEdgeParity( leaf, emask[i] ) )
+ if(getEdgeParity(leaf, emask[i]))
{
- int nst[3] = {st[0] + len, st[1] + len, st[2] + len} ;
- nst[ i ] -= len ;
- // int nstt[3] = {1, 1, 1} ;
- // nstt[ i ] -= 1 ;
- UCHAR* node = locateLeaf( nst ) ;
+ int nst[3] = {st[0] + len, st[1] + len, st[2] + len};
+ nst[i] -= len;
+ // int nstt[3] = {1, 1, 1};
+ // nstt[i] -= 1;
+ LeafNode* node = locateLeaf(nst);
- // getEdgeIntersectionByIndex( node, eemask[i], nstt, 1, pts[ emask[i] ], norms[ emask[i] ] ) ;
- getEdgeIntersectionByIndex( node, eemask[i], nst, len, pts[ emask[i] ], norms[ emask[i] ] ) ;
+ // getEdgeIntersectionByIndex(node, eemask[i], nstt, 1, pts[emask[i]], norms[emask[i]]);
+ getEdgeIntersectionByIndex(node, eemask[i], nst, len, pts[emask[i]], norms[emask[i]]);
}
}
}
- void fillEdgeIntersections( UCHAR* leaf, int st[3], int len, float pts[12][3], float norms[12][3], int parity[12] )
+ void fillEdgeIntersections(LeafNode* leaf, int st[3], int len, float pts[12][3], float norms[12][3], int parity[12])
{
- int i ;
- for ( i = 0 ; i < 12 ; i ++ )
+ int i;
+ for(i = 0; i < 12; i ++)
{
- parity[ i ] = 0 ;
+ parity[i] = 0;
}
- // int stt[3] = { 0, 0, 0 } ;
+ // int stt[3] = {0, 0, 0};
// The three primal edges are easy
- int pmask[3] = { 0, 4, 8 } ;
- for ( i = 0 ; i < 3 ; i ++ )
+ int pmask[3] = {0, 4, 8};
+ for(i = 0; i < 3; i ++)
{
- if ( getStoredEdgesParity( leaf, i ) )
+ if(getStoredEdgesParity(leaf, i))
{
- // getEdgeIntersectionByIndex( leaf, i, stt, 1, pts[ pmask[i] ], norms[ pmask[i] ] ) ;
- getEdgeIntersectionByIndex( leaf, i, st, len, pts[ pmask[i] ], norms[ pmask[i] ] ) ;
- parity[ pmask[i] ] = 1 ;
+ // getEdgeIntersectionByIndex(leaf, i, stt, 1, pts[pmask[i]], norms[pmask[i]]);
+ getEdgeIntersectionByIndex(leaf, i, st, len, pts[pmask[i]], norms[pmask[i]]);
+ parity[pmask[i]] = 1;
}
}
// 3 face adjacent cubes
- int fmask[3][2] = {{6,10},{2,9},{1,5}} ;
- int femask[3][2] = {{1,2},{0,2},{0,1}} ;
- for ( i = 0 ; i < 3 ; i ++ )
+ int fmask[3][2] = {{6,10},{2,9},{1,5}};
+ int femask[3][2] = {{1,2},{0,2},{0,1}};
+ for(i = 0; i < 3; i ++)
{
{
- int nst[3] = {st[0], st[1], st[2]} ;
- nst[ i ] += len ;
- // int nstt[3] = {0, 0, 0} ;
- // nstt[ i ] += 1 ;
- UCHAR* node = locateLeafCheck( nst ) ;
- if ( node == NULL )
+ int nst[3] = {st[0], st[1], st[2]};
+ nst[i] += len;
+ // int nstt[3] = {0, 0, 0};
+ // nstt[i] += 1;
+ LeafNode* node = locateLeafCheck(nst);
+ if(node == NULL)
{
- continue ;
+ continue;
}
- int e1 = getStoredEdgesParity( node, femask[i][0] ) ;
- int e2 = getStoredEdgesParity( node, femask[i][1] ) ;
+ int e1 = getStoredEdgesParity(node, femask[i][0]);
+ int e2 = getStoredEdgesParity(node, femask[i][1]);
- if ( e1 )
+ if(e1)
{
- // getEdgeIntersectionByIndex( node, femask[i][0], nstt, 1, pts[ fmask[i][0] ], norms[ fmask[i][0] ] ) ;
- getEdgeIntersectionByIndex( node, femask[i][0], nst, len, pts[ fmask[i][0] ], norms[ fmask[i][0] ] ) ;
- parity[ fmask[i][0] ] = 1 ;
+ // getEdgeIntersectionByIndex(node, femask[i][0], nstt, 1, pts[fmask[i][0]], norms[fmask[i][0]]);
+ getEdgeIntersectionByIndex(node, femask[i][0], nst, len, pts[fmask[i][0]], norms[fmask[i][0]]);
+ parity[fmask[i][0]] = 1;
}
- if ( e2 )
+ if(e2)
{
- // getEdgeIntersectionByIndex( node, femask[i][1], nstt, 1, pts[ fmask[i][1] ], norms[ fmask[i][1] ] ) ;
- getEdgeIntersectionByIndex( node, femask[i][1], nst, len, pts[ fmask[i][1] ], norms[ fmask[i][1] ] ) ;
- parity[ fmask[i][1] ] = 1 ;
+ // getEdgeIntersectionByIndex(node, femask[i][1], nstt, 1, pts[fmask[i][1]], norms[fmask[i][1]]);
+ getEdgeIntersectionByIndex(node, femask[i][1], nst, len, pts[fmask[i][1]], norms[fmask[i][1]]);
+ parity[fmask[i][1]] = 1;
}
}
}
// 3 edge adjacent cubes
- int emask[3] = {3, 7, 11} ;
- int eemask[3] = {0, 1, 2} ;
- for ( i = 0 ; i < 3 ; i ++ )
+ int emask[3] = {3, 7, 11};
+ int eemask[3] = {0, 1, 2};
+ for(i = 0; i < 3; i ++)
{
-// if ( getEdgeParity( leaf, emask[i] ) )
+// if(getEdgeParity(leaf, emask[i]))
{
- int nst[3] = {st[0] + len, st[1] + len, st[2] + len} ;
- nst[ i ] -= len ;
- // int nstt[3] = {1, 1, 1} ;
- // nstt[ i ] -= 1 ;
- UCHAR* node = locateLeafCheck( nst ) ;
- if ( node == NULL )
+ int nst[3] = {st[0] + len, st[1] + len, st[2] + len};
+ nst[i] -= len;
+ // int nstt[3] = {1, 1, 1};
+ // nstt[i] -= 1;
+ LeafNode* node = locateLeafCheck(nst);
+ if(node == NULL)
{
- continue ;
+ continue;
}
- if ( getStoredEdgesParity( node, eemask[i] ) )
+ if(getStoredEdgesParity(node, eemask[i]))
{
- // getEdgeIntersectionByIndex( node, eemask[i], nstt, 1, pts[ emask[i] ], norms[ emask[i] ] ) ;
- getEdgeIntersectionByIndex( node, eemask[i], nst, len, pts[ emask[i] ], norms[ emask[i] ] ) ;
- parity[ emask[ i ] ] = 1 ;
+ // getEdgeIntersectionByIndex(node, eemask[i], nstt, 1, pts[emask[i]], norms[emask[i]]);
+ getEdgeIntersectionByIndex(node, eemask[i], nst, len, pts[emask[i]], norms[emask[i]]);
+ parity[emask[i]] = 1;
}
}
}
}
- void fillEdgeOffsetsNormals( UCHAR* leaf, int st[3], int len, float pts[12], float norms[12][3], int parity[12] )
+ void fillEdgeOffsetsNormals(LeafNode* leaf, int st[3], int len, float pts[12], float norms[12][3], int parity[12])
{
- int i ;
- for ( i = 0 ; i < 12 ; i ++ )
+ int i;
+ for(i = 0; i < 12; i ++)
{
- parity[ i ] = 0 ;
+ parity[i] = 0;
}
- // int stt[3] = { 0, 0, 0 } ;
+ // int stt[3] = {0, 0, 0};
// The three primal edges are easy
- int pmask[3] = { 0, 4, 8 } ;
- for ( i = 0 ; i < 3 ; i ++ )
+ int pmask[3] = {0, 4, 8};
+ for(i = 0; i < 3; i ++)
{
- if ( getStoredEdgesParity( leaf, i ) )
+ if(getStoredEdgesParity(leaf, i))
{
- pts[ pmask[i] ] = getEdgeOffsetNormalByIndex( leaf, i, norms[ pmask[i] ] ) ;
- parity[ pmask[i] ] = 1 ;
+ pts[pmask[i]] = getEdgeOffsetNormalByIndex(leaf, i, norms[pmask[i]]);
+ parity[pmask[i]] = 1;
}
}
// 3 face adjacent cubes
- int fmask[3][2] = {{6,10},{2,9},{1,5}} ;
- int femask[3][2] = {{1,2},{0,2},{0,1}} ;
- for ( i = 0 ; i < 3 ; i ++ )
+ int fmask[3][2] = {{6,10},{2,9},{1,5}};
+ int femask[3][2] = {{1,2},{0,2},{0,1}};
+ for(i = 0; i < 3; i ++)
{
{
- int nst[3] = {st[0], st[1], st[2]} ;
- nst[ i ] += len ;
- // int nstt[3] = {0, 0, 0} ;
- // nstt[ i ] += 1 ;
- UCHAR* node = locateLeafCheck( nst ) ;
- if ( node == NULL )
+ int nst[3] = {st[0], st[1], st[2]};
+ nst[i] += len;
+ // int nstt[3] = {0, 0, 0};
+ // nstt[i] += 1;
+ LeafNode* node = locateLeafCheck(nst);
+ if(node == NULL)
{
- continue ;
+ continue;
}
- int e1 = getStoredEdgesParity( node, femask[i][0] ) ;
- int e2 = getStoredEdgesParity( node, femask[i][1] ) ;
+ int e1 = getStoredEdgesParity(node, femask[i][0]);
+ int e2 = getStoredEdgesParity(node, femask[i][1]);
- if ( e1 )
+ if(e1)
{
- pts[ fmask[i][0] ] = getEdgeOffsetNormalByIndex( node, femask[i][0], norms[ fmask[i][0] ] ) ;
- parity[ fmask[i][0] ] = 1 ;
+ pts[fmask[i][0]] = getEdgeOffsetNormalByIndex(node, femask[i][0], norms[fmask[i][0]]);
+ parity[fmask[i][0]] = 1;
}
- if ( e2 )
+ if(e2)
{
- pts[ fmask[i][1] ] = getEdgeOffsetNormalByIndex( node, femask[i][1], norms[ fmask[i][1] ] ) ;
- parity[ fmask[i][1] ] = 1 ;
+ pts[fmask[i][1]] = getEdgeOffsetNormalByIndex(node, femask[i][1], norms[fmask[i][1]]);
+ parity[fmask[i][1]] = 1;
}
}
}
// 3 edge adjacent cubes
- int emask[3] = {3, 7, 11} ;
- int eemask[3] = {0, 1, 2} ;
- for ( i = 0 ; i < 3 ; i ++ )
+ int emask[3] = {3, 7, 11};
+ int eemask[3] = {0, 1, 2};
+ for(i = 0; i < 3; i ++)
{
-// if ( getEdgeParity( leaf, emask[i] ) )
+// if(getEdgeParity(leaf, emask[i]))
{
- int nst[3] = {st[0] + len, st[1] + len, st[2] + len} ;
- nst[ i ] -= len ;
- // int nstt[3] = {1, 1, 1} ;
- // nstt[ i ] -= 1 ;
- UCHAR* node = locateLeafCheck( nst ) ;
- if ( node == NULL )
+ int nst[3] = {st[0] + len, st[1] + len, st[2] + len};
+ nst[i] -= len;
+ // int nstt[3] = {1, 1, 1};
+ // nstt[i] -= 1;
+ LeafNode* node = locateLeafCheck(nst);
+ if(node == NULL)
{
- continue ;
+ continue;
}
- if ( getStoredEdgesParity( node, eemask[i] ) )
+ if(getStoredEdgesParity(node, eemask[i]))
{
- pts[ emask[i] ] = getEdgeOffsetNormalByIndex( node, eemask[i], norms[ emask[i] ] ) ;
- parity[ emask[ i ] ] = 1 ;
+ pts[emask[i]] = getEdgeOffsetNormalByIndex(node, eemask[i], norms[emask[i]]);
+ parity[emask[i]] = 1;
}
}
}
@@ -1253,344 +1112,320 @@ private:
/// Update method
- UCHAR* updateEdgeOffsetsNormals( UCHAR* leaf, int oldlen, int newlen, float offs[3], float a[3], float b[3], float c[3] )
+ LeafNode* updateEdgeOffsetsNormals(LeafNode* leaf, int oldlen, int newlen, float offs[3], float a[3], float b[3], float c[3])
{
// First, create a new leaf node
- UCHAR* nleaf = createLeaf( newlen ) ;
- for ( int i = 0 ; i < leaf_node_bytes ; i ++ )
- {
- nleaf[i] = leaf[i] ;
- }
+ LeafNode* nleaf = createLeaf(newlen);
+ *nleaf = *leaf;
// Next, fill in the offsets
- setEdgeOffsetsNormals( nleaf, offs, a, b, c, newlen ) ;
+ setEdgeOffsetsNormals(nleaf, offs, a, b, c, newlen);
// Finally, delete the old leaf
- removeLeaf( oldlen, leaf ) ;
+ removeLeaf(oldlen, leaf);
- return nleaf ;
+ return nleaf;
}
-#endif
/// Locate a leaf
/// WARNING: assuming this leaf already exists!
- UCHAR* locateLeaf( int st[3] )
+ LeafNode* locateLeaf(int st[3])
{
- UCHAR* node = root ;
- for ( int i = GRID_DIMENSION - 1 ; i > GRID_DIMENSION - maxDepth - 1 ; i -- )
+ Node* node = (Node*)root;
+ for(int i = GRID_DIMENSION - 1; i > GRID_DIMENSION - maxDepth - 1; i --)
{
- int index = ( ( ( st[0] >> i ) & 1 ) << 2 ) |
- ( ( ( st[1] >> i ) & 1 ) << 1 ) |
- ( ( ( st[2] >> i ) & 1 ) ) ;
- node = getChild( node, getChildCount( node, index ) ) ;
+ int index =(((st[0] >> i) & 1) << 2) |
+ (((st[1] >> i) & 1) << 1) |
+ (((st[2] >> i) & 1));
+ node = getChild(&node->internal, getChildCount(&node->internal, index));
}
- return node ;
+ return &node->leaf;
}
- UCHAR* locateLeaf( UCHAR* node, int len, int st[3] )
+ LeafNode* locateLeaf(InternalNode* parent, int len, int st[3])
{
- int index ;
- for ( int i = len / 2 ; i >= mindimen ; i >>= 1 )
+ Node *node = (Node*)parent;
+ int index;
+ for(int i = len / 2; i >= mindimen; i >>= 1)
{
- index = ( ( ( st[0] & i ) ? 4 : 0 ) |
- ( ( st[1] & i ) ? 2 : 0 ) |
- ( ( st[2] & i ) ? 1 : 0 ) ) ;
- node = getChild( node, getChildCount( node, index ) ) ;
+ index =(((st[0] & i) ? 4 : 0) |
+ ((st[1] & i) ? 2 : 0) |
+ ((st[2] & i) ? 1 : 0));
+ node = getChild(&node->internal,
+ getChildCount(&node->internal, index));
}
- return node ;
+ return &node->leaf;
}
- UCHAR* locateLeafCheck( int st[3] )
+
+ LeafNode* locateLeafCheck(int st[3])
{
- UCHAR* node = root ;
- for ( int i = GRID_DIMENSION - 1 ; i > GRID_DIMENSION - maxDepth - 1 ; i -- )
+ Node* node = (Node*)root;
+ for(int i = GRID_DIMENSION - 1; i > GRID_DIMENSION - maxDepth - 1; i --)
{
- int index = ( ( ( st[0] >> i ) & 1 ) << 2 ) |
- ( ( ( st[1] >> i ) & 1 ) << 1 ) |
- ( ( ( st[2] >> i ) & 1 ) ) ;
- if ( ! hasChild( node, index ) )
+ int index =(((st[0] >> i) & 1) << 2) |
+ (((st[1] >> i) & 1) << 1) |
+ (((st[2] >> i) & 1));
+ if(!hasChild(&node->internal, index))
{
- return NULL ;
+ return NULL;
}
- node = getChild( node, getChildCount( node, index ) ) ;
+ node = getChild(&node->internal, getChildCount(&node->internal, index));
}
- return node ;
+ return &node->leaf;
}
- UCHAR* locateParent( int len, int st[3], int& count )
+
+ InternalNode* locateParent(int len, int st[3], int& count)
{
- UCHAR* node = root ;
- UCHAR* pre = NULL ;
- int index = 0 ;
- for ( int i = dimen / 2 ; i >= len ; i >>= 1 )
+ InternalNode* node = (InternalNode*)root;
+ InternalNode* pre = NULL;
+ int index = 0;
+ for(int i = dimen / 2; i >= len; i >>= 1)
{
- index = ( ( ( st[0] & i ) ? 4 : 0 ) |
- ( ( st[1] & i ) ? 2 : 0 ) |
- ( ( st[2] & i ) ? 1 : 0 ) ) ;
- pre = node ;
- node = getChild( node, getChildCount( node, index ) ) ;
+ index =(((st[0] & i) ? 4 : 0) |
+ ((st[1] & i) ? 2 : 0) |
+ ((st[2] & i) ? 1 : 0));
+ pre = node;
+ node = &getChild(node, getChildCount(node, index))->internal;
}
- count = getChildCount( pre, index ) ;
- return pre ;
+ count = getChildCount(pre, index);
+ return pre;
}
- UCHAR* locateParent( UCHAR* papa, int len, int st[3], int& count )
+
+ InternalNode* locateParent(InternalNode* parent, int len, int st[3], int& count)
{
- UCHAR* node = papa ;
- UCHAR* pre = NULL ;
+ InternalNode* node = parent;
+ InternalNode* pre = NULL;
int index = 0;
- for ( int i = len / 2 ; i >= mindimen ; i >>= 1 )
+ for(int i = len / 2; i >= mindimen; i >>= 1)
{
- index = ( ( ( st[0] & i ) ? 4 : 0 ) |
- ( ( st[1] & i ) ? 2 : 0 ) |
- ( ( st[2] & i ) ? 1 : 0 ) ) ;
- pre = node ;
- node = getChild( node, getChildCount( node, index ) ) ;
+ index =(((st[0] & i) ? 4 : 0) |
+ ((st[1] & i) ? 2 : 0) |
+ ((st[2] & i) ? 1 : 0));
+ pre = node;
+ node = (InternalNode*)getChild(node, getChildCount(node, index));
}
- count = getChildCount( pre, index ) ;
- return pre ;
+ count = getChildCount(pre, index);
+ return pre;
}
+
/************ Operators for internal nodes ************/
- /// Print the node information
- void printNode( UCHAR* node )
- {
- printf("Address: %p ", node ) ;
- printf("Leaf Mask: ") ;
- for ( int i = 0 ; i < 8 ; i ++ )
- {
- printf( "%d ", isLeaf( node, i ) ) ;
- }
- printf("Child Mask: ") ;
- for ( int i = 0 ; i < 8 ; i ++ )
- {
- printf( "%d ", hasChild( node, i ) ) ;
- }
- printf("\n") ;
- }
-
- /// Get size of an internal node
- int getSize ( int length )
- {
- return INTERNAL_NODE_BYTES + length * 4 ;
- };
-
/// If child index exists
- int hasChild( UCHAR* node, int index )
+ int hasChild(InternalNode* node, int index)
{
- return ( node[0] >> index ) & 1 ;
- };
+ return (node->has_child >> index) & 1;
+ }
/// Test if child is leaf
- int isLeaf ( UCHAR* node, int index )
+ int isLeaf(InternalNode* node, int index)
{
- return ( node[1] >> index ) & 1 ;
- };
+ return (node->child_is_leaf >> index) & 1;
+ }
/// Get the pointer to child index
- UCHAR* getChild ( UCHAR* node, int count )
+ Node* getChild(InternalNode* node, int count)
{
- return (( UCHAR ** ) ( node + INTERNAL_NODE_BYTES )) [ count ] ;
+ return node->children[count];
};
/// Get total number of children
- int getNumChildren( UCHAR* node )
+ int getNumChildren(InternalNode* node)
{
- return numChildrenTable[ node[0] ] ;
- };
+ return numChildrenTable[node->has_child];
+ }
/// Get the count of children
- int getChildCount( UCHAR* node, int index )
+ int getChildCount(InternalNode* node, int index)
{
- return childrenCountTable[ node[0] ][ index ] ;
+ return childrenCountTable[node->has_child][index];
}
- int getChildIndex( UCHAR* node, int count )
+ int getChildIndex(InternalNode* node, int count)
{
- return childrenIndexTable[ node[0] ][ count ] ;
+ return childrenIndexTable[node->has_child][count];
}
- int* getChildCounts( UCHAR* node )
+ int* getChildCounts(InternalNode* node)
{
- return childrenCountTable[ node[0] ] ;
+ return childrenCountTable[node->has_child];
}
/// Get all children
- void fillChildren( UCHAR* node, UCHAR* chd[ 8 ], int leaf[ 8 ] )
+ void fillChildren(InternalNode* node, Node* children[8], int leaf[8])
{
- int count = 0 ;
- for ( int i = 0 ; i < 8 ; i ++ )
+ int count = 0;
+ for(int i = 0; i < 8; i ++)
{
- leaf[ i ] = isLeaf( node, i ) ;
- if ( hasChild( node, i ) )
+ leaf[i] = isLeaf(node, i);
+ if(hasChild(node, i))
{
- chd[ i ] = getChild( node, count ) ;
- count ++ ;
+ children[i] = getChild(node, count);
+ count ++;
}
else
{
- chd[ i ] = NULL ;
- leaf[ i ] = 0 ;
+ children[i] = NULL;
+ leaf[i] = 0;
}
}
}
/// Sets the child pointer
- void setChild ( UCHAR* node, int count, UCHAR* chd )
+ void setChild(InternalNode* node, int count, Node* chd)
{
- (( UCHAR ** ) ( node + INTERNAL_NODE_BYTES )) [ count ] = chd ;
+ node->children[count] = chd;
}
- void setInternalChild ( UCHAR* node, int index, int count, UCHAR* chd )
+ void setInternalChild(InternalNode* node, int index, int count, InternalNode* chd)
{
- setChild( node, count, chd ) ;
- node[0] |= ( 1 << index ) ;
- };
- void setLeafChild ( UCHAR* node, int index, int count, UCHAR* chd )
+ setChild(node, count, (Node*)chd);
+ node->has_child |= (1 << index);
+ }
+ void setLeafChild(InternalNode* node, int index, int count, LeafNode* chd)
{
- setChild( node, count, chd ) ;
- node[0] |= ( 1 << index ) ;
- node[1] |= ( 1 << index ) ;
- };
+ setChild(node, count, (Node*)chd);
+ node->has_child |=(1 << index);
+ node->child_is_leaf |= (1 << index);
+ }
/// Add a kid to an existing internal node
/// Fix me: can we do this without wasting memory ?
/// Fixed: using variable memory
- UCHAR* addChild( UCHAR* node, int index, UCHAR* chd, int aLeaf )
+ InternalNode* addChild(InternalNode* node, int index, Node* child, int aLeaf)
{
// Create new internal node
- int num = getNumChildren( node ) ;
- UCHAR* rnode = createInternal( num + 1 ) ;
+ int num = getNumChildren(node);
+ InternalNode* rnode = createInternal(num + 1);
// Establish children
- int i ;
- int count1 = 0, count2 = 0 ;
- for ( i = 0 ; i < 8 ; i ++ )
+ int i;
+ int count1 = 0, count2 = 0;
+ for(i = 0; i < 8; i ++)
{
- if ( i == index )
+ if(i == index)
{
- if ( aLeaf )
+ if(aLeaf)
{
- setLeafChild( rnode, i, count2, chd ) ;
+ setLeafChild(rnode, i, count2, &child->leaf);
}
else
{
- setInternalChild( rnode, i, count2, chd ) ;
+ setInternalChild(rnode, i, count2, &child->internal);
}
- count2 ++ ;
+ count2 ++;
}
- else if ( hasChild( node, i ) )
+ else if(hasChild(node, i))
{
- if ( isLeaf( node, i ) )
+ if(isLeaf(node, i))
{
- setLeafChild( rnode, i, count2, getChild( node, count1 ) ) ;
+ setLeafChild(rnode, i, count2, &getChild(node, count1)->leaf);
}
else
{
- setInternalChild( rnode, i, count2, getChild( node, count1 ) ) ;
+ setInternalChild(rnode, i, count2, &getChild(node, count1)->internal);
}
- count1 ++ ;
- count2 ++ ;
+ count1 ++;
+ count2 ++;
}
}
- removeInternal( num, node ) ;
- return rnode ;
+ removeInternal(num, node);
+ return rnode;
}
/// Allocate a node
- UCHAR* createInternal( int length )
+ InternalNode* createInternal(int length)
{
- UCHAR* inode = alloc[ length ]->allocate( ) ;
- inode[0] = inode[1] = 0 ;
- return inode ;
- };
- UCHAR* createLeaf( int length )
+ InternalNode* inode = (InternalNode*)alloc[length]->allocate();
+ inode->has_child = 0;
+ inode->child_is_leaf = 0;
+ return inode;
+ }
+
+ LeafNode* createLeaf(int length)
{
- if ( length > 3 )
- {
- printf("wierd");
- }
- UCHAR* lnode = leafalloc[ length ]->allocate( ) ;
- lnode[0] = lnode[1] = lnode[2] = 0 ;
+ assert(length <= 3);
- return lnode ;
- };
+ LeafNode* lnode = (LeafNode*)leafalloc[length]->allocate();
+ lnode->edge_parity = 0;
+ lnode->primary_edge_intersections = 0;
+ lnode->signs = 0;
- void removeInternal ( int num, UCHAR* node )
+ return lnode;
+ }
+
+ void removeInternal(int num, InternalNode* node)
{
- alloc[ num ]->deallocate( node ) ;
+ alloc[num]->deallocate(node);
}
- void removeLeaf ( int num, UCHAR* leaf )
+ void removeLeaf(int num, LeafNode* leaf)
{
- if ( num > 3 || num < 0 )
- {
- printf("wierd");
- }
- leafalloc[ num ]->deallocate( leaf ) ;
+ assert(num >= 0 && num <= 3);
+ leafalloc[num]->deallocate(leaf);
}
/// Add a leaf (by creating a new par node with the leaf added)
- UCHAR* addLeafChild ( UCHAR* par, int index, int count, UCHAR* leaf )
+ InternalNode* addLeafChild(InternalNode* par, int index, int count,
+ LeafNode* leaf)
{
- int num = getNumChildren( par ) + 1 ;
- UCHAR* npar = createInternal( num ) ;
- npar[0] = par[0] ;
- npar[1] = par[1] ;
+ int num = getNumChildren(par) + 1;
+ InternalNode* npar = createInternal(num);
+ *npar = *par;
- if ( num == 1 )
+ if(num == 1)
{
- setLeafChild( npar, index, 0, leaf ) ;
+ setLeafChild(npar, index, 0, leaf);
}
else
{
- int i ;
- for ( i = 0 ; i < count ; i ++ )
+ int i;
+ for(i = 0; i < count; i ++)
{
- setChild( npar, i, getChild( par, i ) ) ;
+ setChild(npar, i, getChild(par, i));
}
- setLeafChild( npar, index, count, leaf ) ;
- for ( i = count + 1 ; i < num ; i ++ )
+ setLeafChild(npar, index, count, leaf);
+ for(i = count + 1; i < num; i ++)
{
- setChild( npar, i, getChild( par, i - 1 ) ) ;
+ setChild(npar, i, getChild(par, i - 1));
}
}
- removeInternal( num-1, par ) ;
- return npar ;
- };
+ removeInternal(num-1, par);
+ return npar;
+ }
- UCHAR* addInternalChild ( UCHAR* par, int index, int count, UCHAR* node )
+ InternalNode* addInternalChild(InternalNode* par, int index, int count,
+ InternalNode* node)
{
- int num = getNumChildren( par ) + 1 ;
- UCHAR* npar = createInternal( num ) ;
- npar[0] = par[0] ;
- npar[1] = par[1] ;
+ int num = getNumChildren(par) + 1;
+ InternalNode* npar = createInternal(num);
+ *npar = *par;
- if ( num == 1 )
+ if(num == 1)
{
- setInternalChild( npar, index, 0, node ) ;
+ setInternalChild(npar, index, 0, node);
}
else
{
- int i ;
- for ( i = 0 ; i < count ; i ++ )
+ int i;
+ for(i = 0; i < count; i ++)
{
- setChild( npar, i, getChild( par, i ) ) ;
+ setChild(npar, i, getChild(par, i));
}
- setInternalChild( npar, index, count, node ) ;
- for ( i = count + 1 ; i < num ; i ++ )
+ setInternalChild(npar, index, count, node);
+ for(i = count + 1; i < num; i ++)
{
- setChild( npar, i, getChild( par, i - 1 ) ) ;
+ setChild(npar, i, getChild(par, i - 1));
}
}
- removeInternal( num-1, par ) ;
- return npar ;
- };
+ removeInternal(num-1, par);
+ return npar;
+ }
};
-
-
#endif
diff --git a/intern/ffmpeg/ffmpeg_compat.h b/intern/ffmpeg/ffmpeg_compat.h
index 582086d130b..bb2c4f2d0a4 100644
--- a/intern/ffmpeg/ffmpeg_compat.h
+++ b/intern/ffmpeg/ffmpeg_compat.h
@@ -1,8 +1,4 @@
-#ifndef __ffmpeg_compat_h_included__
-#define __ffmpeg_compat_h_included__ 1
-
/*
- *
* compatibility macros to make every ffmpeg installation appear
* like the most current installation (wrapping some functionality sometimes)
* it also includes all ffmpeg header files at once, no need to do it
@@ -22,10 +18,11 @@
*
*/
+#ifndef __FFMPEG_COMPAT_H__
+#define __FFMPEG_COMPAT_H__
#include <libavformat/avformat.h>
-
/* check our ffmpeg is new enough, avoids user complaints */
#if (LIBAVFORMAT_VERSION_MAJOR < 52) || ((LIBAVFORMAT_VERSION_MAJOR == 52) && (LIBAVFORMAT_VERSION_MINOR <= 64))
# error "FFmpeg 0.7 or newer is needed, Upgrade your FFmpeg or disable it"
diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt
index 35b617e5452..5693aea0865 100644
--- a/intern/ghost/CMakeLists.txt
+++ b/intern/ghost/CMakeLists.txt
@@ -227,6 +227,20 @@ elseif(UNIX)
intern/GHOST_WindowX11.h
)
+ if(WITH_GHOST_XDND)
+ add_definitions(-DWITH_XDND)
+
+ list(APPEND INC
+ ../../extern/xdnd
+ )
+
+ list(APPEND SRC
+ intern/GHOST_DropTargetX11.cpp
+
+ intern/GHOST_DropTargetX11.h
+ )
+ endif()
+
if(X11_XF86keysym_INCLUDE_PATH)
add_definitions(-DWITH_XF86KEYSYM)
list(APPEND INC_SYS
diff --git a/intern/ghost/GHOST_C-api.h b/intern/ghost/GHOST_C-api.h
index db66a68799e..b47c4444081 100644
--- a/intern/ghost/GHOST_C-api.h
+++ b/intern/ghost/GHOST_C-api.h
@@ -30,8 +30,8 @@
* \brief GHOST C-API function and type declarations.
*/
-#ifndef GHOST_C_API_H
-#define GHOST_C_API_H
+#ifndef __GHOST_C_API_H__
+#define __GHOST_C_API_H__
#include "GHOST_Types.h"
diff --git a/intern/ghost/GHOST_IEvent.h b/intern/ghost/GHOST_IEvent.h
index 4e181b91c9e..05bd3553e01 100644
--- a/intern/ghost/GHOST_IEvent.h
+++ b/intern/ghost/GHOST_IEvent.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_IEvent interface class.
*/
-#ifndef _GHOST_IEVENT_H_
-#define _GHOST_IEVENT_H_
+#ifndef __GHOST_IEVENT_H__
+#define __GHOST_IEVENT_H__
#include <stddef.h>
#include "GHOST_Types.h"
@@ -92,5 +92,5 @@ public:
#endif
};
-#endif // _GHOST_IEVENT_H_
+#endif // __GHOST_IEVENT_H__
diff --git a/intern/ghost/GHOST_IEventConsumer.h b/intern/ghost/GHOST_IEventConsumer.h
index 9229595c90d..043cb27d1b2 100644
--- a/intern/ghost/GHOST_IEventConsumer.h
+++ b/intern/ghost/GHOST_IEventConsumer.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_IEventConsumer interface class.
*/
-#ifndef _GHOST_IEVENT_CONSUMER_H_
-#define _GHOST_IEVENT_CONSUMER_H_
+#ifndef __GHOST_IEVENTCONSUMER_H__
+#define __GHOST_IEVENTCONSUMER_H__
#include "GHOST_IEvent.h"
diff --git a/intern/ghost/GHOST_ISystem.h b/intern/ghost/GHOST_ISystem.h
index ee67694760b..be44bbee99a 100644
--- a/intern/ghost/GHOST_ISystem.h
+++ b/intern/ghost/GHOST_ISystem.h
@@ -32,8 +32,8 @@
* Contains the doxygen documentation main page.
*/
-#ifndef _GHOST_ISYSTEM_H_
-#define _GHOST_ISYSTEM_H_
+#ifndef __GHOST_ISYSTEM_H__
+#define __GHOST_ISYSTEM_H__
#include "GHOST_Types.h"
#include "GHOST_ITimerTask.h"
@@ -416,5 +416,5 @@ public:
#endif
};
-#endif // _GHOST_ISYSTEM_H_
+#endif // __GHOST_ISYSTEM_H__
diff --git a/intern/ghost/GHOST_ISystemPaths.h b/intern/ghost/GHOST_ISystemPaths.h
index 804cba721ff..dea5436c485 100644
--- a/intern/ghost/GHOST_ISystemPaths.h
+++ b/intern/ghost/GHOST_ISystemPaths.h
@@ -28,8 +28,8 @@
* \ingroup GHOST
*/
-#ifndef _GHOST_ISYSTEMPATHS_H_
-#define _GHOST_ISYSTEMPATHS_H_
+#ifndef __GHOST_ISYSTEMPATHS_H__
+#define __GHOST_ISYSTEMPATHS_H__
#include "GHOST_Types.h"
diff --git a/intern/ghost/GHOST_ITimerTask.h b/intern/ghost/GHOST_ITimerTask.h
index 95d75663401..bae41cf84d4 100644
--- a/intern/ghost/GHOST_ITimerTask.h
+++ b/intern/ghost/GHOST_ITimerTask.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_ITimerTask interface class.
*/
-#ifndef _GHOST_ITIMER_TASK_H_
-#define _GHOST_ITIMER_TASK_H_
+#ifndef __GHOST_ITIMERTASK_H__
+#define __GHOST_ITIMERTASK_H__
#include "GHOST_Types.h"
@@ -91,5 +91,5 @@ public:
#endif
};
-#endif // _GHOST_ITIMER_TASK_H_
+#endif // __GHOST_ITIMERTASK_H__
diff --git a/intern/ghost/GHOST_IWindow.h b/intern/ghost/GHOST_IWindow.h
index 6438059287d..4ce8800fef6 100644
--- a/intern/ghost/GHOST_IWindow.h
+++ b/intern/ghost/GHOST_IWindow.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_IWindow interface class.
*/
-#ifndef _GHOST_IWINDOW_H_
-#define _GHOST_IWINDOW_H_
+#ifndef __GHOST_IWINDOW_H__
+#define __GHOST_IWINDOW_H__
#include "STR_String.h"
#include "GHOST_Rect.h"
@@ -312,5 +312,5 @@ public:
#endif
};
-#endif // _GHOST_IWINDOW_H_
+#endif // __GHOST_IWINDOW_H__
diff --git a/intern/ghost/GHOST_Path-api.h b/intern/ghost/GHOST_Path-api.h
index abe837b6290..f1b79a98082 100644
--- a/intern/ghost/GHOST_Path-api.h
+++ b/intern/ghost/GHOST_Path-api.h
@@ -30,8 +30,8 @@
*/
-#ifndef GHOST_PATH_API_H
-#define GHOST_PATH_API_H
+#ifndef __GHOST_PATH_API_H__
+#define __GHOST_PATH_API_H__
#include "GHOST_Types.h"
diff --git a/intern/ghost/GHOST_Rect.h b/intern/ghost/GHOST_Rect.h
index c3b9460a14f..bcbcaded364 100644
--- a/intern/ghost/GHOST_Rect.h
+++ b/intern/ghost/GHOST_Rect.h
@@ -30,8 +30,8 @@
* Macro's used in GHOST debug target.
*/
-#ifndef _H_GHOST_Rect
-#define _H_GHOST_Rect
+#ifndef __GHOST_RECT_H__
+#define __GHOST_RECT_H__
#include "GHOST_Types.h"
@@ -254,5 +254,5 @@ inline bool GHOST_Rect::isInside(GHOST_TInt32 x, GHOST_TInt32 y) const
return (x >= m_l) && (x <= m_r) && (y >= m_t) && (y <= m_b);
}
-#endif // _H_GHOST_Rect
+#endif // __GHOST_RECT_H__
diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h
index 41496bca993..583bfdf1f84 100644
--- a/intern/ghost/GHOST_Types.h
+++ b/intern/ghost/GHOST_Types.h
@@ -30,8 +30,8 @@
*/
-#ifndef _GHOST_TYPES_H_
-#define _GHOST_TYPES_H_
+#ifndef __GHOST_TYPES_H__
+#define __GHOST_TYPES_H__
#ifdef WITH_CXX_GUARDEDALLOC
#include "MEM_guardedalloc.h"
@@ -515,5 +515,5 @@ struct GHOST_TimerTaskHandle__;
typedef void (*GHOST_TimerProcPtr)(struct GHOST_TimerTaskHandle__* task, GHOST_TUns64 time);
#endif
-#endif // _GHOST_TYPES_H_
+#endif // __GHOST_TYPES_H__
diff --git a/intern/ghost/SConscript b/intern/ghost/SConscript
index 68a0cbf7bdd..3410f11a971 100644
--- a/intern/ghost/SConscript
+++ b/intern/ghost/SConscript
@@ -42,6 +42,13 @@ elif window_system in ('linux', 'openbsd3', 'sunos5', 'freebsd7', 'freebsd8', 'f
# defs += ['PREFIX=\\"/usr/local/\\"'] # XXX, make an option
defs += ['WITH_X11_XINPUT'] # XXX, make an option
+ # freebsd doesn't seem to support XDND protocol
+ if env['WITH_GHOST_XDND'] and window_system not in ('freebsd7', 'freebsd8', 'freebsd9'):
+ incs += ' #/extern/xdnd'
+ defs += ['WITH_XDND']
+ else:
+ sources.remove('intern' + os.sep + 'GHOST_DropTargetX11.cpp')
+
elif window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc'):
for f in pf:
try:
diff --git a/intern/ghost/intern/GHOST_Buttons.h b/intern/ghost/intern/GHOST_Buttons.h
index 0209dc304e4..ea1cce574b8 100644
--- a/intern/ghost/intern/GHOST_Buttons.h
+++ b/intern/ghost/intern/GHOST_Buttons.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_Buttons struct.
*/
-#ifndef _GHOST_BUTTONS_H_
-#define _GHOST_BUTTONS_H_
+#ifndef __GHOST_BUTTONS_H__
+#define __GHOST_BUTTONS_H__
#include "GHOST_Types.h"
@@ -74,5 +74,5 @@ struct GHOST_Buttons {
GHOST_TUns8 m_ButtonRight : 1;
};
-#endif // _GHOST_BUTTONS_H_
+#endif // __GHOST_BUTTONS_H__
diff --git a/intern/ghost/intern/GHOST_CallbackEventConsumer.h b/intern/ghost/intern/GHOST_CallbackEventConsumer.h
index 8c16f53025c..e7a1aed507d 100644
--- a/intern/ghost/intern/GHOST_CallbackEventConsumer.h
+++ b/intern/ghost/intern/GHOST_CallbackEventConsumer.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_CallbackEventConsumer class.
*/
-#ifndef _GHOST_CALLBACK_EVENT_CONSUMER_H_
-#define _GHOST_CALLBACK_EVENT_CONSUMER_H_
+#ifndef __GHOST_CALLBACKEVENTCONSUMER_H__
+#define __GHOST_CALLBACKEVENTCONSUMER_H__
#include "GHOST_IEventConsumer.h"
#include "GHOST_C-api.h"
@@ -75,5 +75,5 @@ protected:
GHOST_TUserDataPtr m_userData;
};
-#endif // _GHOST_CALLBACK_EVENT_CONSUMER_H_
+#endif // __GHOST_CALLBACKEVENTCONSUMER_H__
diff --git a/intern/ghost/intern/GHOST_Debug.h b/intern/ghost/intern/GHOST_Debug.h
index 38512f6ce2b..a6392fce9bf 100644
--- a/intern/ghost/intern/GHOST_Debug.h
+++ b/intern/ghost/intern/GHOST_Debug.h
@@ -30,8 +30,8 @@
* Macro's used in GHOST debug target.
*/
-#ifndef _GHOST_DEBUG_H_
-#define _GHOST_DEBUG_H_
+#ifndef __GHOST_DEBUG_H__
+#define __GHOST_DEBUG_H__
#if defined(WIN32) && !defined(FREE_WINDOWS)
# ifdef DEBUG
@@ -72,5 +72,5 @@
# define GHOST_ASSERT(x, info)
#endif // GHOST_DEBUG
-#endif // _GHOST_DEBUG_H_
+#endif // __GHOST_DEBUG_H__
diff --git a/intern/ghost/intern/GHOST_DisplayManager.h b/intern/ghost/intern/GHOST_DisplayManager.h
index b89f303c734..3e867054d01 100644
--- a/intern/ghost/intern/GHOST_DisplayManager.h
+++ b/intern/ghost/intern/GHOST_DisplayManager.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_DisplayManager class.
*/
-#ifndef _GHOST_DISPLAY_MANAGER_H_
-#define _GHOST_DISPLAY_MANAGER_H_
+#ifndef __GHOST_DISPLAYMANAGER_H__
+#define __GHOST_DISPLAYMANAGER_H__
#include "GHOST_Types.h"
@@ -136,5 +136,5 @@ protected:
};
-#endif // _GHOST_DISPLAY_MANAGER_H_
+#endif // __GHOST_DISPLAYMANAGER_H__
diff --git a/intern/ghost/intern/GHOST_DisplayManagerCarbon.h b/intern/ghost/intern/GHOST_DisplayManagerCarbon.h
index 1a3c0d995b9..93467b8f462 100644
--- a/intern/ghost/intern/GHOST_DisplayManagerCarbon.h
+++ b/intern/ghost/intern/GHOST_DisplayManagerCarbon.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_DisplayManagerCarbon class.
*/
-#ifndef _GHOST_DISPLAY_MANAGER_CARBON_H_
-#define _GHOST_DISPLAY_MANAGER_CARBON_H_
+#ifndef __GHOST_DISPLAYMANAGERCARBON_H__
+#define __GHOST_DISPLAYMANAGERCARBON_H__
#ifndef __APPLE__
#error Apple only!
@@ -112,5 +112,5 @@ protected:
};
-#endif // _GHOST_DISPLAY_MANAGER_CARBON_H_
+#endif // __GHOST_DISPLAYMANAGERCARBON_H__
diff --git a/intern/ghost/intern/GHOST_DisplayManagerCocoa.h b/intern/ghost/intern/GHOST_DisplayManagerCocoa.h
index 7e12ca18aa2..bf194ad0492 100644
--- a/intern/ghost/intern/GHOST_DisplayManagerCocoa.h
+++ b/intern/ghost/intern/GHOST_DisplayManagerCocoa.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_DisplayManagerCocoa class.
*/
-#ifndef _GHOST_DISPLAY_MANAGER_COCOA_H_
-#define _GHOST_DISPLAY_MANAGER_COCOA_H_
+#ifndef __GHOST_DISPLAYMANAGERCOCOA_H__
+#define __GHOST_DISPLAYMANAGERCOCOA_H__
#ifndef __APPLE__
#error Apple only!
@@ -102,5 +102,5 @@ protected:
};
-#endif // _GHOST_DISPLAY_MANAGER_COCOA_H_
+#endif // __GHOST_DISPLAYMANAGERCOCOA_H__
diff --git a/intern/ghost/intern/GHOST_DisplayManagerNULL.h b/intern/ghost/intern/GHOST_DisplayManagerNULL.h
index 5d3f0168c52..31fb9faf0cf 100644
--- a/intern/ghost/intern/GHOST_DisplayManagerNULL.h
+++ b/intern/ghost/intern/GHOST_DisplayManagerNULL.h
@@ -25,8 +25,8 @@
* Declaration of GHOST_DisplayManagerNULL class.
*/
-#ifndef _GHOST_DISPLAY_MANAGER_NULL_H_
-#define _GHOST_DISPLAY_MANAGER_NULL_H_
+#ifndef __GHOST_DISPLAYMANAGERNULL_H__
+#define __GHOST_DISPLAYMANAGERNULL_H__
#include "GHOST_DisplayManager.h"
#include "GHOST_SystemNULL.h"
@@ -47,4 +47,4 @@ private :
GHOST_SystemNULL * m_system;
};
-#endif /* _GHOST_DISPLAY_MANAGER_NULL_H_ */
+#endif /* __GHOST_DISPLAYMANAGERNULL_H__ */
diff --git a/intern/ghost/intern/GHOST_DisplayManagerSDL.h b/intern/ghost/intern/GHOST_DisplayManagerSDL.h
index 297a61f41ff..72f756f653a 100644
--- a/intern/ghost/intern/GHOST_DisplayManagerSDL.h
+++ b/intern/ghost/intern/GHOST_DisplayManagerSDL.h
@@ -25,8 +25,8 @@
* Declaration of GHOST_DisplayManagerSDL class.
*/
-#ifndef _GHOST_DISPLAY_MANAGER_SDL_H_
-#define _GHOST_DISPLAY_MANAGER_SDL_H_
+#ifndef __GHOST_DISPLAYMANAGERSDL_H__
+#define __GHOST_DISPLAYMANAGERSDL_H__
#include "GHOST_DisplayManager.h"
@@ -69,4 +69,4 @@ private :
GHOST_SystemSDL * m_system;
};
-#endif /* _GHOST_DISPLAY_MANAGER_SDL_H_ */
+#endif /* __GHOST_DISPLAYMANAGERSDL_H__ */
diff --git a/intern/ghost/intern/GHOST_DisplayManagerWin32.h b/intern/ghost/intern/GHOST_DisplayManagerWin32.h
index 84749d42dbb..534274ec878 100644
--- a/intern/ghost/intern/GHOST_DisplayManagerWin32.h
+++ b/intern/ghost/intern/GHOST_DisplayManagerWin32.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_DisplayManagerWin32 class.
*/
-#ifndef _GHOST_DISPLAY_MANAGER_WIN32_H_
-#define _GHOST_DISPLAY_MANAGER_WIN32_H_
+#ifndef __GHOST_DISPLAYMANAGERWIN32_H__
+#define __GHOST_DISPLAYMANAGERWIN32_H__
#ifndef WIN32
#error WIN32 only!
@@ -97,5 +97,5 @@ protected:
};
-#endif // _GHOST_DISPLAY_MANAGER_WIN32_H_
+#endif // __GHOST_DISPLAYMANAGERWIN32_H__
diff --git a/intern/ghost/intern/GHOST_DisplayManagerX11.h b/intern/ghost/intern/GHOST_DisplayManagerX11.h
index 62374b9170a..c4d2b6dbb0a 100644
--- a/intern/ghost/intern/GHOST_DisplayManagerX11.h
+++ b/intern/ghost/intern/GHOST_DisplayManagerX11.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_DisplayManagerX11 class.
*/
-#ifndef _GHOST_DISPLAY_MANAGER_X11_H_
-#define _GHOST_DISPLAY_MANAGER_X11_H_
+#ifndef __GHOST_DISPLAYMANAGERX11_H__
+#define __GHOST_DISPLAYMANAGERX11_H__
#include "GHOST_DisplayManager.h"
diff --git a/intern/ghost/intern/GHOST_DropTargetWin32.h b/intern/ghost/intern/GHOST_DropTargetWin32.h
index 0e8b2d15991..9f80b82436e 100644
--- a/intern/ghost/intern/GHOST_DropTargetWin32.h
+++ b/intern/ghost/intern/GHOST_DropTargetWin32.h
@@ -29,8 +29,8 @@
* \ingroup GHOST
*/
-#ifndef _GHOST_DROP_TARGET_WIN32_H_
-#define _GHOST_DROP_TARGET_WIN32_H_
+#ifndef __GHOST_DROPTARGETWIN32_H__
+#define __GHOST_DROPTARGETWIN32_H__
#include <string.h>
#include <GHOST_Types.h>
@@ -155,4 +155,4 @@ private:
};
-#endif // _GHOST_DROP_TARGET_WIN32_H_
+#endif // __GHOST_DROPTARGETWIN32_H__
diff --git a/intern/ghost/intern/GHOST_DropTargetX11.cpp b/intern/ghost/intern/GHOST_DropTargetX11.cpp
new file mode 100644
index 00000000000..2239ac63d33
--- /dev/null
+++ b/intern/ghost/intern/GHOST_DropTargetX11.cpp
@@ -0,0 +1,310 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2012 by the Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Sergey Sharybin.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file ghost/intern/GHOST_DropTargetX11.cpp
+ * \ingroup GHOST
+ */
+
+#include "GHOST_DropTargetX11.h"
+#include "GHOST_Debug.h"
+
+#include <ctype.h>
+#include <assert.h>
+
+bool GHOST_DropTargetX11::m_xdndInitialized = false;
+DndClass GHOST_DropTargetX11::m_dndClass;
+Atom * GHOST_DropTargetX11::m_dndTypes = NULL;
+Atom * GHOST_DropTargetX11::m_dndActions = NULL;
+const char *GHOST_DropTargetX11::m_dndMimeTypes[] = {"url/url", "text/uri-list", "text/plain", "application/octet-stream"};
+int GHOST_DropTargetX11::m_refCounter = 0;
+
+#define dndTypeURLID 0
+#define dndTypeURIListID 1
+#define dndTypePlainTextID 2
+#define dndTypeOctetStreamID 3
+
+#define dndTypeURL m_dndTypes[dndTypeURLID]
+#define dndTypeURIList m_dndTypes[dndTypeURIListID]
+#define dndTypePlainText m_dndTypes[dndTypePlainTextID]
+#define dndTypeOctetStream m_dndTypes[dndTypeOctetStreamID]
+
+void GHOST_DropTargetX11::Initialize(void)
+{
+ Display *display = m_system->getXDisplay();
+ int dndTypesCount = sizeof(m_dndMimeTypes) / sizeof(char*);
+ int counter;
+
+ xdnd_init(&m_dndClass, display);
+
+ m_dndTypes = new Atom[dndTypesCount + 1];
+ XInternAtoms(display, (char**)m_dndMimeTypes, dndTypesCount, 0, m_dndTypes);
+ m_dndTypes[dndTypesCount] = 0;
+
+ m_dndActions = new Atom[8];
+ counter = 0;
+
+ m_dndActions[counter++] = m_dndClass.XdndActionCopy;
+ m_dndActions[counter++] = m_dndClass.XdndActionMove;
+
+#if 0 /* Not supported yet */
+ dndActions[counter++] = dnd->XdndActionLink;
+ dndActions[counter++] = dnd->XdndActionAsk;
+ dndActions[counter++] = dnd->XdndActionPrivate;
+ dndActions[counter++] = dnd->XdndActionList;
+ dndActions[counter++] = dnd->XdndActionDescription;
+#endif
+
+ m_dndActions[counter++] = 0;
+}
+
+void GHOST_DropTargetX11::Uninitialize(void)
+{
+ xdnd_shut(&m_dndClass);
+}
+
+GHOST_DropTargetX11::GHOST_DropTargetX11(GHOST_WindowX11 * window, GHOST_SystemX11 * system)
+:
+m_window(window),
+m_system(system)
+{
+ if (!m_xdndInitialized) {
+ Initialize();
+ m_xdndInitialized = true;
+ GHOST_PRINT("XDND initialized\n");
+ }
+
+ Window wnd = window->getXWindow();
+
+ xdnd_set_dnd_aware(&m_dndClass, wnd, 0);
+ xdnd_set_type_list(&m_dndClass, wnd, m_dndTypes);
+
+ m_draggedObjectType = GHOST_kDragnDropTypeUnknown;
+ m_refCounter++;
+}
+
+GHOST_DropTargetX11::~GHOST_DropTargetX11()
+{
+ m_refCounter--;
+ if (m_refCounter == 0) {
+ Uninitialize();
+ m_xdndInitialized = false;
+ GHOST_PRINT("XDND uninitialized\n");
+ }
+}
+
+/* based on a code from Saul Rennison
+ * http://stackoverflow.com/questions/2673207/c-c-url-decode-library */
+
+typedef enum DecodeState_e {
+ STATE_SEARCH = 0, ///< searching for an ampersand to convert
+ STATE_CONVERTING ///< convert the two proceeding characters from hex
+} DecodeState_e;
+
+void GHOST_DropTargetX11::UrlDecode(char *decodedOut, int bufferSize, const char *encodedIn)
+{
+ unsigned int i;
+ unsigned int len = strlen(encodedIn);
+ DecodeState_e state = STATE_SEARCH;
+ int j, asciiCharacter;
+ char tempNumBuf[3] = {0};
+ bool bothDigits = true;
+
+ memset(decodedOut, 0, bufferSize);
+
+ for (i = 0; i < len; ++i) {
+ switch (state) {
+ case STATE_SEARCH:
+ if (encodedIn[i] != '%') {
+ strncat(decodedOut, &encodedIn[i], 1);
+ assert(strlen(decodedOut) < bufferSize);
+ break;
+ }
+
+ // We are now converting
+ state = STATE_CONVERTING;
+ break;
+
+ case STATE_CONVERTING:
+ bothDigits = true;
+
+ // Create a buffer to hold the hex. For example, if %20, this
+ // buffer would hold 20 (in ASCII)
+ memset(tempNumBuf, 0, sizeof(tempNumBuf));
+
+ // Conversion complete (i.e. don't convert again next iter)
+ state = STATE_SEARCH;
+
+ strncpy(tempNumBuf, &encodedIn[i], 2);
+
+ // Ensure both characters are hexadecimal
+
+ for (j = 0; j < 2; ++j) {
+ if (!isxdigit(tempNumBuf[j]))
+ bothDigits = false;
+ }
+
+ if (!bothDigits)
+ break;
+
+ // Convert two hexadecimal characters into one character
+ sscanf(tempNumBuf, "%x", &asciiCharacter);
+
+ // Ensure we aren't going to overflow
+ assert(strlen(decodedOut) < bufferSize);
+
+ // Concatenate this character onto the output
+ strncat(decodedOut, (char*)&asciiCharacter, 1);
+
+ // Skip the next character
+ i++;
+ break;
+ }
+ }
+}
+
+char *GHOST_DropTargetX11::FileUrlDecode(char *fileUrl)
+{
+ if(!strncpy(fileUrl, "file://", 7) == 0) {
+ /* assume one character of encoded URL can be expanded to 4 chars max */
+ int decodedSize = 4 * strlen(fileUrl) + 1;
+ char *decodedPath = (char *)malloc(decodedSize);
+
+ UrlDecode(decodedPath, decodedSize, fileUrl + 7);
+
+ return decodedPath;
+ }
+
+ return NULL;
+}
+
+void *GHOST_DropTargetX11::getURIListGhostData(unsigned char *dropBuffer, int dropBufferSize)
+{
+ GHOST_TStringArray *strArray = NULL;
+ int totPaths = 0, curLength = 0;
+
+ /* count total number of file pathes in buffer */
+ for (int i = 0; i <= dropBufferSize; i++) {
+ if (dropBuffer[i] == 0 || dropBuffer[i] == '\n' || dropBuffer[i] == '\r') {
+ if (curLength) {
+ totPaths++;
+ curLength = 0;
+ }
+ }
+ else curLength++;
+ }
+
+ strArray = (GHOST_TStringArray*)malloc(sizeof(GHOST_TStringArray));
+ strArray->count = 0;
+ strArray->strings = (GHOST_TUns8**)malloc(totPaths*sizeof(GHOST_TUns8*));
+
+ curLength = 0;
+ for (int i = 0; i <= dropBufferSize; i++) {
+ if (dropBuffer[i] == 0 || dropBuffer[i] == '\n' || dropBuffer[i] == '\r') {
+ if (curLength) {
+ char *curPath = (char *)malloc(curLength + 1);
+ char *decodedPath;
+
+ strncpy(curPath, (char*)dropBuffer + i - curLength, curLength);
+ curPath[curLength] = 0;
+
+ decodedPath = FileUrlDecode(curPath);
+ if(decodedPath) {
+ strArray->strings[strArray->count] = (GHOST_TUns8*)decodedPath;
+ strArray->count++;
+ }
+
+ free(curPath);
+ curLength = 0;
+ }
+ }
+ else curLength++;
+ }
+
+ return strArray;
+}
+
+void *GHOST_DropTargetX11::getGhostData(Atom dropType, unsigned char *dropBuffer, int dropBufferSize)
+{
+ void *data = NULL;
+ unsigned char *tmpBuffer = (unsigned char *)malloc(dropBufferSize + 1);
+ bool needsFree = true;
+
+ /* ensure NULL-terminator */
+ memcpy(tmpBuffer, dropBuffer, dropBufferSize);
+ tmpBuffer[dropBufferSize] = 0;
+
+ if (dropType == dndTypeURIList) {
+ m_draggedObjectType = GHOST_kDragnDropTypeFilenames;
+ data = getURIListGhostData(tmpBuffer, dropBufferSize);
+ }
+ else if (dropType == dndTypeURL) {
+ /* need to be tested */
+ char *decodedPath = FileUrlDecode((char *)tmpBuffer);
+
+ if (decodedPath) {
+ m_draggedObjectType = GHOST_kDragnDropTypeString;
+ data = decodedPath;
+ }
+ }
+ else if (dropType == dndTypePlainText || dropType == dndTypeOctetStream) {
+ m_draggedObjectType = GHOST_kDragnDropTypeString;
+ data = tmpBuffer;
+ needsFree = false;
+ }
+ else {
+ m_draggedObjectType = GHOST_kDragnDropTypeUnknown;
+ }
+
+ if (needsFree)
+ free(tmpBuffer);
+
+ return data;
+}
+
+bool GHOST_DropTargetX11::GHOST_HandleClientMessage(XEvent *event)
+{
+ Atom dropType;
+ unsigned char *dropBuffer;
+ int dropBufferSize, dropX, dropY;
+
+ if (xdnd_get_drop(m_system->getXDisplay(), event, m_dndTypes, m_dndActions,
+ &dropBuffer, &dropBufferSize, &dropType, &dropX, &dropY))
+ {
+ void *data = getGhostData(dropType, dropBuffer, dropBufferSize);
+
+ if (data)
+ m_system->pushDragDropEvent(GHOST_kEventDraggingDropDone, m_draggedObjectType, m_window, dropX, dropY, data);
+
+ free(dropBuffer);
+
+ m_draggedObjectType = GHOST_kDragnDropTypeUnknown;
+
+ return true;
+ }
+
+ return false;
+}
diff --git a/intern/ghost/intern/GHOST_DropTargetX11.h b/intern/ghost/intern/GHOST_DropTargetX11.h
new file mode 100644
index 00000000000..b9e17dcc93b
--- /dev/null
+++ b/intern/ghost/intern/GHOST_DropTargetX11.h
@@ -0,0 +1,135 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2012 by the Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Sergey Sharybin.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file ghost/intern/GHOST_DropTargetWin32.h
+ * \ingroup GHOST
+ */
+
+#ifndef __GHOST_DROPTARGETX11_H__
+#define __GHOST_DROPTARGETX11_H__
+
+#include <GHOST_Types.h>
+#include "GHOST_WindowX11.h"
+#include "GHOST_SystemX11.h"
+
+#include "xdnd.h"
+
+class GHOST_DropTargetX11
+{
+public:
+ /**
+ * Constructor
+ *
+ * @param window The window to register as drop target.
+ * @param system The associated system.
+ */
+ GHOST_DropTargetX11(GHOST_WindowX11 * window, GHOST_SystemX11 * system);
+
+ /**
+ * Destructor
+ */
+ ~GHOST_DropTargetX11();
+
+ /**
+ * Handler of ClientMessage X11 event
+ */
+ bool GHOST_HandleClientMessage(XEvent *event);
+
+ /**
+ * Get data to pass in event.
+ * It checks the type and calls specific functions for each type.
+ * @param dropType - type of dropped entity.
+ * @param dropBuffer - buffer returned from source application
+ * @param dropBufferSize - size of returned buffer
+ * @return Pointer to data.
+ */
+ void *getGhostData(Atom dropType, unsigned char *dropBuffer, int dropBufferSize);
+
+private:
+ /* Internal helper functions */
+
+ /**
+ * Initiailize XDND and all related X atoms
+ */
+ void Initialize(void);
+
+ /**
+ * Uninitiailize XDND and all related X atoms
+ */
+ void Uninitialize(void);
+
+ /**
+ * Get data to be passed to event from text/uri-list mime type
+ * @param dropBuffer - buffer returned from source application
+ * @param dropBufferSize - size of dropped buffer
+ * @return pointer to newly created GHOST data
+ */
+ void * getURIListGhostData(unsigned char *dropBuffer, int dropBufferSize);
+
+ /**
+ * Decode URL (i.e. converts "file:///a%20b/test" to "file:///a b/test")
+ * @param decodedOut - buffer for decoded URL
+ * @param bufferSize - size of output buffer
+ * @param encodedIn - input encoded buffer to be decoded
+ */
+ void UrlDecode(char *decodedOut, int bufferSize, const char *encodedIn);
+
+ /**
+ * Fully decode file URL (i.e. converts "file:///a%20b/test" to "/a b/test")
+ * @param fileUrl - file path URL to be fully decoded
+ * @return decoded file path (resutl shold be free-d)
+ */
+ char *FileUrlDecode(char *fileUrl);
+
+ /* The associated GHOST_WindowWin32. */
+ GHOST_WindowX11 * m_window;
+ /* The System. */
+ GHOST_SystemX11 * m_system;
+
+ /* Data type of the dragged object */
+ GHOST_TDragnDropTypes m_draggedObjectType;
+
+ /* is dnd stuff initialzied */
+ static bool m_xdndInitialized;
+
+ /* class holding internal stiff of xdnd library */
+ static DndClass m_dndClass;
+
+ /* list of supported types to eb draggeg into */
+ static Atom * m_dndTypes;
+
+ /* list of supported dran'n'drop actions */
+ static Atom * m_dndActions;
+
+ /* List of supported MIME types to be dragged into */
+ static const char *m_dndMimeTypes[];
+
+ /* counter of references to global XDND structures */
+ static int m_refCounter;
+};
+
+#endif // __GHOST_DROPTARGETX11_H__
diff --git a/intern/ghost/intern/GHOST_Event.h b/intern/ghost/intern/GHOST_Event.h
index aa626f8970d..c7f86f2502d 100644
--- a/intern/ghost/intern/GHOST_Event.h
+++ b/intern/ghost/intern/GHOST_Event.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_Event class.
*/
-#ifndef _GHOST_EVENT_H_
-#define _GHOST_EVENT_H_
+#ifndef __GHOST_EVENT_H__
+#define __GHOST_EVENT_H__
#include "GHOST_IEvent.h"
@@ -103,5 +103,5 @@ protected:
GHOST_TEventDataPtr m_data;
};
-#endif // _GHOST_EVENT_H_
+#endif // __GHOST_EVENT_H__
diff --git a/intern/ghost/intern/GHOST_EventButton.h b/intern/ghost/intern/GHOST_EventButton.h
index 3911e2a8bb5..7c869190b16 100644
--- a/intern/ghost/intern/GHOST_EventButton.h
+++ b/intern/ghost/intern/GHOST_EventButton.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_EventButton class.
*/
-#ifndef _GHOST_EVENT_BUTTON_H_
-#define _GHOST_EVENT_BUTTON_H_
+#ifndef __GHOST_EVENTBUTTON_H__
+#define __GHOST_EVENTBUTTON_H__
#include "GHOST_Event.h"
@@ -63,5 +63,5 @@ protected:
GHOST_TEventButtonData m_buttonEventData;
};
-#endif // _GHOST_EVENT_BUTTON_H_
+#endif // __GHOST_EVENTBUTTON_H__
diff --git a/intern/ghost/intern/GHOST_EventCursor.h b/intern/ghost/intern/GHOST_EventCursor.h
index 863538b442f..749bd8a6922 100644
--- a/intern/ghost/intern/GHOST_EventCursor.h
+++ b/intern/ghost/intern/GHOST_EventCursor.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_EventCursor class.
*/
-#ifndef _GHOST_EVENT_CURSOR_H_
-#define _GHOST_EVENT_CURSOR_H_
+#ifndef __GHOST_EVENTCURSOR_H__
+#define __GHOST_EVENTCURSOR_H__
#include "GHOST_Event.h"
@@ -64,5 +64,5 @@ protected:
};
-#endif // _GHOST_EVENT_CURSOR_H_
+#endif // __GHOST_EVENTCURSOR_H__
diff --git a/intern/ghost/intern/GHOST_EventDragnDrop.h b/intern/ghost/intern/GHOST_EventDragnDrop.h
index 330635de50a..4e256a386c0 100644
--- a/intern/ghost/intern/GHOST_EventDragnDrop.h
+++ b/intern/ghost/intern/GHOST_EventDragnDrop.h
@@ -30,8 +30,8 @@
*/
-#ifndef _GHOST_EVENT_DRAGNDROP_H_
-#define _GHOST_EVENT_DRAGNDROP_H_
+#ifndef __GHOST_EVENTDRAGNDROP_H__
+#define __GHOST_EVENTDRAGNDROP_H__
#include "GHOST_Event.h"
extern "C" {
@@ -131,5 +131,5 @@ protected:
GHOST_TEventDragnDropData m_dragnDropEventData;
};
-#endif // _GHOST_EVENT_DRAGNDROP_H_
+#endif // __GHOST_EVENTDRAGNDROP_H__
diff --git a/intern/ghost/intern/GHOST_EventKey.h b/intern/ghost/intern/GHOST_EventKey.h
index a602bd65e5a..ae3ef374431 100644
--- a/intern/ghost/intern/GHOST_EventKey.h
+++ b/intern/ghost/intern/GHOST_EventKey.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_EventKey class.
*/
-#ifndef _GHOST_EVENT_KEY_H_
-#define _GHOST_EVENT_KEY_H_
+#ifndef __GHOST_EVENTKEY_H__
+#define __GHOST_EVENTKEY_H__
#include "GHOST_Event.h"
@@ -88,5 +88,5 @@ protected:
GHOST_TEventKeyData m_keyEventData;
};
-#endif // _GHOST_EVENT_KEY_H_
+#endif // __GHOST_EVENTKEY_H__
diff --git a/intern/ghost/intern/GHOST_EventManager.h b/intern/ghost/intern/GHOST_EventManager.h
index ad2622ae436..bc43a5c5d07 100644
--- a/intern/ghost/intern/GHOST_EventManager.h
+++ b/intern/ghost/intern/GHOST_EventManager.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_EventManager class.
*/
-#ifndef _GHOST_EVENT_MANAGER_H_
-#define _GHOST_EVENT_MANAGER_H_
+#ifndef __GHOST_EVENTMANAGER_H__
+#define __GHOST_EVENTMANAGER_H__
#include <deque>
#include <vector>
@@ -170,5 +170,5 @@ protected:
TConsumerVector m_consumers;
};
-#endif // _GHOST_EVENT_MANAGER_H_
+#endif // __GHOST_EVENTMANAGER_H__
diff --git a/intern/ghost/intern/GHOST_EventNDOF.h b/intern/ghost/intern/GHOST_EventNDOF.h
index fceacce0805..f256f343823 100644
--- a/intern/ghost/intern/GHOST_EventNDOF.h
+++ b/intern/ghost/intern/GHOST_EventNDOF.h
@@ -25,8 +25,8 @@
* Declaration of GHOST_EventManager class.
*/
-#ifndef _GHOST_EVENT_NDOF_H_
-#define _GHOST_EVENT_NDOF_H_
+#ifndef __GHOST_EVENTNDOF_H__
+#define __GHOST_EVENTNDOF_H__
#include "GHOST_Event.h"
@@ -59,4 +59,4 @@ class GHOST_EventNDOFButton : public GHOST_Event
};
-#endif // _GHOST_EVENT_NDOF_H_
+#endif // __GHOST_EVENTNDOF_H__
diff --git a/intern/ghost/intern/GHOST_EventPrinter.h b/intern/ghost/intern/GHOST_EventPrinter.h
index 523bd4e3185..7c2378db301 100644
--- a/intern/ghost/intern/GHOST_EventPrinter.h
+++ b/intern/ghost/intern/GHOST_EventPrinter.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_EventPrinter class.
*/
-#ifndef _GHOST_EVENT_PRINTER_H_
-#define _GHOST_EVENT_PRINTER_H_
+#ifndef __GHOST_EVENTPRINTER_H__
+#define __GHOST_EVENTPRINTER_H__
#include "GHOST_IEventConsumer.h"
@@ -60,5 +60,5 @@ protected:
void getKeyString(GHOST_TKey key, char str[32]) const;
};
-#endif // _GHOST_EVENT_PRINTER_H_
+#endif // __GHOST_EVENTPRINTER_H__
diff --git a/intern/ghost/intern/GHOST_EventString.h b/intern/ghost/intern/GHOST_EventString.h
index e8735fdfbbe..90e914e3b5c 100644
--- a/intern/ghost/intern/GHOST_EventString.h
+++ b/intern/ghost/intern/GHOST_EventString.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_EventString class.
*/
-#ifndef _GHOST_EVENTSTRING_H_
-#define _GHOST_EVENTSTRING_H_
+#ifndef __GHOST_EVENTSTRING_H__
+#define __GHOST_EVENTSTRING_H__
#include "GHOST_Event.h"
@@ -62,5 +62,5 @@ public:
}
};
-#endif // _GHOST_EVENTSTRING_H_
+#endif // __GHOST_EVENTSTRING_H__
diff --git a/intern/ghost/intern/GHOST_EventTrackpad.h b/intern/ghost/intern/GHOST_EventTrackpad.h
index 55517f0a76c..9a3456bbb57 100644
--- a/intern/ghost/intern/GHOST_EventTrackpad.h
+++ b/intern/ghost/intern/GHOST_EventTrackpad.h
@@ -31,8 +31,8 @@
* Declaration of GHOST_EventTrackpad class.
*/
-#ifndef _GHOST_EVENT_TRACKPAD_H_
-#define _GHOST_EVENT_TRACKPAD_H_
+#ifndef __GHOST_EVENTTRACKPAD_H__
+#define __GHOST_EVENTTRACKPAD_H__
#include "GHOST_Event.h"
diff --git a/intern/ghost/intern/GHOST_EventWheel.h b/intern/ghost/intern/GHOST_EventWheel.h
index 2a82ab8a630..1b7468dbc6e 100644
--- a/intern/ghost/intern/GHOST_EventWheel.h
+++ b/intern/ghost/intern/GHOST_EventWheel.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_EventWheel class.
*/
-#ifndef _GHOST_EVENT_WHEEL_H_
-#define _GHOST_EVENT_WHEEL_H_
+#ifndef __GHOST_EVENTWHEEL_H__
+#define __GHOST_EVENTWHEEL_H__
#include "GHOST_Event.h"
@@ -64,5 +64,5 @@ protected:
};
-#endif // _GHOST_EVENT_WHEEL_H_
+#endif // __GHOST_EVENTWHEEL_H__
diff --git a/intern/ghost/intern/GHOST_ModifierKeys.h b/intern/ghost/intern/GHOST_ModifierKeys.h
index 1cb1272290c..0b690323022 100644
--- a/intern/ghost/intern/GHOST_ModifierKeys.h
+++ b/intern/ghost/intern/GHOST_ModifierKeys.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_ModifierKeys struct.
*/
-#ifndef _GHOST_MODIFIER_KEYS_H_
-#define _GHOST_MODIFIER_KEYS_H_
+#ifndef __GHOST_MODIFIERKEYS_H__
+#define __GHOST_MODIFIERKEYS_H__
#include "GHOST_Types.h"
@@ -100,5 +100,5 @@ struct GHOST_ModifierKeys
GHOST_TUns8 m_OS : 1;
};
-#endif // _GHOST_MODIFIER_KEYS_H_
+#endif // __GHOST_MODIFIERKEYS_H__
diff --git a/intern/ghost/intern/GHOST_NDOFManager.h b/intern/ghost/intern/GHOST_NDOFManager.h
index c4e980bb895..9d72691b746 100644
--- a/intern/ghost/intern/GHOST_NDOFManager.h
+++ b/intern/ghost/intern/GHOST_NDOFManager.h
@@ -21,8 +21,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef _GHOST_NDOFMANAGER_H_
-#define _GHOST_NDOFMANAGER_H_
+#ifndef __GHOST_NDOFMANAGER_H__
+#define __GHOST_NDOFMANAGER_H__
#include "GHOST_System.h"
diff --git a/intern/ghost/intern/GHOST_NDOFManagerCocoa.h b/intern/ghost/intern/GHOST_NDOFManagerCocoa.h
index 7a33d8455ce..8d8081ebb5c 100644
--- a/intern/ghost/intern/GHOST_NDOFManagerCocoa.h
+++ b/intern/ghost/intern/GHOST_NDOFManagerCocoa.h
@@ -21,8 +21,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef _GHOST_NDOFMANAGERCOCOA_H_
-#define _GHOST_NDOFMANAGERCOCOA_H_
+#ifndef __GHOST_NDOFMANAGERCOCOA_H__
+#define __GHOST_NDOFMANAGERCOCOA_H__
#ifdef WITH_INPUT_NDOF
diff --git a/intern/ghost/intern/GHOST_NDOFManagerWin32.h b/intern/ghost/intern/GHOST_NDOFManagerWin32.h
index 671147625db..9b5192817eb 100644
--- a/intern/ghost/intern/GHOST_NDOFManagerWin32.h
+++ b/intern/ghost/intern/GHOST_NDOFManagerWin32.h
@@ -22,8 +22,8 @@
*/
-#ifndef _GHOST_NDOFMANAGERWIN32_H_
-#define _GHOST_NDOFMANAGERWIN32_H_
+#ifndef __GHOST_NDOFMANAGERWIN32_H__
+#define __GHOST_NDOFMANAGERWIN32_H__
#ifdef WITH_INPUT_NDOF
diff --git a/intern/ghost/intern/GHOST_NDOFManagerX11.h b/intern/ghost/intern/GHOST_NDOFManagerX11.h
index 6873318f8c5..4629baeb0de 100644
--- a/intern/ghost/intern/GHOST_NDOFManagerX11.h
+++ b/intern/ghost/intern/GHOST_NDOFManagerX11.h
@@ -21,8 +21,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef _GHOST_NDOFMANAGERX11_H_
-#define _GHOST_NDOFMANAGERX11_H_
+#ifndef __GHOST_NDOFMANAGERX11_H__
+#define __GHOST_NDOFMANAGERX11_H__
#ifdef WITH_INPUT_NDOF
diff --git a/intern/ghost/intern/GHOST_System.h b/intern/ghost/intern/GHOST_System.h
index 0bb0387a287..de474fe07a5 100644
--- a/intern/ghost/intern/GHOST_System.h
+++ b/intern/ghost/intern/GHOST_System.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_System class.
*/
-#ifndef _GHOST_SYSTEM_H_
-#define _GHOST_SYSTEM_H_
+#ifndef __GHOST_SYSTEM_H__
+#define __GHOST_SYSTEM_H__
#include "GHOST_ISystem.h"
@@ -367,5 +367,5 @@ inline GHOST_NDOFManager* GHOST_System::getNDOFManager() const
}
#endif
-#endif // _GHOST_SYSTEM_H_
+#endif // __GHOST_SYSTEM_H__
diff --git a/intern/ghost/intern/GHOST_SystemCarbon.h b/intern/ghost/intern/GHOST_SystemCarbon.h
index 1f51b07c7d0..cda09480788 100644
--- a/intern/ghost/intern/GHOST_SystemCarbon.h
+++ b/intern/ghost/intern/GHOST_SystemCarbon.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_SystemCarbon class.
*/
-#ifndef _GHOST_SYSTEM_CARBON_H_
-#define _GHOST_SYSTEM_CARBON_H_
+#ifndef __GHOST_SYSTEMCARBON_H__
+#define __GHOST_SYSTEMCARBON_H__
#ifndef __APPLE__
#error Apple OSX only!
@@ -285,5 +285,5 @@ protected:
bool m_ignoreWindowSizedMessages;
};
-#endif // _GHOST_SYSTEM_CARBON_H_
+#endif // __GHOST_SYSTEMCARBON_H__
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.h b/intern/ghost/intern/GHOST_SystemCocoa.h
index 581535e82b8..2220955c270 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.h
+++ b/intern/ghost/intern/GHOST_SystemCocoa.h
@@ -31,8 +31,8 @@
* Declaration of GHOST_SystemCocoa class.
*/
-#ifndef _GHOST_SYSTEM_COCOA_H_
-#define _GHOST_SYSTEM_COCOA_H_
+#ifndef __GHOST_SYSTEMCOCOA_H__
+#define __GHOST_SYSTEMCOCOA_H__
#ifndef __APPLE__
#error Apple OSX only!
@@ -300,5 +300,5 @@ protected:
bool m_isGestureInProgress;
};
-#endif // _GHOST_SYSTEM_COCOA_H_
+#endif // __GHOST_SYSTEMCOCOA_H__
diff --git a/intern/ghost/intern/GHOST_SystemNULL.h b/intern/ghost/intern/GHOST_SystemNULL.h
index f89eb77277b..be16a8286d5 100644
--- a/intern/ghost/intern/GHOST_SystemNULL.h
+++ b/intern/ghost/intern/GHOST_SystemNULL.h
@@ -25,8 +25,8 @@
* Declaration of GHOST_SystemNULL class.
*/
-#ifndef _GHOST_SYSTEM_NULL_H_
-#define _GHOST_SYSTEM_NULL_H_
+#ifndef __GHOST_SYSTEMNULL_H__
+#define __GHOST_SYSTEMNULL_H__
#include "GHOST_System.h"
#include "../GHOST_Types.h"
diff --git a/intern/ghost/intern/GHOST_SystemPaths.h b/intern/ghost/intern/GHOST_SystemPaths.h
index 739fd4edfaf..472d6369282 100644
--- a/intern/ghost/intern/GHOST_SystemPaths.h
+++ b/intern/ghost/intern/GHOST_SystemPaths.h
@@ -28,8 +28,8 @@
* \ingroup GHOST
*/
-#ifndef _GHOST_SYSTEMPATHS_H_
-#define _GHOST_SYSTEMPATHS_H_
+#ifndef __GHOST_SYSTEMPATHS_H__
+#define __GHOST_SYSTEMPATHS_H__
#include "GHOST_ISystemPaths.h"
diff --git a/intern/ghost/intern/GHOST_SystemPathsCarbon.h b/intern/ghost/intern/GHOST_SystemPathsCarbon.h
index f660148cd35..4a1f68e9ba7 100644
--- a/intern/ghost/intern/GHOST_SystemPathsCarbon.h
+++ b/intern/ghost/intern/GHOST_SystemPathsCarbon.h
@@ -29,8 +29,8 @@
*/
-#ifndef _GHOST_SYSTEM_PATHS_CARBON_H_
-#define _GHOST_SYSTEM_PATHS_CARBON_H_
+#ifndef __GHOST_SYSTEMPATHSCARBON_H__
+#define __GHOST_SYSTEMPATHSCARBON_H__
#ifndef __APPLE__
#error Apple OSX only!
@@ -84,7 +84,4 @@ public:
void addToSystemRecentFiles(const char* filename) const;
};
-#endif // _GHOST_SYSTEM_CARBON_H_
-
-
-
+#endif // __GHOST_SYSTEMPATHSCARBON_H__
diff --git a/intern/ghost/intern/GHOST_SystemPathsCocoa.h b/intern/ghost/intern/GHOST_SystemPathsCocoa.h
index 2b86659c116..1936d705945 100644
--- a/intern/ghost/intern/GHOST_SystemPathsCocoa.h
+++ b/intern/ghost/intern/GHOST_SystemPathsCocoa.h
@@ -29,8 +29,8 @@
*/
-#ifndef _GHOST_SYSTEM_PATHS_COCOA_H_
-#define _GHOST_SYSTEM_PATHS_COCOA_H_
+#ifndef __GHOST_SYSTEMPATHSCOCOA_H__
+#define __GHOST_SYSTEMPATHSCOCOA_H__
#ifndef __APPLE__
#error Apple OSX only!
@@ -78,5 +78,4 @@ public:
void addToSystemRecentFiles(const char* filename) const;
};
-#endif // _GHOST_SYSTEM_COCOA_H_
-
+#endif // __GHOST_SYSTEMPATHSCOCOA_H__
diff --git a/intern/ghost/intern/GHOST_SystemPathsWin32.h b/intern/ghost/intern/GHOST_SystemPathsWin32.h
index dd875d4abea..a56a2e07b96 100644
--- a/intern/ghost/intern/GHOST_SystemPathsWin32.h
+++ b/intern/ghost/intern/GHOST_SystemPathsWin32.h
@@ -30,8 +30,8 @@
*/
-#ifndef _GHOST_SYSTEM_PATHS_WIN32_H_
-#define _GHOST_SYSTEM_PATHS_WIN32_H_
+#ifndef __GHOST_SYSTEMPATHSWIN32_H__
+#define __GHOST_SYSTEMPATHSWIN32_H__
#ifndef WIN32
#error WIN32 only!
@@ -88,5 +88,5 @@ public:
void addToSystemRecentFiles(const char* filename) const;
};
-#endif // _GHOST_SYSTEM_PATHS_WIN32_H_
+#endif // __GHOST_SYSTEMPATHSWIN32_H__
diff --git a/intern/ghost/intern/GHOST_SystemPathsX11.h b/intern/ghost/intern/GHOST_SystemPathsX11.h
index a0a1d28a253..d05cab5de75 100644
--- a/intern/ghost/intern/GHOST_SystemPathsX11.h
+++ b/intern/ghost/intern/GHOST_SystemPathsX11.h
@@ -29,8 +29,8 @@
*/
-#ifndef _GHOST_SYSTEM_PATHS_X11_H_
-#define _GHOST_SYSTEM_PATHS_X11_H_
+#ifndef __GHOST_SYSTEMPATHSX11_H__
+#define __GHOST_SYSTEMPATHSX11_H__
#include "GHOST_SystemPaths.h"
#include "../GHOST_Types.h"
diff --git a/intern/ghost/intern/GHOST_SystemSDL.h b/intern/ghost/intern/GHOST_SystemSDL.h
index 51bca331ba4..e7700649140 100644
--- a/intern/ghost/intern/GHOST_SystemSDL.h
+++ b/intern/ghost/intern/GHOST_SystemSDL.h
@@ -25,8 +25,8 @@
* Declaration of GHOST_SystemSDL class.
*/
-#ifndef _GHOST_SYSTEM_SDL_H_
-#define _GHOST_SYSTEM_SDL_H_
+#ifndef __GHOST_SYSTEMSDL_H__
+#define __GHOST_SYSTEMSDL_H__
#include "GHOST_System.h"
#include "../GHOST_Types.h"
diff --git a/intern/ghost/intern/GHOST_SystemWin32.h b/intern/ghost/intern/GHOST_SystemWin32.h
index 1f40cdd854f..43387f68349 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.h
+++ b/intern/ghost/intern/GHOST_SystemWin32.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_SystemWin32 class.
*/
-#ifndef _GHOST_SYSTEM_WIN32_H_
-#define _GHOST_SYSTEM_WIN32_H_
+#ifndef __GHOST_SYSTEMWIN32_H__
+#define __GHOST_SYSTEMWIN32_H__
#ifndef WIN32
#error WIN32 only!
@@ -395,4 +395,4 @@ inline void GHOST_SystemWin32::handleKeyboardChange(void)
}
}
}
-#endif // _GHOST_SYSTEM_WIN32_H_
+#endif // __GHOST_SYSTEMWIN32_H__
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index 22c16009591..857d9e79e57 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -42,10 +42,15 @@
#include "GHOST_EventButton.h"
#include "GHOST_EventWheel.h"
#include "GHOST_DisplayManagerX11.h"
+#include "GHOST_EventDragnDrop.h"
#ifdef WITH_INPUT_NDOF
#include "GHOST_NDOFManagerX11.h"
#endif
+#ifdef WITH_XDND
+#include "GHOST_DropTargetX11.h"
+#endif
+
#include "GHOST_Debug.h"
#include <X11/Xatom.h>
@@ -709,8 +714,16 @@ GHOST_SystemX11::processEvent(XEvent *xe)
}
}
} else {
+#ifdef WITH_XDND
+ /* try to handle drag event (if there's no such events, GHOST_HandleClientMessage will return zero) */
+ if (window->getDropTarget()->GHOST_HandleClientMessage(xe) == false) {
+ /* Unknown client message, ignore */
+ }
+#else
/* Unknown client message, ignore */
+#endif
}
+
break;
}
@@ -1478,3 +1491,19 @@ void GHOST_SystemX11::putClipboard(GHOST_TInt8 *buffer, bool selection) const
fprintf(stderr, "failed to own primary\n");
}
}
+
+#ifdef WITH_XDND
+GHOST_TSuccess GHOST_SystemX11::pushDragDropEvent(GHOST_TEventType eventType,
+ GHOST_TDragnDropTypes draggedObjectType,
+ GHOST_IWindow* window,
+ int mouseX, int mouseY,
+ void* data)
+{
+ GHOST_SystemX11* system = ((GHOST_SystemX11*)getSystem());
+ return system->pushEvent(new GHOST_EventDragnDrop(system->getMilliSeconds(),
+ eventType,
+ draggedObjectType,
+ window,mouseX,mouseY,data)
+ );
+}
+#endif
diff --git a/intern/ghost/intern/GHOST_SystemX11.h b/intern/ghost/intern/GHOST_SystemX11.h
index 73d9c95e273..62f5ba341d4 100644
--- a/intern/ghost/intern/GHOST_SystemX11.h
+++ b/intern/ghost/intern/GHOST_SystemX11.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_SystemX11 class.
*/
-#ifndef _GHOST_SYSTEM_X11_H_
-#define _GHOST_SYSTEM_X11_H_
+#ifndef __GHOST_SYSTEMX11_H__
+#define __GHOST_SYSTEMX11_H__
#include <X11/Xlib.h>
#include <GL/glx.h>
@@ -235,6 +235,20 @@ public:
*/
void putClipboard(GHOST_TInt8 *buffer, bool selection) const;
+#if WITH_XDND
+ /**
+ * Creates a drag'n'drop event and pushes it immediately onto the event queue.
+ * Called by GHOST_DropTargetX11 class.
+ * @param eventType The type of drag'n'drop event
+ * @param draggedObjectType The type object concerned (currently array of file names, string, ?bitmap)
+ * @param mouseX x mouse coordinate (in window coordinates)
+ * @param mouseY y mouse coordinate
+ * @param window The window on which the event occurred
+ * @return Indication whether the event was handled.
+ */
+ static GHOST_TSuccess pushDragDropEvent(GHOST_TEventType eventType, GHOST_TDragnDropTypes draggedObjectType,GHOST_IWindow* window, int mouseX, int mouseY, void* data);
+#endif
+
/**
* @see GHOST_ISystem
*/
diff --git a/intern/ghost/intern/GHOST_TaskbarWin32.h b/intern/ghost/intern/GHOST_TaskbarWin32.h
index 8f301edce31..a5d6fdc745f 100644
--- a/intern/ghost/intern/GHOST_TaskbarWin32.h
+++ b/intern/ghost/intern/GHOST_TaskbarWin32.h
@@ -1,8 +1,8 @@
/** \file ghost/intern/GHOST_TaskbarWin32.h
* \ingroup GHOST
*/
-#ifndef GHOST_TASKBARWIN32_H_
-#define GHOST_TASKBARWIN32_H_
+#ifndef __GHOST_TASKBARWIN32_H__
+#define __GHOST_TASKBARWIN32_H__
#ifndef WIN32
#error WIN32 only!
@@ -69,4 +69,4 @@ typedef enum TBPFLAG {TBPF_NOPROGRESS = 0, TBPF_INDETERMINATE = 0x1, TBPF_NORMA
};
#endif /* ITaskbarList3 */
-#endif /*GHOST_TASKBARWIN32_H_*/
+#endif /*__GHOST_TASKBARWIN32_H__*/
diff --git a/intern/ghost/intern/GHOST_TimerManager.h b/intern/ghost/intern/GHOST_TimerManager.h
index f7d1726905e..ce4983ca105 100644
--- a/intern/ghost/intern/GHOST_TimerManager.h
+++ b/intern/ghost/intern/GHOST_TimerManager.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_TimerManager class.
*/
-#ifndef _GHOST_TIMER_MANAGER_H_
-#define _GHOST_TIMER_MANAGER_H_
+#ifndef __GHOST_TIMERMANAGER_H__
+#define __GHOST_TIMERMANAGER_H__
#include <vector>
@@ -121,5 +121,5 @@ protected:
TTimerVector m_timers;
};
-#endif // _GHOST_TIMER_MANAGER_H_
+#endif // __GHOST_TIMERMANAGER_H__
diff --git a/intern/ghost/intern/GHOST_TimerTask.h b/intern/ghost/intern/GHOST_TimerTask.h
index ac86d6c1ce6..e15082ac1ba 100644
--- a/intern/ghost/intern/GHOST_TimerTask.h
+++ b/intern/ghost/intern/GHOST_TimerTask.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_TimerTask class.
*/
-#ifndef _GHOST_TIMER_TASK_H_
-#define _GHOST_TIMER_TASK_H_
+#ifndef __GHOST_TIMERTASK_H__
+#define __GHOST_TIMERTASK_H__
#include "GHOST_ITimerTask.h"
@@ -192,5 +192,5 @@ protected:
GHOST_TUns32 m_auxData;
};
-#endif // _GHOST_TIMER_TASK_H_
+#endif // __GHOST_TIMERTASK_H__
diff --git a/intern/ghost/intern/GHOST_Window.h b/intern/ghost/intern/GHOST_Window.h
index 646097d42c4..323e0fa3418 100644
--- a/intern/ghost/intern/GHOST_Window.h
+++ b/intern/ghost/intern/GHOST_Window.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_Window class.
*/
-#ifndef _GHOST_WINDOW_H_
-#define _GHOST_WINDOW_H_
+#ifndef __GHOST_WINDOW_H__
+#define __GHOST_WINDOW_H__
#include "GHOST_IWindow.h"
diff --git a/intern/ghost/intern/GHOST_WindowCarbon.h b/intern/ghost/intern/GHOST_WindowCarbon.h
index 331e228a663..2c1c827510a 100644
--- a/intern/ghost/intern/GHOST_WindowCarbon.h
+++ b/intern/ghost/intern/GHOST_WindowCarbon.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_WindowCarbon class.
*/
-#ifndef _GHOST_WINDOW_CARBON_H_
-#define _GHOST_WINDOW_CARBON_H_
+#ifndef __GHOST_WINDOWCARBON_H__
+#define __GHOST_WINDOWCARBON_H__
#ifndef __APPLE__
#error Apple OSX only!
@@ -308,5 +308,5 @@ protected:
#endif // GHOST_DRAW_CARBON_GUTTER
};
-#endif // _GHOST_WINDOW_CARBON_H_
+#endif // __GHOST_WINDOWCARBON_H__
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.h b/intern/ghost/intern/GHOST_WindowCocoa.h
index 46bded630ff..fec97c2af97 100644
--- a/intern/ghost/intern/GHOST_WindowCocoa.h
+++ b/intern/ghost/intern/GHOST_WindowCocoa.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_WindowCocoa class.
*/
-#ifndef _GHOST_WINDOW_COCOA_H_
-#define _GHOST_WINDOW_COCOA_H_
+#ifndef __GHOST_WINDOWCOCOA_H__
+#define __GHOST_WINDOWCOCOA_H__
#ifndef __APPLE__
#error Apple OSX only!
@@ -325,5 +325,5 @@ protected:
GHOST_TabletData m_tablet;
};
-#endif // _GHOST_WINDOW_COCOA_H_
+#endif // __GHOST_WINDOWCOCOA_H__
diff --git a/intern/ghost/intern/GHOST_WindowManager.h b/intern/ghost/intern/GHOST_WindowManager.h
index 12999badac5..cf27a3bde49 100644
--- a/intern/ghost/intern/GHOST_WindowManager.h
+++ b/intern/ghost/intern/GHOST_WindowManager.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_WindowManager class.
*/
-#ifndef _GHOST_WINDOW_MANAGER_H_
-#define _GHOST_WINDOW_MANAGER_H_
+#ifndef __GHOST_WINDOWMANAGER_H__
+#define __GHOST_WINDOWMANAGER_H__
#include <vector>
@@ -169,5 +169,5 @@ public:
};
-#endif // _GHOST_WINDOW_MANAGER_H_
+#endif // __GHOST_WINDOWMANAGER_H__
diff --git a/intern/ghost/intern/GHOST_WindowNULL.h b/intern/ghost/intern/GHOST_WindowNULL.h
index f65b719a385..49f6d14552d 100644
--- a/intern/ghost/intern/GHOST_WindowNULL.h
+++ b/intern/ghost/intern/GHOST_WindowNULL.h
@@ -25,8 +25,8 @@
* Declaration of GHOST_WindowNULL class.
*/
-#ifndef _GHOST_WINDOWNULL_H_
-#define _GHOST_WINDOWNULL_H_
+#ifndef __GHOST_WINDOWNULL_H__
+#define __GHOST_WINDOWNULL_H__
#include "GHOST_Window.h"
@@ -92,4 +92,4 @@ private :
};
-#endif // _GHOST_WINDOWNULL_H_
+#endif // __GHOST_WINDOWNULL_H__
diff --git a/intern/ghost/intern/GHOST_WindowSDL.h b/intern/ghost/intern/GHOST_WindowSDL.h
index a8a130f0481..724c59de0b9 100644
--- a/intern/ghost/intern/GHOST_WindowSDL.h
+++ b/intern/ghost/intern/GHOST_WindowSDL.h
@@ -25,8 +25,8 @@
* Declaration of GHOST_WindowSDL class.
*/
-#ifndef _GHOST_WINDOWSDL_H_
-#define _GHOST_WINDOWSDL_H_
+#ifndef __GHOST_WINDOWSDL_H__
+#define __GHOST_WINDOWSDL_H__
#include "GHOST_Window.h"
#include "GHOST_SystemSDL.h"
@@ -163,4 +163,4 @@ protected:
};
-#endif // _GHOST_WINDOWSDL_H_
+#endif // __GHOST_WINDOWSDL_H__
diff --git a/intern/ghost/intern/GHOST_WindowWin32.h b/intern/ghost/intern/GHOST_WindowWin32.h
index 190966ee485..6eb17affdbf 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.h
+++ b/intern/ghost/intern/GHOST_WindowWin32.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_WindowWin32 class.
*/
-#ifndef _GHOST_WINDOW_WIN32_H_
-#define _GHOST_WINDOW_WIN32_H_
+#ifndef __GHOST_WINDOWWIN32_H__
+#define __GHOST_WINDOWWIN32_H__
#ifndef WIN32
#error WIN32 only!
@@ -390,4 +390,4 @@ protected:
GHOST_TEmbedderWindowID m_parentWindowHwnd;
};
-#endif // _GHOST_WINDOW_WIN32_H_
+#endif // __GHOST_WINDOWWIN32_H__
diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp
index 71e3f7b3340..3ceafcab3ce 100644
--- a/intern/ghost/intern/GHOST_WindowX11.cpp
+++ b/intern/ghost/intern/GHOST_WindowX11.cpp
@@ -35,6 +35,10 @@
#include "STR_String.h"
#include "GHOST_Debug.h"
+#ifdef WITH_XDND
+#include "GHOST_DropTargetX11.h"
+#endif
+
// For standard X11 cursors
#include <X11/cursorfont.h>
#include <X11/Xatom.h>
@@ -325,7 +329,13 @@ GHOST_WindowX11(
XSelectInput(m_display , parentWindow, SubstructureNotifyMask);
}
-
+
+#ifdef WITH_XDND
+ /* initialize drop target for newly created window */
+ m_dropTarget = new GHOST_DropTargetX11(this, m_system);
+ GHOST_PRINT("Set drop target\n");
+#endif
+
/*
* One of the problem with WM-spec is that can't set a property
* to a window that isn't mapped. That is why we can't "just
@@ -1318,6 +1328,9 @@ GHOST_WindowX11::
}
#endif
+#ifdef WITH_XDND
+ delete m_dropTarget;
+#endif
XDestroyWindow(m_display, m_window);
XFree(m_visual);
diff --git a/intern/ghost/intern/GHOST_WindowX11.h b/intern/ghost/intern/GHOST_WindowX11.h
index f1146db50f8..5430c5916fc 100644
--- a/intern/ghost/intern/GHOST_WindowX11.h
+++ b/intern/ghost/intern/GHOST_WindowX11.h
@@ -30,8 +30,8 @@
* Declaration of GHOST_WindowX11 class.
*/
-#ifndef _GHOST_WINDOWX11_H_
-#define _GHOST_WINDOWX11_H_
+#ifndef __GHOST_WINDOWX11_H__
+#define __GHOST_WINDOWX11_H__
#include "GHOST_Window.h"
#include <X11/Xlib.h>
@@ -46,6 +46,10 @@
class STR_String;
class GHOST_SystemX11;
+#ifdef WITH_XDND
+class GHOST_DropTargetX11;
+#endif
+
/**
* X11 implementation of GHOST_IWindow.
* Dimensions are given in screen coordinates that are relative to the upper-left corner of the screen.
@@ -224,6 +228,11 @@ public:
XIC getX11_XIC() { return m_xic; }
#endif
+#ifdef WITH_XDND
+ GHOST_DropTargetX11* getDropTarget()
+ { return m_dropTarget; }
+#endif
+
/*
* Need this in case that we want start the window
* in FullScree or Maximized state.
@@ -361,6 +370,10 @@ private :
/** Cache of XC_* ID's to XCursor structures */
std::map<unsigned int, Cursor> m_standard_cursors;
+#ifdef WITH_XDND
+ GHOST_DropTargetX11 * m_dropTarget;
+#endif
+
#ifdef WITH_X11_XINPUT
/* Tablet devices */
XTablet m_xtablet;
@@ -384,4 +397,4 @@ private :
};
-#endif // _GHOST_WINDOWX11_H_
+#endif // __GHOST_WINDOWX11_H__
diff --git a/intern/guardedalloc/MEM_guardedalloc.h b/intern/guardedalloc/MEM_guardedalloc.h
index 7285843aece..83d6549218a 100644
--- a/intern/guardedalloc/MEM_guardedalloc.h
+++ b/intern/guardedalloc/MEM_guardedalloc.h
@@ -57,8 +57,8 @@
* See \ref MEM_guardedalloc.h
*/
-#ifndef MEM_MALLOCN_H
-#define MEM_MALLOCN_H
+#ifndef __MEM_GUARDEDALLOC_H__
+#define __MEM_GUARDEDALLOC_H__
#include <stdio.h> /* needed for FILE* */
#include "MEM_sys_types.h" /* needed for uintptr_t */
diff --git a/intern/guardedalloc/MEM_sys_types.h b/intern/guardedalloc/MEM_sys_types.h
index 764d7c6cfa2..b7e17154df0 100644
--- a/intern/guardedalloc/MEM_sys_types.h
+++ b/intern/guardedalloc/MEM_sys_types.h
@@ -47,8 +47,8 @@
// doxygen would get a conflict
*/
-#ifndef MEM_SYS_TYPES_H
-#define MEM_SYS_TYPES_H
+#ifndef __MEM_SYS_TYPES_H__
+#define __MEM_SYS_TYPES_H__
#ifdef __cplusplus
extern "C" {
@@ -141,5 +141,5 @@ unsigned long __attribute__((__stdcall__)) htonl(unsigned long);
}
#endif
-#endif /* MEM_SYS_TYPES_H */
+#endif /* __MEM_SYS_TYPES_H__ */
diff --git a/intern/guardedalloc/mmap_win.h b/intern/guardedalloc/mmap_win.h
index fa8d3b24815..fdbb249a932 100644
--- a/intern/guardedalloc/mmap_win.h
+++ b/intern/guardedalloc/mmap_win.h
@@ -30,8 +30,8 @@
* \author Andrea Weikert
*/
-#ifndef MMAP_WIN_H
-#define MMAP_WIN_H
+#ifndef __MMAP_WIN_H__
+#define __MMAP_WIN_H__
#define PROT_NONE 0
#define PROT_READ 1
diff --git a/intern/iksolver/extern/IK_solver.h b/intern/iksolver/extern/IK_solver.h
index 179bd4a95b1..7f780a0a17f 100644
--- a/intern/iksolver/extern/IK_solver.h
+++ b/intern/iksolver/extern/IK_solver.h
@@ -65,8 +65,8 @@
* This module only depends on Moto.
*/
-#ifndef NAN_INCLUDED_IK_solver_h
-#define NAN_INCLUDED_IK_solver_h
+#ifndef __IK_SOLVER_H__
+#define __IK_SOLVER_H__
#ifdef __cplusplus
extern "C" {
@@ -168,5 +168,5 @@ int IK_Solve(IK_Solver *solver, float tolerance, int max_iterations);
}
#endif
-#endif // NAN_INCLUDED_IK_solver_h
+#endif // __IK_SOLVER_H__
diff --git a/intern/iksolver/intern/IK_QJacobian.h b/intern/iksolver/intern/IK_QJacobian.h
index c975989309b..b4b5a0402e6 100644
--- a/intern/iksolver/intern/IK_QJacobian.h
+++ b/intern/iksolver/intern/IK_QJacobian.h
@@ -32,9 +32,9 @@
*/
-#ifndef NAN_INCLUDED_IK_QJacobian_h
+#ifndef __IK_QJACOBIAN_H__
-#define NAN_INCLUDED_IK_QJacobian_h
+#define __IK_QJACOBIAN_H__
#include "TNT/cmat.h"
#include <vector>
diff --git a/intern/iksolver/intern/IK_QJacobianSolver.h b/intern/iksolver/intern/IK_QJacobianSolver.h
index 56d38147e3c..cfcd2849fb2 100644
--- a/intern/iksolver/intern/IK_QJacobianSolver.h
+++ b/intern/iksolver/intern/IK_QJacobianSolver.h
@@ -31,9 +31,9 @@
*/
-#ifndef NAN_INCLUDED_IK_QJacobianSolver_h
+#ifndef __IK_QJACOBIANSOLVER_H__
-#define NAN_INCLUDED_IK_QJacobianSolver_h
+#define __IK_QJACOBIANSOLVER_H__
/**
* @author Laurence Bourn
diff --git a/intern/iksolver/intern/IK_QSegment.h b/intern/iksolver/intern/IK_QSegment.h
index 9037f8750f4..68d40829137 100644
--- a/intern/iksolver/intern/IK_QSegment.h
+++ b/intern/iksolver/intern/IK_QSegment.h
@@ -31,8 +31,8 @@
*/
-#ifndef NAN_INCLUDED_IK_QSegment_h
-#define NAN_INCLUDED_IK_QSegment_h
+#ifndef __IK_QSEGMENT_H__
+#define __IK_QSEGMENT_H__
#include "MT_Vector3.h"
#include "MT_Transform.h"
diff --git a/intern/iksolver/intern/IK_QTask.h b/intern/iksolver/intern/IK_QTask.h
index 379866de8f7..3d968cdfe38 100644
--- a/intern/iksolver/intern/IK_QTask.h
+++ b/intern/iksolver/intern/IK_QTask.h
@@ -31,8 +31,8 @@
*/
-#ifndef NAN_INCLUDED_IK_QTask_h
-#define NAN_INCLUDED_IK_QTask_h
+#ifndef __IK_QTASK_H__
+#define __IK_QTASK_H__
#include "MT_Vector3.h"
#include "MT_Transform.h"
diff --git a/intern/iksolver/test/ik_glut_test/common/GlutDrawer.h b/intern/iksolver/test/ik_glut_test/common/GlutDrawer.h
index 4dfcfa1769e..05d2424dfea 100644
--- a/intern/iksolver/test/ik_glut_test/common/GlutDrawer.h
+++ b/intern/iksolver/test/ik_glut_test/common/GlutDrawer.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef NAN_INCLUDED_GlutDrawer
-#define NAN_INCLUDED_GlutDrawer
+#ifndef __GLUTDRAWER_H__
+#define __GLUTDRAWER_H__
#include "MEM_NonCopyable.h"
#include "MEM_SmartPtr.h"
diff --git a/intern/iksolver/test/ik_glut_test/common/GlutKeyboardManager.h b/intern/iksolver/test/ik_glut_test/common/GlutKeyboardManager.h
index 61cd7a25ac0..ea39b6835f6 100644
--- a/intern/iksolver/test/ik_glut_test/common/GlutKeyboardManager.h
+++ b/intern/iksolver/test/ik_glut_test/common/GlutKeyboardManager.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef NAN_INCLUDED_GlutKeyboardManager
-#define NAN_INCLUDED_GlutKeyboardManager
+#ifndef __GLUTKEYBOARDMANAGER_H__
+#define __GLUTKEYBOARDMANAGER_H__
#include "MEM_NonCopyable.h"
#include "MEM_SmartPtr.h"
diff --git a/intern/iksolver/test/ik_glut_test/common/GlutMouseManager.h b/intern/iksolver/test/ik_glut_test/common/GlutMouseManager.h
index 50fb37c267e..4a2344b7c74 100644
--- a/intern/iksolver/test/ik_glut_test/common/GlutMouseManager.h
+++ b/intern/iksolver/test/ik_glut_test/common/GlutMouseManager.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef NAN_INCLUDED_GlutMouseManager_h
-#define NAN_INCLUDED_GlutMouseManager_h
+#ifndef __GLUTMOUSEMANAGER_H__
+#define __GLUTMOUSEMANAGER_H__
#include "MEM_NonCopyable.h"
#include "MEM_SmartPtr.h"
diff --git a/intern/iksolver/test/ik_glut_test/intern/ChainDrawer.h b/intern/iksolver/test/ik_glut_test/intern/ChainDrawer.h
index 5975eaa7c65..f2863806112 100644
--- a/intern/iksolver/test/ik_glut_test/intern/ChainDrawer.h
+++ b/intern/iksolver/test/ik_glut_test/intern/ChainDrawer.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef NAN_INCLUDED_ChainDrawer_h
-#define NAN_INCLUDED_ChainDrawer_h
+#ifndef __CHAINDRAWER_H__
+#define __CHAINDRAWER_H__
#include "../common/GlutDrawer.h"
#include "MyGlutMouseHandler.h"
diff --git a/intern/iksolver/test/ik_glut_test/intern/MyGlutKeyHandler.h b/intern/iksolver/test/ik_glut_test/intern/MyGlutKeyHandler.h
index 2ac9b25d13a..621e0d32869 100644
--- a/intern/iksolver/test/ik_glut_test/intern/MyGlutKeyHandler.h
+++ b/intern/iksolver/test/ik_glut_test/intern/MyGlutKeyHandler.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef NAN_INCLUDED_MyGlutKeyHandler_h
-#define NAN_INCLUDED_MyGlutKeyHandler_h
+#ifndef __MYGLUTKEYHANDLER_H__
+#define __MYGLUTKEYHANDLER_H__
#include "../common/GlutKeyboardManager.h"
diff --git a/intern/iksolver/test/ik_glut_test/intern/MyGlutMouseHandler.h b/intern/iksolver/test/ik_glut_test/intern/MyGlutMouseHandler.h
index 5d94db44698..205ce38ac23 100644
--- a/intern/iksolver/test/ik_glut_test/intern/MyGlutMouseHandler.h
+++ b/intern/iksolver/test/ik_glut_test/intern/MyGlutMouseHandler.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef NAN_INCLUDED_MyGlutMouseHandler_h
-#define NAN_INCLUDED_MyGlutMouseHandler_h
+#ifndef __MYGLUTMOUSEHANDLER_H__
+#define __MYGLUTMOUSEHANDLER_H__
#include "../common/GlutMouseManager.h"
#include <GL/glut.h>
diff --git a/intern/memutil/MEM_Allocator.h b/intern/memutil/MEM_Allocator.h
index 99d0b5177f3..9541604b680 100644
--- a/intern/memutil/MEM_Allocator.h
+++ b/intern/memutil/MEM_Allocator.h
@@ -25,8 +25,8 @@
*/
-#ifndef MEM_ALLOCATOR_H
-#define MEM_ALLOCATOR_H
+#ifndef __MEM_ALLOCATOR_H__
+#define __MEM_ALLOCATOR_H__
#include <stddef.h>
#include "guardedalloc/MEM_guardedalloc.h"
@@ -89,4 +89,4 @@ struct MEM_Allocator
}
};
-#endif // MEM_ALLOCATOR_H
+#endif // __MEM_ALLOCATOR_H__
diff --git a/intern/memutil/MEM_CacheLimiter.h b/intern/memutil/MEM_CacheLimiter.h
index 94aca280a0e..9a36b67aa2f 100644
--- a/intern/memutil/MEM_CacheLimiter.h
+++ b/intern/memutil/MEM_CacheLimiter.h
@@ -25,8 +25,8 @@
*/
-#ifndef MEM_CACHELIMITER_H
-#define MEM_CACHELIMITER_H
+#ifndef __MEM_CACHELIMITER_H__
+#define __MEM_CACHELIMITER_H__
/**
* @section MEM_CacheLimiter
@@ -63,7 +63,7 @@
template<class T>
class MEM_CacheLimiter;
-#ifndef __MEM_cache_limiter_c_api_h_included__
+#ifndef __MEM_CACHELIMITERC_API_H__
extern "C" {
extern void MEM_CacheLimiter_set_maximum(size_t m);
extern size_t MEM_CacheLimiter_get_maximum();
@@ -201,4 +201,4 @@ private:
MEM_CacheLimiter_DataSize_Func getDataSize;
};
-#endif // MEM_CACHELIMITER_H
+#endif // __MEM_CACHELIMITER_H__
diff --git a/intern/memutil/MEM_CacheLimiterC-Api.h b/intern/memutil/MEM_CacheLimiterC-Api.h
index c8672fa03fd..4ed692fb55f 100644
--- a/intern/memutil/MEM_CacheLimiterC-Api.h
+++ b/intern/memutil/MEM_CacheLimiterC-Api.h
@@ -25,8 +25,8 @@
*/
-#ifndef MEM_CACHELIMITERC_API_H
-#define MEM_CACHELIMITERC_API_H
+#ifndef __MEM_CACHELIMITERC_API_H__
+#define __MEM_CACHELIMITERC_API_H__
#ifdef __cplusplus
extern "C" {
@@ -44,10 +44,10 @@ typedef void(*MEM_CacheLimiter_Destruct_Func)(void*);
/* function used to measure stored data element size */
typedef size_t(*MEM_CacheLimiter_DataSize_Func) (void*);
-#ifndef MEM_CACHELIMITER_H
+#ifndef __MEM_CACHELIMITER_H__
extern void MEM_CacheLimiter_set_maximum(size_t m);
extern int MEM_CacheLimiter_get_maximum(void);
-#endif // MEM_CACHELIMITER_H
+#endif /* __MEM_CACHELIMITER_H__ */
/**
* Create new MEM_CacheLimiter object
* managed objects are destructed with the data_destructor
@@ -145,4 +145,4 @@ extern void * MEM_CacheLimiter_get(MEM_CacheLimiterHandleC * handle);
#endif
-#endif // MEM_CACHELIMITERC_API_H
+#endif // __MEM_CACHELIMITERC_API_H__
diff --git a/intern/memutil/MEM_NonCopyable.h b/intern/memutil/MEM_NonCopyable.h
index 7ddd35d6fc4..9378ea7b69d 100644
--- a/intern/memutil/MEM_NonCopyable.h
+++ b/intern/memutil/MEM_NonCopyable.h
@@ -34,8 +34,8 @@
* Declaration of MEM_NonCopyable class.
*/
-#ifndef NAN_INCLUDED_NonCopyable_h
-#define NAN_INCLUDED_NonCopyable_h
+#ifndef __MEM_NONCOPYABLE_H__
+#define __MEM_NONCOPYABLE_H__
/**
* Simple class that makes sure sub classes cannot
diff --git a/intern/memutil/MEM_RefCountPtr.h b/intern/memutil/MEM_RefCountPtr.h
index 43dbc807ae0..4f475345076 100644
--- a/intern/memutil/MEM_RefCountPtr.h
+++ b/intern/memutil/MEM_RefCountPtr.h
@@ -35,8 +35,8 @@
* @author Laurence
*/
-#ifndef NAN_INCLUDED_MEM_RefCountPtr_h
-#define NAN_INCLUDED_MEM_RefCountPtr_h
+#ifndef __MEM_REFCOUNTPTR_H__
+#define __MEM_REFCOUNTPTR_H__
#include <stdlib.h> // for NULL !
diff --git a/intern/memutil/MEM_RefCounted.h b/intern/memutil/MEM_RefCounted.h
index 0c3a54122f1..9da0103f6a3 100644
--- a/intern/memutil/MEM_RefCounted.h
+++ b/intern/memutil/MEM_RefCounted.h
@@ -34,8 +34,8 @@
* Declaration of MEM_RefCounted class.
*/
-#ifndef MEM_REFCOUNTED_H
-#define MEM_REFCOUNTED_H
+#ifndef __MEM_REFCOUNTED_H__
+#define __MEM_REFCOUNTED_H__
/**
* An object with reference counting.
@@ -112,5 +112,5 @@ inline int MEM_RefCounted::decRef()
return m_refCount;
}
-#endif // MEM_REFCOUNTED_H
+#endif // __MEM_REFCOUNTED_H__
diff --git a/intern/memutil/MEM_RefCountedC-Api.h b/intern/memutil/MEM_RefCountedC-Api.h
index 4b2679cccc2..a611482a991 100644
--- a/intern/memutil/MEM_RefCountedC-Api.h
+++ b/intern/memutil/MEM_RefCountedC-Api.h
@@ -34,8 +34,8 @@
* Interface for C access to functionality relating to shared objects in the foundation library.
*/
-#ifndef MEM_REFCOUNTEDC_API_H
-#define MEM_REFCOUNTEDC_API_H
+#ifndef __MEM_REFCOUNTEDC_API_H__
+#define __MEM_REFCOUNTEDC_API_H__
/** A pointer to a private object. */
typedef struct MEM_TOpaqueObject* MEM_TObjectPtr;
@@ -75,4 +75,4 @@ extern int MEM_RefCountedDecRef(MEM_TRefCountedObjectPtr shared);
}
#endif
-#endif // MEM_REFCOUNTEDC_API_H
+#endif // __MEM_REFCOUNTEDC_API_H__
diff --git a/intern/memutil/MEM_SmartPtr.h b/intern/memutil/MEM_SmartPtr.h
index a2ab273d092..6a0dc1723c4 100644
--- a/intern/memutil/MEM_SmartPtr.h
+++ b/intern/memutil/MEM_SmartPtr.h
@@ -35,8 +35,8 @@
* @author Laurence
*/
-#ifndef NAN_INCLUDED_MEM_SmartPtr_h
-#define NAN_INCLUDED_MEM_SmartPtr_h
+#ifndef __MEM_SMARTPTR_H__
+#define __MEM_SMARTPTR_H__
#include <stdlib.h> // for NULL !
diff --git a/intern/string/STR_HashedString.h b/intern/string/STR_HashedString.h
index cd3b0e2b58f..f56e365bdb3 100644
--- a/intern/string/STR_HashedString.h
+++ b/intern/string/STR_HashedString.h
@@ -37,8 +37,8 @@
* @date November, 14, 2001
*/
-#ifndef __STR_HASHSTRING
-#define __STR_HASHSTRING
+#ifndef __STR_HASHEDSTRING_H__
+#define __STR_HASHEDSTRING_H__
#include "STR_String.h"
@@ -150,5 +150,5 @@ private:
mutable dword m_CachedHash;
};
-#endif //__STR_HASHSTRING
+#endif //__STR_HASHEDSTRING_H__
diff --git a/intern/string/STR_String.h b/intern/string/STR_String.h
index fa08dc3648e..cbf9d0c1b3b 100644
--- a/intern/string/STR_String.h
+++ b/intern/string/STR_String.h
@@ -37,8 +37,8 @@
* @date April, 25, 2001
*/
-#ifndef _STR_String_H_
-#define _STR_String_H_
+#ifndef __STR_STRING_H__
+#define __STR_STRING_H__
#ifndef STR_NO_ASSERTD
#undef assertd
@@ -217,5 +217,5 @@ inline STR_String operator+(rcSTR_String lhs, const char *rhs) { return STR_
inline STR_String operator+(const char *lhs, rcSTR_String rhs) { return STR_String(lhs, strlen(lhs), rhs.ReadPtr(), rhs.Length()); }
-#endif //_STR_String_H_
+#endif //__STR_STRING_H__
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 93cec3326db..87e4738b70e 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -19,6 +19,7 @@
# <pep8 compliant>
import bpy
from bpy.types import Header, Menu, Panel
+from .properties_paint_common import UnifiedPaintPanel
class VIEW3D_HT_header(Header):
@@ -51,6 +52,8 @@ class VIEW3D_HT_header(Header):
elif obj:
if mode_string not in {'PAINT_TEXTURE'}:
sub.menu("VIEW3D_MT_%s" % mode_string.lower())
+ if mode_string in {'SCULPT', 'PAINT_VERTEX', 'PAINT_WEIGHT', 'PAINT_TEXTURE'}:
+ sub.menu("VIEW3D_MT_brush")
else:
sub.menu("VIEW3D_MT_object")
@@ -80,22 +83,23 @@ class VIEW3D_HT_header(Header):
row.prop(toolsettings, "proportional_edit_falloff", text="", icon_only=True)
# Snap
- snap_element = toolsettings.snap_element
- row = layout.row(align=True)
- row.prop(toolsettings, "use_snap", text="")
- row.prop(toolsettings, "snap_element", text="", icon_only=True)
- if snap_element != 'INCREMENT':
- row.prop(toolsettings, "snap_target", text="")
- if obj:
- if obj.mode == 'OBJECT':
- row.prop(toolsettings, "use_snap_align_rotation", text="")
- elif obj.mode == 'EDIT':
- row.prop(toolsettings, "use_snap_self", text="")
-
- if snap_element == 'VOLUME':
- row.prop(toolsettings, "use_snap_peel_object", text="")
- elif snap_element == 'FACE':
- row.prop(toolsettings, "use_snap_project", text="")
+ if not obj or obj.mode not in {'SCULPT', 'VERTEX_PAINT', 'WEIGHT_PAINT', 'TEXTURE_PAINT'}:
+ snap_element = toolsettings.snap_element
+ row = layout.row(align=True)
+ row.prop(toolsettings, "use_snap", text="")
+ row.prop(toolsettings, "snap_element", text="", icon_only=True)
+ if snap_element != 'INCREMENT':
+ row.prop(toolsettings, "snap_target", text="")
+ if obj:
+ if obj.mode == 'OBJECT':
+ row.prop(toolsettings, "use_snap_align_rotation", text="")
+ elif obj.mode == 'EDIT':
+ row.prop(toolsettings, "use_snap_self", text="")
+
+ if snap_element == 'VOLUME':
+ row.prop(toolsettings, "use_snap_peel_object", text="")
+ elif snap_element == 'FACE':
+ row.prop(toolsettings, "use_snap_project", text="")
# OpenGL render
row = layout.row(align=True)
@@ -1013,6 +1017,45 @@ class VIEW3D_MT_object_game(Menu):
layout.operator("object.game_property_clear")
+
+# ********** Brush menu **********
+class VIEW3D_MT_brush(Menu):
+ bl_label = "Brush"
+
+ def draw(self, context):
+ layout = self.layout
+
+ settings = UnifiedPaintPanel.paint_settings(context)
+ brush = settings.brush
+
+ ups = context.tool_settings.unified_paint_settings
+ layout.prop(ups, "use_unified_size", text="Unified Size")
+ layout.prop(ups, "use_unified_strength", text="Unified Strength")
+
+ # skip if no active brush
+ if not brush:
+ return
+
+ # TODO: still missing a lot of brush options here
+
+ # sculpt options
+ if context.sculpt_object:
+
+ sculpt_tool = brush.sculpt_tool
+
+ layout.separator()
+ layout.operator_menu_enum("brush.curve_preset", "shape", text='Curve Preset')
+ layout.separator()
+
+ if sculpt_tool != 'GRAB':
+ layout.prop_menu_enum(brush, "stroke_method")
+
+ if sculpt_tool in {'DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'}:
+ layout.prop_menu_enum(brush, "direction")
+
+ if sculpt_tool == 'LAYER':
+ layout.prop(brush, "use_persistent")
+ layout.operator("sculpt.set_persistent_base")
# ********** Vertex paint menu **********
@@ -1116,7 +1159,6 @@ class VIEW3D_MT_sculpt(Menu):
toolsettings = context.tool_settings
sculpt = toolsettings.sculpt
- brush = toolsettings.sculpt.brush
layout.operator("ed.undo")
layout.operator("ed.redo")
@@ -1130,30 +1172,13 @@ class VIEW3D_MT_sculpt(Menu):
layout.prop(sculpt, "lock_x")
layout.prop(sculpt, "lock_y")
layout.prop(sculpt, "lock_z")
- layout.separator()
- layout.operator_menu_enum("brush.curve_preset", "shape")
- layout.separator()
-
- if brush is not None: # unlikely but can happen
- sculpt_tool = brush.sculpt_tool
-
- if sculpt_tool != 'GRAB':
- layout.prop_menu_enum(brush, "stroke_method")
-
- if sculpt_tool in {'DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'}:
- layout.prop_menu_enum(brush, "direction")
-
- if sculpt_tool == 'LAYER':
- layout.prop(brush, "use_persistent")
- layout.operator("sculpt.set_persistent_base")
layout.separator()
layout.prop(sculpt, "use_threaded", text="Threaded Sculpt")
+ layout.prop(sculpt, "show_low_resolution")
layout.prop(sculpt, "show_brush")
+ layout.prop(sculpt, "use_deform_only")
- # TODO, make available from paint menu!
- layout.prop(toolsettings, "sculpt_paint_use_unified_size", text="Unify Size")
- layout.prop(toolsettings, "sculpt_paint_use_unified_strength", text="Unify Strength")
# ********** Particle menu **********
diff --git a/source/blender/avi/AVI_avi.h b/source/blender/avi/AVI_avi.h
index ea073f79a7e..00c6863f75c 100644
--- a/source/blender/avi/AVI_avi.h
+++ b/source/blender/avi/AVI_avi.h
@@ -50,8 +50,8 @@
*
*/
-#ifndef __AVI_H__
-#define __AVI_H__
+#ifndef __AVI_AVI_H__
+#define __AVI_AVI_H__
#include "MEM_sys_types.h"
#include <stdio.h> /* for FILE */
@@ -305,5 +305,5 @@ AviError AVI_write_frame (AviMovie *movie, int frame_num, ...);
AviError AVI_print_error (AviError error);
void AVI_set_debug (int mode);
-#endif /* __AVI_H__ */
+#endif /* __AVI_AVI_H__ */
diff --git a/source/blender/avi/intern/avi_intern.h b/source/blender/avi/intern/avi_intern.h
index 15307956756..c8d54fe99e9 100644
--- a/source/blender/avi/intern/avi_intern.h
+++ b/source/blender/avi/intern/avi_intern.h
@@ -29,8 +29,8 @@
* \ingroup avi
*/
-#ifndef AVI_INTERN_H
-#define AVI_INTERN_H
+#ifndef __AVI_INTERN_H__
+#define __AVI_INTERN_H__
#include <stdio.h> /* for FILE */
diff --git a/source/blender/avi/intern/endian.h b/source/blender/avi/intern/endian.h
index 7a443fae8df..3229f32cbbd 100644
--- a/source/blender/avi/intern/endian.h
+++ b/source/blender/avi/intern/endian.h
@@ -34,8 +34,8 @@
*/
-#ifndef AVI_ENDIAN_H
-#define AVI_ENDIAN_H
+#ifndef __ENDIAN_H__
+#define __ENDIAN_H__
#include <stdio.h>
#include "AVI_avi.h"
diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h
index a045f47cb40..d7b441e70e1 100644
--- a/source/blender/blenfont/BLF_api.h
+++ b/source/blender/blenfont/BLF_api.h
@@ -29,8 +29,8 @@
*/
-#ifndef BLF_API_H
-#define BLF_API_H
+#ifndef __BLF_API_H__
+#define __BLF_API_H__
struct rctf;
@@ -204,4 +204,4 @@ void BLF_dir_free(char **dirs, int count);
extern int blf_mono_font;
extern int blf_mono_font_render; // dont mess drawing with render threads.
-#endif /* BLF_API_H */
+#endif /* __BLF_API_H__ */
diff --git a/source/blender/blenfont/BLF_translation.h b/source/blender/blenfont/BLF_translation.h
index ce53b76da01..3bb6c37e345 100644
--- a/source/blender/blenfont/BLF_translation.h
+++ b/source/blender/blenfont/BLF_translation.h
@@ -30,8 +30,8 @@
*/
-#ifndef BLF_TRANSLATION_H
-#define BLF_TRANSLATION_H
+#ifndef __BLF_TRANSLATION_H__
+#define __BLF_TRANSLATION_H__
#define TEXT_DOMAIN_NAME "blender"
@@ -75,4 +75,4 @@ const char *BLF_translate_do_tooltip(const char *msgid);
#define IFACE_(msgid) BLF_translate_do_iface(msgid)
#define TIP_(msgid) BLF_translate_do_tooltip(msgid)
-#endif /* BLF_TRANSLATION_H */
+#endif /* __BLF_TRANSLATION_H__ */
diff --git a/source/blender/blenfont/intern/blf_internal.h b/source/blender/blenfont/intern/blf_internal.h
index 20124666bcc..3ef0b3422fe 100644
--- a/source/blender/blenfont/intern/blf_internal.h
+++ b/source/blender/blenfont/intern/blf_internal.h
@@ -28,8 +28,8 @@
*/
-#ifndef BLF_INTERNAL_H
-#define BLF_INTERNAL_H
+#ifndef __BLF_INTERNAL_H__
+#define __BLF_INTERNAL_H__
struct FontBLF;
struct GlyphBLF;
@@ -72,4 +72,4 @@ struct GlyphBLF *blf_glyph_add(struct FontBLF *font, unsigned int index, unsigne
void blf_glyph_free(struct GlyphBLF *g);
int blf_glyph_render(struct FontBLF *font, struct GlyphBLF *g, float x, float y);
-#endif /* BLF_INTERNAL_H */
+#endif /* __BLF_INTERNAL_H__ */
diff --git a/source/blender/blenfont/intern/blf_internal_types.h b/source/blender/blenfont/intern/blf_internal_types.h
index e8021aad6d1..cbe7975fdd6 100644
--- a/source/blender/blenfont/intern/blf_internal_types.h
+++ b/source/blender/blenfont/intern/blf_internal_types.h
@@ -28,8 +28,8 @@
*/
-#ifndef BLF_INTERNAL_TYPES_H
-#define BLF_INTERNAL_TYPES_H
+#ifndef __BLF_INTERNAL_TYPES_H__
+#define __BLF_INTERNAL_TYPES_H__
typedef struct GlyphCacheBLF {
struct GlyphCacheBLF *next;
@@ -223,4 +223,4 @@ typedef struct DirBLF {
char *path;
} DirBLF;
-#endif /* BLF_INTERNAL_TYPES_H */
+#endif /* __BLF_INTERNAL_TYPES_H__ */
diff --git a/source/blender/blenfont/intern/blf_lang.c b/source/blender/blenfont/intern/blf_lang.c
index d96011f0f1e..95203c2b1c0 100644
--- a/source/blender/blenfont/intern/blf_lang.c
+++ b/source/blender/blenfont/intern/blf_lang.c
@@ -101,7 +101,7 @@ static const char *locales[] = {
"greek", "el_GR",
"korean", "ko_KR",
"nepali", "ne_NP",
- "persian", "fa_PE",
+ "persian", "fa_IR",
"indonesian", "id_ID",
"serbian (latin)", "sr_RS@latin",
"kyrgyz", "ky",
diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h
index a887412bbf4..40e2a4082f6 100644
--- a/source/blender/blenkernel/BKE_DerivedMesh.h
+++ b/source/blender/blenkernel/BKE_DerivedMesh.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_DERIVEDMESH_H
-#define BKE_DERIVEDMESH_H
+#ifndef __BKE_DERIVEDMESH_H__
+#define __BKE_DERIVEDMESH_H__
/** \file BKE_DerivedMesh.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h
index 67efb7752ea..564cd235869 100644
--- a/source/blender/blenkernel/BKE_action.h
+++ b/source/blender/blenkernel/BKE_action.h
@@ -24,8 +24,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_ACTION_H
-#define BKE_ACTION_H
+#ifndef __BKE_ACTION_H__
+#define __BKE_ACTION_H__
/** \file BKE_action.h
* \ingroup bke
* \brief Blender kernel action and pose functionality.
diff --git a/source/blender/blenkernel/BKE_anim.h b/source/blender/blenkernel/BKE_anim.h
index a55955c4d04..d605776ed50 100644
--- a/source/blender/blenkernel/BKE_anim.h
+++ b/source/blender/blenkernel/BKE_anim.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_ANIM_H
-#define BKE_ANIM_H
+#ifndef __BKE_ANIM_H__
+#define __BKE_ANIM_H__
/** \file BKE_anim.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_animsys.h b/source/blender/blenkernel/BKE_animsys.h
index 8e5b313b919..fb4a44b2c80 100644
--- a/source/blender/blenkernel/BKE_animsys.h
+++ b/source/blender/blenkernel/BKE_animsys.h
@@ -23,8 +23,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_ANIM_SYS_H
-#define BKE_ANIM_SYS_H
+#ifndef __BKE_ANIMSYS_H__
+#define __BKE_ANIMSYS_H__
/** \file BKE_animsys.h
* \ingroup bke
@@ -160,4 +160,4 @@ void animsys_evaluate_action_group(struct PointerRNA *ptr, struct bAction *act,
/* ************************************* */
-#endif /* BKE_ANIM_SYS_H*/
+#endif /* __BKE_ANIMSYS_H__*/
diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h
index 07d8d69f44e..b09122d022b 100644
--- a/source/blender/blenkernel/BKE_armature.h
+++ b/source/blender/blenkernel/BKE_armature.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_ARMATURE_H
-#define BKE_ARMATURE_H
+#ifndef __BKE_ARMATURE_H__
+#define __BKE_ARMATURE_H__
/** \file BKE_armature.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h
index c5a5c134cdf..1c661b3804f 100644
--- a/source/blender/blenkernel/BKE_blender.h
+++ b/source/blender/blenkernel/BKE_blender.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_BLENDER_H
-#define BKE_BLENDER_H
+#ifndef __BKE_BLENDER_H__
+#define __BKE_BLENDER_H__
/** \file BKE_blender.h
* \ingroup bke
@@ -51,7 +51,7 @@ extern "C" {
/* can be left blank, otherwise a,b,c... etc with no quotes */
#define BLENDER_VERSION_CHAR
/* alpha/beta/rc/release, docs use this */
-#define BLENDER_VERSION_CYCLE release
+#define BLENDER_VERSION_CYCLE alpha
extern char versionstr[]; /* from blender.c */
diff --git a/source/blender/blenkernel/BKE_bmesh.h b/source/blender/blenkernel/BKE_bmesh.h
index c8df6c4f455..51fb0da61fa 100644
--- a/source/blender/blenkernel/BKE_bmesh.h
+++ b/source/blender/blenkernel/BKE_bmesh.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_BMESH_H
-#define BKE_BMESH_H
+#ifndef __BKE_BMESH_H__
+#define __BKE_BMESH_H__
/** \file BKE_bmesh.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_bmeshCustomData.h b/source/blender/blenkernel/BKE_bmeshCustomData.h
index 793410371df..bbdc6f39cff 100644
--- a/source/blender/blenkernel/BKE_bmeshCustomData.h
+++ b/source/blender/blenkernel/BKE_bmeshCustomData.h
@@ -26,8 +26,8 @@
*/
-#ifndef BKE_BMESHCUSTOMDATA_H
-#define BKE_BMESHCUSTOMDATA_H
+#ifndef __BKE_BMESHCUSTOMDATA_H__
+#define __BKE_BMESHCUSTOMDATA_H__
/** \file BKE_bmeshCustomData.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_bmfont.h b/source/blender/blenkernel/BKE_bmfont.h
index 71fd2ae3d67..6c0cbe3a51b 100644
--- a/source/blender/blenkernel/BKE_bmfont.h
+++ b/source/blender/blenkernel/BKE_bmfont.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_BMFONT_H
-#define BKE_BMFONT_H
+#ifndef __BKE_BMFONT_H__
+#define __BKE_BMFONT_H__
/** \file BKE_bmfont.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_bmfont_types.h b/source/blender/blenkernel/BKE_bmfont_types.h
index a4d37069cab..73ef0c3a2c3 100644
--- a/source/blender/blenkernel/BKE_bmfont_types.h
+++ b/source/blender/blenkernel/BKE_bmfont_types.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_BMFONT_TYPES_H
-#define BKE_BMFONT_TYPES_H
+#ifndef __BKE_BMFONT_TYPES_H__
+#define __BKE_BMFONT_TYPES_H__
/** \file BKE_bmfont_types.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_boids.h b/source/blender/blenkernel/BKE_boids.h
index 18e8be1512e..bb724c6632e 100644
--- a/source/blender/blenkernel/BKE_boids.h
+++ b/source/blender/blenkernel/BKE_boids.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_BOIDS_H
-#define BKE_BOIDS_H
+#ifndef __BKE_BOIDS_H__
+#define __BKE_BOIDS_H__
/** \file BKE_boids.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_booleanops_mesh.h b/source/blender/blenkernel/BKE_booleanops_mesh.h
index 4c4a2dc9998..2e48b664449 100644
--- a/source/blender/blenkernel/BKE_booleanops_mesh.h
+++ b/source/blender/blenkernel/BKE_booleanops_mesh.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_BOOLEANOPS_MESH_H
-#define BKE_BOOLEANOPS_MESH_H
+#ifndef __BKE_BOOLEANOPS_MESH_H__
+#define __BKE_BOOLEANOPS_MESH_H__
/** \file BKE_booleanops_mesh.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_brush.h b/source/blender/blenkernel/BKE_brush.h
index 13f72634bda..f5cd2635ff7 100644
--- a/source/blender/blenkernel/BKE_brush.h
+++ b/source/blender/blenkernel/BKE_brush.h
@@ -26,8 +26,8 @@
* General operations for brushes.
*/
-#ifndef BKE_BRUSH_H
-#define BKE_BRUSH_H
+#ifndef __BKE_BRUSH_H__
+#define __BKE_BRUSH_H__
/** \file BKE_brush.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_bullet.h b/source/blender/blenkernel/BKE_bullet.h
index 5eb653f69d1..2103eea1041 100644
--- a/source/blender/blenkernel/BKE_bullet.h
+++ b/source/blender/blenkernel/BKE_bullet.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_BULLET_H
-#define BKE_BULLET_H
+#ifndef __BKE_BULLET_H__
+#define __BKE_BULLET_H__
/** \file BKE_bullet.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_bvhutils.h b/source/blender/blenkernel/BKE_bvhutils.h
index 07f0c2fef7c..d3d8546ddae 100644
--- a/source/blender/blenkernel/BKE_bvhutils.h
+++ b/source/blender/blenkernel/BKE_bvhutils.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_BVHUTILS_H
-#define BKE_BVHUTILS_H
+#ifndef __BKE_BVHUTILS_H__
+#define __BKE_BVHUTILS_H__
/** \file BKE_bvhutils.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_camera.h b/source/blender/blenkernel/BKE_camera.h
index 72e22dc1583..6d10219e74c 100644
--- a/source/blender/blenkernel/BKE_camera.h
+++ b/source/blender/blenkernel/BKE_camera.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_CAMERA_H
-#define BKE_CAMERA_H
+#ifndef __BKE_CAMERA_H__
+#define __BKE_CAMERA_H__
/** \file BKE_camera.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_cdderivedmesh.h b/source/blender/blenkernel/BKE_cdderivedmesh.h
index c71c86e110d..9b274a8a411 100644
--- a/source/blender/blenkernel/BKE_cdderivedmesh.h
+++ b/source/blender/blenkernel/BKE_cdderivedmesh.h
@@ -32,8 +32,8 @@
* mesh elements (vertices, edges and faces) as layers of custom element data.
*/
-#ifndef BKE_CDDERIVEDMESH_H
-#define BKE_CDDERIVEDMESH_H
+#ifndef __BKE_CDDERIVEDMESH_H__
+#define __BKE_CDDERIVEDMESH_H__
#include "BKE_DerivedMesh.h"
diff --git a/source/blender/blenkernel/BKE_cloth.h b/source/blender/blenkernel/BKE_cloth.h
index 6d42b8dc80b..ec20e3234a3 100644
--- a/source/blender/blenkernel/BKE_cloth.h
+++ b/source/blender/blenkernel/BKE_cloth.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_CLOTH_H
-#define BKE_CLOTH_H
+#ifndef __BKE_CLOTH_H__
+#define __BKE_CLOTH_H__
/** \file BKE_cloth.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_collision.h b/source/blender/blenkernel/BKE_collision.h
index acb3ae03816..453c16bb8c8 100644
--- a/source/blender/blenkernel/BKE_collision.h
+++ b/source/blender/blenkernel/BKE_collision.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_COLLISIONS_H
-#define BKE_COLLISIONS_H
+#ifndef __BKE_COLLISION_H__
+#define __BKE_COLLISION_H__
/** \file BKE_collision.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_colortools.h b/source/blender/blenkernel/BKE_colortools.h
index b358209a0f4..1da0caf97c2 100644
--- a/source/blender/blenkernel/BKE_colortools.h
+++ b/source/blender/blenkernel/BKE_colortools.h
@@ -24,8 +24,8 @@
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
-#ifndef BKE_COLORTOOLS_H
-#define BKE_COLORTOOLS_H
+#ifndef __BKE_COLORTOOLS_H__
+#define __BKE_COLORTOOLS_H__
/** \file BKE_colortools.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_constraint.h b/source/blender/blenkernel/BKE_constraint.h
index 925d1180dbd..f834ad5e774 100644
--- a/source/blender/blenkernel/BKE_constraint.h
+++ b/source/blender/blenkernel/BKE_constraint.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_CONSTRAINT_H
-#define BKE_CONSTRAINT_H
+#ifndef __BKE_CONSTRAINT_H__
+#define __BKE_CONSTRAINT_H__
/** \file BKE_constraint.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_context.h b/source/blender/blenkernel/BKE_context.h
index 0aefe2231a5..78354cd4713 100644
--- a/source/blender/blenkernel/BKE_context.h
+++ b/source/blender/blenkernel/BKE_context.h
@@ -23,8 +23,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_CONTEXT_H
-#define BKE_CONTEXT_H
+#ifndef __BKE_CONTEXT_H__
+#define __BKE_CONTEXT_H__
/** \file BKE_context.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_curve.h b/source/blender/blenkernel/BKE_curve.h
index f0704741ebb..dd0c021f281 100644
--- a/source/blender/blenkernel/BKE_curve.h
+++ b/source/blender/blenkernel/BKE_curve.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_CURVE_H
-#define BKE_CURVE_H
+#ifndef __BKE_CURVE_H__
+#define __BKE_CURVE_H__
/** \file BKE_curve.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h
index 7ad25ac7e79..764088da47b 100644
--- a/source/blender/blenkernel/BKE_customdata.h
+++ b/source/blender/blenkernel/BKE_customdata.h
@@ -31,8 +31,8 @@
* \brief CustomData interface, see also DNA_customdata_types.h.
*/
-#ifndef BKE_CUSTOMDATA_H
-#define BKE_CUSTOMDATA_H
+#ifndef __BKE_CUSTOMDATA_H__
+#define __BKE_CUSTOMDATA_H__
#ifdef __cplusplus
extern "C" {
diff --git a/source/blender/blenkernel/BKE_customdata_file.h b/source/blender/blenkernel/BKE_customdata_file.h
index be7aaa70188..c4c41c20d80 100644
--- a/source/blender/blenkernel/BKE_customdata_file.h
+++ b/source/blender/blenkernel/BKE_customdata_file.h
@@ -18,8 +18,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_CUSTOMDATA_FILE_H
-#define BKE_CUSTOMDATA_FILE_H
+#ifndef __BKE_CUSTOMDATA_FILE_H__
+#define __BKE_CUSTOMDATA_FILE_H__
/** \file BKE_customdata_file.h
* \ingroup bke
@@ -57,5 +57,5 @@ void cdf_remove(const char *filename);
CDataFileLayer *cdf_layer_find(CDataFile *cdf, int type, const char *name);
CDataFileLayer *cdf_layer_add(CDataFile *cdf, int type, const char *name, size_t datasize);
-#endif /* BKE_CUSTOMDATA_FILE_H */
+#endif /* __BKE_CUSTOMDATA_FILE_H__ */
diff --git a/source/blender/blenkernel/BKE_deform.h b/source/blender/blenkernel/BKE_deform.h
index 11747899aa9..2e9c94a3bb1 100644
--- a/source/blender/blenkernel/BKE_deform.h
+++ b/source/blender/blenkernel/BKE_deform.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_DEFORM_H
-#define BKE_DEFORM_H
+#ifndef __BKE_DEFORM_H__
+#define __BKE_DEFORM_H__
/** \file BKE_deform.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_depsgraph.h b/source/blender/blenkernel/BKE_depsgraph.h
index 5d475903feb..1bc85a64c77 100644
--- a/source/blender/blenkernel/BKE_depsgraph.h
+++ b/source/blender/blenkernel/BKE_depsgraph.h
@@ -23,8 +23,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef DEPSGRAPH_API
-#define DEPSGRAPH_API
+#ifndef __BKE_DEPSGRAPH_H__
+#define __BKE_DEPSGRAPH_H__
/** \file BKE_depsgraph.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_displist.h b/source/blender/blenkernel/BKE_displist.h
index 2d863201767..f43ec749a69 100644
--- a/source/blender/blenkernel/BKE_displist.h
+++ b/source/blender/blenkernel/BKE_displist.h
@@ -27,8 +27,8 @@
*/
-#ifndef BKE_DISPLIST_H
-#define BKE_DISPLIST_H
+#ifndef __BKE_DISPLIST_H__
+#define __BKE_DISPLIST_H__
/** \file BKE_displist.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_dynamicpaint.h b/source/blender/blenkernel/BKE_dynamicpaint.h
index 75b3c5b4f24..b6de8188536 100644
--- a/source/blender/blenkernel/BKE_dynamicpaint.h
+++ b/source/blender/blenkernel/BKE_dynamicpaint.h
@@ -11,8 +11,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_DYNAMIC_PAINT_H_
-#define BKE_DYNAMIC_PAINT_H_
+#ifndef __BKE_DYNAMICPAINT_H__
+#define __BKE_DYNAMICPAINT_H__
struct bContext;
struct wmOperator;
@@ -88,4 +88,4 @@ void dynamicPaint_outputSurfaceImage(struct DynamicPaintSurface *surface, char*
#define DPAINT_WAVE_OBSTACLE 1
#define DPAINT_WAVE_REFLECT_ONLY 2
-#endif /* BKE_DYNAMIC_PAINT_H_ */
+#endif /* __BKE_DYNAMICPAINT_H__ */
diff --git a/source/blender/blenkernel/BKE_effect.h b/source/blender/blenkernel/BKE_effect.h
index 3ebd57dde39..c2706ddb5c0 100644
--- a/source/blender/blenkernel/BKE_effect.h
+++ b/source/blender/blenkernel/BKE_effect.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_EFFECT_H
-#define BKE_EFFECT_H
+#ifndef __BKE_EFFECT_H__
+#define __BKE_EFFECT_H__
/** \file BKE_effect.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h
index 27e9140ba77..d79d6a204b9 100644
--- a/source/blender/blenkernel/BKE_fcurve.h
+++ b/source/blender/blenkernel/BKE_fcurve.h
@@ -23,8 +23,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_FCURVE_H
-#define BKE_FCURVE_H
+#ifndef __BKE_FCURVE_H__
+#define __BKE_FCURVE_H__
/** \file BKE_fcurve.h
* \ingroup bke
@@ -270,4 +270,4 @@ void fcurve_store_samples(struct FCurve *fcu, void *data, int start, int end, Fc
}
#endif
-#endif /* BKE_FCURVE_H*/
+#endif /* __BKE_FCURVE_H__*/
diff --git a/source/blender/blenkernel/BKE_fluidsim.h b/source/blender/blenkernel/BKE_fluidsim.h
index 2b2c7a4ff87..c2b1b1d6cad 100644
--- a/source/blender/blenkernel/BKE_fluidsim.h
+++ b/source/blender/blenkernel/BKE_fluidsim.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_FLUIDSIM_H
-#define BKE_FLUIDSIM_H
+#ifndef __BKE_FLUIDSIM_H__
+#define __BKE_FLUIDSIM_H__
/** \file BKE_fluidsim.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_font.h b/source/blender/blenkernel/BKE_font.h
index e164294b9a2..e94787cfd3c 100644
--- a/source/blender/blenkernel/BKE_font.h
+++ b/source/blender/blenkernel/BKE_font.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_VFONT_H
-#define BKE_VFONT_H
+#ifndef __BKE_FONT_H__
+#define __BKE_FONT_H__
/** \file BKE_font.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h
index ee3edbb47e7..fab42b5667b 100644
--- a/source/blender/blenkernel/BKE_global.h
+++ b/source/blender/blenkernel/BKE_global.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_GLOBAL_H
-#define BKE_GLOBAL_H
+#ifndef __BKE_GLOBAL_H__
+#define __BKE_GLOBAL_H__
/** \file BKE_global.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_gpencil.h b/source/blender/blenkernel/BKE_gpencil.h
index dbb1107c228..bb0216fe11c 100644
--- a/source/blender/blenkernel/BKE_gpencil.h
+++ b/source/blender/blenkernel/BKE_gpencil.h
@@ -23,8 +23,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_GPENCIL_H
-#define BKE_GPENCIL_H
+#ifndef __BKE_GPENCIL_H__
+#define __BKE_GPENCIL_H__
/** \file BKE_gpencil.h
* \ingroup bke
@@ -63,4 +63,4 @@ struct bGPDlayer *gpencil_layer_getactive(struct bGPdata *gpd);
void gpencil_layer_setactive(struct bGPdata *gpd, struct bGPDlayer *active);
void gpencil_layer_delactive(struct bGPdata *gpd);
-#endif /* BKE_GPENCIL_H */
+#endif /* __BKE_GPENCIL_H__ */
diff --git a/source/blender/blenkernel/BKE_group.h b/source/blender/blenkernel/BKE_group.h
index 044a40658c3..6629f0bdf7f 100644
--- a/source/blender/blenkernel/BKE_group.h
+++ b/source/blender/blenkernel/BKE_group.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_GROUP_H
-#define BKE_GROUP_H
+#ifndef __BKE_GROUP_H__
+#define __BKE_GROUP_H__
/** \file BKE_group.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_icons.h b/source/blender/blenkernel/BKE_icons.h
index ee18a41dbfe..85f259c3d94 100644
--- a/source/blender/blenkernel/BKE_icons.h
+++ b/source/blender/blenkernel/BKE_icons.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_ICONS_H
-#define BKE_ICONS_H
+#ifndef __BKE_ICONS_H__
+#define __BKE_ICONS_H__
/** \file BKE_icons.h
* \ingroup bke
@@ -90,4 +90,4 @@ struct PreviewImage* BKE_previewimg_copy(struct PreviewImage *prv);
/* retrieve existing or create new preview image */
struct PreviewImage* BKE_previewimg_get(struct ID *id);
-#endif /* BKE_ICONS_H */
+#endif /* __BKE_ICONS_H__ */
diff --git a/source/blender/blenkernel/BKE_idcode.h b/source/blender/blenkernel/BKE_idcode.h
index 57855a7082f..2188bed1bf7 100644
--- a/source/blender/blenkernel/BKE_idcode.h
+++ b/source/blender/blenkernel/BKE_idcode.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_ID_INFO_H
-#define BKE_ID_INFO_H
+#ifndef __BKE_IDCODE_H__
+#define __BKE_IDCODE_H__
/** \file BKE_idcode.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_idprop.h b/source/blender/blenkernel/BKE_idprop.h
index fbe5bf2ef44..5a661f7c731 100644
--- a/source/blender/blenkernel/BKE_idprop.h
+++ b/source/blender/blenkernel/BKE_idprop.h
@@ -23,8 +23,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef _BKE_IDPROP_H
-#define _BKE_IDPROP_H
+#ifndef __BKE_IDPROP_H__
+#define __BKE_IDPROP_H__
/** \file BKE_idprop.h
* \ingroup bke
@@ -204,4 +204,4 @@ void IDP_UnlinkProperty(struct IDProperty *prop);
#define IDP_IDPArray(prop) ((IDProperty*)(prop)->data.pointer)
#define IDP_Double(prop) (*(double*)&(prop)->data.val)
-#endif /* _BKE_IDPROP_H */
+#endif /* __BKE_IDPROP_H__ */
diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h
index 5cdc3537f5b..722ead80ad9 100644
--- a/source/blender/blenkernel/BKE_image.h
+++ b/source/blender/blenkernel/BKE_image.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_IMAGE_H
-#define BKE_IMAGE_H
+#ifndef __BKE_IMAGE_H__
+#define __BKE_IMAGE_H__
/** \file BKE_image.h
* \ingroup bke
@@ -54,10 +54,10 @@ int BKE_alphatest_ibuf(struct ImBuf *ibuf);
int BKE_write_ibuf_stamp(struct Scene *scene, struct Object *camera, struct ImBuf *ibuf, const char *name, struct ImageFormatData *imf);
int BKE_write_ibuf(struct ImBuf *ibuf, const char *name, struct ImageFormatData *imf);
int BKE_write_ibuf_as(struct ImBuf *ibuf, const char *name, struct ImageFormatData *imf, const short is_copy);
-void BKE_makepicstring(char *string, const char *base, const char *relbase, int frame, char imtype, const short use_ext, const short use_frames);
+void BKE_makepicstring(char *string, const char *base, const char *relbase, int frame, const char imtype, const short use_ext, const short use_frames);
int BKE_add_image_extension(char *string, const char imtype);
char BKE_ftype_to_imtype(const int ftype);
-int BKE_imtype_to_ftype(char imtype);
+int BKE_imtype_to_ftype(const char imtype);
int BKE_imtype_is_movie(const char imtype);
int BKE_imtype_supports_zbuf(const char imtype);
diff --git a/source/blender/blenkernel/BKE_ipo.h b/source/blender/blenkernel/BKE_ipo.h
index d21b0597976..547e7de7634 100644
--- a/source/blender/blenkernel/BKE_ipo.h
+++ b/source/blender/blenkernel/BKE_ipo.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_IPO_H
-#define BKE_IPO_H
+#ifndef __BKE_IPO_H__
+#define __BKE_IPO_H__
/** \file BKE_ipo.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_key.h b/source/blender/blenkernel/BKE_key.h
index c055bb2004b..c1f75baf8ff 100644
--- a/source/blender/blenkernel/BKE_key.h
+++ b/source/blender/blenkernel/BKE_key.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_KEY_H
-#define BKE_KEY_H
+#ifndef __BKE_KEY_H__
+#define __BKE_KEY_H__
/** \file BKE_key.h
* \ingroup bke
@@ -87,4 +87,4 @@ extern int slurph_opt;
};
#endif
-#endif // BKE_KEY_H
+#endif // __BKE_KEY_H__
diff --git a/source/blender/blenkernel/BKE_lamp.h b/source/blender/blenkernel/BKE_lamp.h
index cc9452ae155..50e25576320 100644
--- a/source/blender/blenkernel/BKE_lamp.h
+++ b/source/blender/blenkernel/BKE_lamp.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_LAMP_H
-#define BKE_LAMP_H
+#ifndef __BKE_LAMP_H__
+#define __BKE_LAMP_H__
/** \file BKE_lamp.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_lattice.h b/source/blender/blenkernel/BKE_lattice.h
index b5395309896..8a1529a7ad0 100644
--- a/source/blender/blenkernel/BKE_lattice.h
+++ b/source/blender/blenkernel/BKE_lattice.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_LATTICE_H
-#define BKE_LATTICE_H
+#ifndef __BKE_LATTICE_H__
+#define __BKE_LATTICE_H__
/** \file BKE_lattice.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h
index e8d6c85664b..e18a510ac07 100644
--- a/source/blender/blenkernel/BKE_library.h
+++ b/source/blender/blenkernel/BKE_library.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_LIBRARY_TYPES_H
-#define BKE_LIBRARY_TYPES_H
+#ifndef __BKE_LIBRARY_H__
+#define __BKE_LIBRARY_H__
/** \file BKE_library.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_main.h b/source/blender/blenkernel/BKE_main.h
index 05ba60b8a5b..ffcbb6e40bc 100644
--- a/source/blender/blenkernel/BKE_main.h
+++ b/source/blender/blenkernel/BKE_main.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_MAIN_H
-#define BKE_MAIN_H
+#ifndef __BKE_MAIN_H__
+#define __BKE_MAIN_H__
/** \file BKE_main.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h
index 0079ecb7d9c..3e73f6b9dd9 100644
--- a/source/blender/blenkernel/BKE_material.h
+++ b/source/blender/blenkernel/BKE_material.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_MATERIAL_H
-#define BKE_MATERIAL_H
+#ifndef __BKE_MATERIAL_H__
+#define __BKE_MATERIAL_H__
/** \file BKE_material.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_mball.h b/source/blender/blenkernel/BKE_mball.h
index 3dde54fd811..e3b5a006edf 100644
--- a/source/blender/blenkernel/BKE_mball.h
+++ b/source/blender/blenkernel/BKE_mball.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_MBALL_H
-#define BKE_MBALL_H
+#ifndef __BKE_MBALL_H__
+#define __BKE_MBALL_H__
/** \file BKE_mball.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h
index 30a4b154e31..ba6bf330b1e 100644
--- a/source/blender/blenkernel/BKE_mesh.h
+++ b/source/blender/blenkernel/BKE_mesh.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_MESH_H
-#define BKE_MESH_H
+#ifndef __BKE_MESH_H__
+#define __BKE_MESH_H__
/** \file BKE_mesh.h
* \ingroup bke
@@ -213,4 +213,4 @@ void mesh_loops_to_mface_corners(struct CustomData *fdata, struct CustomData *ld
}
#endif
-#endif /* BKE_MESH_H */
+#endif /* __BKE_MESH_H__ */
diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h
index f72bc5b93ec..895fe64bea8 100644
--- a/source/blender/blenkernel/BKE_modifier.h
+++ b/source/blender/blenkernel/BKE_modifier.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_MODIFIER_H
-#define BKE_MODIFIER_H
+#ifndef __BKE_MODIFIER_H__
+#define __BKE_MODIFIER_H__
/** \file BKE_modifier.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_movieclip.h b/source/blender/blenkernel/BKE_movieclip.h
index eabbf459584..2d78e924c90 100644
--- a/source/blender/blenkernel/BKE_movieclip.h
+++ b/source/blender/blenkernel/BKE_movieclip.h
@@ -24,8 +24,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_MOVIECLIP_H
-#define BKE_MOVIECLIP_H
+#ifndef __BKE_MOVIECLIP_H__
+#define __BKE_MOVIECLIP_H__
/** \file BKE_movieclip.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_multires.h b/source/blender/blenkernel/BKE_multires.h
index 4f1262cd523..53a92f8c2ce 100644
--- a/source/blender/blenkernel/BKE_multires.h
+++ b/source/blender/blenkernel/BKE_multires.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_MULTIRES_H
-#define BKE_MULTIRES_H
+#ifndef __BKE_MULTIRES_H__
+#define __BKE_MULTIRES_H__
/** \file BKE_multires.h
* \ingroup bke
@@ -94,5 +94,5 @@ void mdisp_apply_weight(const int S, const int corners, int x, int y, const int
void mdisp_flip_disp(const int S, const int corners, const float axis_x[2], const float axis_y[2], float disp[3]);
void mdisp_join_tris(struct MDisps *dst, struct MDisps *tri1, struct MDisps *tri2);
-#endif // BKE_MULTIRES_H
+#endif // __BKE_MULTIRES_H__
diff --git a/source/blender/blenkernel/BKE_navmesh_conversion.h b/source/blender/blenkernel/BKE_navmesh_conversion.h
index ab5c2b19707..8de53ed8b8e 100644
--- a/source/blender/blenkernel/BKE_navmesh_conversion.h
+++ b/source/blender/blenkernel/BKE_navmesh_conversion.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_NAVMESH_CONVERSION_H
-#define BKE_NAVMESH_CONVERSION_H
+#ifndef __BKE_NAVMESH_CONVERSION_H__
+#define __BKE_NAVMESH_CONVERSION_H__
struct DerivedMesh;
diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h
index 773c5ced1cb..921972c9fa8 100644
--- a/source/blender/blenkernel/BKE_nla.h
+++ b/source/blender/blenkernel/BKE_nla.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_NLA_H
-#define BKE_NLA_H
+#ifndef __BKE_NLA_H__
+#define __BKE_NLA_H__
/** \file BKE_nla.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index 0cccd8a366b..ae2f9305894 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_NODE_H
-#define BKE_NODE_H
+#ifndef __BKE_NODE_H__
+#define __BKE_NODE_H__
/** \file BKE_node.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h
index 828b0b47e3a..ac703663864 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_OBJECT_H
-#define BKE_OBJECT_H
+#ifndef __BKE_OBJECT_H__
+#define __BKE_OBJECT_H__
/** \file BKE_object.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_ocean.h b/source/blender/blenkernel/BKE_ocean.h
index c8ce3f8ce63..7c0d99b35ea 100644
--- a/source/blender/blenkernel/BKE_ocean.h
+++ b/source/blender/blenkernel/BKE_ocean.h
@@ -23,8 +23,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_OCEAN_H
-#define BKE_OCEAN_H
+#ifndef __BKE_OCEAN_H__
+#define __BKE_OCEAN_H__
#ifdef __cplusplus
extern "C" {
diff --git a/source/blender/blenkernel/BKE_packedFile.h b/source/blender/blenkernel/BKE_packedFile.h
index 606d6167937..1eff20cbd57 100644
--- a/source/blender/blenkernel/BKE_packedFile.h
+++ b/source/blender/blenkernel/BKE_packedFile.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_PACKEDFILE_H
-#define BKE_PACKEDFILE_H
+#ifndef __BKE_PACKEDFILE_H__
+#define __BKE_PACKEDFILE_H__
/** \file BKE_packedFile.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h
index 081b79b44d6..c048dad82eb 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_PAINT_H
-#define BKE_PAINT_H
+#ifndef __BKE_PAINT_H__
+#define __BKE_PAINT_H__
/** \file BKE_paint.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h
index dbefbd95a15..c03ecca17cf 100644
--- a/source/blender/blenkernel/BKE_particle.h
+++ b/source/blender/blenkernel/BKE_particle.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_PARTICLE_H
-#define BKE_PARTICLE_H
+#ifndef __BKE_PARTICLE_H__
+#define __BKE_PARTICLE_H__
/** \file BKE_particle.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_plugin_types.h b/source/blender/blenkernel/BKE_plugin_types.h
index 73c6dae35cf..8f9706f9833 100644
--- a/source/blender/blenkernel/BKE_plugin_types.h
+++ b/source/blender/blenkernel/BKE_plugin_types.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_PLUGIN_TYPES_H
-#define BKE_PLUGIN_TYPES_H
+#ifndef __BKE_PLUGIN_TYPES_H__
+#define __BKE_PLUGIN_TYPES_H__
/** \file BKE_plugin_types.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h
index d1b0acf7142..38f0503b40d 100644
--- a/source/blender/blenkernel/BKE_pointcache.h
+++ b/source/blender/blenkernel/BKE_pointcache.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_POINTCACHE_H
-#define BKE_POINTCACHE_H
+#ifndef __BKE_POINTCACHE_H__
+#define __BKE_POINTCACHE_H__
/** \file BKE_pointcache.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_property.h b/source/blender/blenkernel/BKE_property.h
index 779c83acf21..a29dc0e7be4 100644
--- a/source/blender/blenkernel/BKE_property.h
+++ b/source/blender/blenkernel/BKE_property.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_PROPERTY_H
-#define BKE_PROPERTY_H
+#ifndef __BKE_PROPERTY_H__
+#define __BKE_PROPERTY_H__
/** \file BKE_property.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_report.h b/source/blender/blenkernel/BKE_report.h
index 784f8a63757..fd372ae6d83 100644
--- a/source/blender/blenkernel/BKE_report.h
+++ b/source/blender/blenkernel/BKE_report.h
@@ -23,8 +23,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_REPORT_H
-#define BKE_REPORT_H
+#ifndef __BKE_REPORT_H__
+#define __BKE_REPORT_H__
/** \file BKE_report.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_sca.h b/source/blender/blenkernel/BKE_sca.h
index cfcc0e146d8..22b44511195 100644
--- a/source/blender/blenkernel/BKE_sca.h
+++ b/source/blender/blenkernel/BKE_sca.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_SCA_H
-#define BKE_SCA_H
+#ifndef __BKE_SCA_H__
+#define __BKE_SCA_H__
/** \file BKE_sca.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h
index 2df5e7ac2c6..e46d99ed873 100644
--- a/source/blender/blenkernel/BKE_scene.h
+++ b/source/blender/blenkernel/BKE_scene.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_SCENE_H
-#define BKE_SCENE_H
+#ifndef __BKE_SCENE_H__
+#define __BKE_SCENE_H__
/** \file BKE_scene.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h
index 44b92f70519..c254144b812 100644
--- a/source/blender/blenkernel/BKE_screen.h
+++ b/source/blender/blenkernel/BKE_screen.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_SCREEN_H
-#define BKE_SCREEN_H
+#ifndef __BKE_SCREEN_H__
+#define __BKE_SCREEN_H__
/** \file BKE_screen.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_script.h b/source/blender/blenkernel/BKE_script.h
index d8ceaf23652..7bd801a8177 100644
--- a/source/blender/blenkernel/BKE_script.h
+++ b/source/blender/blenkernel/BKE_script.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_SCRIPT_H
-#define BKE_SCRIPT_H
+#ifndef __BKE_SCRIPT_H__
+#define __BKE_SCRIPT_H__
/** \file BKE_script.h
* \ingroup bke
@@ -46,4 +46,4 @@ void free_script (struct Script *script);
}
#endif
-#endif /* BKE_SCRIPT_H */
+#endif /* __BKE_SCRIPT_H__ */
diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h
index ed0730b7f09..5c6058b1453 100644
--- a/source/blender/blenkernel/BKE_sequencer.h
+++ b/source/blender/blenkernel/BKE_sequencer.h
@@ -23,8 +23,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_SEQUENCER_H
-#define BKE_SEQUENCER_H
+#ifndef __BKE_SEQUENCER_H__
+#define __BKE_SEQUENCER_H__
/** \file BKE_sequencer.h
* \ingroup bke
@@ -341,4 +341,4 @@ extern SequencerDrawView sequencer_view3d_cb;
extern ListBase seqbase_clipboard;
extern int seqbase_clipboard_frame;
-#endif // BKE_SEQUENCER_H
+#endif // __BKE_SEQUENCER_H__
diff --git a/source/blender/blenkernel/BKE_shrinkwrap.h b/source/blender/blenkernel/BKE_shrinkwrap.h
index d1fef8b0ce1..446084053de 100644
--- a/source/blender/blenkernel/BKE_shrinkwrap.h
+++ b/source/blender/blenkernel/BKE_shrinkwrap.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_SHRINKWRAP_H
-#define BKE_SHRINKWRAP_H
+#ifndef __BKE_SHRINKWRAP_H__
+#define __BKE_SHRINKWRAP_H__
/** \file BKE_shrinkwrap.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_sketch.h b/source/blender/blenkernel/BKE_sketch.h
index 1dd82c1d8e6..76b3dbacf7f 100644
--- a/source/blender/blenkernel/BKE_sketch.h
+++ b/source/blender/blenkernel/BKE_sketch.h
@@ -19,8 +19,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_SKETCH_H
-#define BKE_SKETCH_H
+#ifndef __BKE_SKETCH_H__
+#define __BKE_SKETCH_H__
/** \file BKE_sketch.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_smoke.h b/source/blender/blenkernel/BKE_smoke.h
index 51acef44f52..1e97bc07f99 100644
--- a/source/blender/blenkernel/BKE_smoke.h
+++ b/source/blender/blenkernel/BKE_smoke.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_SMOKE_H_
-#define BKE_SMOKE_H_
+#ifndef __BKE_SMOKE_H__
+#define __BKE_SMOKE_H__
/** \file BKE_smoke.h
* \ingroup bke
@@ -45,4 +45,4 @@ void smokeModifier_copy(struct SmokeModifierData *smd, struct SmokeModifierData
long long smoke_get_mem_req(int xres, int yres, int zres, int amplify);
-#endif /* BKE_SMOKE_H_ */
+#endif /* __BKE_SMOKE_H__ */
diff --git a/source/blender/blenkernel/BKE_softbody.h b/source/blender/blenkernel/BKE_softbody.h
index c889aa83b9a..6714225f513 100644
--- a/source/blender/blenkernel/BKE_softbody.h
+++ b/source/blender/blenkernel/BKE_softbody.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_SOFTBODY_H
-#define BKE_SOFTBODY_H
+#ifndef __BKE_SOFTBODY_H__
+#define __BKE_SOFTBODY_H__
/** \file BKE_softbody.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h
index fdf1d09559d..8b01dbde531 100644
--- a/source/blender/blenkernel/BKE_sound.h
+++ b/source/blender/blenkernel/BKE_sound.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_SOUND_H
-#define BKE_SOUND_H
+#ifndef __BKE_SOUND_H__
+#define __BKE_SOUND_H__
/** \file BKE_sound.h
* \ingroup bke
@@ -79,7 +79,7 @@ void sound_load(struct Main *main, struct bSound* sound);
void sound_free(struct bSound* sound);
-#ifdef AUD_CAPI
+#ifdef __AUD_C_API_H__
AUD_Device* sound_mixdown(struct Scene *scene, AUD_DeviceSpecs specs, int start, float volume);
#endif
diff --git a/source/blender/blenkernel/BKE_speaker.h b/source/blender/blenkernel/BKE_speaker.h
index d309c048f1a..fddcfb2c7f3 100644
--- a/source/blender/blenkernel/BKE_speaker.h
+++ b/source/blender/blenkernel/BKE_speaker.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_SPEAKER_H
-#define BKE_SPEAKER_H
+#ifndef __BKE_SPEAKER_H__
+#define __BKE_SPEAKER_H__
/** \file BKE_speaker.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_subsurf.h b/source/blender/blenkernel/BKE_subsurf.h
index dcbd045f62d..5e56cc7b3be 100644
--- a/source/blender/blenkernel/BKE_subsurf.h
+++ b/source/blender/blenkernel/BKE_subsurf.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_SUBSURF_H
-#define BKE_SUBSURF_H
+#ifndef __BKE_SUBSURF_H__
+#define __BKE_SUBSURF_H__
/** \file BKE_subsurf.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_suggestions.h b/source/blender/blenkernel/BKE_suggestions.h
index a0a270422c7..6168b98ac4c 100644
--- a/source/blender/blenkernel/BKE_suggestions.h
+++ b/source/blender/blenkernel/BKE_suggestions.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_SUGGESTIONS_H
-#define BKE_SUGGESTIONS_H
+#ifndef __BKE_SUGGESTIONS_H__
+#define __BKE_SUGGESTIONS_H__
/** \file BKE_suggestions.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_text.h b/source/blender/blenkernel/BKE_text.h
index f0c054560c4..504b859c183 100644
--- a/source/blender/blenkernel/BKE_text.h
+++ b/source/blender/blenkernel/BKE_text.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_TEXT_H
-#define BKE_TEXT_H
+#ifndef __BKE_TEXT_H__
+#define __BKE_TEXT_H__
/** \file BKE_text.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_texture.h b/source/blender/blenkernel/BKE_texture.h
index a67a06ef9fb..2574c45eec2 100644
--- a/source/blender/blenkernel/BKE_texture.h
+++ b/source/blender/blenkernel/BKE_texture.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_TEXTURE_H
-#define BKE_TEXTURE_H
+#ifndef __BKE_TEXTURE_H__
+#define __BKE_TEXTURE_H__
/** \file BKE_texture.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_tracking.h b/source/blender/blenkernel/BKE_tracking.h
index ebbba7de7c7..1be858ecf80 100644
--- a/source/blender/blenkernel/BKE_tracking.h
+++ b/source/blender/blenkernel/BKE_tracking.h
@@ -24,8 +24,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_TRACKING_H
-#define BKE_TRACKING_H
+#ifndef __BKE_TRACKING_H__
+#define __BKE_TRACKING_H__
/** \file BKE_trackingp.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_unit.h b/source/blender/blenkernel/BKE_unit.h
index db586f6d262..e3ad49e2225 100644
--- a/source/blender/blenkernel/BKE_unit.h
+++ b/source/blender/blenkernel/BKE_unit.h
@@ -20,8 +20,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_UNIT_H
-#define BKE_UNIT_H
+#ifndef __BKE_UNIT_H__
+#define __BKE_UNIT_H__
/** \file BKE_unit.h
* \ingroup bke
@@ -76,4 +76,4 @@ double bUnit_GetScaler(void *usys_pt, int index);
}
#endif
-#endif /* BKE_UNIT_H */
+#endif /* __BKE_UNIT_H__ */
diff --git a/source/blender/blenkernel/BKE_utildefines.h b/source/blender/blenkernel/BKE_utildefines.h
index a6a9bb0c0f6..39458cb3a13 100644
--- a/source/blender/blenkernel/BKE_utildefines.h
+++ b/source/blender/blenkernel/BKE_utildefines.h
@@ -33,8 +33,8 @@
*/
-#ifndef BKE_UTILDEFINES_H
-#define BKE_UTILDEFINES_H
+#ifndef __BKE_UTILDEFINES_H__
+#define __BKE_UTILDEFINES_H__
#ifdef __cplusplus
extern "C" {
@@ -89,4 +89,4 @@ extern "C" {
}
#endif
-#endif // BKE_UTILDEFINES_H
+#endif // __BKE_UTILDEFINES_H__
diff --git a/source/blender/blenkernel/BKE_world.h b/source/blender/blenkernel/BKE_world.h
index fe25279dcfb..16ff3acaf71 100644
--- a/source/blender/blenkernel/BKE_world.h
+++ b/source/blender/blenkernel/BKE_world.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_WORLD_H
-#define BKE_WORLD_H
+#ifndef __BKE_WORLD_H__
+#define __BKE_WORLD_H__
/** \file BKE_world.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_writeavi.h b/source/blender/blenkernel/BKE_writeavi.h
index c906761f3d7..03174fb5284 100644
--- a/source/blender/blenkernel/BKE_writeavi.h
+++ b/source/blender/blenkernel/BKE_writeavi.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_WRITEAVI_H
-#define BKE_WRITEAVI_H
+#ifndef __BKE_WRITEAVI_H__
+#define __BKE_WRITEAVI_H__
/** \file BKE_writeavi.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_writeffmpeg.h b/source/blender/blenkernel/BKE_writeffmpeg.h
index 4c42d1e4a6c..299f8e185cf 100644
--- a/source/blender/blenkernel/BKE_writeffmpeg.h
+++ b/source/blender/blenkernel/BKE_writeffmpeg.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_WRITEFFMPEG_H
-#define BKE_WRITEFFMPEG_H
+#ifndef __BKE_WRITEFFMPEG_H__
+#define __BKE_WRITEFFMPEG_H__
/** \file BKE_writeffmpeg.h
* \ingroup bke
diff --git a/source/blender/blenkernel/BKE_writeframeserver.h b/source/blender/blenkernel/BKE_writeframeserver.h
index 040550d8faa..cb607e1473c 100644
--- a/source/blender/blenkernel/BKE_writeframeserver.h
+++ b/source/blender/blenkernel/BKE_writeframeserver.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_WRITEFRAMESERVER_H
-#define BKE_WRITEFRAMESERVER_H
+#ifndef __BKE_WRITEFRAMESERVER_H__
+#define __BKE_WRITEFRAMESERVER_H__
/** \file BKE_writeframeserver.h
* \ingroup bke
diff --git a/source/blender/blenkernel/depsgraph_private.h b/source/blender/blenkernel/depsgraph_private.h
index 0338d10a66d..0db3c5615f5 100644
--- a/source/blender/blenkernel/depsgraph_private.h
+++ b/source/blender/blenkernel/depsgraph_private.h
@@ -27,8 +27,8 @@
* \ingroup bke
*/
-#ifndef DEPSGRAPH_PRIVATE
-#define DEPSGRAPH_PRIVATE
+#ifndef __DEPSGRAPH_PRIVATE_H__
+#define __DEPSGRAPH_PRIVATE_H__
#include "BKE_depsgraph.h"
#include "DNA_constraint_types.h"
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index 9ae3ad95d5c..c3d2425f280 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -794,6 +794,9 @@ void BKE_animdata_main_cb (Main *mainptr, ID_AnimData_Edit_Callback func, void *
/* speakers */
ANIMDATA_IDS_CB(mainptr->speaker.first);
+ /* movie clips */
+ ANIMDATA_IDS_CB(mainptr->movieclip.first);
+
/* objects */
ANIMDATA_IDS_CB(mainptr->object.first);
@@ -875,6 +878,9 @@ void BKE_all_animdata_fix_paths_rename (const char *prefix, const char *oldName,
/* speakers */
RENAMEFIX_ANIM_IDS(mainptr->speaker.first);
+ /* movie clips */
+ RENAMEFIX_ANIM_IDS(mainptr->movieclip.first);
+
/* objects */
RENAMEFIX_ANIM_IDS(mainptr->object.first);
diff --git a/source/blender/blenkernel/intern/bmesh_private.h b/source/blender/blenkernel/intern/bmesh_private.h
index d0b03883e6e..10074813fae 100644
--- a/source/blender/blenkernel/intern/bmesh_private.h
+++ b/source/blender/blenkernel/intern/bmesh_private.h
@@ -35,8 +35,8 @@
*/
-#ifndef BMESH_PRIVATE
-#define BMESH_PRIVATE
+#ifndef __BMESH_PRIVATE_H__
+#define __BMESH_PRIVATE_H__
#include "BKE_bmesh.h"
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 6fd89db10e7..bf9ed8b17e3 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -2285,7 +2285,7 @@ void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startfra
/* float offset; unused for now */
float time, nexttime;
- /* TODO: this has to be sorter out once bsystem_time gets redone, */
+ /* TODO: this has to be sorted out once bsystem_time gets redone, */
/* now caches can handle interpolating etc. too - jahka */
/* time handling for point cache:
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 0790896da0d..b2188754503 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -1192,11 +1192,10 @@ static void seq_open_anim_file(Sequence * seq)
}
-static int seq_proxy_get_fname(SeqRenderData context, Sequence * seq, int cfra, char * name)
+static int seq_proxy_get_fname(Sequence * seq, int cfra, int render_size, char * name)
{
int frameno;
char dir[PROXY_MAXFILE];
- int render_size = context.preview_render_size;
if (!seq->strip->proxy) {
return FALSE;
@@ -1226,22 +1225,17 @@ static int seq_proxy_get_fname(SeqRenderData context, Sequence * seq, int cfra,
return TRUE;
}
- /* dirty hack to distinguish 100% render size from PROXY_100 */
- if (render_size == 99) {
- render_size = 100;
- }
-
/* generate a separate proxy directory for each preview size */
if (seq->type == SEQ_IMAGE) {
BLI_snprintf(name, PROXY_MAXFILE, "%s/images/%d/%s_proxy", dir,
- context.preview_render_size,
+ render_size,
give_stripelem(seq, cfra)->name);
frameno = 1;
} else {
frameno = (int) give_stripelem_index(seq, cfra) + seq->anim_startofs;
BLI_snprintf(name, PROXY_MAXFILE, "%s/proxy_misc/%d/####", dir,
- context.preview_render_size);
+ render_size);
}
BLI_path_abs(name, G.main->name);
@@ -1258,6 +1252,12 @@ static struct ImBuf * seq_proxy_fetch(SeqRenderData context, Sequence * seq, int
IMB_Proxy_Size psize = seq_rendersize_to_proxysize(
context.preview_render_size);
int size_flags;
+ int render_size = context.preview_render_size;
+
+ /* dirty hack to distinguish 100% render size from PROXY_100 */
+ if (render_size == 99) {
+ render_size = 100;
+ }
if (!(seq->flag & SEQ_USE_PROXY)) {
return NULL;
@@ -1273,7 +1273,7 @@ static struct ImBuf * seq_proxy_fetch(SeqRenderData context, Sequence * seq, int
if (seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) {
int frameno = (int) give_stripelem_index(seq, cfra) + seq->anim_startofs;
if (seq->strip->proxy->anim == NULL) {
- if (seq_proxy_get_fname(context, seq, cfra, name)==0) {
+ if (seq_proxy_get_fname(seq, cfra, render_size, name)==0) {
return NULL;
}
@@ -1292,7 +1292,7 @@ static struct ImBuf * seq_proxy_fetch(SeqRenderData context, Sequence * seq, int
IMB_TC_NONE, IMB_PROXY_NONE);
}
- if (seq_proxy_get_fname(context, seq, cfra, name) == 0) {
+ if (seq_proxy_get_fname(seq, cfra, render_size, name) == 0) {
return NULL;
}
@@ -1313,7 +1313,7 @@ static void seq_proxy_build_frame(SeqRenderData context,
int ok;
struct ImBuf * ibuf;
- if (!seq_proxy_get_fname(context, seq, cfra, name)) {
+ if (!seq_proxy_get_fname(seq, cfra, proxy_render_size, name)) {
return;
}
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index c4c3eb4a8b2..e9f7823dfe8 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -1244,7 +1244,7 @@ static void ffmpeg_set_expert_options(RenderData *rd)
* The other options were taken from the libx264-default.preset
* included in the ffmpeg distribution.
*/
-// ffmpeg_property_add_string(rd, "video", "flags:loop"); // this breakes compatibility for QT
+// ffmpeg_property_add_string(rd, "video", "flags:loop"); // this breaks compatibility for QT
ffmpeg_property_add_string(rd, "video", "cmp:chroma");
ffmpeg_property_add_string(rd, "video", "partitions:parti4x4");
ffmpeg_property_add_string(rd, "video", "partitions:partp8x8");
diff --git a/source/blender/blenkernel/nla_private.h b/source/blender/blenkernel/nla_private.h
index e287606921b..51a7ac7ee62 100644
--- a/source/blender/blenkernel/nla_private.h
+++ b/source/blender/blenkernel/nla_private.h
@@ -30,8 +30,8 @@
*/
-#ifndef NLA_PRIVATE
-#define NLA_PRIVATE
+#ifndef __NLA_PRIVATE_H__
+#define __NLA_PRIVATE_H__
/* --------------- NLA Evaluation DataTypes ----------------------- */
@@ -85,4 +85,4 @@ NlaEvalStrip *nlastrips_ctime_get_strip(ListBase *list, ListBase *strips, short
void nlastrip_evaluate(PointerRNA *ptr, ListBase *channels, ListBase *modifiers, NlaEvalStrip *nes);
void nladata_flush_channels(ListBase *channels);
-#endif // NLA_PRIVATE
+#endif // __NLA_PRIVATE_H__
diff --git a/source/blender/blenlib/BLI_args.h b/source/blender/blenlib/BLI_args.h
index 3b8b60be1b9..7a7529fa3c3 100644
--- a/source/blender/blenlib/BLI_args.h
+++ b/source/blender/blenlib/BLI_args.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLI_ARGS_H
-#define BLI_ARGS_H
+#ifndef __BLI_ARGS_H__
+#define __BLI_ARGS_H__
/** \file BLI_args.h
* \ingroup bli
diff --git a/source/blender/blenlib/BLI_blenlib.h b/source/blender/blenlib/BLI_blenlib.h
index 515c2444e80..c802b083f1f 100644
--- a/source/blender/blenlib/BLI_blenlib.h
+++ b/source/blender/blenlib/BLI_blenlib.h
@@ -55,8 +55,8 @@
* standard libraries.
*/
-#ifndef BLI_BLENLIB_H
-#define BLI_BLENLIB_H
+#ifndef __BLI_BLENLIB_H__
+#define __BLI_BLENLIB_H__
struct ListBase;
diff --git a/source/blender/blenlib/BLI_boxpack2d.h b/source/blender/blenlib/BLI_boxpack2d.h
index 886965f66b3..7f92047b312 100644
--- a/source/blender/blenlib/BLI_boxpack2d.h
+++ b/source/blender/blenlib/BLI_boxpack2d.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef _BLI_BOXPACK2D_H_
-#define _BLI_BOXPACK2D_H_
+#ifndef __BLI_BOXPACK2D_H__
+#define __BLI_BOXPACK2D_H__
/** \file BLI_boxpack2d.h
* \ingroup bli
diff --git a/source/blender/blenlib/BLI_bpath.h b/source/blender/blenlib/BLI_bpath.h
index e850db5a171..f1639bdb3c1 100644
--- a/source/blender/blenlib/BLI_bpath.h
+++ b/source/blender/blenlib/BLI_bpath.h
@@ -31,8 +31,8 @@
* so for BPath we dont need to malloc
*/
-#ifndef BLI_BPATH_H
-#define BLI_BPATH_H
+#ifndef __BLI_BPATH_H__
+#define __BLI_BPATH_H__
struct ID;
struct ListBase;
@@ -64,4 +64,4 @@ void makeFilesRelative(struct Main *bmain, const char *basedir, struct ReportLis
void makeFilesAbsolute(struct Main *bmain, const char *basedir, struct ReportList *reports);
void findMissingFiles(struct Main *bmain, const char *searchpath, struct ReportList *reports);
-#endif // BLI_BPATH_H
+#endif // __BLI_BPATH_H__
diff --git a/source/blender/blenlib/BLI_callbacks.h b/source/blender/blenlib/BLI_callbacks.h
index 201ada45acf..f4f92a0cbee 100644
--- a/source/blender/blenlib/BLI_callbacks.h
+++ b/source/blender/blenlib/BLI_callbacks.h
@@ -29,8 +29,8 @@
* \ingroup bli
*/
-#ifndef BLI_CALLBACKS_H
-#define BLI_CALLBACKS_H
+#ifndef __BLI_CALLBACKS_H__
+#define __BLI_CALLBACKS_H__
struct bContext;
struct Main;
@@ -70,4 +70,4 @@ void BLI_cb_finalize(void);
/* This is blenlib internal only, unrelated to above */
void callLocalErrorCallBack(const char* msg);
-#endif /* BLI_CALLBACKS_H */
+#endif /* __BLI_CALLBACKS_H__ */
diff --git a/source/blender/blenlib/BLI_cpu.h b/source/blender/blenlib/BLI_cpu.h
index de04a2a6cc6..fa29162e59e 100644
--- a/source/blender/blenlib/BLI_cpu.h
+++ b/source/blender/blenlib/BLI_cpu.h
@@ -18,8 +18,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLI_CPU_H
-#define BLI_CPU_H
+#ifndef __BLI_CPU_H__
+#define __BLI_CPU_H__
/** \file BLI_cpu.h
* \ingroup bli
diff --git a/source/blender/blenlib/BLI_dlrbTree.h b/source/blender/blenlib/BLI_dlrbTree.h
index cde2058b200..bad74a1e5a8 100644
--- a/source/blender/blenlib/BLI_dlrbTree.h
+++ b/source/blender/blenlib/BLI_dlrbTree.h
@@ -23,8 +23,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLI_DLRB_TREE_H
-#define BLI_DLRB_TREE_H
+#ifndef __BLI_DLRBTREE_H__
+#define __BLI_DLRBTREE_H__
/** \file BLI_dlrbTree.h
* \ingroup bli
@@ -158,4 +158,4 @@ void BLI_dlrbTree_insert(DLRBT_Tree *tree, DLRBT_Node *node);
/* ********************************************** */
-#endif // BLI_DLRB_TREE_H
+#endif // __BLI_DLRBTREE_H__
diff --git a/source/blender/blenlib/BLI_dynstr.h b/source/blender/blenlib/BLI_dynstr.h
index 32c4e012d1d..6b499c3bbcf 100644
--- a/source/blender/blenlib/BLI_dynstr.h
+++ b/source/blender/blenlib/BLI_dynstr.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLI_DYNSTR_H
-#define BLI_DYNSTR_H
+#ifndef __BLI_DYNSTR_H__
+#define __BLI_DYNSTR_H__
/** \file BLI_dynstr.h
* \ingroup bli
diff --git a/source/blender/blenlib/BLI_edgehash.h b/source/blender/blenlib/BLI_edgehash.h
index 9153155e359..b00ac683eb1 100644
--- a/source/blender/blenlib/BLI_edgehash.h
+++ b/source/blender/blenlib/BLI_edgehash.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLI_EDGEHASH_H
-#define BLI_EDGEHASH_H
+#ifndef __BLI_EDGEHASH_H__
+#define __BLI_EDGEHASH_H__
/** \file BLI_edgehash.h
* \ingroup bli
diff --git a/source/blender/blenlib/BLI_editVert.h b/source/blender/blenlib/BLI_editVert.h
index 0ddea230b84..b5096abc5bc 100644
--- a/source/blender/blenlib/BLI_editVert.h
+++ b/source/blender/blenlib/BLI_editVert.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLI_EDITVERT_H
-#define BLI_EDITVERT_H
+#ifndef __BLI_EDITVERT_H__
+#define __BLI_EDITVERT_H__
/** \file BLI_editVert.h
* \ingroup bli
diff --git a/source/blender/blenlib/BLI_fileops.h b/source/blender/blenlib/BLI_fileops.h
index 2e8f1a5512e..8fe8456e845 100644
--- a/source/blender/blenlib/BLI_fileops.h
+++ b/source/blender/blenlib/BLI_fileops.h
@@ -30,8 +30,8 @@
* \brief File and directory operations.
* */
-#ifndef BLI_FILEOPS_H
-#define BLI_FILEOPS_H
+#ifndef __BLI_FILEOPS_H__
+#define __BLI_FILEOPS_H__
#ifdef __cplusplus
extern "C" {
diff --git a/source/blender/blenlib/BLI_fileops_types.h b/source/blender/blenlib/BLI_fileops_types.h
index 443ba654cb6..8e4b5b3e411 100644
--- a/source/blender/blenlib/BLI_fileops_types.h
+++ b/source/blender/blenlib/BLI_fileops_types.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLI_FILEOPS_TYPES_H
-#define BLI_FILEOPS_TYPES_H
+#ifndef __BLI_FILEOPS_TYPES_H__
+#define __BLI_FILEOPS_TYPES_H__
/** \file BLI_fileops_types.h
* \ingroup bli
@@ -74,5 +74,5 @@ struct dirlink
char *name;
};
-#endif /* BLI_FILEOPS_TYPES_H */
+#endif /* __BLI_FILEOPS_TYPES_H__ */
diff --git a/source/blender/blenlib/BLI_fnmatch.h b/source/blender/blenlib/BLI_fnmatch.h
index ac8960ff9c9..711d1aa756b 100644
--- a/source/blender/blenlib/BLI_fnmatch.h
+++ b/source/blender/blenlib/BLI_fnmatch.h
@@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#ifndef _FNMATCH_H
-#define _FNMATCH_H 1
+#ifndef __BLI_FNMATCH_H__
+#define __BLI_FNMATCH_H__
/** \file BLI_fnmatch.h
* \ingroup bli
@@ -69,4 +69,4 @@ extern int fnmatch __P ((const char *__pattern, const char *__string,
}
#endif
-#endif /* fnmatch.h */
+#endif /* __BLI_FNMATCH_H__ */
diff --git a/source/blender/blenlib/BLI_ghash.h b/source/blender/blenlib/BLI_ghash.h
index f2a7e73e5e0..ccad3250a5f 100644
--- a/source/blender/blenlib/BLI_ghash.h
+++ b/source/blender/blenlib/BLI_ghash.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLI_GHASH_H
-#define BLI_GHASH_H
+#ifndef __BLI_GHASH_H__
+#define __BLI_GHASH_H__
/** \file BLI_ghash.h
* \ingroup bli
@@ -156,4 +156,4 @@ void BLI_ghashutil_pairfree (void *ptr);
}
#endif
-#endif /* BLI_GHASH_H */
+#endif /* __BLI_GHASH_H__ */
diff --git a/source/blender/blenlib/BLI_graph.h b/source/blender/blenlib/BLI_graph.h
index 056bba71dea..5995daebc61 100644
--- a/source/blender/blenlib/BLI_graph.h
+++ b/source/blender/blenlib/BLI_graph.h
@@ -22,8 +22,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLI_GRAPH_H_
-#define BLI_GRAPH_H_
+#ifndef __BLI_GRAPH_H__
+#define __BLI_GRAPH_H__
/** \file BLI_graph.h
* \ingroup bli
@@ -184,4 +184,4 @@ void BLI_mirrorAlongAxis(float v[3], float center[3], float axis[3]);
/* Anything higher is the order in radial symmetry */
#define SYM_SIDE_RADIAL 3
-#endif /*BLI_GRAPH_H_*/
+#endif /*__BLI_GRAPH_H__*/
diff --git a/source/blender/blenlib/BLI_gsqueue.h b/source/blender/blenlib/BLI_gsqueue.h
index 425ecb79899..53fdb5a541a 100644
--- a/source/blender/blenlib/BLI_gsqueue.h
+++ b/source/blender/blenlib/BLI_gsqueue.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLI_GSQUEUE_H
-#define BLI_GSQUEUE_H
+#ifndef __BLI_GSQUEUE_H__
+#define __BLI_GSQUEUE_H__
/** \file BLI_gsqueue.h
* \ingroup bli
@@ -95,5 +95,5 @@ void BLI_gsqueue_pushback (GSQueue *gq, void *item);
*/
void BLI_gsqueue_free (GSQueue *gq);
-#endif /* BLI_GSQUEUE_H */
+#endif /* __BLI_GSQUEUE_H__ */
diff --git a/source/blender/blenlib/BLI_heap.h b/source/blender/blenlib/BLI_heap.h
index 0124c997d91..5c67bf52b9a 100644
--- a/source/blender/blenlib/BLI_heap.h
+++ b/source/blender/blenlib/BLI_heap.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLI_HEAP_H
-#define BLI_HEAP_H
+#ifndef __BLI_HEAP_H__
+#define __BLI_HEAP_H__
/** \file BLI_heap.h
* \ingroup bli
diff --git a/source/blender/blenlib/BLI_jitter.h b/source/blender/blenlib/BLI_jitter.h
index f432a51de9f..9aa21a89521 100644
--- a/source/blender/blenlib/BLI_jitter.h
+++ b/source/blender/blenlib/BLI_jitter.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLI_JITTER_H
-#define BLI_JITTER_H
+#ifndef __BLI_JITTER_H__
+#define __BLI_JITTER_H__
/** \file BLI_jitter.h
* \ingroup bli
diff --git a/source/blender/blenlib/BLI_kdopbvh.h b/source/blender/blenlib/BLI_kdopbvh.h
index 8ead7bf5f17..ff3017fef03 100644
--- a/source/blender/blenlib/BLI_kdopbvh.h
+++ b/source/blender/blenlib/BLI_kdopbvh.h
@@ -26,8 +26,8 @@
*/
-#ifndef BLI_KDOPBVH_H
-#define BLI_KDOPBVH_H
+#ifndef __BLI_KDOPBVH_H__
+#define __BLI_KDOPBVH_H__
/** \file BLI_kdopbvh.h
* \ingroup bli
@@ -111,5 +111,5 @@ int BLI_bvhtree_range_query(BVHTree *tree, const float co[3], float radius, BVHT
}
#endif
-#endif // BLI_KDOPBVH_H
+#endif // __BLI_KDOPBVH_H__
diff --git a/source/blender/blenlib/BLI_kdtree.h b/source/blender/blenlib/BLI_kdtree.h
index 9ffc64e8812..0ec514b4480 100644
--- a/source/blender/blenlib/BLI_kdtree.h
+++ b/source/blender/blenlib/BLI_kdtree.h
@@ -26,8 +26,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLI_KDTREE_H
-#define BLI_KDTREE_H
+#ifndef __BLI_KDTREE_H__
+#define __BLI_KDTREE_H__
/** \file BLI_kdtree.h
* \ingroup bli
diff --git a/source/blender/blenlib/BLI_linklist.h b/source/blender/blenlib/BLI_linklist.h
index 6886dff0da3..664beb4eb98 100644
--- a/source/blender/blenlib/BLI_linklist.h
+++ b/source/blender/blenlib/BLI_linklist.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLI_LINKLIST_H
-#define BLI_LINKLIST_H
+#ifndef __BLI_LINKLIST_H__
+#define __BLI_LINKLIST_H__
/** \file BLI_linklist.h
* \ingroup bli
diff --git a/source/blender/blenlib/BLI_listbase.h b/source/blender/blenlib/BLI_listbase.h
index 88ee79d7b97..b0a5e80d850 100644
--- a/source/blender/blenlib/BLI_listbase.h
+++ b/source/blender/blenlib/BLI_listbase.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLI_LISTBASE_H
-#define BLI_LISTBASE_H
+#ifndef __BLI_LISTBASE_H__
+#define __BLI_LISTBASE_H__
/** \file BLI_listbase.h
* \ingroup bli
diff --git a/source/blender/blenlib/BLI_math.h b/source/blender/blenlib/BLI_math.h
index 1fe700492be..89c37daae84 100644
--- a/source/blender/blenlib/BLI_math.h
+++ b/source/blender/blenlib/BLI_math.h
@@ -23,8 +23,8 @@
* ***** END GPL LICENSE BLOCK *****
* */
-#ifndef BLI_MATH_H
-#define BLI_MATH_H
+#ifndef __BLI_MATH_H__
+#define __BLI_MATH_H__
/** \file BLI_math.h
* \ingroup bli
@@ -59,5 +59,5 @@
#include "BLI_math_vector.h"
#include "BLI_math_geom.h"
-#endif /* BLI_MATH_H */
+#endif /* __BLI_MATH_H__ */
diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h
index 53db77dc203..d0a1311f2bc 100644
--- a/source/blender/blenlib/BLI_math_base.h
+++ b/source/blender/blenlib/BLI_math_base.h
@@ -23,8 +23,8 @@
* ***** END GPL LICENSE BLOCK *****
* */
-#ifndef BLI_MATH_BASE_H
-#define BLI_MATH_BASE_H
+#ifndef __BLI_MATH_BASE_H__
+#define __BLI_MATH_BASE_H__
/** \file BLI_math_base.h
* \ingroup bli
@@ -142,7 +142,7 @@
#define CLAMP(a, b, c) if((a)<(b)) (a)=(b); else if((a)>(c)) (a)=(c)
#endif
-#ifdef BLI_MATH_INLINE_H
+#ifdef __BLI_MATH_INLINE_H__
#include "intern/math_base_inline.c"
#endif
@@ -181,5 +181,5 @@ extern double round(double x);
double double_round(double x, int ndigits);
-#endif /* BLI_MATH_BASE_H */
+#endif /* __BLI_MATH_BASE_H__ */
diff --git a/source/blender/blenlib/BLI_math_color.h b/source/blender/blenlib/BLI_math_color.h
index f4d6882b5d8..4771fdbcb69 100644
--- a/source/blender/blenlib/BLI_math_color.h
+++ b/source/blender/blenlib/BLI_math_color.h
@@ -23,8 +23,8 @@
* ***** END GPL LICENSE BLOCK *****
* */
-#ifndef BLI_MATH_COLOR_H
-#define BLI_MATH_COLOR_H
+#ifndef __BLI_MATH_COLOR_H__
+#define __BLI_MATH_COLOR_H__
/** \file BLI_math_color.h
* \ingroup bli
@@ -113,7 +113,7 @@ void rgba_float_to_uchar(unsigned char col_r[4], const float col_f[4]);
void lift_gamma_gain_to_asc_cdl(float *lift, float *gamma, float *gain, float *offset, float *slope, float *power);
-#ifdef BLI_MATH_INLINE_H
+#ifdef __BLI_MATH_INLINE_H__
#include "intern/math_color_inline.c"
#endif
@@ -121,5 +121,5 @@ void lift_gamma_gain_to_asc_cdl(float *lift, float *gamma, float *gain, float *o
}
#endif
-#endif /* BLI_MATH_COLOR_H */
+#endif /* __BLI_MATH_COLOR_H__ */
diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h
index 8d18f5253c4..61e34b7cb75 100644
--- a/source/blender/blenlib/BLI_math_geom.h
+++ b/source/blender/blenlib/BLI_math_geom.h
@@ -23,8 +23,8 @@
* ***** END GPL LICENSE BLOCK *****
* */
-#ifndef BLI_MATH_GEOM_H
-#define BLI_MATH_GEOM_H
+#ifndef __BLI_MATH_GEOM_H__
+#define __BLI_MATH_GEOM_H__
/** \file BLI_math_geom.h
* \ingroup bli
@@ -36,7 +36,7 @@ extern "C" {
#include "BLI_math_inline.h"
-#ifdef BLI_MATH_INLINE_H
+#ifdef __BLI_MATH_INLINE_H__
#include "intern/math_geom_inline.c"
#endif
@@ -273,5 +273,5 @@ void axis_dominant_v3(int *axis_a, int *axis_b, const float axis[3]);
}
#endif
-#endif /* BLI_MATH_GEOM_H */
+#endif /* __BLI_MATH_GEOM_H__ */
diff --git a/source/blender/blenlib/BLI_math_inline.h b/source/blender/blenlib/BLI_math_inline.h
index 83aeb6cb735..fcc5fb744bb 100644
--- a/source/blender/blenlib/BLI_math_inline.h
+++ b/source/blender/blenlib/BLI_math_inline.h
@@ -23,8 +23,8 @@
* ***** END GPL LICENSE BLOCK *****
* */
-#ifndef BLI_MATH_INLINE_H
-#define BLI_MATH_INLINE_H
+#ifndef __BLI_MATH_INLINE_H__
+#define __BLI_MATH_INLINE_H__
/** \file BLI_math_inline.h
* \ingroup bli
@@ -35,9 +35,9 @@ extern "C" {
#endif
/* add platform/compiler checks here if it is not supported */
-#define BLI_MATH_INLINE_H
+#define __BLI_MATH_INLINE_H__
-#ifdef BLI_MATH_INLINE_H
+#ifdef __BLI_MATH_INLINE_H__
#ifdef _MSC_VER
#define MINLINE static __forceinline
#define MALWAYS_INLINE MINLINE
@@ -59,5 +59,5 @@ extern "C" {
}
#endif
-#endif /* BLI_MATH_INLINE_H */
+#endif /* __BLI_MATH_INLINE_H__ */
diff --git a/source/blender/blenlib/BLI_math_matrix.h b/source/blender/blenlib/BLI_math_matrix.h
index 4d3a4dfe445..8c19941e18c 100644
--- a/source/blender/blenlib/BLI_math_matrix.h
+++ b/source/blender/blenlib/BLI_math_matrix.h
@@ -23,8 +23,8 @@
* ***** END GPL LICENSE BLOCK *****
* */
-#ifndef BLI_MATH_MATRIX_H
-#define BLI_MATH_MATRIX_H
+#ifndef __BLI_MATH_MATRIX_H__
+#define __BLI_MATH_MATRIX_H__
/** \file BLI_math_matrix.h
* \ingroup bli
@@ -179,5 +179,5 @@ void print_m4(const char *str, float M[3][4]);
}
#endif
-#endif /* BLI_MATH_MATRIX_H */
+#endif /* __BLI_MATH_MATRIX_H__ */
diff --git a/source/blender/blenlib/BLI_math_rotation.h b/source/blender/blenlib/BLI_math_rotation.h
index fca7c3469a1..62b81530c65 100644
--- a/source/blender/blenlib/BLI_math_rotation.h
+++ b/source/blender/blenlib/BLI_math_rotation.h
@@ -23,8 +23,8 @@
* ***** END GPL LICENSE BLOCK *****
* */
-#ifndef BLI_MATH_ROTATION_H
-#define BLI_MATH_ROTATION_H
+#ifndef __BLI_MATH_ROTATION_H__
+#define __BLI_MATH_ROTATION_H__
/** \file BLI_math_rotation.h
* \ingroup bli
@@ -189,5 +189,5 @@ float angle_wrap_deg(float angle);
}
#endif
-#endif /* BLI_MATH_ROTATION_H */
+#endif /* __BLI_MATH_ROTATION_H__ */
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h
index 12a0b1892a1..af8b52a7edf 100644
--- a/source/blender/blenlib/BLI_math_vector.h
+++ b/source/blender/blenlib/BLI_math_vector.h
@@ -23,8 +23,8 @@
* ***** END GPL LICENSE BLOCK *****
* */
-#ifndef BLI_MATH_VECTOR_H
-#define BLI_MATH_VECTOR_H
+#ifndef __BLI_MATH_VECTOR_H__
+#define __BLI_MATH_VECTOR_H__
/** \file BLI_math_vector.h
* \ingroup bli
@@ -36,7 +36,7 @@ extern "C" {
#include "BLI_math_inline.h"
-#ifdef BLI_MATH_INLINE_H
+#ifdef __BLI_MATH_INLINE_H__
#include "intern/math_vector_inline.c"
#endif
@@ -216,5 +216,5 @@ void fill_vn_fl(float *array_tar, const int size, const float val);
}
#endif
-#endif /* BLI_MATH_VECTOR_H */
+#endif /* __BLI_MATH_VECTOR_H__ */
diff --git a/source/blender/blenlib/BLI_md5.h b/source/blender/blenlib/BLI_md5.h
index afcc3cdfa3e..51211d548cd 100644
--- a/source/blender/blenlib/BLI_md5.h
+++ b/source/blender/blenlib/BLI_md5.h
@@ -18,8 +18,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLI_MD5_H
-#define BLI_MD5_H
+#ifndef __BLI_MD5_H__
+#define __BLI_MD5_H__
/** \file BLI_md5.h
* \ingroup bli
diff --git a/source/blender/blenlib/BLI_memarena.h b/source/blender/blenlib/BLI_memarena.h
index ceb7b17f7ef..8306a69e567 100644
--- a/source/blender/blenlib/BLI_memarena.h
+++ b/source/blender/blenlib/BLI_memarena.h
@@ -35,8 +35,8 @@
* data, which are all freed at the same moment.
*/
-#ifndef BLI_MEMARENA_H
-#define BLI_MEMARENA_H
+#ifndef __BLI_MEMARENA_H__
+#define __BLI_MEMARENA_H__
#ifdef __cplusplus
extern "C" {
diff --git a/source/blender/blenlib/BLI_mempool.h b/source/blender/blenlib/BLI_mempool.h
index 77896709285..d80d46e9ae5 100644
--- a/source/blender/blenlib/BLI_mempool.h
+++ b/source/blender/blenlib/BLI_mempool.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLI_MEMPOOL_H
-#define BLI_MEMPOOL_H
+#ifndef __BLI_MEMPOOL_H__
+#define __BLI_MEMPOOL_H__
/** \file BLI_mempool.h
* \ingroup bli
diff --git a/source/blender/blenlib/BLI_noise.h b/source/blender/blenlib/BLI_noise.h
index de2efb18216..9f5475ced25 100644
--- a/source/blender/blenlib/BLI_noise.h
+++ b/source/blender/blenlib/BLI_noise.h
@@ -26,8 +26,8 @@
*
*/
-#ifndef BLI_NOISE_H
-#define BLI_NOISE_H
+#ifndef __BLI_NOISE_H__
+#define __BLI_NOISE_H__
/** \file BLI_noise.h
* \ingroup bli
diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h
index 68bb1a7280d..a2d432b492a 100644
--- a/source/blender/blenlib/BLI_path_util.h
+++ b/source/blender/blenlib/BLI_path_util.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLI_PATH_UTIL_H
-#define BLI_PATH_UTIL_H
+#ifndef __BLI_PATH_UTIL_H__
+#define __BLI_PATH_UTIL_H__
/** \file BLI_path_util.h
* \ingroup bli
diff --git a/source/blender/blenlib/BLI_pbvh.h b/source/blender/blenlib/BLI_pbvh.h
index e17a37c0a12..ef32ec03a61 100644
--- a/source/blender/blenlib/BLI_pbvh.h
+++ b/source/blender/blenlib/BLI_pbvh.h
@@ -18,8 +18,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLI_PBVH_H
-#define BLI_PBVH_H
+#ifndef __BLI_PBVH_H__
+#define __BLI_PBVH_H__
/** \file BLI_pbvh.h
* \ingroup bli
@@ -246,5 +246,5 @@ void BLI_pbvh_gather_proxies(PBVH* pbvh, PBVHNode*** nodes, int* totnode);
//void BLI_pbvh_node_BB_reset(PBVHNode* node);
//void BLI_pbvh_node_BB_expand(PBVHNode* node, float co[3]);
-#endif /* BLI_PBVH_H */
+#endif /* __BLI_PBVH_H__ */
diff --git a/source/blender/blenlib/BLI_rand.h b/source/blender/blenlib/BLI_rand.h
index 7ce0031bcf9..1749bbcc38a 100644
--- a/source/blender/blenlib/BLI_rand.h
+++ b/source/blender/blenlib/BLI_rand.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLI_RAND_H
-#define BLI_RAND_H
+#ifndef __BLI_RAND_H__
+#define __BLI_RAND_H__
/** \file BLI_rand.h
* \ingroup bli
diff --git a/source/blender/blenlib/BLI_rect.h b/source/blender/blenlib/BLI_rect.h
index 25b7f193105..4ff203737a0 100644
--- a/source/blender/blenlib/BLI_rect.h
+++ b/source/blender/blenlib/BLI_rect.h
@@ -26,8 +26,8 @@
*
*/
-#ifndef BLI_RECT_H
-#define BLI_RECT_H
+#ifndef __BLI_RECT_H__
+#define __BLI_RECT_H__
/** \file BLI_rect.h
* \ingroup bli
diff --git a/source/blender/blenlib/BLI_scanfill.h b/source/blender/blenlib/BLI_scanfill.h
index 8af98b2d348..5c788bc6bb7 100644
--- a/source/blender/blenlib/BLI_scanfill.h
+++ b/source/blender/blenlib/BLI_scanfill.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLI_SCANFILL_H
-#define BLI_SCANFILL_H
+#ifndef __BLI_SCANFILL_H__
+#define __BLI_SCANFILL_H__
/** \file BLI_scanfill.h
* \ingroup bli
diff --git a/source/blender/blenlib/BLI_string.h b/source/blender/blenlib/BLI_string.h
index 46389a9259e..25eb2ebecc2 100644
--- a/source/blender/blenlib/BLI_string.h
+++ b/source/blender/blenlib/BLI_string.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLI_STRING_H
-#define BLI_STRING_H
+#ifndef __BLI_STRING_H__
+#define __BLI_STRING_H__
/** \file BLI_string.h
* \ingroup bli
diff --git a/source/blender/blenlib/BLI_string_utf8.h b/source/blender/blenlib/BLI_string_utf8.h
index 6eba7d5eb49..7799c32c4b7 100644
--- a/source/blender/blenlib/BLI_string_utf8.h
+++ b/source/blender/blenlib/BLI_string_utf8.h
@@ -20,8 +20,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLI_STRING_UTF8_H
-#define BLI_STRING_UTF8_H
+#ifndef __BLI_STRING_UTF8_H__
+#define __BLI_STRING_UTF8_H__
/** \file BLI_string_utf8.h
* \ingroup bli
diff --git a/source/blender/blenlib/BLI_threads.h b/source/blender/blenlib/BLI_threads.h
index a513b9f9e85..8e75a2db629 100644
--- a/source/blender/blenlib/BLI_threads.h
+++ b/source/blender/blenlib/BLI_threads.h
@@ -27,8 +27,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLI_THREADS_H
-#define BLI_THREADS_H
+#ifndef __BLI_THREADS_H__
+#define __BLI_THREADS_H__
/** \file BLI_threads.h
* \ingroup bli
diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h
index 6d9188c1848..ef8a6015adb 100644
--- a/source/blender/blenlib/BLI_utildefines.h
+++ b/source/blender/blenlib/BLI_utildefines.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLI_UTILDEFINES_H
-#define BLI_UTILDEFINES_H
+#ifndef __BLI_UTILDEFINES_H__
+#define __BLI_UTILDEFINES_H__
/** \file BLI_utildefines.h
* \ingroup bli
@@ -225,10 +225,13 @@
#define GET_INT_FROM_POINTER(i) ((int)(intptr_t)(i))
/* Macro to convert a value to string in the preprocessor
- * STRINGIFY_ARG: gives the defined name in the string
- * STRINGIFY: gives the defined value. */
-#define STRINGIFY_ARG(x) #x
-#define STRINGIFY(x) STRINGIFY_ARG(x)
+ * STRINGIFY_ARG: gives the argument as a string
+ * STRINGIFY_APPEND: appends any argument 'b' onto the string argument 'a',
+ * used by STRINGIFY because some preprocessors warn about zero arguments
+ * STRINGIFY: gives the argument's value as a string */
+#define STRINGIFY_ARG(x) "" #x
+#define STRINGIFY_APPEND(a, b) "" a #b
+#define STRINGIFY(x) STRINGIFY_APPEND("", x)
/* useful for debugging */
#define AT __FILE__ ":" STRINGIFY(__LINE__)
@@ -310,4 +313,4 @@
# define UNLIKELY(x) (x)
#endif
-#endif // BLI_UTILDEFINES_H
+#endif // __BLI_UTILDEFINES_H__
diff --git a/source/blender/blenlib/BLI_uvproject.h b/source/blender/blenlib/BLI_uvproject.h
index d4a34a9e290..5abad87452c 100644
--- a/source/blender/blenlib/BLI_uvproject.h
+++ b/source/blender/blenlib/BLI_uvproject.h
@@ -17,8 +17,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BKE_UVPROJECT_H
-#define BKE_UVPROJECT_H
+#ifndef __BLI_UVPROJECT_H__
+#define __BLI_UVPROJECT_H__
/** \file BLI_uvproject.h
* \ingroup bli
diff --git a/source/blender/blenlib/BLI_vfontdata.h b/source/blender/blenlib/BLI_vfontdata.h
index e858e784991..5f7b7c39036 100644
--- a/source/blender/blenlib/BLI_vfontdata.h
+++ b/source/blender/blenlib/BLI_vfontdata.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLI_VFONTDATA_H
-#define BLI_VFONTDATA_H
+#ifndef __BLI_VFONTDATA_H__
+#define __BLI_VFONTDATA_H__
/** \file BLI_vfontdata.h
* \ingroup bli
diff --git a/source/blender/blenlib/BLI_voxel.h b/source/blender/blenlib/BLI_voxel.h
index 8dd95a897ae..4a13810a705 100644
--- a/source/blender/blenlib/BLI_voxel.h
+++ b/source/blender/blenlib/BLI_voxel.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLI_VOXEL_H
-#define BLI_VOXEL_H
+#ifndef __BLI_VOXEL_H__
+#define __BLI_VOXEL_H__
/** \file BLI_voxel.h
* \ingroup bli
@@ -41,4 +41,4 @@ float voxel_sample_trilinear(float *data, const int res[3], const float co[3]);
float voxel_sample_triquadratic(float *data, const int res[3], const float co[3]);
float voxel_sample_tricubic(float *data, const int res[3], const float co[3], int bspline);
-#endif /* BLI_VOXEL_H */
+#endif /* __BLI_VOXEL_H__ */
diff --git a/source/blender/blenlib/BLI_winstuff.h b/source/blender/blenlib/BLI_winstuff.h
index 0eb2f86b668..d939882b105 100644
--- a/source/blender/blenlib/BLI_winstuff.h
+++ b/source/blender/blenlib/BLI_winstuff.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef __WINSTUFF_H__
-#define __WINSTUFF_H__
+#ifndef __BLI_WINSTUFF_H__
+#define __BLI_WINSTUFF_H__
/** \file BLI_winstuff.h
* \ingroup bli
@@ -150,5 +150,5 @@ int BLI_getInstallationDir(char *str);
#endif /* _WIN32 */
-#endif /* __WINSTUFF_H__ */
+#endif /* __BLI_WINSTUFF_H__ */
diff --git a/source/blender/blenlib/PIL_time.h b/source/blender/blenlib/PIL_time.h
index 0a777a80b2a..fa2ad8644e9 100644
--- a/source/blender/blenlib/PIL_time.h
+++ b/source/blender/blenlib/PIL_time.h
@@ -32,8 +32,8 @@
*/
-#ifndef PIL_TIME_H
-#define PIL_TIME_H
+#ifndef __PIL_TIME_H__
+#define __PIL_TIME_H__
#ifdef __cplusplus
extern "C" {
@@ -78,4 +78,4 @@ void PIL_sleep_ms (int ms);
}
#endif
-#endif /* !PIL_TIME_H */
+#endif /* !__PIL_TIME_H__ */
diff --git a/source/blender/blenlib/intern/dynamiclist.h b/source/blender/blenlib/intern/dynamiclist.h
index 83b5aac963c..64c4a8fd61a 100644
--- a/source/blender/blenlib/intern/dynamiclist.h
+++ b/source/blender/blenlib/intern/dynamiclist.h
@@ -29,8 +29,8 @@
*/
-#ifndef B_DYNAMIC_LIST_H
-#define B_DYNAMIC_LIST_H
+#ifndef __DYNAMICLIST_H__
+#define __DYNAMICLIST_H__
#define PAGE_SIZE 4
diff --git a/source/blender/blenlib/intern/math_color_inline.c b/source/blender/blenlib/intern/math_color_inline.c
index 386452ed592..f8b986e799b 100644
--- a/source/blender/blenlib/intern/math_color_inline.c
+++ b/source/blender/blenlib/intern/math_color_inline.c
@@ -163,7 +163,7 @@ MINLINE void linearrgb_to_srgb_ushort4_predivide(unsigned short srgb[4], const f
for(i=0; i<3; ++i) {
t = linear[i] * inv_alpha;
- srgb[i] = (t < 1.0f)? to_srgb_table_lookup(t) * alpha : FTOUSHORT(linearrgb_to_srgb(t) * alpha);
+ srgb[i] = (t < 1.0f)? (unsigned short)(to_srgb_table_lookup(t) * alpha) : FTOUSHORT(linearrgb_to_srgb(t) * alpha);
}
srgb[3] = FTOUSHORT(linear[3]);
diff --git a/source/blender/blenlib/intern/math_vector.c b/source/blender/blenlib/intern/math_vector.c
index 47deb705def..ce9896b99cc 100644
--- a/source/blender/blenlib/intern/math_vector.c
+++ b/source/blender/blenlib/intern/math_vector.c
@@ -112,8 +112,12 @@ void mid_v3_v3v3(float v[3], const float v1[3], const float v2[3])
/********************************** Angles ***********************************/
/* Return the angle in radians between vecs 1-2 and 2-3 in radians
- If v1 is a shoulder, v2 is the elbow and v3 is the hand,
- this would return the angle at the elbow */
+ * If v1 is a shoulder, v2 is the elbow and v3 is the hand,
+ * this would return the angle at the elbow.
+ *
+ * note that when v1/v2/v3 represent 3 points along a straight line
+ * that the angle returned will be pi (180deg), rather then 0.0
+ */
float angle_v3v3v3(const float v1[3], const float v2[3], const float v3[3])
{
float vec1[3], vec2[3];
diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h
index d63baca883e..52d06c36bdf 100644
--- a/source/blender/blenloader/BLO_readfile.h
+++ b/source/blender/blenloader/BLO_readfile.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLO_READFILE_H
-#define BLO_READFILE_H
+#ifndef __BLO_READFILE_H__
+#define __BLO_READFILE_H__
/** \file BLO_readfile.h
* \ingroup blenloader
diff --git a/source/blender/blenloader/BLO_runtime.h b/source/blender/blenloader/BLO_runtime.h
index 573db5301bc..0a5a7d3a660 100644
--- a/source/blender/blenloader/BLO_runtime.h
+++ b/source/blender/blenloader/BLO_runtime.h
@@ -26,8 +26,8 @@
*
*/
-#ifndef BLO_RUNTIME_H
-#define BLO_RUNTIME_H
+#ifndef __BLO_RUNTIME_H__
+#define __BLO_RUNTIME_H__
/** \file BLO_runtime.h
* \ingroup blenloader
@@ -47,5 +47,5 @@ struct BlendFileData *BLO_read_runtime(const char *file, struct ReportList *repo
}
#endif
-#endif /* BLO_RUNTIME_H */
+#endif /* __BLO_RUNTIME_H__ */
diff --git a/source/blender/blenloader/BLO_soundfile.h b/source/blender/blenloader/BLO_soundfile.h
index 4c8d40b3e69..d2f87139b74 100644
--- a/source/blender/blenloader/BLO_soundfile.h
+++ b/source/blender/blenloader/BLO_soundfile.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLO_SOUNDFILE_H
-#define BLO_SOUNDFILE_H
+#ifndef __BLO_SOUNDFILE_H__
+#define __BLO_SOUNDFILE_H__
/** \file BLO_soundfile.h
* \ingroup blenloader
diff --git a/source/blender/blenloader/BLO_sys_types.h b/source/blender/blenloader/BLO_sys_types.h
index 20d211a74c1..9430878a641 100644
--- a/source/blender/blenloader/BLO_sys_types.h
+++ b/source/blender/blenloader/BLO_sys_types.h
@@ -40,8 +40,8 @@
*
*/
-#ifndef BLO_SYS_TYPES_H
-#define BLO_SYS_TYPES_H
+#ifndef __BLO_SYS_TYPES_H__
+#define __BLO_SYS_TYPES_H__
#ifdef __cplusplus
extern "C" {
diff --git a/source/blender/blenloader/BLO_undofile.h b/source/blender/blenloader/BLO_undofile.h
index 0e06cbd9041..f3c16e07c62 100644
--- a/source/blender/blenloader/BLO_undofile.h
+++ b/source/blender/blenloader/BLO_undofile.h
@@ -26,8 +26,8 @@
* external writefile function prototypes
*/
-#ifndef BLO_UNDOFILE_H
-#define BLO_UNDOFILE_H
+#ifndef __BLO_UNDOFILE_H__
+#define __BLO_UNDOFILE_H__
/** \file BLO_undofile.h
* \ingroup blenloader
diff --git a/source/blender/blenloader/BLO_writefile.h b/source/blender/blenloader/BLO_writefile.h
index 1ac5feef119..87b832a070e 100644
--- a/source/blender/blenloader/BLO_writefile.h
+++ b/source/blender/blenloader/BLO_writefile.h
@@ -25,8 +25,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef BLO_WRITEFILE_H
-#define BLO_WRITEFILE_H
+#ifndef __BLO_WRITEFILE_H__
+#define __BLO_WRITEFILE_H__
/** \file BLO_writefile.h
* \ingroup blenloader
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index f7a493167a9..d50a0633af4 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -3838,7 +3838,7 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh)
if((fd->flags & FD_FLAGS_SWITCH_ENDIAN) && mesh->tface) {
TFace *tf= mesh->tface;
- unsigned int i;
+ int i;
for (i=0; i< (mesh->totface); i++, tf++) {
SWITCH_INT(tf->col[0]);
@@ -7498,15 +7498,16 @@ static void do_versions_nodetree_convert_angle(bNodeTree *ntree)
void do_versions_image_settings_2_60(Scene *sce)
{
- /* note: rd->subimtype is moved into indervidual settings now and no longer
+ /* note: rd->subimtype is moved into individual settings now and no longer
* exists */
RenderData *rd= &sce->r;
ImageFormatData *imf= &sce->r.im_format;
- imf->imtype= rd->imtype;
- imf->planes= rd->planes;
- imf->compress= rd->quality;
- imf->quality= rd->quality;
+ /* we know no data loss happens here, the old values were in char range */
+ imf->imtype= (char)rd->imtype;
+ imf->planes= (char)rd->planes;
+ imf->compress= (char)rd->quality;
+ imf->quality= (char)rd->quality;
/* default, was stored in multiple places, may override later */
imf->depth= R_IMF_CHAN_DEPTH_8;
@@ -14086,6 +14087,11 @@ static void expand_sound(FileData *fd, Main *mainvar, bSound *snd)
expand_doit(fd, mainvar, snd->ipo); // XXX depreceated - old animation system
}
+static void expand_movieclip(FileData *fd, Main *mainvar, MovieClip *clip)
+{
+ if (clip->adt)
+ expand_animdata(fd, mainvar, clip->adt);
+}
static void expand_main(FileData *fd, Main *mainvar)
{
@@ -14169,6 +14175,10 @@ static void expand_main(FileData *fd, Main *mainvar)
break;
case ID_PA:
expand_particlesettings(fd, mainvar, (ParticleSettings *)id);
+ break;
+ case ID_MC:
+ expand_movieclip(fd, mainvar, (MovieClip *)id);
+ break;
}
doit= 1;
diff --git a/source/blender/blenloader/intern/readfile.h b/source/blender/blenloader/intern/readfile.h
index c7a53555415..511ded0ecdc 100644
--- a/source/blender/blenloader/intern/readfile.h
+++ b/source/blender/blenloader/intern/readfile.h
@@ -30,8 +30,8 @@
* \ingroup blenloader
*/
-#ifndef READFILE_H
-#define READFILE_H
+#ifndef __READFILE_H__
+#define __READFILE_H__
#include "zlib.h"
diff --git a/source/blender/blenpluginapi/externdef.h b/source/blender/blenpluginapi/externdef.h
index 28239d117cd..fbd81a83272 100644
--- a/source/blender/blenpluginapi/externdef.h
+++ b/source/blender/blenpluginapi/externdef.h
@@ -30,8 +30,8 @@
* SUCH DAMAGE.
*/
-#ifndef _EXTERNDEF_H
-#define _EXTERNDEF_H
+#ifndef __EXTERNDEF_H__
+#define __EXTERNDEF_H__
#ifdef WIN32
#ifdef PLUGIN_INTERN
@@ -46,4 +46,4 @@
#define LIBIMPORT extern
#endif
-#endif /* _EXTERNDEF_H */
+#endif /* __EXTERNDEF_H__ */
diff --git a/source/blender/blenpluginapi/floatpatch.h b/source/blender/blenpluginapi/floatpatch.h
index 73fe35cad26..4c9b98d073d 100644
--- a/source/blender/blenpluginapi/floatpatch.h
+++ b/source/blender/blenpluginapi/floatpatch.h
@@ -30,8 +30,8 @@
* SUCH DAMAGE.
*/
-#ifndef FLOATPATCH_H
-#define FLOATPATCH_H
+#ifndef __FLOATPATCH_H__
+#define __FLOATPATCH_H__
/* floating point libs differ at systems... with these defines it comilies at all! */
@@ -88,5 +88,5 @@
#endif
-#endif /* FLOATPATCH_H */
+#endif /* __FLOATPATCH_H__ */
diff --git a/source/blender/blenpluginapi/iff.h b/source/blender/blenpluginapi/iff.h
index f07e80b36ce..cf235c2f0ca 100644
--- a/source/blender/blenpluginapi/iff.h
+++ b/source/blender/blenpluginapi/iff.h
@@ -30,8 +30,8 @@
* SUCH DAMAGE.
*/
-#ifndef IFF_H
-#define IFF_H
+#ifndef __IFF_H__
+#define __IFF_H__
#include <sys/types.h>
#include "util.h"
@@ -117,5 +117,5 @@ LIBIMPORT void IMB_rectfill_area(struct ImBuf *ibuf, float *col, int x1, int y1,
LIBIMPORT void buf_rectfill_area(unsigned char *rect, float *rectf, int width, int height, const float col[4], int x1, int y1, int x2, int y2);
LIBIMPORT void IMB_rectfill_alpha(struct ImBuf *drect, const float value);
-#endif /* IFF_H */
+#endif /* __IFF_H__ */
diff --git a/source/blender/blenpluginapi/plugin.h b/source/blender/blenpluginapi/plugin.h
index 65569560faf..eb32fe80fa3 100644
--- a/source/blender/blenpluginapi/plugin.h
+++ b/source/blender/blenpluginapi/plugin.h
@@ -30,8 +30,8 @@
* SUCH DAMAGE.
*/
-#ifndef PLUGIN_H
-#define PLUGIN_H
+#ifndef __PLUGIN_H__
+#define __PLUGIN_H__
#include "externdef.h"
#include "iff.h"
@@ -102,5 +102,5 @@ LIBIMPORT float turbulence(float noisesize, float x, float y, float z, int depth
/* hard turbulence */
LIBIMPORT float turbulence1(float noisesize, float x, float y, float z, int depth);
-#endif /* PLUGIN_H */
+#endif /* __PLUGIN_H__ */
diff --git a/source/blender/blenpluginapi/util.h b/source/blender/blenpluginapi/util.h
index 156e758977d..340201924d7 100644
--- a/source/blender/blenpluginapi/util.h
+++ b/source/blender/blenpluginapi/util.h
@@ -30,8 +30,8 @@
* SUCH DAMAGE.
*/
-#ifndef UTIL_H
-#define UTIL_H
+#ifndef __UTIL_H__
+#define __UTIL_H__
#include <sys/types.h>
#include <stdlib.h>
@@ -98,5 +98,5 @@ LIBEXPORT void *mallocT(int len, char *str);
LIBEXPORT void *callocT(int len, char *str);
LIBEXPORT void freeT(void *vmemh);
-#endif /* UTIL_H */
+#endif /* __UTIL_H__ */
diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp
index c47e024aba4..b889dd21177 100644
--- a/source/blender/collada/AnimationImporter.cpp
+++ b/source/blender/collada/AnimationImporter.cpp
@@ -834,34 +834,33 @@ void AnimationImporter::translate_Animations ( COLLADAFW::Node * node ,
std::vector<FCurve*> animcurves;
for (unsigned int j = 0; j < bindings.getCount(); j++) {
animcurves = curve_map[bindings[j].animation];
- if ( is_matrix )
+ if ( is_matrix ) {
apply_matrix_curves(ob, animcurves, root , node, transform );
+ }
else {
- //calculate rnapaths and array index of fcurves according to transformation and animation class
- Assign_transform_animations(transform, &bindings[j], &animcurves, is_joint, joint_path );
-
- std::vector<FCurve*>::iterator iter;
- //Add the curves of the current animation to the object
- for (iter = animcurves.begin(); iter != animcurves.end(); iter++) {
- FCurve * fcu = *iter;
- if ((ob->type == OB_ARMATURE))
- add_bone_fcurve( ob, node , fcu );
- else
- BLI_addtail(AnimCurves, fcu);
+
+ if (is_joint) {
+
+ add_bone_animation_sampled(ob, animcurves, root, node, transform);
+ }
+ else {
+ //calculate rnapaths and array index of fcurves according to transformation and animation class
+ Assign_transform_animations(transform, &bindings[j], &animcurves, is_joint, joint_path );
+
+ std::vector<FCurve*>::iterator iter;
+ //Add the curves of the current animation to the object
+ for (iter = animcurves.begin(); iter != animcurves.end(); iter++) {
+ FCurve * fcu = *iter;
+
+ BLI_addtail(AnimCurves, fcu);
+ }
}
+
}
}
}
- if (is_rotation) {
- if (is_joint)
- {
- bPoseChannel *chan = get_pose_channel(ob->pose, bone_name);
- chan->rotmode = ROT_MODE_EUL;
- }
- else
- {
- ob->rotmode = ROT_MODE_EUL;
- }
+ if (is_rotation && !is_joint) {
+ ob->rotmode = ROT_MODE_EUL;
}
}
}
@@ -992,6 +991,136 @@ void AnimationImporter::translate_Animations ( COLLADAFW::Node * node ,
}
}
+void AnimationImporter::add_bone_animation_sampled(Object * ob, std::vector<FCurve*>& animcurves, COLLADAFW::Node* root, COLLADAFW::Node* node, COLLADAFW::Transformation * tm)
+{
+ const char *bone_name = bc_get_joint_name(node);
+ char joint_path[200];
+ armature_importer->get_rna_path_for_joint(node, joint_path, sizeof(joint_path));
+
+ std::vector<float> frames;
+ find_frames(&frames, &animcurves);
+
+ // convert degrees to radians
+ if (tm->getTransformationType() == COLLADAFW::Transformation::ROTATE) {
+
+ std::vector<FCurve*>::iterator iter;
+ for (iter = animcurves.begin(); iter != animcurves.end(); iter++) {
+ FCurve* fcu = *iter;
+
+ fcurve_deg_to_rad(fcu);
+ }
+ }
+
+
+ float irest_dae[4][4];
+ float rest[4][4], irest[4][4];
+
+ get_joint_rest_mat(irest_dae, root, node);
+ invert_m4(irest_dae);
+
+ Bone *bone = get_named_bone((bArmature*)ob->data, bone_name);
+ if (!bone) {
+ fprintf(stderr, "cannot find bone \"%s\"\n", bone_name);
+ return;
+ }
+
+ unit_m4(rest);
+ copy_m4_m4(rest, bone->arm_mat);
+ invert_m4_m4(irest, rest);
+
+ // new curves to assign matrix transform animation
+ FCurve *newcu[10]; // if tm_type is matrix, then create 10 curves: 4 rot, 3 loc, 3 scale
+ unsigned int totcu = 10 ;
+ const char *tm_str = NULL;
+ char rna_path[200];
+ for (int i = 0; i < totcu; i++) {
+
+ int axis = i;
+
+ if (i < 4) {
+ tm_str = "rotation_quaternion";
+ axis = i;
+ }
+ else if (i < 7) {
+ tm_str = "location";
+ axis = i - 4;
+ }
+ else {
+ tm_str = "scale";
+ axis = i - 7;
+ }
+
+
+ BLI_snprintf(rna_path, sizeof(rna_path), "%s.%s", joint_path, tm_str);
+
+ newcu[i] = create_fcurve(axis, rna_path);
+ newcu[i]->totvert = frames.size();
+ }
+
+ if (frames.size() == 0)
+ return;
+
+ std::sort(frames.begin(), frames.end());
+
+ std::vector<float>::iterator it;
+
+ // sample values at each frame
+ for (it = frames.begin(); it != frames.end(); it++) {
+ float fra = *it;
+
+ float mat[4][4];
+ float matfra[4][4];
+
+ unit_m4(matfra);
+
+ // calc object-space mat
+ evaluate_transform_at_frame(matfra, node, fra);
+
+
+ // for joints, we need a special matrix
+ // special matrix: iR * M * iR_dae * R
+ // where R, iR are bone rest and inverse rest mats in world space (Blender bones),
+ // iR_dae is joint inverse rest matrix (DAE) and M is an evaluated joint world-space matrix (DAE)
+ float temp[4][4], par[4][4];
+
+
+ // calc M
+ calc_joint_parent_mat_rest(par, NULL, root, node);
+ mult_m4_m4m4(temp, par, matfra);
+
+ // evaluate_joint_world_transform_at_frame(temp, NULL, , node, fra);
+
+ // calc special matrix
+ mul_serie_m4(mat, irest, temp, irest_dae, rest, NULL, NULL, NULL, NULL);
+
+ float rot[4], loc[3], scale[3];
+
+ mat4_to_quat(rot, mat);
+ copy_v3_v3(loc, mat[3]);
+ mat4_to_size(scale, mat);
+
+ // add keys
+ for (int i = 0; i < totcu; i++) {
+ if (i < 4)
+ add_bezt(newcu[i], fra, rot[i]);
+ else if (i < 7)
+ add_bezt(newcu[i], fra, loc[i - 4]);
+ else
+ add_bezt(newcu[i], fra, scale[i - 7]);
+ }
+ }
+ verify_adt_action((ID*)&ob->id, 1);
+
+ // add curves
+ for (int i= 0; i < totcu; i++) {
+ add_bone_fcurve(ob, node, newcu[i]);
+ }
+
+ bPoseChannel *chan = get_pose_channel(ob->pose, bone_name);
+ chan->rotmode = ROT_MODE_QUAT;
+
+}
+
//Check if object is animated by checking if animlist_map holds the animlist_id of node transforms
AnimationImporter::AnimMix* AnimationImporter::get_animation_type ( const COLLADAFW::Node * node ,
@@ -1406,12 +1535,10 @@ void AnimationImporter::evaluate_transform_at_frame(float mat[4][4], COLLADAFW::
float m[4][4];
unit_m4(m);
- if ( type != COLLADAFW::Transformation::MATRIX )
- continue;
std::string nodename = node->getName().size() ? node->getName() : node->getOriginalId();
if (!evaluate_animation(tm, m, fra, nodename.c_str())) {
- /*switch (type) {
+ switch (type) {
case COLLADAFW::Transformation::ROTATE:
dae_rotate_to_mat4(tm, m);
break;
@@ -1426,8 +1553,8 @@ void AnimationImporter::evaluate_transform_at_frame(float mat[4][4], COLLADAFW::
break;
default:
fprintf(stderr, "unsupported transformation type %d\n", type);
- }*/
- dae_matrix_to_mat4(tm, m);
+ }
+ // dae_matrix_to_mat4(tm, m);
}
@@ -1510,6 +1637,7 @@ bool AnimationImporter::evaluate_animation(COLLADAFW::Transformation *tm, float
}
COLLADABU::Math::Vector3& axis = ((COLLADAFW::Rotate*)tm)->getRotationAxis();
+
float ax[3] = {axis[0], axis[1], axis[2]};
float angle = evaluate_fcurve(curves[0], fra);
axis_angle_to_mat4(mat, ax, angle);
diff --git a/source/blender/collada/AnimationImporter.h b/source/blender/collada/AnimationImporter.h
index 2c3165db122..5fb96017dee 100644
--- a/source/blender/collada/AnimationImporter.h
+++ b/source/blender/collada/AnimationImporter.h
@@ -24,8 +24,8 @@
* \ingroup collada
*/
-#ifndef __BC_ANIMATIONIMPORTER_H__
-#define __BC_ANIMATIONIMPORTER_H__
+#ifndef __ANIMATIONIMPORTER_H__
+#define __ANIMATIONIMPORTER_H__
#include <map>
#include <vector>
@@ -153,6 +153,8 @@ public:
void apply_matrix_curves( Object * ob, std::vector<FCurve*>& animcurves, COLLADAFW::Node* root ,COLLADAFW::Node* node,
COLLADAFW::Transformation * tm );
+ void add_bone_animation_sampled(Object * ob, std::vector<FCurve*>& animcurves, COLLADAFW::Node* root ,COLLADAFW::Node* node, COLLADAFW::Transformation * tm);
+
void Assign_transform_animations(COLLADAFW::Transformation* transform ,
const COLLADAFW::AnimationList::AnimationBinding * binding,
std::vector<FCurve*>* curves, bool is_joint, char * joint_path);
diff --git a/source/blender/collada/ArmatureImporter.h b/source/blender/collada/ArmatureImporter.h
index 343badaca28..0c95ee81272 100644
--- a/source/blender/collada/ArmatureImporter.h
+++ b/source/blender/collada/ArmatureImporter.h
@@ -24,8 +24,8 @@
* \ingroup collada
*/
-#ifndef __BC_ARMATUREIMPORTER_H__
-#define __BC_ARMATUREIMPORTER_H__
+#ifndef __ARMATUREIMPORTER_H__
+#define __ARMATUREIMPORTER_H__
#include "COLLADAFWNode.h"
#include "COLLADAFWUniqueId.h"
diff --git a/source/blender/collada/MeshImporter.h b/source/blender/collada/MeshImporter.h
index 3bccc4ed04a..0c2e600121f 100644
--- a/source/blender/collada/MeshImporter.h
+++ b/source/blender/collada/MeshImporter.h
@@ -24,8 +24,8 @@
* \ingroup collada
*/
-#ifndef __BC__MESHIMPORTER_H__
-#define __BC__MESHIMPORTER_H__
+#ifndef __MESHIMPORTER_H__
+#define __MESHIMPORTER_H__
#include <map>
#include <vector>
diff --git a/source/blender/collada/SkinInfo.h b/source/blender/collada/SkinInfo.h
index 71b7c71fd90..7befe7168d3 100644
--- a/source/blender/collada/SkinInfo.h
+++ b/source/blender/collada/SkinInfo.h
@@ -24,8 +24,8 @@
* \ingroup collada
*/
-#ifndef __BC_SKININFO_H__
-#define __BC_SKININFO_H__
+#ifndef __SKININFO_H__
+#define __SKININFO_H__
#include <map>
#include <vector>
diff --git a/source/blender/collada/TransformReader.h b/source/blender/collada/TransformReader.h
index e1409a9ced8..a08f4438d73 100644
--- a/source/blender/collada/TransformReader.h
+++ b/source/blender/collada/TransformReader.h
@@ -24,8 +24,8 @@
* \ingroup collada
*/
-#ifndef __BC_TRANSFORMREADER_H__
-#define __BC_TRANSFORMREADER_H__
+#ifndef __TRANSFORMREADER_H__
+#define __TRANSFORMREADER_H__
#include "COLLADAFWNode.h"
#include "COLLADAFWTransformation.h"
diff --git a/source/blender/collada/TransformWriter.cpp b/source/blender/collada/TransformWriter.cpp
index c806cd48587..0cf26a03107 100644
--- a/source/blender/collada/TransformWriter.cpp
+++ b/source/blender/collada/TransformWriter.cpp
@@ -95,20 +95,24 @@ void TransformWriter::add_node_transform_ob(COLLADASW::Node& node, Object *ob)
*/
/* Using parentinv should allow use of existing curves */
- // If parentinv is identity don't add it.
- bool add_parinv = false;
- for(int i = 0; i < 16; ++i)
+ if(ob->parent)
{
- float f = (i%4 == i/4) ? 1.0f : 0.0f ;
- if(ob->parentinv[i%4][i/4] != f) add_parinv = true;
- }
-
- if(add_parinv && ob->parent)
- {
- double dmat[4][4];
- UnitConverter converter;
- converter.mat4_to_dae_double(dmat, ob->parentinv);
- node.addMatrix("parentinverse", dmat);
+ // If parentinv is identity don't add it.
+ bool add_parinv = false;
+
+ for(int i = 0; i < 16; ++i)
+ {
+ float f = (i%4 == i/4) ? 1.0f : 0.0f ;
+ add_parinv |= (ob->parentinv[i%4][i/4] != f);
+ }
+
+ if(add_parinv)
+ {
+ double dmat[4][4];
+ UnitConverter converter;
+ converter.mat4_to_dae_double(dmat, ob->parentinv);
+ node.addMatrix("parentinverse", dmat);
+ }
}
add_transform(node, ob->loc, ob->rot, ob->size);
diff --git a/source/blender/collada/collada.h b/source/blender/collada/collada.h
index 161977368db..f8afc797447 100644
--- a/source/blender/collada/collada.h
+++ b/source/blender/collada/collada.h
@@ -24,8 +24,8 @@
* \ingroup collada
*/
-#ifndef BLENDER_COLLADA_H
-#define BLENDER_COLLADA_H
+#ifndef __COLLADA_H__
+#define __COLLADA_H__
struct bContext;
struct Scene;
diff --git a/source/blender/collada/collada_internal.h b/source/blender/collada/collada_internal.h
index 5c3aa49b837..4f555acb882 100644
--- a/source/blender/collada/collada_internal.h
+++ b/source/blender/collada/collada_internal.h
@@ -24,8 +24,8 @@
* \ingroup collada
*/
-#ifndef COLLADA_INTERNAL_H
-#define COLLADA_INTERNAL_H
+#ifndef __COLLADA_INTERNAL_H__
+#define __COLLADA_INTERNAL_H__
#include <string>
#include <vector>
@@ -98,4 +98,4 @@ extern std::string get_material_id(Material *mat);
extern bool has_object_type(Scene* sce, short obtype);
-#endif /* COLLADA_INTERNAL_H */
+#endif /* __COLLADA_INTERNAL_H__ */
diff --git a/source/blender/collada/collada_utils.h b/source/blender/collada/collada_utils.h
index b95e3bd2824..b0c24152652 100644
--- a/source/blender/collada/collada_utils.h
+++ b/source/blender/collada/collada_utils.h
@@ -24,8 +24,8 @@
* \ingroup collada
*/
-#ifndef __BC_UTILS_H__
-#define __BC_UTILS_H__
+#ifndef __COLLADA_UTILS_H__
+#define __COLLADA_UTILS_H__
#include "COLLADAFWMeshPrimitive.h"
#include "COLLADAFWGeometry.h"
diff --git a/source/blender/editors/animation/anim_intern.h b/source/blender/editors/animation/anim_intern.h
index 0ac941e5630..bfc70c79404 100644
--- a/source/blender/editors/animation/anim_intern.h
+++ b/source/blender/editors/animation/anim_intern.h
@@ -28,8 +28,8 @@
*/
-#ifndef ANIM_INTERN_H
-#define ANIM_INTERN_H
+#ifndef __ANIM_INTERN_H__
+#define __ANIM_INTERN_H__
/* KeyingSets/Keyframing Interface ------------- */
@@ -79,4 +79,4 @@ void ANIM_OT_driver_button_remove(struct wmOperatorType *ot);
void ANIM_OT_copy_driver_button(struct wmOperatorType *ot);
void ANIM_OT_paste_driver_button(struct wmOperatorType *ot);
-#endif // ANIM_INTERN_H
+#endif // __ANIM_INTERN_H__
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 84206c4275e..5557923c3d6 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -1178,7 +1178,8 @@ void ANIM_OT_keyframe_insert (wmOperatorType *ot)
/* confirm whether a keyframe was added by showing a popup
* - by default, this is enabled, since this operator is assumed to be called independently
*/
- prop= RNA_def_boolean(ot->srna, "confirm_success", 1, "Confirm Successful Insert", "Show a popup when the keyframes get successfully added");
+ prop= RNA_def_boolean(ot->srna, "confirm_success", 1, "Confirm Successful Insert",
+ "Show a popup when the keyframes get successfully added");
RNA_def_property_flag(prop, PROP_HIDDEN);
}
@@ -1233,7 +1234,8 @@ void ANIM_OT_keyframe_insert_menu (wmOperatorType *ot)
* - by default, this is disabled so that if a menu is shown, this doesn't come up too
*/
// XXX should this just be always on?
- prop= RNA_def_boolean(ot->srna, "confirm_success", 0, "Confirm Successful Insert", "Show a popup when the keyframes get successfully added");
+ prop= RNA_def_boolean(ot->srna, "confirm_success", 0, "Confirm Successful Insert",
+ "Show a popup when the keyframes get successfully added");
RNA_def_property_flag(prop, PROP_HIDDEN);
/* whether the menu should always be shown
@@ -1273,7 +1275,7 @@ static int delete_key_exec (bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- /* try to insert keyframes for the channels specified by KeyingSet */
+ /* try to delete keyframes for the channels specified by KeyingSet */
success= ANIM_apply_keyingset(C, NULL, NULL, ks, MODIFYKEY_MODE_DELETE, cfra);
if (G.f & G_DEBUG)
printf("KeyingSet '%s' - Successfully removed %d Keyframes \n", ks->name, success);
@@ -1325,7 +1327,8 @@ void ANIM_OT_keyframe_delete (wmOperatorType *ot)
/* confirm whether a keyframe was added by showing a popup
* - by default, this is enabled, since this operator is assumed to be called independently
*/
- RNA_def_boolean(ot->srna, "confirm_success", 1, "Confirm Successful Insert", "Show a popup when the keyframes get successfully added");
+ RNA_def_boolean(ot->srna, "confirm_success", 1, "Confirm Successful Delete",
+ "Show a popup when the keyframes get successfully removed");
}
/* Delete Key Operator ------------------------ */
diff --git a/source/blender/editors/armature/BIF_generate.h b/source/blender/editors/armature/BIF_generate.h
index 311b110a3f6..1d8ee8e2c62 100644
--- a/source/blender/editors/armature/BIF_generate.h
+++ b/source/blender/editors/armature/BIF_generate.h
@@ -23,8 +23,8 @@
*/
-#ifndef BIF_GENERATE_H
-#define BIF_GENERATE_H
+#ifndef __BIF_GENERATE_H__
+#define __BIF_GENERATE_H__
struct ToolSettings;
struct EditBone;
@@ -45,4 +45,4 @@ struct EditBone * subdivideArcBy(struct ToolSettings *toolsettings, struct bArma
void setBoneRollFromNormal(struct EditBone *bone, float *no, float invmat[][4], float tmat[][3]);
-#endif /* BIF_GENERATE_H */
+#endif /* __BIF_GENERATE_H__ */
diff --git a/source/blender/editors/armature/BIF_retarget.h b/source/blender/editors/armature/BIF_retarget.h
index ad3d3555250..c878b0c36df 100644
--- a/source/blender/editors/armature/BIF_retarget.h
+++ b/source/blender/editors/armature/BIF_retarget.h
@@ -23,8 +23,8 @@
*/
-#ifndef BIF_RETARGET_H
-#define BIF_RETARGET_H
+#ifndef __BIF_RETARGET_H__
+#define __BIF_RETARGET_H__
#include "DNA_listBase.h"
@@ -168,4 +168,4 @@ void RIG_printArc(struct RigGraph *rg, struct RigArc *arc);
void RIG_printGraph(struct RigGraph *rg);
void RIG_printArcBones(struct RigArc *arc);
-#endif /* BIF_RETARGET_H */
+#endif /* __BIF_RETARGET_H__ */
diff --git a/source/blender/editors/armature/armature_intern.h b/source/blender/editors/armature/armature_intern.h
index 40d909380a0..13239f87e65 100644
--- a/source/blender/editors/armature/armature_intern.h
+++ b/source/blender/editors/armature/armature_intern.h
@@ -28,8 +28,8 @@
* \ingroup edarmature
*/
-#ifndef ED_ARMATURE_INTERN_H
-#define ED_ARMATURE_INTERN_H
+#ifndef __ARMATURE_INTERN_H__
+#define __ARMATURE_INTERN_H__
/* internal exports only */
struct wmOperatorType;
@@ -219,5 +219,5 @@ struct EditBone *duplicateEditBoneObjects(struct EditBone *curBone, const char *
/* editbones is the source list */
void updateDuplicateSubtargetObjects(struct EditBone *dupBone, struct ListBase *editbones, struct Object *src_ob, struct Object *dst_ob);
-#endif /* ED_ARMATURE_INTERN_H */
+#endif /* __ARMATURE_INTERN_H__ */
diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c
index 319b2c755b1..005f5f6da95 100644
--- a/source/blender/editors/armature/meshlaplacian.c
+++ b/source/blender/editors/armature/meshlaplacian.c
@@ -181,9 +181,9 @@ static void laplacian_triangle_area(LaplacianSystem *sys, int i1, int i2, int i3
t2= cotan_weight(v2, v3, v1);
t3= cotan_weight(v3, v1, v2);
- if(RAD2DEGF(angle_v3v3v3(v2, v1, v3)) > 90) obtuse= 1;
- else if(RAD2DEGF(angle_v3v3v3(v1, v2, v3)) > 90) obtuse= 2;
- else if(RAD2DEGF(angle_v3v3v3(v1, v3, v2)) > 90) obtuse= 3;
+ if (angle_v3v3v3(v2, v1, v3) > DEG2RADF(90.0f)) obtuse= 1;
+ else if(angle_v3v3v3(v1, v2, v3) > DEG2RADF(90.0f)) obtuse= 2;
+ else if(angle_v3v3v3(v1, v3, v2) > DEG2RADF(90.0f)) obtuse= 3;
if (obtuse > 0) {
area= area_tri_v3(v1, v2, v3);
diff --git a/source/blender/editors/armature/meshlaplacian.h b/source/blender/editors/armature/meshlaplacian.h
index 6ec67997d24..fbc1596ed0c 100644
--- a/source/blender/editors/armature/meshlaplacian.h
+++ b/source/blender/editors/armature/meshlaplacian.h
@@ -31,8 +31,8 @@
*/
-#ifndef BIF_MESHLAPLACIAN_H
-#define BIF_MESHLAPLACIAN_H
+#ifndef __MESHLAPLACIAN_H__
+#define __MESHLAPLACIAN_H__
//#define RIGID_DEFORM
diff --git a/source/blender/editors/armature/reeb.h b/source/blender/editors/armature/reeb.h
index 0080bbec120..b925aea510a 100644
--- a/source/blender/editors/armature/reeb.h
+++ b/source/blender/editors/armature/reeb.h
@@ -25,8 +25,8 @@
*/
-#ifndef REEB_H_
-#define REEB_H_
+#ifndef __REEB_H__
+#define __REEB_H__
#define WITH_BF_REEB
@@ -203,4 +203,4 @@ void REEB_exportGraph(ReebGraph *rg, int count);
void REEB_draw(void);
-#endif /*REEB_H_*/
+#endif /*__REEB_H__*/
diff --git a/source/blender/editors/curve/curve_intern.h b/source/blender/editors/curve/curve_intern.h
index 2014345e163..0cc47774207 100644
--- a/source/blender/editors/curve/curve_intern.h
+++ b/source/blender/editors/curve/curve_intern.h
@@ -29,8 +29,8 @@
*/
-#ifndef ED_CURVE_INTERN_H
-#define ED_CURVE_INTERN_H
+#ifndef __CURVE_INTERN_H__
+#define __CURVE_INTERN_H__
/* internal exports only */
struct wmOperatorType;
diff --git a/source/blender/editors/gpencil/gpencil_intern.h b/source/blender/editors/gpencil/gpencil_intern.h
index 8000af54f53..b88723d8a3c 100644
--- a/source/blender/editors/gpencil/gpencil_intern.h
+++ b/source/blender/editors/gpencil/gpencil_intern.h
@@ -28,8 +28,8 @@
* \ingroup edgpencil
*/
-#ifndef ED_GPENCIL_INTERN_H
-#define ED_GPENCIL_INTERN_H
+#ifndef __GPENCIL_INTERN_H__
+#define __GPENCIL_INTERN_H__
/* internal exports only */
@@ -117,5 +117,5 @@ typedef enum ACTCONT_TYPES {
-#endif /* ED_GPENCIL_INTERN_H */
+#endif /* __GPENCIL_INTERN_H__ */
diff --git a/source/blender/editors/include/BIF_gl.h b/source/blender/editors/include/BIF_gl.h
index 940a5866fcd..d34e6f74b4c 100644
--- a/source/blender/editors/include/BIF_gl.h
+++ b/source/blender/editors/include/BIF_gl.h
@@ -30,8 +30,8 @@
* \ingroup editorui
*/
-#ifndef BIF_GL_H
-#define BIF_GL_H
+#ifndef __BIF_GL_H__
+#define __BIF_GL_H__
#include "GL/glew.h"
@@ -50,5 +50,5 @@
#define glMultMatrixf(x) glMultMatrixf( (float *)(x))
#define glLoadMatrixf(x) glLoadMatrixf( (float *)(x))
-#endif /* #ifdef BIF_GL_H */
+#endif /* #ifdef __BIF_GL_H__ */
diff --git a/source/blender/editors/include/BIF_glutil.h b/source/blender/editors/include/BIF_glutil.h
index 33e9192a23e..b1114eba141 100644
--- a/source/blender/editors/include/BIF_glutil.h
+++ b/source/blender/editors/include/BIF_glutil.h
@@ -27,8 +27,8 @@
* \ingroup editorui
*/
-#ifndef BIF_GLUTIL_H
-#define BIF_GLUTIL_H
+#ifndef __BIF_GLUTIL_H__
+#define __BIF_GLUTIL_H__
struct rcti;
struct rctf;
@@ -216,5 +216,5 @@ typedef struct bglMats {
} bglMats;
void bgl_get_mats(bglMats *mats);
-#endif /* BIF_GLUTIL_H */
+#endif /* __BIF_GLUTIL_H__ */
diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h
index 6b449f68e1d..c75ec259504 100644
--- a/source/blender/editors/include/ED_anim_api.h
+++ b/source/blender/editors/include/ED_anim_api.h
@@ -28,8 +28,8 @@
* \ingroup editors
*/
-#ifndef ED_ANIM_API_H
-#define ED_ANIM_API_H
+#ifndef __ED_ANIM_API_H__
+#define __ED_ANIM_API_H__
struct ID;
struct ListBase;
@@ -605,5 +605,5 @@ void ED_operatormacros_action(void);
/* ************************************************ */
-#endif /* ED_ANIM_API_H */
+#endif /* __ED_ANIM_API_H__ */
diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h
index d345f16b768..544250fcd2e 100644
--- a/source/blender/editors/include/ED_armature.h
+++ b/source/blender/editors/include/ED_armature.h
@@ -27,8 +27,8 @@
* \ingroup editors
*/
-#ifndef ED_ARMATURE_H
-#define ED_ARMATURE_H
+#ifndef __ED_ARMATURE_H__
+#define __ED_ARMATURE_H__
#ifdef __cplusplus
extern "C" {
@@ -182,7 +182,7 @@ void mesh_deform_bind(struct Scene *scene,
}
#endif
-#endif /* ED_ARMATURE_H */
+#endif /* __ED_ARMATURE_H__ */
diff --git a/source/blender/editors/include/ED_clip.h b/source/blender/editors/include/ED_clip.h
index 004fd7ceef7..8e3488203a2 100644
--- a/source/blender/editors/include/ED_clip.h
+++ b/source/blender/editors/include/ED_clip.h
@@ -28,8 +28,8 @@
* \ingroup editors
*/
-#ifndef ED_MOVIECLIP_H
-#define ED_MOVIECLIP_H
+#ifndef __ED_CLIP_H__
+#define __ED_CLIP_H__
struct ARegion;
struct bContext;
diff --git a/source/blender/editors/include/ED_curve.h b/source/blender/editors/include/ED_curve.h
index 7e7d60fdea8..700ff39fdba 100644
--- a/source/blender/editors/include/ED_curve.h
+++ b/source/blender/editors/include/ED_curve.h
@@ -28,8 +28,8 @@
* \ingroup editors
*/
-#ifndef ED_CURVE_H
-#define ED_CURVE_H
+#ifndef __ED_CURVE_H__
+#define __ED_CURVE_H__
struct Base;
struct bContext;
@@ -95,5 +95,5 @@ int ED_curve_actSelection(struct Curve *cu, float center[3]);
/* debug only */
void printknots(struct Object *obedit);
-#endif /* ED_CURVE_H */
+#endif /* __ED_CURVE_H__ */
diff --git a/source/blender/editors/include/ED_datafiles.h b/source/blender/editors/include/ED_datafiles.h
index 2c4472c4636..9fe2fe685a0 100644
--- a/source/blender/editors/include/ED_datafiles.h
+++ b/source/blender/editors/include/ED_datafiles.h
@@ -28,8 +28,8 @@
* \ingroup editors
*/
-#ifndef ED_DATAFILES_H
-#define ED_DATAFILES_H
+#ifndef __ED_DATAFILES_H__
+#define __ED_DATAFILES_H__
/* Datafiles embedded in Blender */
@@ -142,5 +142,5 @@ extern int datatoc_vertexdraw_png_size;
extern char datatoc_vertexdraw_png[];
-#endif /* ED_DATAFILES_H */
+#endif /* __ED_DATAFILES_H__ */
diff --git a/source/blender/editors/include/ED_fileselect.h b/source/blender/editors/include/ED_fileselect.h
index dc362f9f99b..7cf750f5a9b 100644
--- a/source/blender/editors/include/ED_fileselect.h
+++ b/source/blender/editors/include/ED_fileselect.h
@@ -28,8 +28,8 @@
* \ingroup editors
*/
-#ifndef ED_FILES_H
-#define ED_FILES_H
+#ifndef __ED_FILESELECT_H__
+#define __ED_FILESELECT_H__
struct SpaceFile;
struct ARegion;
@@ -106,5 +106,5 @@ void ED_fileselect_exit(struct bContext *C, struct SpaceFile *sfile);
int ED_file_extension_icon(const char *relname);
-#endif /* ED_FILES_H */
+#endif /* __ED_FILESELECT_H__ */
diff --git a/source/blender/editors/include/ED_fluidsim.h b/source/blender/editors/include/ED_fluidsim.h
index d47ba2bfba9..54acf73aacd 100644
--- a/source/blender/editors/include/ED_fluidsim.h
+++ b/source/blender/editors/include/ED_fluidsim.h
@@ -32,8 +32,8 @@
* \ingroup editors
*/
-#ifndef ED_FLUIDSIM_H
-#define ED_FLUIDSIM_H
+#ifndef __ED_FLUIDSIM_H__
+#define __ED_FLUIDSIM_H__
struct Object;
struct FluidsimSettings;
@@ -48,4 +48,4 @@ void fluidsimSettingsFree(struct FluidsimSettings* sb);
/* duplicate internal data */
struct FluidsimSettings* fluidsimSettingsCopy(struct FluidsimSettings* sb);
-#endif /* ED_FLUIDSIM_H */
+#endif /* __ED_FLUIDSIM_H__ */
diff --git a/source/blender/editors/include/ED_gpencil.h b/source/blender/editors/include/ED_gpencil.h
index a640b5c911c..ce434493137 100644
--- a/source/blender/editors/include/ED_gpencil.h
+++ b/source/blender/editors/include/ED_gpencil.h
@@ -27,8 +27,8 @@
* \ingroup editors
*/
-#ifndef ED_GPENCIL_H
-#define ED_GPENCIL_H
+#ifndef __ED_GPENCIL_H__
+#define __ED_GPENCIL_H__
struct ListBase;
struct bContext;
@@ -109,4 +109,4 @@ void mirror_gplayer_frames(struct bGPDlayer *gpl, short mode);
int ED_gpencil_session_active(void);
int ED_undo_gpencil_step(struct bContext *C, int step, const char *name);
-#endif /* ED_GPENCIL_H */
+#endif /* __ED_GPENCIL_H__ */
diff --git a/source/blender/editors/include/ED_image.h b/source/blender/editors/include/ED_image.h
index 05cde05f25c..b95615ce365 100644
--- a/source/blender/editors/include/ED_image.h
+++ b/source/blender/editors/include/ED_image.h
@@ -27,8 +27,8 @@
* \ingroup editors
*/
-#ifndef ED_IMAGE_H
-#define ED_IMAGE_H
+#ifndef __ED_IMAGE_H__
+#define __ED_IMAGE_H__
struct SpaceImage;
struct Main;
@@ -70,5 +70,5 @@ void ED_image_update_frame(const struct Main *mainp, int cfra);
void ED_image_draw_info(struct ARegion *ar, int color_manage, int channels, int x, int y,
const unsigned char cp[4], const float fp[4], int *zp, float *zpf);
-#endif /* ED_IMAGE_H */
+#endif /* __ED_IMAGE_H__ */
diff --git a/source/blender/editors/include/ED_info.h b/source/blender/editors/include/ED_info.h
index 7044ab63cad..6970abaa633 100644
--- a/source/blender/editors/include/ED_info.h
+++ b/source/blender/editors/include/ED_info.h
@@ -24,11 +24,11 @@
* \ingroup editors
*/
-#ifndef ED_INFO_H
-#define ED_INFO_H
+#ifndef __ED_INFO_H__
+#define __ED_INFO_H__
/* info_stats.c */
void ED_info_stats_clear(struct Scene *scene);
const char *ED_info_stats_string(struct Scene *scene);
-#endif /* ED_INFO_H */
+#endif /* __ED_INFO_H__ */
diff --git a/source/blender/editors/include/ED_keyframes_draw.h b/source/blender/editors/include/ED_keyframes_draw.h
index 91723a1a33f..7f68325e5ee 100644
--- a/source/blender/editors/include/ED_keyframes_draw.h
+++ b/source/blender/editors/include/ED_keyframes_draw.h
@@ -29,8 +29,8 @@
* \ingroup editors
*/
-#ifndef ED_KEYFRAMES_DRAW_H
-#define ED_KEYFRAMES_DRAW_H
+#ifndef __ED_KEYFRAMES_DRAW_H__
+#define __ED_KEYFRAMES_DRAW_H__
struct bAnimContext;
struct AnimData;
@@ -150,5 +150,5 @@ short compare_ab_cfraPtr(void *node, void *data);
/* Checks if ActKeyBlock can be used (i.e. drawn/used to detect "holds") */
short actkeyblock_is_valid(ActKeyBlock *ab, struct DLRBT_Tree *keys);
-#endif /* ED_KEYFRAMES_DRAW_H */
+#endif /* __ED_KEYFRAMES_DRAW_H__ */
diff --git a/source/blender/editors/include/ED_keyframes_edit.h b/source/blender/editors/include/ED_keyframes_edit.h
index 5881e8c4bfe..7ba37b49f85 100644
--- a/source/blender/editors/include/ED_keyframes_edit.h
+++ b/source/blender/editors/include/ED_keyframes_edit.h
@@ -28,8 +28,8 @@
* \ingroup editors
*/
-#ifndef ED_KEYFRAMES_EDIT_H
-#define ED_KEYFRAMES_EDIT_H
+#ifndef __ED_KEYFRAMES_EDIT_H__
+#define __ED_KEYFRAMES_EDIT_H__
struct bAnimContext;
struct bAnimListElem;
@@ -254,4 +254,4 @@ short paste_animedit_keys(struct bAnimContext *ac, ListBase *anim_data,
/* ************************************************ */
-#endif /* ED_KEYFRAMES_EDIT_H */
+#endif /* __ED_KEYFRAMES_EDIT_H__ */
diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h
index eda84d0e7a4..63c0511e6b3 100644
--- a/source/blender/editors/include/ED_keyframing.h
+++ b/source/blender/editors/include/ED_keyframing.h
@@ -27,8 +27,8 @@
* \ingroup editors
*/
-#ifndef ED_KEYFRAMING_H
-#define ED_KEYFRAMING_H
+#ifndef __ED_KEYFRAMING_H__
+#define __ED_KEYFRAMING_H__
#ifdef __cplusplus
extern "C" {
@@ -330,4 +330,4 @@ int ED_autokeyframe_pchan(struct bContext *C, struct Scene *scene, struct Object
}
#endif
-#endif /* ED_KEYFRAMING_H */
+#endif /* __ED_KEYFRAMING_H__ */
diff --git a/source/blender/editors/include/ED_logic.h b/source/blender/editors/include/ED_logic.h
index ce1f2b8faac..71a5552ae26 100644
--- a/source/blender/editors/include/ED_logic.h
+++ b/source/blender/editors/include/ED_logic.h
@@ -27,10 +27,10 @@
* \ingroup editors
*/
-#ifndef ED_LOGIC_H
-#define ED_LOGIC_H
+#ifndef __ED_LOGIC_H__
+#define __ED_LOGIC_H__
/* logic_ops.c */
void ED_operatortypes_logic(void);
-#endif /* ED_LOGIC_H */
+#endif /* __ED_LOGIC_H__ */
diff --git a/source/blender/editors/include/ED_markers.h b/source/blender/editors/include/ED_markers.h
index 30a0d47eda2..c0b5ba6ecf8 100644
--- a/source/blender/editors/include/ED_markers.h
+++ b/source/blender/editors/include/ED_markers.h
@@ -28,8 +28,8 @@
* \ingroup editors
*/
-#ifndef ED_MARKERS_H
-#define ED_MARKERS_H
+#ifndef __ED_MARKERS_H__
+#define __ED_MARKERS_H__
struct wmKeyConfig;
struct wmKeyMap;
@@ -77,5 +77,5 @@ void ED_marker_keymap_animedit_conflictfree(struct wmKeyMap *keymap);
/* debugging only */
void debug_markers_print_list(struct ListBase *markers);
-#endif /* ED_MARKERS_H */
+#endif /* __ED_MARKERS_H__ */
diff --git a/source/blender/editors/include/ED_mball.h b/source/blender/editors/include/ED_mball.h
index 259004864fb..89917f09284 100644
--- a/source/blender/editors/include/ED_mball.h
+++ b/source/blender/editors/include/ED_mball.h
@@ -28,8 +28,8 @@
* \ingroup editors
*/
-#ifndef _ED_MBALL_H_
-#define _ED_MBALL_H_
+#ifndef __ED_MBALL_H__
+#define __ED_MBALL_H__
struct bContext;
struct Object;
diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h
index 160e3eea6cc..6e289fb5a2a 100644
--- a/source/blender/editors/include/ED_mesh.h
+++ b/source/blender/editors/include/ED_mesh.h
@@ -28,8 +28,8 @@
* \ingroup editors
*/
-#ifndef ED_MESH_H
-#define ED_MESH_H
+#ifndef __ED_MESH_H__
+#define __ED_MESH_H__
#ifdef __cplusplus
extern "C" {
@@ -268,5 +268,5 @@ void ED_mesh_mirrtopo_free(MirrTopoStore_t *mesh_topo_store);
}
#endif
-#endif /* ED_MESH_H */
+#endif /* __ED_MESH_H__ */
diff --git a/source/blender/editors/include/ED_node.h b/source/blender/editors/include/ED_node.h
index 18bb4975da9..192236b7cb8 100644
--- a/source/blender/editors/include/ED_node.h
+++ b/source/blender/editors/include/ED_node.h
@@ -28,8 +28,8 @@
* \ingroup editors
*/
-#ifndef ED_NODE_H
-#define ED_NODE_H
+#ifndef __ED_NODE_H__
+#define __ED_NODE_H__
struct ID;
struct Main;
@@ -63,5 +63,5 @@ void ED_node_set_active(struct Main *bmain, struct bNodeTree *ntree, struct bNod
/* node ops.c */
void ED_operatormacros_node(void);
-#endif /* ED_NODE_H */
+#endif /* __ED_NODE_H__ */
diff --git a/source/blender/editors/include/ED_numinput.h b/source/blender/editors/include/ED_numinput.h
index e2387c3e9dd..f103b07d09c 100644
--- a/source/blender/editors/include/ED_numinput.h
+++ b/source/blender/editors/include/ED_numinput.h
@@ -24,8 +24,8 @@
* \ingroup editors
*/
-#ifndef ED_NUMINPUT_H
-#define ED_NUMINPUT_H
+#ifndef __ED_NUMINPUT_H__
+#define __ED_NUMINPUT_H__
typedef struct NumInput {
diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h
index f3e780d715e..c808e63d320 100644
--- a/source/blender/editors/include/ED_object.h
+++ b/source/blender/editors/include/ED_object.h
@@ -28,8 +28,8 @@
* \ingroup editors
*/
-#ifndef ED_OBJECT_H
-#define ED_OBJECT_H
+#ifndef __ED_OBJECT_H__
+#define __ED_OBJECT_H__
#ifdef __cplusplus
extern "C" {
@@ -178,5 +178,5 @@ int ED_object_modifier_copy(struct ReportList *reports, struct Object *ob, struc
}
#endif
-#endif /* ED_OBJECT_H */
+#endif /* __ED_OBJECT_H__ */
diff --git a/source/blender/editors/include/ED_particle.h b/source/blender/editors/include/ED_particle.h
index 3035aa44735..1c7f5cf0641 100644
--- a/source/blender/editors/include/ED_particle.h
+++ b/source/blender/editors/include/ED_particle.h
@@ -30,8 +30,8 @@
* \ingroup editors
*/
-#ifndef ED_PARTICLE_H
-#define ED_PARTICLE_H
+#ifndef __ED_PARTICLE_H__
+#define __ED_PARTICLE_H__
struct bContext;
struct Object;
@@ -74,5 +74,5 @@ int PE_undo_valid(struct Scene *scene);
void PE_undo_number(struct Scene *scene, int nr);
const char *PE_undo_get_name(struct Scene *scene, int nr, int *active);
-#endif /* ED_PARTICLE_H */
+#endif /* __ED_PARTICLE_H__ */
diff --git a/source/blender/editors/include/ED_physics.h b/source/blender/editors/include/ED_physics.h
index eadd1566671..6c885b9336f 100644
--- a/source/blender/editors/include/ED_physics.h
+++ b/source/blender/editors/include/ED_physics.h
@@ -30,8 +30,8 @@
* \ingroup editors
*/
-#ifndef ED_PHYSICS_H
-#define ED_PHYSICS_H
+#ifndef __ED_PHYSICS_H__
+#define __ED_PHYSICS_H__
struct wmKeyConfig;
@@ -44,5 +44,5 @@ int PE_poll_view3d(struct bContext *C);
void ED_operatortypes_physics(void);
void ED_keymap_physics(struct wmKeyConfig *keyconf);
-#endif /* ED_PHYSICS_H */
+#endif /* __ED_PHYSICS_H__ */
diff --git a/source/blender/editors/include/ED_render.h b/source/blender/editors/include/ED_render.h
index 73776f7234b..c9e00b0296a 100644
--- a/source/blender/editors/include/ED_render.h
+++ b/source/blender/editors/include/ED_render.h
@@ -25,8 +25,8 @@
* \ingroup editors
*/
-#ifndef ED_RENDER_H
-#define ED_RENDER_H
+#ifndef __ED_RENDER_H__
+#define __ED_RENDER_H__
#include "DNA_vec_types.h"
diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h
index e0ff5cddf85..252eb790b2a 100644
--- a/source/blender/editors/include/ED_screen.h
+++ b/source/blender/editors/include/ED_screen.h
@@ -28,8 +28,8 @@
* \ingroup editors
*/
-#ifndef ED_SCREEN_H
-#define ED_SCREEN_H
+#ifndef __ED_SCREEN_H__
+#define __ED_SCREEN_H__
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
@@ -181,5 +181,5 @@ int ED_operator_posemode(struct bContext *C);
#define ED_KEYMAP_GPENCIL 32
#define ED_KEYMAP_HEADER 64
-#endif /* ED_SCREEN_H */
+#endif /* __ED_SCREEN_H__ */
diff --git a/source/blender/editors/include/ED_screen_types.h b/source/blender/editors/include/ED_screen_types.h
index 544d366c926..51699d095ae 100644
--- a/source/blender/editors/include/ED_screen_types.h
+++ b/source/blender/editors/include/ED_screen_types.h
@@ -28,8 +28,8 @@
* \ingroup editors
*/
-#ifndef ED_SCREEN_TYPES_H__
-#define ED_SCREEN_TYPES_H__
+#ifndef __ED_SCREEN_TYPES_H__
+#define __ED_SCREEN_TYPES_H__
/* ----------------------------------------------------- */
@@ -100,4 +100,4 @@ typedef struct AZone {
#define AZONE_AREA 1
#define AZONE_REGION 2
-#endif /* ED_SCREEN_TYPES_H__ */
+#endif /* __ED_SCREEN_TYPES_H__ */
diff --git a/source/blender/editors/include/ED_sculpt.h b/source/blender/editors/include/ED_sculpt.h
index bd746e36ef4..9cb32c31f5b 100644
--- a/source/blender/editors/include/ED_sculpt.h
+++ b/source/blender/editors/include/ED_sculpt.h
@@ -27,8 +27,8 @@
* \ingroup editors
*/
-#ifndef ED_SCULPT_H
-#define ED_SCULPT_H
+#ifndef __ED_SCULPT_H__
+#define __ED_SCULPT_H__
struct ARegion;
struct bContext;
diff --git a/source/blender/editors/include/ED_sequencer.h b/source/blender/editors/include/ED_sequencer.h
index da2fce2596b..abeb00c301f 100644
--- a/source/blender/editors/include/ED_sequencer.h
+++ b/source/blender/editors/include/ED_sequencer.h
@@ -24,9 +24,9 @@
* \ingroup editors
*/
-#ifndef ED_SEQUENCER_H
-#define ED_SEQUENCER_H
+#ifndef __ED_SEQUENCER_H__
+#define __ED_SEQUENCER_H__
#define SEQ_ZOOM_FAC(szoom) ((szoom) > 0.0f)? (szoom) : ((szoom) == 0.0f)? (1.0f) : (-1.0f/(szoom))
-#endif /* ED_SEQUENCER_H */
+#endif /* __ED_SEQUENCER_H__ */
diff --git a/source/blender/editors/include/ED_sound.h b/source/blender/editors/include/ED_sound.h
index a4e90094e19..d3e7502bb99 100644
--- a/source/blender/editors/include/ED_sound.h
+++ b/source/blender/editors/include/ED_sound.h
@@ -28,10 +28,10 @@
* \ingroup editors
*/
-#ifndef ED_SOUND_H
-#define ED_SOUND_H
+#ifndef __ED_SOUND_H__
+#define __ED_SOUND_H__
void ED_operatortypes_sound(void);
-#endif /* ED_SOUND_H */
+#endif /* __ED_SOUND_H__ */
diff --git a/source/blender/editors/include/ED_space_api.h b/source/blender/editors/include/ED_space_api.h
index b5a1ca193db..0d6e640c7bf 100644
--- a/source/blender/editors/include/ED_space_api.h
+++ b/source/blender/editors/include/ED_space_api.h
@@ -28,8 +28,8 @@
* \ingroup editors
*/
-#ifndef ED_SPACE_API_H
-#define ED_SPACE_API_H
+#ifndef __ED_SPACE_API_H__
+#define __ED_SPACE_API_H__
struct ARegionType;
struct bContext;
@@ -73,5 +73,5 @@ void ED_region_draw_cb_draw(const struct bContext *, struct ARegion *, int);
void ED_region_draw_cb_exit(struct ARegionType *, void *);
void *ED_region_draw_cb_customdata(void *handle);
-#endif /* ED_SPACE_API_H */
+#endif /* __ED_SPACE_API_H__ */
diff --git a/source/blender/editors/include/ED_text.h b/source/blender/editors/include/ED_text.h
index da01e25f4d9..9a36cb3d6ab 100644
--- a/source/blender/editors/include/ED_text.h
+++ b/source/blender/editors/include/ED_text.h
@@ -27,12 +27,12 @@
* \ingroup editors
*/
-#ifndef ED_TEXT_H
-#define ED_TEXT_H
+#ifndef __ED_TEXT_H__
+#define __ED_TEXT_H__
struct bContext;
void ED_text_undo_step(struct bContext *C, int step);
-#endif /* ED_TEXT_H */
+#endif /* __ED_TEXT_H__ */
diff --git a/source/blender/editors/include/ED_transform.h b/source/blender/editors/include/ED_transform.h
index 2ca3e2bfe7f..36bda11b1d4 100644
--- a/source/blender/editors/include/ED_transform.h
+++ b/source/blender/editors/include/ED_transform.h
@@ -29,8 +29,8 @@
* \ingroup editors
*/
-#ifndef ED_TRANSFORM_H
-#define ED_TRANSFORM_H
+#ifndef __ED_TRANSFORM_H__
+#define __ED_TRANSFORM_H__
/* ******************* Registration Function ********************** */
diff --git a/source/blender/editors/include/ED_types.h b/source/blender/editors/include/ED_types.h
index 6ea45c995c9..c4104472a82 100644
--- a/source/blender/editors/include/ED_types.h
+++ b/source/blender/editors/include/ED_types.h
@@ -28,8 +28,8 @@
* \ingroup editors
*/
-#ifndef ED_TYPES_H
-#define ED_TYPES_H
+#ifndef __ED_TYPES_H__
+#define __ED_TYPES_H__
/* **************** GENERAL EDITOR-WIDE TYPES AND DEFINES ************************** */
@@ -44,5 +44,5 @@
-#endif /* ED_TYPES_H */
+#endif /* __ED_TYPES_H__ */
diff --git a/source/blender/editors/include/ED_util.h b/source/blender/editors/include/ED_util.h
index c08e5eabbd3..d082f3449fa 100644
--- a/source/blender/editors/include/ED_util.h
+++ b/source/blender/editors/include/ED_util.h
@@ -28,8 +28,8 @@
* \ingroup editors
*/
-#ifndef ED_UTIL_H
-#define ED_UTIL_H
+#ifndef __ED_UTIL_H__
+#define __ED_UTIL_H__
struct Scene;
struct Object;
@@ -93,5 +93,5 @@ int GetButStringLength(const char *str);
/* where else to go ? */
void unpack_menu(struct bContext *C, const char *opname, const char *id_name, const char *abs_name, const char *folder, struct PackedFile *pf);
-#endif /* ED_UTIL_H */
+#endif /* __ED_UTIL_H__ */
diff --git a/source/blender/editors/include/ED_uvedit.h b/source/blender/editors/include/ED_uvedit.h
index bc8a12c97cc..4d8bceb044f 100644
--- a/source/blender/editors/include/ED_uvedit.h
+++ b/source/blender/editors/include/ED_uvedit.h
@@ -27,8 +27,8 @@
* \ingroup editors
*/
-#ifndef ED_UVEDIT_H
-#define ED_UVEDIT_H
+#ifndef __ED_UVEDIT_H__
+#define __ED_UVEDIT_H__
struct ARegionType;
struct EditFace;
@@ -86,5 +86,5 @@ void draw_uvedit_main(struct SpaceImage *sima, struct ARegion *ar, struct Scene
/* uvedit_buttons.c */
void ED_uvedit_buttons_register(struct ARegionType *art);
-#endif /* ED_UVEDIT_H */
+#endif /* __ED_UVEDIT_H__ */
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index 7616e25cbe9..63c03cd2963 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -28,8 +28,8 @@
* \ingroup editors
*/
-#ifndef ED_VIEW3D_H
-#define ED_VIEW3D_H
+#ifndef __ED_VIEW3D_H__
+#define __ED_VIEW3D_H__
/* ********* exports for space_view3d/ module ********** */
struct ARegion;
@@ -308,4 +308,4 @@ void ED_view3d_operator_properties_viewmat(struct wmOperatorType *ot);
void ED_view3d_operator_properties_viewmat_set(struct bContext *C, struct wmOperator *op);
void ED_view3d_operator_properties_viewmat_get(struct wmOperator *op, int *winx, int *winy, float persmat[4][4]);
-#endif /* ED_VIEW3D_H */
+#endif /* __ED_VIEW3D_H__ */
diff --git a/source/blender/editors/include/UI_icons.h b/source/blender/editors/include/UI_icons.h
index f102ecb0d08..f35af356c94 100644
--- a/source/blender/editors/include/UI_icons.h
+++ b/source/blender/editors/include/UI_icons.h
@@ -29,8 +29,8 @@
*/
/* Note: this is included twice with different #defines for DEF_ICON
- once from UI_resources.h for the internal icon enum and
- once for interface_api.c for the definition of the RNA enum for the icons */
+ * once from UI_resources.h for the internal icon enum and
+ * once for interface_api.c for the definition of the RNA enum for the icons */
/* ICON_ prefix added */
DEF_ICON(NONE)
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 3f907004931..5eafdc27e68 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -29,8 +29,8 @@
* \ingroup editorui
*/
-#ifndef UI_INTERFACE_H
-#define UI_INTERFACE_H
+#ifndef __UI_INTERFACE_H__
+#define __UI_INTERFACE_H__
#include "BLO_sys_types.h" /* size_t */
#include "RNA_types.h"
@@ -838,5 +838,5 @@ void UI_template_fix_linking(void);
int UI_editsource_enable_check(void);
void UI_editsource_active_but_test(uiBut *but);
-#endif /* UI_INTERFACE_H */
+#endif /* __UI_INTERFACE_H__ */
diff --git a/source/blender/editors/include/UI_interface_icons.h b/source/blender/editors/include/UI_interface_icons.h
index e5ad51169a8..a1b42ac39c2 100644
--- a/source/blender/editors/include/UI_interface_icons.h
+++ b/source/blender/editors/include/UI_interface_icons.h
@@ -29,8 +29,8 @@
* \ingroup editorui
*/
-#ifndef UI_INTERFACE_ICONS_H
-#define UI_INTERFACE_ICONS_H
+#ifndef __UI_INTERFACE_ICONS_H__
+#define __UI_INTERFACE_ICONS_H__
struct Image;
struct ImBuf;
@@ -75,4 +75,4 @@ struct ListBase *UI_iconfile_list(void);
int UI_iconfile_get_index(const char *filename);
-#endif /* UI_INTERFACE_ICONS_H */
+#endif /* __UI_INTERFACE_ICONS_H__ */
diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h
index d755b17bc98..f676dcbdff2 100644
--- a/source/blender/editors/include/UI_resources.h
+++ b/source/blender/editors/include/UI_resources.h
@@ -30,8 +30,8 @@
* \ingroup editorui
*/
-#ifndef UI_RESOURCES_H
-#define UI_RESOURCES_H
+#ifndef __UI_RESOURCES_H__
+#define __UI_RESOURCES_H__
/* elubie: TODO: move the typedef for icons to UI_interface_icons.h */
/* and add/replace include of UI_resources.h by UI_interface_icons.h */
diff --git a/source/blender/editors/include/UI_view2d.h b/source/blender/editors/include/UI_view2d.h
index 7ff27a5bbde..436f268d1bf 100644
--- a/source/blender/editors/include/UI_view2d.h
+++ b/source/blender/editors/include/UI_view2d.h
@@ -31,8 +31,8 @@
* \ingroup editorui
*/
-#ifndef UI_VIEW2D_H
-#define UI_VIEW2D_H
+#ifndef __UI_VIEW2D_H__
+#define __UI_VIEW2D_H__
/* ------------------------------------------ */
/* Settings and Defines: */
@@ -201,5 +201,5 @@ void UI_view2d_text_cache_draw(struct ARegion *ar);
void UI_view2d_operatortypes(void);
void UI_view2d_keymap(struct wmKeyConfig *keyconf);
-#endif /* UI_VIEW2D_H */
+#endif /* __UI_VIEW2D_H__ */
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index 3feda5d4db4..7c2d411e076 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -1013,21 +1013,26 @@ static void icon_draw_size(float x, float y, int icon_id, float aspect, float al
}
}
+static void ui_id_preview_image_render_size(bContext *C, ID *id, PreviewImage *pi, int size)
+{
+ if ((pi->changed[size] ||!pi->rect[size])) /* changed only ever set by dynamic icons */
+ {
+ /* create the rect if necessary */
+ icon_set_image(C, id, pi, size);
+
+ pi->changed[size] = 0;
+ }
+}
+
static void ui_id_icon_render(bContext *C, ID *id, int big)
{
- PreviewImage *pi = BKE_previewimg_get(id);
-
- if (pi) {
- if ((pi->changed[0] ||!pi->rect[0])) /* changed only ever set by dynamic icons */
- {
- /* create the rect if necessary */
-
- icon_set_image(C, id, pi, ICON_SIZE_ICON); /* icon size */
- if (big)
- icon_set_image(C, id, pi, ICON_SIZE_PREVIEW); /* bigger preview size */
-
- pi->changed[0] = 0;
- }
+ PreviewImage *pi = BKE_previewimg_get(id);
+
+ if (pi) {
+ if (big)
+ ui_id_preview_image_render_size(C, id, pi, ICON_SIZE_PREVIEW); /* bigger preview size */
+ else
+ ui_id_preview_image_render_size(C, id, pi, ICON_SIZE_ICON); /* icon size */
}
}
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index 2d8de475c4b..d324018e4ba 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -30,8 +30,8 @@
*/
-#ifndef INTERFACE_H
-#define INTERFACE_H
+#ifndef __INTERFACE_INTERN_H__
+#define __INTERFACE_INTERN_H__
#include "UI_resources.h"
#include "RNA_types.h"
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 429cd658dea..b3b187f92a2 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -1281,7 +1281,7 @@ static void rna_search_cb(const struct bContext *C, void *arg_but, const char *s
BLI_strncpy(name_ui, id->name+2, sizeof(name_ui));
#endif
name= BLI_strdup(name_ui);
- iconid= ui_id_icon_get((bContext*)C, id, 1);
+ iconid= ui_id_icon_get((bContext*)C, id, 0);
}
else {
name= RNA_struct_name_get_alloc(&itemptr, NULL, 0, NULL); /* could use the string length here */
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 4a797b0e960..a73291ec352 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -96,6 +96,7 @@ typedef struct TemplateID {
ListBase *idlb;
int prv_rows, prv_cols;
+ int preview;
} TemplateID;
/* Search browse menu, assign */
@@ -143,7 +144,7 @@ static void id_search_cb(const bContext *C, void *arg_template, const char *str,
char name_ui[MAX_ID_NAME];
name_uiprefix_id(name_ui, id);
- iconid= ui_id_icon_get((bContext*)C, id, 1);
+ iconid= ui_id_icon_get((bContext*)C, id, template->preview);
if(!uiSearchItemAdd(items, name_ui, id, iconid))
break;
@@ -370,6 +371,7 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
uiButSetFlag(but, UI_BUT_DISABLED);
uiLayoutRow(layout, 1);
+ template->preview= 1;
}
else if(flag & UI_ID_BROWSE) {
but= uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X*1.6, UI_UNIT_Y,
diff --git a/source/blender/editors/mesh/editmesh_lib.c b/source/blender/editors/mesh/editmesh_lib.c
index 5ec147a742b..2895f5c34e6 100644
--- a/source/blender/editors/mesh/editmesh_lib.c
+++ b/source/blender/editors/mesh/editmesh_lib.c
@@ -2410,7 +2410,7 @@ UvElementMap *EM_make_uv_element_map(EditMesh *em, int selected, int do_islands)
vmap->totalUVs = totuv;
- for(efa = em->faces.first; efa; a++, efa = efa->next) {
+ for(efa = em->faces.first; efa; efa = efa->next) {
if(!selected || ((!efa->h) && (efa->f & SELECT))) {
nverts = (efa->v4)? 4: 3;
diff --git a/source/blender/editors/mesh/mesh_intern.h b/source/blender/editors/mesh/mesh_intern.h
index 91cba8a482b..21d615e52d5 100644
--- a/source/blender/editors/mesh/mesh_intern.h
+++ b/source/blender/editors/mesh/mesh_intern.h
@@ -32,8 +32,8 @@
/* Internal for editmesh_xxxx.c functions */
-#ifndef MESH_INTERN_H
-#define MESH_INTERN_H
+#ifndef __MESH_INTERN_H__
+#define __MESH_INTERN_H__
struct bContext;
struct wmOperatorType;
@@ -261,5 +261,5 @@ void MESH_OT_navmesh_face_add(struct wmOperatorType *ot);
void MESH_OT_navmesh_reset(struct wmOperatorType *ot);
void MESH_OT_navmesh_clear(struct wmOperatorType *ot);
-#endif // MESH_INTERN_H
+#endif // __MESH_INTERN_H__
diff --git a/source/blender/editors/metaball/mball_intern.h b/source/blender/editors/metaball/mball_intern.h
index 1cb4c19fc72..0329f8e5bfa 100644
--- a/source/blender/editors/metaball/mball_intern.h
+++ b/source/blender/editors/metaball/mball_intern.h
@@ -29,8 +29,8 @@
*/
-#ifndef ED_MBALL_INTERN_H
-#define ED_MBALL_INTERN_H
+#ifndef __MBALL_INTERN_H__
+#define __MBALL_INTERN_H__
#include "DNA_object_types.h"
diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h
index 7f416feb0d5..73c5c50f448 100644
--- a/source/blender/editors/object/object_intern.h
+++ b/source/blender/editors/object/object_intern.h
@@ -28,8 +28,8 @@
* \ingroup edobj
*/
-#ifndef ED_OBJECT_INTERN_H
-#define ED_OBJECT_INTERN_H
+#ifndef __OBJECT_INTERN_H__
+#define __OBJECT_INTERN_H__
struct wmOperatorType;
struct KeyBlock;
@@ -225,5 +225,5 @@ void OBJECT_OT_group_remove(struct wmOperatorType *ot);
/* object_bake.c */
void OBJECT_OT_bake_image(wmOperatorType *ot);
-#endif /* ED_OBJECT_INTERN_H */
+#endif /* __OBJECT_INTERN_H__ */
diff --git a/source/blender/editors/physics/physics_intern.h b/source/blender/editors/physics/physics_intern.h
index db6d63f6396..75779cf6102 100644
--- a/source/blender/editors/physics/physics_intern.h
+++ b/source/blender/editors/physics/physics_intern.h
@@ -30,8 +30,8 @@
*/
-#ifndef ED_PHYSICS_INTERN_H
-#define ED_PHYSICS_INTERN_H
+#ifndef __PHYSICS_INTERN_H__
+#define __PHYSICS_INTERN_H__
struct wmOperatorType;
@@ -105,5 +105,5 @@ void PTCACHE_OT_bake_from_cache(struct wmOperatorType *ot);
void PTCACHE_OT_add(struct wmOperatorType *ot);
void PTCACHE_OT_remove(struct wmOperatorType *ot);
-#endif /* ED_PHYSICS_INTERN_H */
+#endif /* __PHYSICS_INTERN_H__ */
diff --git a/source/blender/editors/render/render_intern.h b/source/blender/editors/render/render_intern.h
index 08001688e3f..18ba2b5abf9 100644
--- a/source/blender/editors/render/render_intern.h
+++ b/source/blender/editors/render/render_intern.h
@@ -29,8 +29,8 @@
*/
-#ifndef RENDER_INTERN_H
-#define RENDER_INTERN_H
+#ifndef __RENDER_INTERN_H__
+#define __RENDER_INTERN_H__
struct wmOperatorType;
struct RenderResult;
@@ -77,5 +77,5 @@ void RENDER_OT_view_cancel(struct wmOperatorType *ot);
/* render_opengl.c */
void RENDER_OT_opengl(struct wmOperatorType *ot);
-#endif /* RENDER_INTERN_H */
+#endif /* __RENDER_INTERN_H__ */
diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c
index 3e34a55a3d9..3eda30e1554 100644
--- a/source/blender/editors/render/render_preview.c
+++ b/source/blender/editors/render/render_preview.c
@@ -164,6 +164,19 @@ typedef struct ShaderPreview {
} ShaderPreview;
+typedef struct IconPreviewSize {
+ struct IconPreviewSize *next, *prev;
+ int sizex, sizey;
+ unsigned int *rect;
+} IconPreviewSize;
+
+typedef struct IconPreview {
+ Scene *scene;
+ void *owner;
+ ID *id;
+ ListBase sizes;
+} IconPreview;
+
/* *************************** Preview for buttons *********************** */
static Main *pr_main= NULL;
@@ -944,38 +957,96 @@ static void common_preview_startjob(void *customdata, short *stop, short *do_upd
shader_preview_startjob(customdata, stop, do_update);
}
-static void common_preview_endjob(void *customdata)
+/* exported functions */
+
+static void icon_preview_add_size(IconPreview *ip, unsigned int *rect, int sizex, int sizey)
{
- ShaderPreview *sp= customdata;
+ IconPreviewSize *cur_size = ip->sizes.first, *new_size;
- if(sp->id && GS(sp->id->name) == ID_BR)
- WM_main_add_notifier(NC_BRUSH|NA_EDITED, sp->id);
+ while (cur_size) {
+ if (cur_size->sizex == sizex && cur_size->sizey == sizey) {
+ /* requested size is already in list, no need to add it again */
+ return;
+ }
+
+ cur_size = cur_size->next;
+ }
+
+ new_size = MEM_callocN(sizeof(IconPreviewSize), "IconPreviewSize");
+ new_size->sizex = sizex;
+ new_size->sizey = sizey;
+ new_size->rect = rect;
+
+ BLI_addtail(&ip->sizes, new_size);
}
-/* exported functions */
+static void icon_preview_startjob_all_sizes(void *customdata, short *stop, short *do_update, float *progress)
+{
+ IconPreview *ip = (IconPreview *)customdata;
+ IconPreviewSize *cur_size = ip->sizes.first;
+
+ while (cur_size) {
+ ShaderPreview sp;
+
+ memset(&sp, 0, sizeof(ShaderPreview));
+
+ /* construct shader preview from image size and previewcustomdata */
+ sp.scene= ip->scene;
+ sp.owner= ip->owner;
+ sp.sizex= cur_size->sizex;
+ sp.sizey= cur_size->sizey;
+ sp.pr_method= PR_ICON_RENDER;
+ sp.pr_rect= cur_size->rect;
+ sp.id = ip->id;
+
+ common_preview_startjob(&sp, stop, do_update, progress);
+
+ cur_size = cur_size->next;
+ }
+}
+
+static void icon_preview_endjob(void *customdata)
+{
+ IconPreview *ip = customdata;
+
+ if (ip->id && GS(ip->id->name) == ID_BR)
+ WM_main_add_notifier(NC_BRUSH|NA_EDITED, ip->id);
+}
+
+static void icon_preview_free(void *customdata)
+{
+ IconPreview *ip = (IconPreview *)customdata;
+
+ BLI_freelistN(&ip->sizes);
+ MEM_freeN(ip);
+}
void ED_preview_icon_job(const bContext *C, void *owner, ID *id, unsigned int *rect, int sizex, int sizey)
{
wmJob *steve;
- ShaderPreview *sp;
+ IconPreview *ip, *old_ip;
/* suspended start means it starts after 1 timer step, see WM_jobs_timer below */
steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), owner, "Icon Preview", WM_JOB_EXCL_RENDER|WM_JOB_SUSPEND);
- sp= MEM_callocN(sizeof(ShaderPreview), "shader preview");
+
+ ip= MEM_callocN(sizeof(IconPreview), "icon preview");
+
+ /* render all resolutions from suspended job too */
+ old_ip= WM_jobs_get_customdata(steve);
+ if (old_ip)
+ BLI_movelisttolist(&ip->sizes, &old_ip->sizes);
/* customdata for preview thread */
- sp->scene= CTX_data_scene(C);
- sp->owner= id;
- sp->sizex= sizex;
- sp->sizey= sizey;
- sp->pr_method= PR_ICON_RENDER;
- sp->pr_rect= rect;
- sp->id = id;
+ ip->scene= CTX_data_scene(C);
+ ip->owner= id;
+ ip->id= id;
+
+ icon_preview_add_size(ip, rect, sizex, sizey);
/* setup job */
- WM_jobs_customdata(steve, sp, shader_preview_free);
+ WM_jobs_customdata(steve, ip, icon_preview_free);
WM_jobs_timer(steve, 0.25, NC_MATERIAL, NC_MATERIAL);
- WM_jobs_callbacks(steve, common_preview_startjob, NULL, NULL, common_preview_endjob);
+ WM_jobs_callbacks(steve, icon_preview_startjob_all_sizes, NULL, NULL, icon_preview_endjob);
WM_jobs_start(CTX_wm_manager(C), steve);
}
diff --git a/source/blender/editors/screen/screen_intern.h b/source/blender/editors/screen/screen_intern.h
index b882a0881a1..90533fd3a12 100644
--- a/source/blender/editors/screen/screen_intern.h
+++ b/source/blender/editors/screen/screen_intern.h
@@ -28,8 +28,8 @@
* \ingroup edscr
*/
-#ifndef ED_SCREEN_INTERN_H
-#define ED_SCREEN_INTERN_H
+#ifndef __SCREEN_INTERN_H__
+#define __SCREEN_INTERN_H__
/* internal exports only */
struct wmWindow;
@@ -65,7 +65,7 @@ extern const char *screen_context_dir[]; /* doc access */
void SCREEN_OT_screenshot(struct wmOperatorType *ot);
void SCREEN_OT_screencast(struct wmOperatorType *ot);
-#endif /* ED_SCREEN_INTERN_H */
+#endif /* __SCREEN_INTERN_H__ */
diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h
index 73dc1e236f6..b4315c2847d 100644
--- a/source/blender/editors/sculpt_paint/paint_intern.h
+++ b/source/blender/editors/sculpt_paint/paint_intern.h
@@ -29,8 +29,8 @@
*/
-#ifndef ED_PAINT_INTERN_H
-#define ED_PAINT_INTERN_H
+#ifndef __PAINT_INTERN_H__
+#define __PAINT_INTERN_H__
struct ARegion;
struct bContext;
@@ -168,5 +168,5 @@ struct ListBase *undo_paint_push_get_list(int type);
void undo_paint_push_count_alloc(int type, int size);
void undo_paint_push_end(int type);
-#endif /* ED_PAINT_INTERN_H */
+#endif /* __PAINT_INTERN_H__ */
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h
index 275d1d52355..a69d5b2ee56 100644
--- a/source/blender/editors/sculpt_paint/sculpt_intern.h
+++ b/source/blender/editors/sculpt_paint/sculpt_intern.h
@@ -30,8 +30,8 @@
*/
-#ifndef BDR_SCULPTMODE_H
-#define BDR_SCULPTMODE_H
+#ifndef __SCULPT_INTERN_H__
+#define __SCULPT_INTERN_H__
#include "DNA_listBase.h"
#include "DNA_vec_types.h"
diff --git a/source/blender/editors/sound/sound_intern.h b/source/blender/editors/sound/sound_intern.h
index 91c1b5d1456..e8a8ec55ab5 100644
--- a/source/blender/editors/sound/sound_intern.h
+++ b/source/blender/editors/sound/sound_intern.h
@@ -29,10 +29,10 @@
*/
-#ifndef ED_SOUND_INTERN_H
-#define ED_SOUND_INTERN_H
+#ifndef __SOUND_INTERN_H__
+#define __SOUND_INTERN_H__
struct wmOperatorType;
-#endif /* ED_SOUND_INTERN_H */
+#endif /* __SOUND_INTERN_H__ */
diff --git a/source/blender/editors/space_action/action_intern.h b/source/blender/editors/space_action/action_intern.h
index 2a23f105737..751a809cac6 100644
--- a/source/blender/editors/space_action/action_intern.h
+++ b/source/blender/editors/space_action/action_intern.h
@@ -28,8 +28,8 @@
* \ingroup spaction
*/
-#ifndef ED_ACTION_INTERN_H
-#define ED_ACTION_INTERN_H
+#ifndef __ACTION_INTERN_H__
+#define __ACTION_INTERN_H__
struct bContext;
struct bAnimContext;
@@ -135,5 +135,5 @@ enum {
void action_operatortypes(void);
void action_keymap(struct wmKeyConfig *keyconf);
-#endif /* ED_ACTION_INTERN_H */
+#endif /* __ACTION_INTERN_H__ */
diff --git a/source/blender/editors/space_buttons/buttons_intern.h b/source/blender/editors/space_buttons/buttons_intern.h
index aa692a940d8..8d0f84cf70f 100644
--- a/source/blender/editors/space_buttons/buttons_intern.h
+++ b/source/blender/editors/space_buttons/buttons_intern.h
@@ -28,8 +28,8 @@
* \ingroup spbuttons
*/
-#ifndef ED_BUTTONS_INTERN_H
-#define ED_BUTTONS_INTERN_H
+#ifndef __BUTTONS_INTERN_H__
+#define __BUTTONS_INTERN_H__
#include "DNA_listBase.h"
#include "RNA_types.h"
@@ -117,5 +117,5 @@ void BUTTONS_OT_file_browse(struct wmOperatorType *ot);
void BUTTONS_OT_directory_browse(struct wmOperatorType *ot);
void BUTTONS_OT_toolbox(struct wmOperatorType *ot);
-#endif /* ED_BUTTONS_INTERN_H */
+#endif /* __BUTTONS_INTERN_H__ */
diff --git a/source/blender/editors/space_clip/clip_intern.h b/source/blender/editors/space_clip/clip_intern.h
index 9ff58a73ca2..c0b7137b5d8 100644
--- a/source/blender/editors/space_clip/clip_intern.h
+++ b/source/blender/editors/space_clip/clip_intern.h
@@ -29,8 +29,8 @@
* \ingroup spclip
*/
-#ifndef ED_CLIP_INTERN_H
-#define ED_CLIP_INTERN_H
+#ifndef __CLIP_INTERN_H__
+#define __CLIP_INTERN_H__
struct bContext;
struct ARegion;
@@ -152,4 +152,4 @@ void CLIP_OT_tracking_object_remove(struct wmOperatorType *ot);
void CLIP_OT_copy_tracks(struct wmOperatorType *ot);
void CLIP_OT_paste_tracks(struct wmOperatorType *ot);
-#endif /* ED_CLIP_INTERN_H */
+#endif /* __CLIP_INTERN_H__ */
diff --git a/source/blender/editors/space_console/console_intern.h b/source/blender/editors/space_console/console_intern.h
index 1c7aef01450..ce5c5f81f63 100644
--- a/source/blender/editors/space_console/console_intern.h
+++ b/source/blender/editors/space_console/console_intern.h
@@ -24,8 +24,8 @@
* \ingroup spconsole
*/
-#ifndef ED_CONSOLE_INTERN_H
-#define ED_CONSOLE_INTERN_H
+#ifndef __CONSOLE_INTERN_H__
+#define __CONSOLE_INTERN_H__
/* internal exports only */
@@ -69,4 +69,4 @@ void CONSOLE_OT_select_set(struct wmOperatorType *ot);
enum { LINE_BEGIN, LINE_END, PREV_CHAR, NEXT_CHAR, PREV_WORD, NEXT_WORD };
enum { DEL_ALL, DEL_NEXT_CHAR, DEL_PREV_CHAR, DEL_SELECTION, DEL_NEXT_SEL, DEL_PREV_SEL };
-#endif /* ED_CONSOLE_INTERN_H */
+#endif /* __CONSOLE_INTERN_H__ */
diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h
index d9de804404e..e2c0591f901 100644
--- a/source/blender/editors/space_file/file_intern.h
+++ b/source/blender/editors/space_file/file_intern.h
@@ -28,8 +28,8 @@
* \ingroup spfile
*/
-#ifndef ED_FILE_INTERN_H
-#define ED_FILE_INTERN_H
+#ifndef __FILE_INTERN_H__
+#define __FILE_INTERN_H__
/* internal exports only */
@@ -112,5 +112,5 @@ void autocomplete_file(struct bContext *C, char *str, void *arg_v);
/* file_panels.c */
void file_panels_register(struct ARegionType *art);
-#endif /* ED_FILE_INTERN_H */
+#endif /* __FILE_INTERN_H__ */
diff --git a/source/blender/editors/space_file/filelist.h b/source/blender/editors/space_file/filelist.h
index 0a8824e473d..fac6a387b9f 100644
--- a/source/blender/editors/space_file/filelist.h
+++ b/source/blender/editors/space_file/filelist.h
@@ -30,8 +30,8 @@
*/
-#ifndef FILELIST_H
-#define FILELIST_H
+#ifndef __FILELIST_H__
+#define __FILELIST_H__
#ifdef __cplusplus
extern "C" {
diff --git a/source/blender/editors/space_file/fsmenu.h b/source/blender/editors/space_file/fsmenu.h
index 5947db073f6..0d046fd985d 100644
--- a/source/blender/editors/space_file/fsmenu.h
+++ b/source/blender/editors/space_file/fsmenu.h
@@ -31,8 +31,8 @@
*/
-#ifndef BSE_FSMENU_H
-#define BSE_FSMENU_H
+#ifndef __FSMENU_H__
+#define __FSMENU_H__
/* XXX could become UserPref */
#define FSMENU_RECENT_MAX 10
diff --git a/source/blender/editors/space_graph/graph_intern.h b/source/blender/editors/space_graph/graph_intern.h
index bc4fa398221..363ec407f71 100644
--- a/source/blender/editors/space_graph/graph_intern.h
+++ b/source/blender/editors/space_graph/graph_intern.h
@@ -28,8 +28,8 @@
* \ingroup spgraph
*/
-#ifndef ED_GRAPH_INTERN_H
-#define ED_GRAPH_INTERN_H
+#ifndef __GRAPH_INTERN_H__
+#define __GRAPH_INTERN_H__
struct bContext;
struct wmWindowManager;
@@ -173,5 +173,5 @@ void graphedit_keymap(struct wmKeyConfig *keyconf);
void graphedit_operatortypes(void);
-#endif /* ED_GRAPH_INTERN_H */
+#endif /* __GRAPH_INTERN_H__ */
diff --git a/source/blender/editors/space_image/image_intern.h b/source/blender/editors/space_image/image_intern.h
index 29673f74538..71762a087a7 100644
--- a/source/blender/editors/space_image/image_intern.h
+++ b/source/blender/editors/space_image/image_intern.h
@@ -29,8 +29,8 @@
*/
-#ifndef ED_IMAGE_INTERN_H
-#define ED_IMAGE_INTERN_H
+#ifndef __IMAGE_INTERN_H__
+#define __IMAGE_INTERN_H__
/* internal exports only */
struct bContext;
@@ -95,5 +95,5 @@ void image_buttons_register(struct ARegionType *art);
void IMAGE_OT_properties(struct wmOperatorType *ot);
void IMAGE_OT_scopes(struct wmOperatorType *ot);
-#endif /* ED_IMAGE_INTERN_H */
+#endif /* __IMAGE_INTERN_H__ */
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c
index 3a5793461ea..8063dc6c902 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -873,6 +873,12 @@ static void image_buttons_area_listener(ARegion *ar, wmNotifier *wmn)
if(wmn->action==NA_EDITED)
ED_region_tag_redraw(ar);
break;
+ case NC_TEXTURE:
+ case NC_MATERIAL:
+ /* sending by texture render job and needed to properly update displaying
+ * brush texture icon */
+ ED_region_tag_redraw(ar);
+ break;
}
}
diff --git a/source/blender/editors/space_info/info_intern.h b/source/blender/editors/space_info/info_intern.h
index fc0615a914b..80018e849d3 100644
--- a/source/blender/editors/space_info/info_intern.h
+++ b/source/blender/editors/space_info/info_intern.h
@@ -28,8 +28,8 @@
* \ingroup spinfo
*/
-#ifndef ED_INFO_INTERN_H
-#define ED_INFO_INTERN_H
+#ifndef __INFO_INTERN_H__
+#define __INFO_INTERN_H__
/* internal exports only */
@@ -61,4 +61,4 @@ void INFO_OT_report_replay(struct wmOperatorType *ot);
void INFO_OT_report_delete(struct wmOperatorType *ot);
void INFO_OT_report_copy(struct wmOperatorType *ot);
-#endif /* ED_INFO_INTERN_H */
+#endif /* __INFO_INTERN_H__ */
diff --git a/source/blender/editors/space_logic/logic_intern.h b/source/blender/editors/space_logic/logic_intern.h
index 457fe14352c..3e0b13e9d6c 100644
--- a/source/blender/editors/space_logic/logic_intern.h
+++ b/source/blender/editors/space_logic/logic_intern.h
@@ -29,8 +29,8 @@
*/
-#ifndef ED_LOGIC_INTERN_H
-#define ED_LOGIC_INTERN_H
+#ifndef __LOGIC_INTERN_H__
+#define __LOGIC_INTERN_H__
/* internal exports only */
struct bContext;
@@ -56,5 +56,5 @@ void LOGIC_OT_links_cut(struct wmOperatorType *ot);
void logic_buttons(struct bContext *C, struct ARegion *ar);
void make_unique_prop_names(struct bContext *C, char *str);
-#endif /* ED_LOGIC_INTERN_H */
+#endif /* __LOGIC_INTERN_H__ */
diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h
index 00c16d68f36..9d0762ce108 100644
--- a/source/blender/editors/space_nla/nla_intern.h
+++ b/source/blender/editors/space_nla/nla_intern.h
@@ -28,8 +28,8 @@
* \ingroup spnla
*/
-#ifndef ED_NLA_INTERN_H
-#define ED_NLA_INTERN_H
+#ifndef __NLA_INTERN_H__
+#define __NLA_INTERN_H__
/* internal exports only */
@@ -140,5 +140,5 @@ short nlaedit_is_tweakmode_on(bAnimContext *ac);
void nla_operatortypes(void);
void nla_keymap(wmKeyConfig *keyconf);
-#endif /* ED_NLA_INTERN_H */
+#endif /* __NLA_INTERN_H__ */
diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h
index 186ad3768be..48501079e60 100644
--- a/source/blender/editors/space_node/node_intern.h
+++ b/source/blender/editors/space_node/node_intern.h
@@ -28,8 +28,8 @@
* \ingroup spnode
*/
-#ifndef ED_NODE_INTERN_H
-#define ED_NODE_INTERN_H
+#ifndef __NODE_INTERN_H__
+#define __NODE_INTERN_H__
#include <stddef.h> /* for size_t */
#include "UI_interface.h"
@@ -190,4 +190,4 @@ enum {
B_NODE_SETIMAGE,
} eNodeSpace_ButEvents;
-#endif /* ED_NODE_INTERN_H */
+#endif /* __NODE_INTERN_H__ */
diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h
index be33fc2e37a..8c53e9ad111 100644
--- a/source/blender/editors/space_outliner/outliner_intern.h
+++ b/source/blender/editors/space_outliner/outliner_intern.h
@@ -29,8 +29,8 @@
*/
-#ifndef ED_OUTLINER_INTERN_H
-#define ED_OUTLINER_INTERN_H
+#ifndef __OUTLINER_INTERN_H__
+#define __OUTLINER_INTERN_H__
#include "RNA_types.h"
@@ -237,4 +237,4 @@ void OUTLINER_OT_action_set(struct wmOperatorType *ot);
void outliner_operatortypes(void);
void outliner_keymap(struct wmKeyConfig *keyconf);
-#endif /* ED_OUTLINER_INTERN_H */
+#endif /* __OUTLINER_INTERN_H__ */
diff --git a/source/blender/editors/space_script/script_intern.h b/source/blender/editors/space_script/script_intern.h
index 98e9699079b..00863863994 100644
--- a/source/blender/editors/space_script/script_intern.h
+++ b/source/blender/editors/space_script/script_intern.h
@@ -28,8 +28,8 @@
* \ingroup spscript
*/
-#ifndef ED_SCRIPT_INTERN_H
-#define ED_SCRIPT_INTERN_H
+#ifndef __SCRIPT_INTERN_H__
+#define __SCRIPT_INTERN_H__
/* internal exports only */
@@ -41,5 +41,5 @@ void script_keymap(struct wmKeyConfig *keyconf);
void SCRIPT_OT_reload(struct wmOperatorType *ot);
void SCRIPT_OT_python_file_run(struct wmOperatorType *ot);
-#endif /* ED_SCRIPT_INTERN_H */
+#endif /* __SCRIPT_INTERN_H__ */
diff --git a/source/blender/editors/space_sequencer/sequencer_intern.h b/source/blender/editors/space_sequencer/sequencer_intern.h
index 812bdbc678f..91d4e490ddc 100644
--- a/source/blender/editors/space_sequencer/sequencer_intern.h
+++ b/source/blender/editors/space_sequencer/sequencer_intern.h
@@ -28,8 +28,8 @@
* \ingroup spseq
*/
-#ifndef ED_SEQUENCER_INTERN_H
-#define ED_SEQUENCER_INTERN_H
+#ifndef __SEQUENCER_INTERN_H__
+#define __SEQUENCER_INTERN_H__
#include "RNA_access.h"
#include "DNA_sequence_types.h"
@@ -176,5 +176,5 @@ struct ImBuf *make_histogram_view_from_ibuf(struct ImBuf * ibuf);
void SEQUENCER_OT_properties(struct wmOperatorType *ot);
void sequencer_buttons_register(struct ARegionType *art);
-#endif /* ED_SEQUENCER_INTERN_H */
+#endif /* __SEQUENCER_INTERN_H__ */
diff --git a/source/blender/editors/space_text/text_intern.h b/source/blender/editors/space_text/text_intern.h
index 043fb97547b..2d297dd20d7 100644
--- a/source/blender/editors/space_text/text_intern.h
+++ b/source/blender/editors/space_text/text_intern.h
@@ -28,8 +28,8 @@
* \ingroup sptext
*/
-#ifndef ED_TEXT_INTERN_H
-#define ED_TEXT_INTERN_H
+#ifndef __TEXT_INTERN_H__
+#define __TEXT_INTERN_H__
/* internal exports only */
@@ -163,5 +163,5 @@ void TEXT_OT_resolve_conflict(struct wmOperatorType *ot);
/* space_text.c */
extern const char *text_context_dir[]; /* doc access */
-#endif /* ED_TEXT_INTERN_H */
+#endif /* __TEXT_INTERN_H__ */
diff --git a/source/blender/editors/space_time/time_intern.h b/source/blender/editors/space_time/time_intern.h
index a345d00bd74..ce52cbbd65e 100644
--- a/source/blender/editors/space_time/time_intern.h
+++ b/source/blender/editors/space_time/time_intern.h
@@ -29,8 +29,8 @@
*/
-#ifndef ED_TIME_INTERN_H
-#define ED_TIME_INTERN_H
+#ifndef __TIME_INTERN_H__
+#define __TIME_INTERN_H__
/* internal exports only */
@@ -40,5 +40,5 @@ struct wmWindowManager;
void time_operatortypes(void);
void time_keymap(struct wmKeyConfig *keyconf);
-#endif /* ED_TIME_INTERN_H */
+#endif /* __TIME_INTERN_H__ */
diff --git a/source/blender/editors/space_userpref/userpref_intern.h b/source/blender/editors/space_userpref/userpref_intern.h
index fc6d218b20c..03074290d13 100644
--- a/source/blender/editors/space_userpref/userpref_intern.h
+++ b/source/blender/editors/space_userpref/userpref_intern.h
@@ -28,10 +28,10 @@
* \ingroup spuserpref
*/
-#ifndef ED_USERPREF_INTERN_H
-#define ED_USERPREF_INTERN_H
+#ifndef __USERPREF_INTERN_H__
+#define __USERPREF_INTERN_H__
/* internal exports only */
-#endif /* ED_USERPREF_INTERN_H */
+#endif /* __USERPREF_INTERN_H__ */
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 94ab847c91b..72a068af095 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -933,6 +933,7 @@ static void view3d_buttons_area_listener(ARegion *ar, wmNotifier *wmn)
ED_region_tag_redraw(ar);
break;
case NC_TEXTURE:
+ case NC_MATERIAL:
/* for brush textures */
ED_region_tag_redraw(ar);
break;
diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c
index e9b339c0baf..1df0b3a8a4e 100644
--- a/source/blender/editors/space_view3d/view3d_header.c
+++ b/source/blender/editors/space_view3d/view3d_header.c
@@ -478,6 +478,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
uiBut *but;
uiLayout *row;
const float dpi_fac= UI_DPI_FAC;
+ int is_paint = 0;
RNA_pointer_create(&screen->id, &RNA_SpaceView3D, v3d, &v3dptr);
RNA_pointer_create(&scene->id, &RNA_ToolSettings, ts, &toolsptr);
@@ -492,6 +493,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
/* mode */
if(ob) {
v3d->modeselect = ob->mode;
+ is_paint = ELEM4(ob->mode, OB_MODE_SCULPT, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_PAINT,OB_MODE_TEXTURE_PAINT);
}
else {
v3d->modeselect = OB_MODE_OBJECT;
@@ -504,20 +506,21 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C)
/* Draw type */
uiItemR(layout, &v3dptr, "viewport_shade", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
- if (obedit==NULL && ((ob && ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT)))) {
- /* Manipulators aren't used in weight paint mode */
-
- PointerRNA meshptr;
+ if (obedit==NULL && is_paint) {
+ /* Manipulators aren't used in paint modes */
+ if (!ELEM(ob->mode, OB_MODE_SCULPT, OB_MODE_PARTICLE_EDIT)) {
+ /* masks aren't used for sculpt and particle painting */
+ PointerRNA meshptr;
- RNA_pointer_create(&ob->id, &RNA_Mesh, ob->data, &meshptr);
- if(ob->mode & (OB_MODE_TEXTURE_PAINT|OB_MODE_VERTEX_PAINT)) {
- uiItemR(layout, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
- }
- else {
-
- row= uiLayoutRow(layout, 1);
- uiItemR(row, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
- uiItemR(row, &meshptr, "use_paint_mask_vertex", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+ RNA_pointer_create(&ob->id, &RNA_Mesh, ob->data, &meshptr);
+ if(ob->mode & (OB_MODE_TEXTURE_PAINT|OB_MODE_VERTEX_PAINT)) {
+ uiItemR(layout, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+ }
+ else {
+ row= uiLayoutRow(layout, 1);
+ uiItemR(row, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+ uiItemR(row, &meshptr, "use_paint_mask_vertex", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+ }
}
} else {
const char *str_menu;
diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h
index 07754c0883c..40037f82376 100644
--- a/source/blender/editors/space_view3d/view3d_intern.h
+++ b/source/blender/editors/space_view3d/view3d_intern.h
@@ -28,8 +28,8 @@
* \ingroup spview3d
*/
-#ifndef ED_VIEW3D_INTERN_H
-#define ED_VIEW3D_INTERN_H
+#ifndef __VIEW3D_INTERN_H__
+#define __VIEW3D_INTERN_H__
#include "ED_view3d.h"
@@ -215,5 +215,5 @@ extern float view3d_camera_border_hack_col[4];
extern short view3d_camera_border_hack_test;
#endif
-#endif /* ED_VIEW3D_INTERN_H */
+#endif /* __VIEW3D_INTERN_H__ */
diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h
index aab7dda0e86..4c4c2f67d82 100644
--- a/source/blender/editors/transform/transform.h
+++ b/source/blender/editors/transform/transform.h
@@ -30,8 +30,8 @@
*/
-#ifndef TRANSFORM_H
-#define TRANSFORM_H
+#ifndef __TRANSFORM_H__
+#define __TRANSFORM_H__
#include "ED_transform.h"
#include "ED_numinput.h"
diff --git a/source/blender/editors/util/util_intern.h b/source/blender/editors/util/util_intern.h
index c6e2d079c28..d366ad7997f 100644
--- a/source/blender/editors/util/util_intern.h
+++ b/source/blender/editors/util/util_intern.h
@@ -29,8 +29,8 @@
*/
-#ifndef ED_UTIL_INTERN_H
-#define ED_UTIL_INTERN_H
+#ifndef __UTIL_INTERN_H__
+#define __UTIL_INTERN_H__
/* internal exports only */
@@ -42,5 +42,5 @@ void *undo_editmode_get_prev (struct Object *ob);
void undo_editmode_step (struct bContext *C, int step);
void undo_editmode_number (struct bContext *C, int nr);
-#endif /* ED_UTIL_INTERN_H */
+#endif /* __UTIL_INTERN_H__ */
diff --git a/source/blender/editors/uvedit/uvedit_intern.h b/source/blender/editors/uvedit/uvedit_intern.h
index ef25159a3af..a5b4173cc67 100644
--- a/source/blender/editors/uvedit/uvedit_intern.h
+++ b/source/blender/editors/uvedit/uvedit_intern.h
@@ -29,8 +29,8 @@
*/
-#ifndef ED_UVEDIT_INTERN_H
-#define ED_UVEDIT_INTERN_H
+#ifndef __UVEDIT_INTERN_H__
+#define __UVEDIT_INTERN_H__
struct EditFace;
struct EditMesh;
@@ -111,5 +111,5 @@ void UV_OT_sphere_project(struct wmOperatorType *ot);
void UV_OT_unwrap(struct wmOperatorType *ot);
void UV_OT_stitch(struct wmOperatorType *ot);
-#endif /* ED_UVEDIT_INTERN_H */
+#endif /* __UVEDIT_INTERN_H__ */
diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.h b/source/blender/editors/uvedit/uvedit_parametrizer.h
index e8dac7346ac..2cb4759c5ae 100644
--- a/source/blender/editors/uvedit/uvedit_parametrizer.h
+++ b/source/blender/editors/uvedit/uvedit_parametrizer.h
@@ -2,8 +2,8 @@
* \ingroup eduv
*/
-#ifndef __PARAMETRIZER_H__
-#define __PARAMETRIZER_H__
+#ifndef __UVEDIT_PARAMETRIZER_H__
+#define __UVEDIT_PARAMETRIZER_H__
#ifdef __cplusplus
extern "C" {
@@ -96,5 +96,5 @@ void param_flush_restore(ParamHandle *handle);
}
#endif
-#endif /*__PARAMETRIZER_H__*/
+#endif /*__UVEDIT_PARAMETRIZER_H__*/
diff --git a/source/blender/gpu/GPU_draw.h b/source/blender/gpu/GPU_draw.h
index f73bd402167..89976699114 100644
--- a/source/blender/gpu/GPU_draw.h
+++ b/source/blender/gpu/GPU_draw.h
@@ -29,8 +29,8 @@
* \ingroup gpu
*/
-#ifndef GPU_GAME_H
-#define GPU_GAME_H
+#ifndef __GPU_DRAW_H__
+#define __GPU_DRAW_H__
#ifdef __cplusplus
extern "C" {
diff --git a/source/blender/gpu/GPU_extensions.h b/source/blender/gpu/GPU_extensions.h
index 9fb0dd1ae07..5ec373802a3 100644
--- a/source/blender/gpu/GPU_extensions.h
+++ b/source/blender/gpu/GPU_extensions.h
@@ -29,8 +29,8 @@
* \ingroup gpu
*/
-#ifndef GPU_EXTENSIONS_H
-#define GPU_EXTENSIONS_H
+#ifndef __GPU_EXTENSIONS_H__
+#define __GPU_EXTENSIONS_H__
#ifdef __cplusplus
extern "C" {
diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h
index 5689f02d2d7..8254c0f30ca 100644
--- a/source/blender/gpu/GPU_material.h
+++ b/source/blender/gpu/GPU_material.h
@@ -29,8 +29,8 @@
* \ingroup gpu
*/
-#ifndef __GPU_MATERIAL__
-#define __GPU_MATERIAL__
+#ifndef __GPU_MATERIAL_H__
+#define __GPU_MATERIAL_H__
#include "DNA_listBase.h"
@@ -238,5 +238,5 @@ int GPU_lamp_shadow_layer(GPULamp *lamp);
}
#endif
-#endif /*__GPU_MATERIAL__*/
+#endif /*__GPU_MATERIAL_H__*/
diff --git a/source/blender/ikplugin/BIK_api.h b/source/blender/ikplugin/BIK_api.h
index 4b90b2546ff..cbc6485cb54 100644
--- a/source/blender/ikplugin/BIK_api.h
+++ b/source/blender/ikplugin/BIK_api.h
@@ -31,8 +31,8 @@
*/
-#ifndef BIK_API_H
-#define BIK_API_H
+#ifndef __BIK_API_H__
+#define __BIK_API_H__
#ifdef __cplusplus
extern "C" {
@@ -92,5 +92,5 @@ int BIK_get_solver_param(struct bPose *pose, struct bPoseChannel *pchan, int id,
}
#endif
-#endif // BIK_API_H
+#endif // __BIK_API_H__
diff --git a/source/blender/ikplugin/intern/ikplugin_api.h b/source/blender/ikplugin/intern/ikplugin_api.h
index b1e723289ec..77c962269dc 100644
--- a/source/blender/ikplugin/intern/ikplugin_api.h
+++ b/source/blender/ikplugin/intern/ikplugin_api.h
@@ -31,8 +31,8 @@
*/
-#ifndef IKPLUGIN_API_H
-#define IKPLUGIN_API_H
+#ifndef __IKPLUGIN_API_H__
+#define __IKPLUGIN_API_H__
#ifdef __cplusplus
extern "C" {
@@ -60,5 +60,5 @@ typedef struct IKPlugin IKPlugin;
}
#endif
-#endif // IKPLUGIN_API_H
+#endif // __IKPLUGIN_API_H__
diff --git a/source/blender/ikplugin/intern/iksolver_plugin.h b/source/blender/ikplugin/intern/iksolver_plugin.h
index 885383ab65e..dd00c5f4add 100644
--- a/source/blender/ikplugin/intern/iksolver_plugin.h
+++ b/source/blender/ikplugin/intern/iksolver_plugin.h
@@ -31,8 +31,8 @@
*/
-#ifndef IKSOLVER_PLUGIN_H
-#define IKSOLVER_PLUGIN_H
+#ifndef __IKSOLVER_PLUGIN_H__
+#define __IKSOLVER_PLUGIN_H__
#include "ikplugin_api.h"
@@ -47,5 +47,5 @@ void iksolver_execute_tree(struct Scene *scene, struct Object *ob, struct bPose
}
#endif
-#endif // IKSOLVER_PLUGIN_H
+#endif // __IKSOLVER_PLUGIN_H__
diff --git a/source/blender/ikplugin/intern/itasc_plugin.h b/source/blender/ikplugin/intern/itasc_plugin.h
index 1d6acb2cce3..0d5fde0bec0 100644
--- a/source/blender/ikplugin/intern/itasc_plugin.h
+++ b/source/blender/ikplugin/intern/itasc_plugin.h
@@ -31,8 +31,8 @@
*/
-#ifndef ITASC_PLUGIN_H
-#define ITASC_PLUGIN_H
+#ifndef __ITASC_PLUGIN_H__
+#define __ITASC_PLUGIN_H__
#include "ikplugin_api.h"
@@ -52,5 +52,5 @@ void itasc_test_constraint(struct Object *ob, struct bConstraint *cons);
}
#endif
-#endif // ITASC_PLUGIN_H
+#endif // __ITASC_PLUGIN_H__
diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h
index 07f1b9e4683..9d21cc6d8d9 100644
--- a/source/blender/imbuf/IMB_imbuf.h
+++ b/source/blender/imbuf/IMB_imbuf.h
@@ -68,8 +68,8 @@
* posix-compliant.
*/
-#ifndef IMB_IMBUF_H
-#define IMB_IMBUF_H
+#ifndef __IMB_IMBUF_H__
+#define __IMB_IMBUF_H__
/**
*
diff --git a/source/blender/imbuf/IMB_imbuf_types.h b/source/blender/imbuf/IMB_imbuf_types.h
index cb5d6721566..c2b42db447d 100644
--- a/source/blender/imbuf/IMB_imbuf_types.h
+++ b/source/blender/imbuf/IMB_imbuf_types.h
@@ -44,8 +44,8 @@
* \todo Clean up includes.
*/
-#ifndef IMB_IMBUF_TYPES_H
-#define IMB_IMBUF_TYPES_H
+#ifndef __IMB_IMBUF_TYPES_H__
+#define __IMB_IMBUF_TYPES_H__
struct ImMetaData;
diff --git a/source/blender/imbuf/IMB_moviecache.h b/source/blender/imbuf/IMB_moviecache.h
index 309c6ee550e..3fa98a04d8d 100644
--- a/source/blender/imbuf/IMB_moviecache.h
+++ b/source/blender/imbuf/IMB_moviecache.h
@@ -24,8 +24,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef IMB_MOVIECACHE_H
-#define IMB_MOVIECACHE_H
+#ifndef __IMB_MOVIECACHE_H__
+#define __IMB_MOVIECACHE_H__
/** \file IMB_moviecache.h
* \ingroup imbuf
diff --git a/source/blender/imbuf/IMB_thumbs.h b/source/blender/imbuf/IMB_thumbs.h
index ad620007abe..49e90134d21 100644
--- a/source/blender/imbuf/IMB_thumbs.h
+++ b/source/blender/imbuf/IMB_thumbs.h
@@ -30,8 +30,8 @@
*/
-#ifndef _IMB_THUMBS_H
-#define _IMB_THUMBS_H
+#ifndef __IMB_THUMBS_H__
+#define __IMB_THUMBS_H__
#ifdef __cplusplus
extern "C" {
@@ -85,5 +85,5 @@ void IMB_overlayblend_thumb(unsigned int *thumb, int width, int height, float as
}
#endif /* __cplusplus */
-#endif /* _IMB_THUMBS_H */
+#endif /* __IMB_THUMBS_H__ */
diff --git a/source/blender/imbuf/intern/IMB_allocimbuf.h b/source/blender/imbuf/intern/IMB_allocimbuf.h
index c2f1d2a1f51..52b3bc1f11a 100644
--- a/source/blender/imbuf/intern/IMB_allocimbuf.h
+++ b/source/blender/imbuf/intern/IMB_allocimbuf.h
@@ -33,8 +33,8 @@
* \ingroup imbuf
* \brief Header file for allocimbuf.c
*/
-#ifndef IMB_ALLOCIMBUF_H
-#define IMB_ALLOCIMBUF_H
+#ifndef __IMB_ALLOCIMBUF_H__
+#define __IMB_ALLOCIMBUF_H__
struct ImBuf;
diff --git a/source/blender/imbuf/intern/IMB_anim.h b/source/blender/imbuf/intern/IMB_anim.h
index a9f020c94e8..b29d9d419e2 100644
--- a/source/blender/imbuf/intern/IMB_anim.h
+++ b/source/blender/imbuf/intern/IMB_anim.h
@@ -33,8 +33,8 @@
*/
-#ifndef IMB_ANIM_H
-#define IMB_ANIM_H
+#ifndef __IMB_ANIM_H__
+#define __IMB_ANIM_H__
#ifdef _WIN32
# define INC_OLE2
diff --git a/source/blender/imbuf/intern/IMB_filetype.h b/source/blender/imbuf/intern/IMB_filetype.h
index 4cd10ad01d0..83267ed323d 100644
--- a/source/blender/imbuf/intern/IMB_filetype.h
+++ b/source/blender/imbuf/intern/IMB_filetype.h
@@ -25,8 +25,8 @@
*/
-#ifndef IMB_FILETYPE_H
-#define IMB_FILETYPE_H
+#ifndef __IMB_FILETYPE_H__
+#define __IMB_FILETYPE_H__
/* Generic File Type */
@@ -119,5 +119,5 @@ void imb_loadtiletiff(struct ImBuf *ibuf, unsigned char *mem, size_t size,
int imb_savetiff(struct ImBuf *ibuf, const char *name, int flags);
void *libtiff_findsymbol(char *name);
-#endif /* IMB_FILETYPE_H */
+#endif /* __IMB_FILETYPE_H__ */
diff --git a/source/blender/imbuf/intern/IMB_filter.h b/source/blender/imbuf/intern/IMB_filter.h
index 29e6c4950df..6199cc13bb9 100644
--- a/source/blender/imbuf/intern/IMB_filter.h
+++ b/source/blender/imbuf/intern/IMB_filter.h
@@ -33,8 +33,8 @@
* \brief Function declarations for filter.c
*/
-#ifndef IMB_FILTER_H
-#define IMB_FILTER_H
+#ifndef __IMB_FILTER_H__
+#define __IMB_FILTER_H__
struct ImBuf;
diff --git a/source/blender/imbuf/intern/IMB_indexer.h b/source/blender/imbuf/intern/IMB_indexer.h
index f9d90208078..6546840ea85 100644
--- a/source/blender/imbuf/intern/IMB_indexer.h
+++ b/source/blender/imbuf/intern/IMB_indexer.h
@@ -22,8 +22,8 @@
*/
-#ifndef IMB_INDEXER_H
-#define IMB_INDEXER_H
+#ifndef __IMB_INDEXER_H__
+#define __IMB_INDEXER_H__
#ifdef WIN32
# include <io.h>
diff --git a/source/blender/imbuf/intern/IMB_metadata.h b/source/blender/imbuf/intern/IMB_metadata.h
index 0f57b8f654a..9b3a8004c74 100644
--- a/source/blender/imbuf/intern/IMB_metadata.h
+++ b/source/blender/imbuf/intern/IMB_metadata.h
@@ -30,8 +30,8 @@
*/
-#ifndef _IMB_IMGINFO_H
-#define _IMB_IMGINFO_H
+#ifndef __IMB_METADATA_H__
+#define __IMB_METADATA_H__
struct ImBuf;
@@ -80,4 +80,4 @@ int IMB_metadata_add_field(struct ImBuf* img, const char* key, const char* field
*/
int IMB_metadata_del_field(struct ImBuf *img, const char *key);
-#endif /* _IMB_IMGINFO_H */
+#endif /* __IMB_METADATA_H__ */
diff --git a/source/blender/imbuf/intern/cineon/cineonfile.h b/source/blender/imbuf/intern/cineon/cineonfile.h
index 896e0af65b3..ea321c87d48 100644
--- a/source/blender/imbuf/intern/cineon/cineonfile.h
+++ b/source/blender/imbuf/intern/cineon/cineonfile.h
@@ -26,8 +26,8 @@
*
*/
-#ifndef _CINEON_FILE_H_
-#define _CINEON_FILE_H_
+#ifndef __CINEONFILE_H__
+#define __CINEONFILE_H__
#include "logImageCore.h"
@@ -130,4 +130,4 @@ typedef struct {
}
#endif
-#endif /* _CINEON_FILE_H_ */
+#endif /* __CINEONFILE_H__ */
diff --git a/source/blender/imbuf/intern/cineon/cineonlib.h b/source/blender/imbuf/intern/cineon/cineonlib.h
index c24503e2ada..b1ad0532e25 100644
--- a/source/blender/imbuf/intern/cineon/cineonlib.h
+++ b/source/blender/imbuf/intern/cineon/cineonlib.h
@@ -23,8 +23,8 @@
*
*/
-#ifndef _CINEON_LIB_H_
-#define _CINEON_LIB_H_
+#ifndef __CINEONLIB_H__
+#define __CINEONLIB_H__
#include "logImageCore.h"
@@ -68,4 +68,4 @@ void cineonClose(CineonFile* cineon);
}
#endif
-#endif /* _CINEON_LIB_H_ */
+#endif /* __CINEONLIB_H__ */
diff --git a/source/blender/imbuf/intern/cineon/dpxfile.h b/source/blender/imbuf/intern/cineon/dpxfile.h
index abb11ec2e8c..dc8fc0bdbd2 100644
--- a/source/blender/imbuf/intern/cineon/dpxfile.h
+++ b/source/blender/imbuf/intern/cineon/dpxfile.h
@@ -26,8 +26,8 @@
*
*/
-#ifndef _DPX_FILE_H_
-#define _DPX_FILE_H_
+#ifndef __DPXFILE_H__
+#define __DPXFILE_H__
#include "logImageCore.h"
@@ -124,4 +124,4 @@ typedef struct {
}
#endif
-#endif /* _DPX_FILE_H_ */
+#endif /* __DPXFILE_H__ */
diff --git a/source/blender/imbuf/intern/cineon/dpxlib.h b/source/blender/imbuf/intern/cineon/dpxlib.h
index 1607de311c3..b09c699ae5b 100644
--- a/source/blender/imbuf/intern/cineon/dpxlib.h
+++ b/source/blender/imbuf/intern/cineon/dpxlib.h
@@ -22,8 +22,8 @@
*
*/
-#ifndef _DPX_LIB_H_
-#define _DPX_LIB_H_
+#ifndef __DPXLIB_H__
+#define __DPXLIB_H__
#ifdef __cplusplus
extern "C" {
@@ -56,4 +56,4 @@ void dpxDump(const char* filename);
}
#endif
-#endif /* _DPX_LIB_H_ */
+#endif /* __DPXLIB_H__ */
diff --git a/source/blender/imbuf/intern/cineon/logImageCore.h b/source/blender/imbuf/intern/cineon/logImageCore.h
index cbc7cb9d64a..c8592621f08 100644
--- a/source/blender/imbuf/intern/cineon/logImageCore.h
+++ b/source/blender/imbuf/intern/cineon/logImageCore.h
@@ -27,8 +27,8 @@
*
*/
-#ifndef _LOG_IMAGE_CORE_H_
-#define _LOG_IMAGE_CORE_H_
+#ifndef __LOGIMAGECORE_H__
+#define __LOGIMAGECORE_H__
#include <stdio.h>
#include "logImageLib.h"
@@ -119,4 +119,4 @@ R32 reverseR32(R32 value);
}
#endif
-#endif /* _LOG_IMAGE_CORE_H_ */
+#endif /* __LOGIMAGECORE_H__ */
diff --git a/source/blender/imbuf/intern/cineon/logImageLib.h b/source/blender/imbuf/intern/cineon/logImageLib.h
index 9f6d3ad2adf..72448ed962b 100644
--- a/source/blender/imbuf/intern/cineon/logImageLib.h
+++ b/source/blender/imbuf/intern/cineon/logImageLib.h
@@ -22,8 +22,8 @@
*
*/
-#ifndef _LOG_IMAGE_LIB_H_
-#define _LOG_IMAGE_LIB_H_
+#ifndef __LOGIMAGELIB_H__
+#define __LOGIMAGELIB_H__
#ifdef __cplusplus
extern "C" {
@@ -87,4 +87,4 @@ void logImageDump(const char* filename);
}
#endif
-#endif /* _LOG_IMAGE_LIB_H_ */
+#endif /* __LOGIMAGELIB_H__ */
diff --git a/source/blender/imbuf/intern/cineon/logmemfile.h b/source/blender/imbuf/intern/cineon/logmemfile.h
index 36f950232ac..2611463148e 100644
--- a/source/blender/imbuf/intern/cineon/logmemfile.h
+++ b/source/blender/imbuf/intern/cineon/logmemfile.h
@@ -22,11 +22,11 @@
*
*/
-#ifndef _LOGMEMFILE_H
-#define _LOGMEMFILE_H
+#ifndef __LOGMEMFILE_H__
+#define __LOGMEMFILE_H__
int logimage_fseek(void* logfile, intptr_t offsett, int origin);
int logimage_fwrite(void *buffer, unsigned int size, unsigned int count, void *logfile);
int logimage_fread(void *buffer, unsigned int size, unsigned int count, void *logfile);
-#endif /* _LOGMEMFILE_H */
+#endif /* __LOGMEMFILE_H__ */
diff --git a/source/blender/imbuf/intern/dds/BlockDXT.h b/source/blender/imbuf/intern/dds/BlockDXT.h
index cdf839ce9b4..c6712f4f058 100644
--- a/source/blender/imbuf/intern/dds/BlockDXT.h
+++ b/source/blender/imbuf/intern/dds/BlockDXT.h
@@ -55,8 +55,8 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
-#ifndef _DDS_BLOCKDXT_H
-#define _DDS_BLOCKDXT_H
+#ifndef __BLOCKDXT_H__
+#define __BLOCKDXT_H__
#include <Common.h>
#include <Color.h>
@@ -271,4 +271,4 @@ void mem_read(Stream & mem, BlockATI1 & block);
void mem_read(Stream & mem, BlockATI2 & block);
void mem_read(Stream & mem, BlockCTX1 & block);
-#endif // _DDS_BLOCKDXT_H
+#endif // __BLOCKDXT_H__
diff --git a/source/blender/imbuf/intern/dds/Color.h b/source/blender/imbuf/intern/dds/Color.h
index b23a5a32bdc..17de0a596c6 100644
--- a/source/blender/imbuf/intern/dds/Color.h
+++ b/source/blender/imbuf/intern/dds/Color.h
@@ -34,8 +34,8 @@
// This code is in the public domain -- castanyo@yahoo.es
-#ifndef _DDS_COLOR_H
-#define _DDS_COLOR_H
+#ifndef __COLOR_H__
+#define __COLOR_H__
/// 32 bit color stored as BGRA.
class Color32
@@ -96,4 +96,4 @@ public:
};
};
-#endif // _DDS_COLOR_H
+#endif // __COLOR_H__
diff --git a/source/blender/imbuf/intern/dds/ColorBlock.h b/source/blender/imbuf/intern/dds/ColorBlock.h
index eb483f559c2..e72b6253035 100644
--- a/source/blender/imbuf/intern/dds/ColorBlock.h
+++ b/source/blender/imbuf/intern/dds/ColorBlock.h
@@ -34,8 +34,8 @@
// This code is in the public domain -- castanyo@yahoo.es
-#ifndef _DDS_COLORBLOCK_H
-#define _DDS_COLORBLOCK_H
+#ifndef __COLORBLOCK_H__
+#define __COLORBLOCK_H__
#include <Color.h>
#include <Image.h>
@@ -104,4 +104,4 @@ inline Color32 & ColorBlock::color(uint x, uint y)
return m_color[y * 4 + x];
}
-#endif // _DDS_COLORBLOCK_H
+#endif // __COLORBLOCK_H__
diff --git a/source/blender/imbuf/intern/dds/Common.h b/source/blender/imbuf/intern/dds/Common.h
index 8c307e346f0..4e3e3e024f7 100644
--- a/source/blender/imbuf/intern/dds/Common.h
+++ b/source/blender/imbuf/intern/dds/Common.h
@@ -25,8 +25,8 @@
*/
-#ifndef _DDS_COMMON_H
-#define _DDS_COMMON_H
+#ifndef __COMMON_H__
+#define __COMMON_H__
#ifndef min
#define min(a,b) ((a) <= (b) ? (a) : (b))
diff --git a/source/blender/imbuf/intern/dds/DirectDrawSurface.h b/source/blender/imbuf/intern/dds/DirectDrawSurface.h
index 8b8388c9f89..23c8bbf2de3 100644
--- a/source/blender/imbuf/intern/dds/DirectDrawSurface.h
+++ b/source/blender/imbuf/intern/dds/DirectDrawSurface.h
@@ -55,8 +55,8 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
-#ifndef _DDS_DIRECTDRAWSURFACE_H
-#define _DDS_DIRECTDRAWSURFACE_H
+#ifndef __DIRECTDRAWSURFACE_H__
+#define __DIRECTDRAWSURFACE_H__
#include <Common.h>
#include <Stream.h>
@@ -198,4 +198,4 @@ void mem_read(Stream & mem, DDSCaps & caps);
void mem_read(Stream & mem, DDSHeader & header);
void mem_read(Stream & mem, DDSHeader10 & header);
-#endif // _DDS_DIRECTDRAWSURFACE_H
+#endif // __DIRECTDRAWSURFACE_H__
diff --git a/source/blender/imbuf/intern/dds/Image.h b/source/blender/imbuf/intern/dds/Image.h
index e932e1122f2..9c2220567aa 100644
--- a/source/blender/imbuf/intern/dds/Image.h
+++ b/source/blender/imbuf/intern/dds/Image.h
@@ -34,8 +34,8 @@
// This code is in the public domain -- castanyo@yahoo.es
-#ifndef _DDS_IMAGE_H
-#define _DDS_IMAGE_H
+#ifndef __IMAGE_H__
+#define __IMAGE_H__
#include <Common.h>
#include <Color.h>
@@ -101,4 +101,4 @@ inline Color32 & Image::pixel(uint x, uint y)
return pixel(y * width() + x);
}
-#endif // _DDS_IMAGE_H
+#endif // __IMAGE_H__
diff --git a/source/blender/imbuf/intern/dds/PixelFormat.h b/source/blender/imbuf/intern/dds/PixelFormat.h
index c76c7994ed2..9add62c4616 100644
--- a/source/blender/imbuf/intern/dds/PixelFormat.h
+++ b/source/blender/imbuf/intern/dds/PixelFormat.h
@@ -55,8 +55,8 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
-#ifndef _DDS_PIXELFORMAT_H
-#define _DDS_PIXELFORMAT_H
+#ifndef __PIXELFORMAT_H__
+#define __PIXELFORMAT_H__
#include <Common.h>
diff --git a/source/blender/imbuf/intern/dds/Stream.h b/source/blender/imbuf/intern/dds/Stream.h
index 1c789ac948f..9f513ca8aba 100644
--- a/source/blender/imbuf/intern/dds/Stream.h
+++ b/source/blender/imbuf/intern/dds/Stream.h
@@ -27,8 +27,8 @@
/* simple memory stream functions with buffer overflow check */
-#ifndef _STREAM_H
-#define _STREAM_H
+#ifndef __STREAM_H__
+#define __STREAM_H__
struct Stream
{
@@ -45,5 +45,5 @@ unsigned int mem_read(Stream & mem, unsigned short & i);
unsigned int mem_read(Stream & mem, unsigned char & i);
unsigned int mem_read(Stream & mem, unsigned char *i, unsigned int cnt);
-#endif // _STREAM_H
+#endif // __STREAM_H__
diff --git a/source/blender/imbuf/intern/dds/dds_api.h b/source/blender/imbuf/intern/dds/dds_api.h
index e477a4b8003..589257816e0 100644
--- a/source/blender/imbuf/intern/dds/dds_api.h
+++ b/source/blender/imbuf/intern/dds/dds_api.h
@@ -25,8 +25,8 @@
*/
-#ifndef _DDS_API_H
-#define _DDS_API_H
+#ifndef __DDS_API_H__
+#define __DDS_API_H__
#ifdef __cplusplus
extern "C" {
diff --git a/source/blender/imbuf/intern/imbuf.h b/source/blender/imbuf/intern/imbuf.h
index c1afecf621f..2125583375f 100644
--- a/source/blender/imbuf/intern/imbuf.h
+++ b/source/blender/imbuf/intern/imbuf.h
@@ -35,8 +35,8 @@
*/
-#ifndef IMBUF_H
-#define IMBUF_H
+#ifndef __IMBUF_H__
+#define __IMBUF_H__
#include <stdlib.h>
#include <sys/types.h>
@@ -78,5 +78,5 @@ typedef unsigned char uchar;
#define TRUE 1
#define FALSE 0
-#endif /* IMBUF_H */
+#endif /* __IMBUF_H__ */
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.h b/source/blender/imbuf/intern/openexr/openexr_api.h
index 8567673a3e3..2b3a17ba47d 100644
--- a/source/blender/imbuf/intern/openexr/openexr_api.h
+++ b/source/blender/imbuf/intern/openexr/openexr_api.h
@@ -30,8 +30,8 @@
*/
-#ifndef _OPENEXR_API_H
-#define _OPENEXR_API_H
+#ifndef __OPENEXR_API_H__
+#define __OPENEXR_API_H__
#ifdef __cplusplus
extern "C" {
diff --git a/source/blender/imbuf/intern/openexr/openexr_multi.h b/source/blender/imbuf/intern/openexr/openexr_multi.h
index abb675e1dca..84e3da0baa7 100644
--- a/source/blender/imbuf/intern/openexr/openexr_multi.h
+++ b/source/blender/imbuf/intern/openexr/openexr_multi.h
@@ -30,8 +30,8 @@
*/
-#ifndef _OPENEXR_MULTI_H
-#define _OPENEXR_MULTI_H
+#ifndef __OPENEXR_MULTI_H__
+#define __OPENEXR_MULTI_H__
/* experiment with more advanced exr api */
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index cb7b8d15d52..eb8d06fc9f2 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -30,8 +30,8 @@
* \brief ID and Library types, which are fundamental for sdna.
*/
-#ifndef DNA_ID_H
-#define DNA_ID_H
+#ifndef __DNA_ID_H__
+#define __DNA_ID_H__
#include "DNA_listBase.h"
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h
index e582d071319..058c72be639 100644
--- a/source/blender/makesdna/DNA_action_types.h
+++ b/source/blender/makesdna/DNA_action_types.h
@@ -29,8 +29,8 @@
* \ingroup DNA
*/
-#ifndef DNA_ACTION_TYPES_H
-#define DNA_ACTION_TYPES_H
+#ifndef __DNA_ACTION_TYPES_H__
+#define __DNA_ACTION_TYPES_H__
#include "DNA_listBase.h"
#include "DNA_ID.h"
diff --git a/source/blender/makesdna/DNA_actuator_types.h b/source/blender/makesdna/DNA_actuator_types.h
index 3be46538c22..817da3cd445 100644
--- a/source/blender/makesdna/DNA_actuator_types.h
+++ b/source/blender/makesdna/DNA_actuator_types.h
@@ -29,8 +29,8 @@
* \ingroup DNA
*/
-#ifndef DNA_ACTUATOR_TYPES_H
-#define DNA_ACTUATOR_TYPES_H
+#ifndef __DNA_ACTUATOR_TYPES_H__
+#define __DNA_ACTUATOR_TYPES_H__
struct Object;
struct Mesh;
diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h
index 2233da86385..ae31bea4981 100644
--- a/source/blender/makesdna/DNA_anim_types.h
+++ b/source/blender/makesdna/DNA_anim_types.h
@@ -27,8 +27,8 @@
* \ingroup DNA
*/
-#ifndef DNA_ANIM_TYPES_H
-#define DNA_ANIM_TYPES_H
+#ifndef __DNA_ANIM_TYPES_H__
+#define __DNA_ANIM_TYPES_H__
#ifdef __cplusplus
extern "C" {
@@ -909,4 +909,4 @@ typedef struct IdAdtTemplate {
};
#endif
-#endif /* DNA_ANIM_TYPES_H */
+#endif /* __DNA_ANIM_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h
index 33f965663de..f915b75a77f 100644
--- a/source/blender/makesdna/DNA_armature_types.h
+++ b/source/blender/makesdna/DNA_armature_types.h
@@ -27,8 +27,8 @@
* \ingroup DNA
*/
-#ifndef DNA_ARMATURE_TYPES_H
-#define DNA_ARMATURE_TYPES_H
+#ifndef __DNA_ARMATURE_TYPES_H__
+#define __DNA_ARMATURE_TYPES_H__
#include "DNA_listBase.h"
#include "DNA_ID.h"
diff --git a/source/blender/makesdna/DNA_boid_types.h b/source/blender/makesdna/DNA_boid_types.h
index 53ff5179049..09221c4ada9 100644
--- a/source/blender/makesdna/DNA_boid_types.h
+++ b/source/blender/makesdna/DNA_boid_types.h
@@ -30,8 +30,8 @@
* \ingroup DNA
*/
-#ifndef DNA_BOID_TYPES_H
-#define DNA_BOID_TYPES_H
+#ifndef __DNA_BOID_TYPES_H__
+#define __DNA_BOID_TYPES_H__
#include "DNA_listBase.h"
diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h
index 690c3c95964..454008c73a7 100644
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@ -29,8 +29,8 @@
* \ingroup DNA
*/
-#ifndef DNA_BRUSH_TYPES_H
-#define DNA_BRUSH_TYPES_H
+#ifndef __DNA_BRUSH_TYPES_H__
+#define __DNA_BRUSH_TYPES_H__
#include "DNA_ID.h"
diff --git a/source/blender/makesdna/DNA_camera_types.h b/source/blender/makesdna/DNA_camera_types.h
index a46be730d6c..4618b99f6b6 100644
--- a/source/blender/makesdna/DNA_camera_types.h
+++ b/source/blender/makesdna/DNA_camera_types.h
@@ -29,8 +29,8 @@
* \ingroup DNA
*/
-#ifndef DNA_CAMERA_TYPES_H
-#define DNA_CAMERA_TYPES_H
+#ifndef __DNA_CAMERA_TYPES_H__
+#define __DNA_CAMERA_TYPES_H__
#include "DNA_defs.h"
diff --git a/source/blender/makesdna/DNA_cloth_types.h b/source/blender/makesdna/DNA_cloth_types.h
index 1079f1db835..79a1d821543 100644
--- a/source/blender/makesdna/DNA_cloth_types.h
+++ b/source/blender/makesdna/DNA_cloth_types.h
@@ -29,8 +29,8 @@
* \ingroup DNA
*/
-#ifndef DNA_CLOTH_TYPES_H
-#define DNA_CLOTH_TYPES_H
+#ifndef __DNA_CLOTH_TYPES_H__
+#define __DNA_CLOTH_TYPES_H__
/**
* This struct contains all the global data required to run a simulation.
diff --git a/source/blender/makesdna/DNA_color_types.h b/source/blender/makesdna/DNA_color_types.h
index f5762f8b49f..676389ffeea 100644
--- a/source/blender/makesdna/DNA_color_types.h
+++ b/source/blender/makesdna/DNA_color_types.h
@@ -29,8 +29,8 @@
* \ingroup DNA
*/
-#ifndef DNA_COLOR_TYPES_H
-#define DNA_COLOR_TYPES_H
+#ifndef __DNA_COLOR_TYPES_H__
+#define __DNA_COLOR_TYPES_H__
#include "DNA_vec_types.h"
diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h
index fdc493ddfd3..7a2d2929e47 100644
--- a/source/blender/makesdna/DNA_constraint_types.h
+++ b/source/blender/makesdna/DNA_constraint_types.h
@@ -30,8 +30,8 @@
* \ingroup DNA
*/
-#ifndef DNA_CONSTRAINT_TYPES_H
-#define DNA_CONSTRAINT_TYPES_H
+#ifndef __DNA_CONSTRAINT_TYPES_H__
+#define __DNA_CONSTRAINT_TYPES_H__
#include "DNA_defs.h"
#include "DNA_ID.h"
diff --git a/source/blender/makesdna/DNA_controller_types.h b/source/blender/makesdna/DNA_controller_types.h
index 51ab29db7ae..bdfedb5b4d1 100644
--- a/source/blender/makesdna/DNA_controller_types.h
+++ b/source/blender/makesdna/DNA_controller_types.h
@@ -29,8 +29,8 @@
* \ingroup DNA
*/
-#ifndef DNA_CONTROLLER_TYPES_H
-#define DNA_CONTROLLER_TYPES_H
+#ifndef __DNA_CONTROLLER_TYPES_H__
+#define __DNA_CONTROLLER_TYPES_H__
struct bActuator;
struct Text;
diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h
index 455738c840b..d5b9477f7f6 100644
--- a/source/blender/makesdna/DNA_curve_types.h
+++ b/source/blender/makesdna/DNA_curve_types.h
@@ -29,8 +29,8 @@
* \ingroup DNA
*/
-#ifndef DNA_CURVE_TYPES_H
-#define DNA_CURVE_TYPES_H
+#ifndef __DNA_CURVE_TYPES_H__
+#define __DNA_CURVE_TYPES_H__
#include "DNA_defs.h"
#include "DNA_listBase.h"
diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h
index a4bb5715174..eeeb0581527 100644
--- a/source/blender/makesdna/DNA_customdata_types.h
+++ b/source/blender/makesdna/DNA_customdata_types.h
@@ -29,8 +29,8 @@
* \ingroup DNA
*/
-#ifndef DNA_CUSTOMDATA_TYPES_H
-#define DNA_CUSTOMDATA_TYPES_H
+#ifndef __DNA_CUSTOMDATA_TYPES_H__
+#define __DNA_CUSTOMDATA_TYPES_H__
#ifdef __cplusplus
extern "C" {
diff --git a/source/blender/makesdna/DNA_defs.h b/source/blender/makesdna/DNA_defs.h
index 46d7fc2b009..aa2cfb3f6e9 100644
--- a/source/blender/makesdna/DNA_defs.h
+++ b/source/blender/makesdna/DNA_defs.h
@@ -24,8 +24,8 @@
* \ingroup DNA
*/
-#ifndef DNA_DEFS_H
-#define DNA_DEFS_H
+#ifndef __DNA_DEFS_H__
+#define __DNA_DEFS_H__
/* makesdna ignores */
#ifdef DNA_DEPRECATED_ALLOW
@@ -50,4 +50,4 @@
/* non-id name variables should use this length */
#define MAX_NAME 64
-#endif /* DNA_DEFS_H */
+#endif /* __DNA_DEFS_H__ */
diff --git a/source/blender/makesdna/DNA_dynamicpaint_types.h b/source/blender/makesdna/DNA_dynamicpaint_types.h
index 2345b8dd1c0..fedc603fde2 100644
--- a/source/blender/makesdna/DNA_dynamicpaint_types.h
+++ b/source/blender/makesdna/DNA_dynamicpaint_types.h
@@ -25,8 +25,8 @@
* \ingroup DNA
*/
-#ifndef DNA_DYNAMICPAINT_TYPES_H
-#define DNA_DYNAMICPAINT_TYPES_H
+#ifndef __DNA_DYNAMICPAINT_TYPES_H__
+#define __DNA_DYNAMICPAINT_TYPES_H__
#include "DNA_listBase.h"
struct CurveMapping;
diff --git a/source/blender/makesdna/DNA_effect_types.h b/source/blender/makesdna/DNA_effect_types.h
index ddff22aae37..7ca3bbe3319 100644
--- a/source/blender/makesdna/DNA_effect_types.h
+++ b/source/blender/makesdna/DNA_effect_types.h
@@ -29,8 +29,8 @@
* \ingroup DNA
*/
-#ifndef DNA_EFFECT_TYPES_H
-#define DNA_EFFECT_TYPES_H
+#ifndef __DNA_EFFECT_TYPES_H__
+#define __DNA_EFFECT_TYPES_H__
/* don't forget, new effects also in writefile.c for dna!!! */
diff --git a/source/blender/makesdna/DNA_fileglobal_types.h b/source/blender/makesdna/DNA_fileglobal_types.h
index ed9f3cec987..0ae5c2465da 100644
--- a/source/blender/makesdna/DNA_fileglobal_types.h
+++ b/source/blender/makesdna/DNA_fileglobal_types.h
@@ -29,8 +29,8 @@
* \ingroup DNA
*/
-#ifndef DNA_FILEGLOBAL_TYPES_H
-#define DNA_FILEGLOBAL_TYPES_H
+#ifndef __DNA_FILEGLOBAL_TYPES_H__
+#define __DNA_FILEGLOBAL_TYPES_H__
struct bScreen;
struct Scene;
diff --git a/source/blender/makesdna/DNA_genfile.h b/source/blender/makesdna/DNA_genfile.h
index 2264e82b363..d4cfccaef70 100644
--- a/source/blender/makesdna/DNA_genfile.h
+++ b/source/blender/makesdna/DNA_genfile.h
@@ -30,8 +30,8 @@
* \brief blenloader genfile private function prototypes
*/
-#ifndef DNA_GENFILE_H
-#define DNA_GENFILE_H
+#ifndef __DNA_GENFILE_H__
+#define __DNA_GENFILE_H__
struct SDNA;
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index 71f0dbb60b1..6f3014c0961 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -27,8 +27,8 @@
* \ingroup DNA
*/
-#ifndef DNA_GPENCIL_TYPES_H
-#define DNA_GPENCIL_TYPES_H
+#ifndef __DNA_GPENCIL_TYPES_H__
+#define __DNA_GPENCIL_TYPES_H__
#include "DNA_listBase.h"
#include "DNA_ID.h"
@@ -160,4 +160,4 @@ typedef struct bGPdata {
#define GP_DATA_DEPTH_STROKE_ENDPOINTS (1<<7)
-#endif /* DNA_GPENCIL_TYPES_H */
+#endif /* __DNA_GPENCIL_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_group_types.h b/source/blender/makesdna/DNA_group_types.h
index ab42086d6d0..8aa6de4fbe2 100644
--- a/source/blender/makesdna/DNA_group_types.h
+++ b/source/blender/makesdna/DNA_group_types.h
@@ -32,8 +32,8 @@
* \ingroup DNA
*/
-#ifndef DNA_GROUP_TYPES_H
-#define DNA_GROUP_TYPES_H
+#ifndef __DNA_GROUP_TYPES_H__
+#define __DNA_GROUP_TYPES_H__
#include "DNA_listBase.h"
#include "DNA_ID.h"
diff --git a/source/blender/makesdna/DNA_image_types.h b/source/blender/makesdna/DNA_image_types.h
index 8f6cc5bf354..de2c9919df0 100644
--- a/source/blender/makesdna/DNA_image_types.h
+++ b/source/blender/makesdna/DNA_image_types.h
@@ -29,8 +29,8 @@
* \ingroup DNA
*/
-#ifndef DNA_IMAGE_TYPES_H
-#define DNA_IMAGE_TYPES_H
+#ifndef __DNA_IMAGE_TYPES_H__
+#define __DNA_IMAGE_TYPES_H__
#include "DNA_ID.h"
diff --git a/source/blender/makesdna/DNA_ipo_types.h b/source/blender/makesdna/DNA_ipo_types.h
index 201ea8994ca..e3ab6b4a7db 100644
--- a/source/blender/makesdna/DNA_ipo_types.h
+++ b/source/blender/makesdna/DNA_ipo_types.h
@@ -33,8 +33,8 @@
* etc. are only still maintained to provide backwards compatibility for old files.
*/
-#ifndef DNA_IPO_TYPES_H
-#define DNA_IPO_TYPES_H
+#ifndef __DNA_IPO_TYPES_H__
+#define __DNA_IPO_TYPES_H__
#include "DNA_listBase.h"
#include "DNA_curve_types.h"
diff --git a/source/blender/makesdna/DNA_key_types.h b/source/blender/makesdna/DNA_key_types.h
index b64389a365c..d27ec513cc1 100644
--- a/source/blender/makesdna/DNA_key_types.h
+++ b/source/blender/makesdna/DNA_key_types.h
@@ -24,8 +24,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef DNA_KEY_TYPES_H
-#define DNA_KEY_TYPES_H
+#ifndef __DNA_KEY_TYPES_H__
+#define __DNA_KEY_TYPES_H__
/** \file DNA_key_types.h
* \ingroup DNA
diff --git a/source/blender/makesdna/DNA_lamp_types.h b/source/blender/makesdna/DNA_lamp_types.h
index 18fbde8a3c3..8cf3814ada1 100644
--- a/source/blender/makesdna/DNA_lamp_types.h
+++ b/source/blender/makesdna/DNA_lamp_types.h
@@ -29,8 +29,8 @@
* \ingroup DNA
*/
-#ifndef DNA_LAMP_TYPES_H
-#define DNA_LAMP_TYPES_H
+#ifndef __DNA_LAMP_TYPES_H__
+#define __DNA_LAMP_TYPES_H__
#include "DNA_defs.h"
#include "DNA_ID.h"
@@ -206,5 +206,5 @@ typedef struct Lamp {
#define LAMAP_SHAD 2
-#endif /* DNA_LAMP_TYPES_H */
+#endif /* __DNA_LAMP_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_lattice_types.h b/source/blender/makesdna/DNA_lattice_types.h
index 0a73ed5b24f..1b4bd53151b 100644
--- a/source/blender/makesdna/DNA_lattice_types.h
+++ b/source/blender/makesdna/DNA_lattice_types.h
@@ -29,8 +29,8 @@
* \ingroup DNA
*/
-#ifndef DNA_LATTICE_TYPES_H
-#define DNA_LATTICE_TYPES_H
+#ifndef __DNA_LATTICE_TYPES_H__
+#define __DNA_LATTICE_TYPES_H__
#include "DNA_defs.h"
#include "DNA_ID.h"
diff --git a/source/blender/makesdna/DNA_listBase.h b/source/blender/makesdna/DNA_listBase.h
index 99ad6f41e96..d0e7a2f4433 100644
--- a/source/blender/makesdna/DNA_listBase.h
+++ b/source/blender/makesdna/DNA_listBase.h
@@ -33,8 +33,8 @@
* library system.
*/
-#ifndef DNA_LISTBASE_H
-#define DNA_LISTBASE_H
+#ifndef __DNA_LISTBASE_H__
+#define __DNA_LISTBASE_H__
#ifdef __cplusplus
extern "C" {
diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h
index eacc1b222e4..b58ae921200 100644
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@ -29,8 +29,8 @@
* \ingroup DNA
*/
-#ifndef DNA_MATERIAL_TYPES_H
-#define DNA_MATERIAL_TYPES_H
+#ifndef __DNA_MATERIAL_TYPES_H__
+#define __DNA_MATERIAL_TYPES_H__
#include "DNA_defs.h"
#include "DNA_ID.h"
diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h
index 1dc96190c67..d15cf4f1871 100644
--- a/source/blender/makesdna/DNA_mesh_types.h
+++ b/source/blender/makesdna/DNA_mesh_types.h
@@ -29,8 +29,8 @@
* \ingroup DNA
*/
-#ifndef DNA_MESH_TYPES_H
-#define DNA_MESH_TYPES_H
+#ifndef __DNA_MESH_TYPES_H__
+#define __DNA_MESH_TYPES_H__
#include "DNA_defs.h"
#include "DNA_listBase.h"
diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h
index ce9d1538fed..e85e703cd27 100644
--- a/source/blender/makesdna/DNA_meshdata_types.h
+++ b/source/blender/makesdna/DNA_meshdata_types.h
@@ -29,8 +29,8 @@
* \ingroup DNA
*/
-#ifndef DNA_MESHDATA_TYPES_H
-#define DNA_MESHDATA_TYPES_H
+#ifndef __DNA_MESHDATA_TYPES_H__
+#define __DNA_MESHDATA_TYPES_H__
#include "DNA_customdata_types.h"
#include "DNA_listBase.h"
diff --git a/source/blender/makesdna/DNA_meta_types.h b/source/blender/makesdna/DNA_meta_types.h
index 863e2b2e6ed..9c20b8f644b 100644
--- a/source/blender/makesdna/DNA_meta_types.h
+++ b/source/blender/makesdna/DNA_meta_types.h
@@ -29,8 +29,8 @@
* \ingroup DNA
*/
-#ifndef DNA_META_TYPES_H
-#define DNA_META_TYPES_H
+#ifndef __DNA_META_TYPES_H__
+#define __DNA_META_TYPES_H__
#include "DNA_listBase.h"
#include "DNA_ID.h"
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index dca401f12e8..0899b77abbc 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -22,8 +22,8 @@
* \ingroup DNA
*/
-#ifndef DNA_MODIFIER_TYPES_H
-#define DNA_MODIFIER_TYPES_H
+#ifndef __DNA_MODIFIER_TYPES_H__
+#define __DNA_MODIFIER_TYPES_H__
#include "DNA_defs.h"
#include "DNA_listBase.h"
diff --git a/source/blender/makesdna/DNA_movieclip_types.h b/source/blender/makesdna/DNA_movieclip_types.h
index 71029293d09..be189e883c7 100644
--- a/source/blender/makesdna/DNA_movieclip_types.h
+++ b/source/blender/makesdna/DNA_movieclip_types.h
@@ -32,8 +32,8 @@
* \author Sergey Sharybin
*/
-#ifndef DNA_MOVIECLIP_TYPES_H
-#define DNA_MOVIECLIP_TYPES_H
+#ifndef __DNA_MOVIECLIP_TYPES_H__
+#define __DNA_MOVIECLIP_TYPES_H__
#include "DNA_ID.h"
#include "DNA_tracking_types.h"
diff --git a/source/blender/makesdna/DNA_nla_types.h b/source/blender/makesdna/DNA_nla_types.h
index a28097e8449..43b52ed65eb 100644
--- a/source/blender/makesdna/DNA_nla_types.h
+++ b/source/blender/makesdna/DNA_nla_types.h
@@ -29,8 +29,8 @@
* \ingroup DNA
*/
-#ifndef DNA_NLA_TYPES_H
-#define DNA_NLA_TYPES_H
+#ifndef __DNA_NLA_TYPES_H__
+#define __DNA_NLA_TYPES_H__
#include "DNA_listBase.h"
diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index 33ac75912fa..361aca4a572 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -29,8 +29,8 @@
* \ingroup DNA
*/
-#ifndef DNA_NODE_TYPES_H
-#define DNA_NODE_TYPES_H
+#ifndef __DNA_NODE_TYPES_H__
+#define __DNA_NODE_TYPES_H__
#include "DNA_ID.h"
#include "DNA_vec_types.h"
diff --git a/source/blender/makesdna/DNA_object_fluidsim.h b/source/blender/makesdna/DNA_object_fluidsim.h
index 0651f076096..751d420daa7 100644
--- a/source/blender/makesdna/DNA_object_fluidsim.h
+++ b/source/blender/makesdna/DNA_object_fluidsim.h
@@ -31,8 +31,8 @@
* \ingroup DNA
*/
-#ifndef DNA_OBJECT_FLUIDSIM_H
-#define DNA_OBJECT_FLUIDSIM_H
+#ifndef __DNA_OBJECT_FLUIDSIM_H__
+#define __DNA_OBJECT_FLUIDSIM_H__
#include "DNA_ID.h"
diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h
index 70aeaaacd44..6603288912b 100644
--- a/source/blender/makesdna/DNA_object_force.h
+++ b/source/blender/makesdna/DNA_object_force.h
@@ -31,8 +31,8 @@
* \ingroup DNA
*/
-#ifndef DNA_OBJECT_FORCE_H
-#define DNA_OBJECT_FORCE_H
+#ifndef __DNA_OBJECT_FORCE_H__
+#define __DNA_OBJECT_FORCE_H__
#ifdef __cplusplus
extern "C" {
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index b8580b47269..7d3662c7ffb 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -30,8 +30,8 @@
* \brief Object is a sort of wrapper for general info.
*/
-#ifndef DNA_OBJECT_TYPES_H
-#define DNA_OBJECT_TYPES_H
+#ifndef __DNA_OBJECT_TYPES_H__
+#define __DNA_OBJECT_TYPES_H__
#include "DNA_defs.h"
#include "DNA_listBase.h"
diff --git a/source/blender/makesdna/DNA_outliner_types.h b/source/blender/makesdna/DNA_outliner_types.h
index ee3903c3b40..17124a724fe 100644
--- a/source/blender/makesdna/DNA_outliner_types.h
+++ b/source/blender/makesdna/DNA_outliner_types.h
@@ -29,8 +29,8 @@
* \ingroup DNA
*/
-#ifndef DNA_OUTLINER_TYPES_H
-#define DNA_OUTLINER_TYPES_H
+#ifndef __DNA_OUTLINER_TYPES_H__
+#define __DNA_OUTLINER_TYPES_H__
#include "DNA_listBase.h"
diff --git a/source/blender/makesdna/DNA_packedFile_types.h b/source/blender/makesdna/DNA_packedFile_types.h
index 91134c2c575..339ac0f8c0d 100644
--- a/source/blender/makesdna/DNA_packedFile_types.h
+++ b/source/blender/makesdna/DNA_packedFile_types.h
@@ -31,8 +31,8 @@
* \since 12-oct-2000 nzc
*/
-#ifndef DNA_PACKEDFILE_TYPES_H
-#define DNA_PACKEDFILE_TYPES_H
+#ifndef __DNA_PACKEDFILE_TYPES_H__
+#define __DNA_PACKEDFILE_TYPES_H__
typedef struct PackedFile {
int size;
diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h
index 4c3279c6527..220ee69b442 100644
--- a/source/blender/makesdna/DNA_particle_types.h
+++ b/source/blender/makesdna/DNA_particle_types.h
@@ -29,8 +29,8 @@
* \ingroup DNA
*/
-#ifndef DNA_PARTICLE_TYPES_H
-#define DNA_PARTICLE_TYPES_H
+#ifndef __DNA_PARTICLE_TYPES_H__
+#define __DNA_PARTICLE_TYPES_H__
#include "DNA_defs.h"
#include "DNA_ID.h"
diff --git a/source/blender/makesdna/DNA_property_types.h b/source/blender/makesdna/DNA_property_types.h
index a36e362632b..55fa50e3f63 100644
--- a/source/blender/makesdna/DNA_property_types.h
+++ b/source/blender/makesdna/DNA_property_types.h
@@ -36,8 +36,8 @@
* hierarchy here is a bit strange, and not desirable.
*/
-#ifndef DNA_PROPERTY_TYPES_H
-#define DNA_PROPERTY_TYPES_H
+#ifndef __DNA_PROPERTY_TYPES_H__
+#define __DNA_PROPERTY_TYPES_H__
/* ********************* PROPERTY ************************ */
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 1f42118dbc0..79d561fd2ea 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -29,8 +29,8 @@
* \ingroup DNA
*/
-#ifndef DNA_SCENE_TYPES_H
-#define DNA_SCENE_TYPES_H
+#ifndef __DNA_SCENE_TYPES_H__
+#define __DNA_SCENE_TYPES_H__
#include "DNA_defs.h"
diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h
index 504c8da7612..75d9b91e9c8 100644
--- a/source/blender/makesdna/DNA_screen_types.h
+++ b/source/blender/makesdna/DNA_screen_types.h
@@ -27,8 +27,8 @@
* \ingroup DNA
*/
-#ifndef DNA_SCREEN_TYPES_H
-#define DNA_SCREEN_TYPES_H
+#ifndef __DNA_SCREEN_TYPES_H__
+#define __DNA_SCREEN_TYPES_H__
#include "DNA_listBase.h"
#include "DNA_view2d_types.h"
diff --git a/source/blender/makesdna/DNA_sdna_types.h b/source/blender/makesdna/DNA_sdna_types.h
index 462ff8ce045..97b65235a29 100644
--- a/source/blender/makesdna/DNA_sdna_types.h
+++ b/source/blender/makesdna/DNA_sdna_types.h
@@ -29,8 +29,8 @@
* \ingroup DNA
*/
-#ifndef DNA_SDNA_H
-#define DNA_SDNA_H
+#ifndef __DNA_SDNA_TYPES_H__
+#define __DNA_SDNA_TYPES_H__
#
#
diff --git a/source/blender/makesdna/DNA_sensor_types.h b/source/blender/makesdna/DNA_sensor_types.h
index 80f19b30079..05927e3a486 100644
--- a/source/blender/makesdna/DNA_sensor_types.h
+++ b/source/blender/makesdna/DNA_sensor_types.h
@@ -31,8 +31,8 @@
* \author nzc
*/
-#ifndef DNA_SENSOR_TYPES_H
-#define DNA_SENSOR_TYPES_H
+#ifndef __DNA_SENSOR_TYPES_H__
+#define __DNA_SENSOR_TYPES_H__
struct Object;
struct Material;
diff --git a/source/blender/makesdna/DNA_sequence_types.h b/source/blender/makesdna/DNA_sequence_types.h
index 20399e541d7..cff4e539e6e 100644
--- a/source/blender/makesdna/DNA_sequence_types.h
+++ b/source/blender/makesdna/DNA_sequence_types.h
@@ -30,8 +30,8 @@
* \author nzc
*/
-#ifndef DNA_SEQUENCE_TYPES_H
-#define DNA_SEQUENCE_TYPES_H
+#ifndef __DNA_SEQUENCE_TYPES_H__
+#define __DNA_SEQUENCE_TYPES_H__
#include "DNA_defs.h"
#include "DNA_listBase.h"
diff --git a/source/blender/makesdna/DNA_smoke_types.h b/source/blender/makesdna/DNA_smoke_types.h
index 753f1374774..894e1135c0d 100644
--- a/source/blender/makesdna/DNA_smoke_types.h
+++ b/source/blender/makesdna/DNA_smoke_types.h
@@ -29,8 +29,8 @@
* \ingroup DNA
*/
-#ifndef DNA_SMOKE_TYPES_H
-#define DNA_SMOKE_TYPES_H
+#ifndef __DNA_SMOKE_TYPES_H__
+#define __DNA_SMOKE_TYPES_H__
/* flags */
#define MOD_SMOKE_HIGHRES (1<<1) /* enable high resolution */
diff --git a/source/blender/makesdna/DNA_sound_types.h b/source/blender/makesdna/DNA_sound_types.h
index 1dab9effa9e..1fab63f9d63 100644
--- a/source/blender/makesdna/DNA_sound_types.h
+++ b/source/blender/makesdna/DNA_sound_types.h
@@ -30,8 +30,8 @@
* \author nzc
*/
-#ifndef DNA_SOUND_TYPES_H
-#define DNA_SOUND_TYPES_H
+#ifndef __DNA_SOUND_TYPES_H__
+#define __DNA_SOUND_TYPES_H__
#include "DNA_listBase.h"
#include "DNA_ID.h"
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index f5ca88d9391..8d9f52a78d4 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -30,8 +30,8 @@
* \author nzc
*/
-#ifndef DNA_SPACE_TYPES_H
-#define DNA_SPACE_TYPES_H
+#ifndef __DNA_SPACE_TYPES_H__
+#define __DNA_SPACE_TYPES_H__
#include "DNA_defs.h"
#include "DNA_listBase.h"
diff --git a/source/blender/makesdna/DNA_speaker_types.h b/source/blender/makesdna/DNA_speaker_types.h
index 2e8227f4f92..8ad987818ae 100644
--- a/source/blender/makesdna/DNA_speaker_types.h
+++ b/source/blender/makesdna/DNA_speaker_types.h
@@ -24,8 +24,8 @@
* \ingroup DNA
*/
-#ifndef DNA_SPEAKER_TYPES_H
-#define DNA_SPEAKER_TYPES_H
+#ifndef __DNA_SPEAKER_TYPES_H__
+#define __DNA_SPEAKER_TYPES_H__
#include "DNA_ID.h"
@@ -64,5 +64,5 @@ typedef struct Speaker {
#define SPK_MUTED (1<<1)
#define SPK_RELATIVE (1<<2)
-#endif /* DNA_SPEAKER_TYPES_H */
+#endif /* __DNA_SPEAKER_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_text_types.h b/source/blender/makesdna/DNA_text_types.h
index 67f3c5288f6..cf26dae402d 100644
--- a/source/blender/makesdna/DNA_text_types.h
+++ b/source/blender/makesdna/DNA_text_types.h
@@ -30,8 +30,8 @@
* \author nzc
*/
-#ifndef DNA_TEXT_TYPES_H
-#define DNA_TEXT_TYPES_H
+#ifndef __DNA_TEXT_TYPES_H__
+#define __DNA_TEXT_TYPES_H__
#include "DNA_listBase.h"
#include "DNA_ID.h"
diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h
index de844fd2d7f..c6ffec2aff7 100644
--- a/source/blender/makesdna/DNA_texture_types.h
+++ b/source/blender/makesdna/DNA_texture_types.h
@@ -31,8 +31,8 @@
* \author nzc
*/
-#ifndef DNA_TEXTURE_TYPES_H
-#define DNA_TEXTURE_TYPES_H
+#ifndef __DNA_TEXTURE_TYPES_H__
+#define __DNA_TEXTURE_TYPES_H__
#include "DNA_defs.h"
#include "DNA_ID.h"
diff --git a/source/blender/makesdna/DNA_tracking_types.h b/source/blender/makesdna/DNA_tracking_types.h
index e81344d7d51..03e731cf765 100644
--- a/source/blender/makesdna/DNA_tracking_types.h
+++ b/source/blender/makesdna/DNA_tracking_types.h
@@ -32,8 +32,8 @@
* \author Sergey Sharybin
*/
-#ifndef DNA_TRACKING_TYPES_H
-#define DNA_TRACKING_TYPES_H
+#ifndef __DNA_TRACKING_TYPES_H__
+#define __DNA_TRACKING_TYPES_H__
#include "DNA_listBase.h"
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 405e1e33720..d64c3133001 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -31,8 +31,8 @@
* \author nzc
*/
-#ifndef DNA_USERDEF_TYPES_H
-#define DNA_USERDEF_TYPES_H
+#ifndef __DNA_USERDEF_TYPES_H__
+#define __DNA_USERDEF_TYPES_H__
#include "DNA_listBase.h"
#include "DNA_texture_types.h" /* ColorBand */
diff --git a/source/blender/makesdna/DNA_vec_types.h b/source/blender/makesdna/DNA_vec_types.h
index 10135ba85e9..0e832b8c95f 100644
--- a/source/blender/makesdna/DNA_vec_types.h
+++ b/source/blender/makesdna/DNA_vec_types.h
@@ -32,8 +32,8 @@
* \author nzc
*/
-#ifndef DNA_VEC_TYPES_H
-#define DNA_VEC_TYPES_H
+#ifndef __DNA_VEC_TYPES_H__
+#define __DNA_VEC_TYPES_H__
/* types */
diff --git a/source/blender/makesdna/DNA_vfont_types.h b/source/blender/makesdna/DNA_vfont_types.h
index d6168af6028..299a6540f40 100644
--- a/source/blender/makesdna/DNA_vfont_types.h
+++ b/source/blender/makesdna/DNA_vfont_types.h
@@ -31,8 +31,8 @@
* \author nzc
*/
-#ifndef DNA_VFONT_TYPES_H
-#define DNA_VFONT_TYPES_H
+#ifndef __DNA_VFONT_TYPES_H__
+#define __DNA_VFONT_TYPES_H__
#include "DNA_ID.h"
diff --git a/source/blender/makesdna/DNA_view2d_types.h b/source/blender/makesdna/DNA_view2d_types.h
index 0581cad4170..9c4abfbfdef 100644
--- a/source/blender/makesdna/DNA_view2d_types.h
+++ b/source/blender/makesdna/DNA_view2d_types.h
@@ -29,8 +29,8 @@
* \ingroup DNA
*/
-#ifndef DNA_VIEW2D_TYPES_H
-#define DNA_VIEW2D_TYPES_H
+#ifndef __DNA_VIEW2D_TYPES_H__
+#define __DNA_VIEW2D_TYPES_H__
#include "DNA_vec_types.h"
diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h
index 58c3f091d6d..0758e6e1713 100644
--- a/source/blender/makesdna/DNA_view3d_types.h
+++ b/source/blender/makesdna/DNA_view3d_types.h
@@ -29,8 +29,8 @@
* \ingroup DNA
*/
-#ifndef DNA_VIEW3D_TYPES_H
-#define DNA_VIEW3D_TYPES_H
+#ifndef __DNA_VIEW3D_TYPES_H__
+#define __DNA_VIEW3D_TYPES_H__
struct ViewDepths;
struct Object;
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h
index 156d2ebbb20..3e6c46ba8b1 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -28,8 +28,8 @@
* \ingroup DNA
*/
-#ifndef DNA_WINDOWMANAGER_TYPES_H
-#define DNA_WINDOWMANAGER_TYPES_H
+#ifndef __DNA_WINDOWMANAGER_TYPES_H__
+#define __DNA_WINDOWMANAGER_TYPES_H__
#include "DNA_listBase.h"
#include "DNA_vec_types.h"
@@ -338,4 +338,4 @@ typedef struct wmOperator {
/* wmOperator flag */
#define OP_GRAB_POINTER 1
-#endif /* DNA_WINDOWMANAGER_TYPES_H */
+#endif /* __DNA_WINDOWMANAGER_TYPES_H__ */
diff --git a/source/blender/makesdna/DNA_world_types.h b/source/blender/makesdna/DNA_world_types.h
index a04ea89a291..5482566ac41 100644
--- a/source/blender/makesdna/DNA_world_types.h
+++ b/source/blender/makesdna/DNA_world_types.h
@@ -29,8 +29,8 @@
* \ingroup DNA
*/
-#ifndef DNA_WORLD_TYPES_H
-#define DNA_WORLD_TYPES_H
+#ifndef __DNA_WORLD_TYPES_H__
+#define __DNA_WORLD_TYPES_H__
#include "DNA_defs.h"
#include "DNA_ID.h"
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index 45510947757..dc342f47362 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -20,8 +20,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef RNA_ACCESS_H
-#define RNA_ACCESS_H
+#ifndef __RNA_ACCESS_H__
+#define __RNA_ACCESS_H__
/** \file RNA_access.h
* \ingroup RNA
@@ -1017,4 +1017,4 @@ __attribute__ ((format (printf, 1, 2)))
}
#endif
-#endif /* RNA_ACCESS_H */
+#endif /* __RNA_ACCESS_H__ */
diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h
index 4fb08227fb6..95f988b470b 100644
--- a/source/blender/makesrna/RNA_define.h
+++ b/source/blender/makesrna/RNA_define.h
@@ -20,8 +20,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef RNA_DEFINE_H
-#define RNA_DEFINE_H
+#ifndef __RNA_DEFINE_H__
+#define __RNA_DEFINE_H__
/** \file RNA_define.h
* \ingroup RNA
@@ -218,5 +218,5 @@ const char *RNA_property_typename(PropertyType type);
}
#endif
-#endif /* RNA_DEFINE_H */
+#endif /* __RNA_DEFINE_H__ */
diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h
index 72917600d05..a333d9ace12 100644
--- a/source/blender/makesrna/RNA_enum_types.h
+++ b/source/blender/makesrna/RNA_enum_types.h
@@ -20,8 +20,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef RNA_ENUM_TYPES_H
-#define RNA_ENUM_TYPES_H
+#ifndef __RNA_ENUM_TYPES_H__
+#define __RNA_ENUM_TYPES_H__
/** \file RNA_enum_types.h
* \ingroup RNA
@@ -137,4 +137,4 @@ EnumPropertyItem *RNA_image_local_itemf(struct bContext *C, struct PointerRNA *p
EnumPropertyItem *RNA_scene_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, int *free);
EnumPropertyItem *RNA_scene_local_itemf(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop, int *free);
-#endif /* RNA_ENUM_TYPES_H */
+#endif /* __RNA_ENUM_TYPES_H__ */
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h
index 85869115e79..ee9c6b26e2f 100644
--- a/source/blender/makesrna/RNA_types.h
+++ b/source/blender/makesrna/RNA_types.h
@@ -27,8 +27,8 @@
#include "BLO_sys_types.h"
-#ifndef RNA_TYPES_H
-#define RNA_TYPES_H
+#ifndef __RNA_TYPES_H__
+#define __RNA_TYPES_H__
#ifdef __cplusplus
extern "C" {
@@ -371,4 +371,4 @@ typedef struct ExtensionRNA {
}
#endif
-#endif /* RNA_TYPES_H */
+#endif /* __RNA_TYPES_H__ */
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 5339ee58acf..0df8a625caf 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -475,7 +475,7 @@ static const char *rna_ensure_property_description(PropertyRNA *prop)
}
#ifdef WITH_INTERNATIONAL
- if(description && (U.transopts&USER_DOTRANSLATE) && (U.transopts&USER_TR_TOOLTIPS))
+ if(description && BLF_translate_tooltips())
description= BLF_gettext(description);
#endif
@@ -492,7 +492,7 @@ static const char *rna_ensure_property_name(PropertyRNA *prop)
name= ((IDProperty*)prop)->name;
#ifdef WITH_INTERNATIONAL
- if((U.transopts&USER_DOTRANSLATE) && (U.transopts&USER_TR_IFACE)) {
+ if(BLF_translate_iface()) {
if(prop->translation_context)
name = BLF_pgettext(prop->translation_context, name);
else
@@ -1182,7 +1182,7 @@ void RNA_property_enum_items_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA
RNA_property_enum_items(C, ptr, prop, item, totitem, free);
#ifdef WITH_INTERNATIONAL
- if((U.transopts&USER_DOTRANSLATE) && (U.transopts&USER_TR_IFACE)) {
+ if(BLF_translate_iface()) {
int i;
EnumPropertyItem *nitem;
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h
index e9f8ecd1ef2..6d902ba037a 100644
--- a/source/blender/makesrna/intern/rna_internal.h
+++ b/source/blender/makesrna/intern/rna_internal.h
@@ -25,8 +25,8 @@
*/
-#ifndef RNA_INTERNAL_H
-#define RNA_INTERNAL_H
+#ifndef __RNA_INTERNAL_H__
+#define __RNA_INTERNAL_H__
#include "UI_resources.h"
@@ -387,6 +387,6 @@ void rna_mtex_texture_slots_clear(struct ID *self, struct bContext *C, struct Re
int rna_IDMaterials_assign_int(struct PointerRNA *ptr, int key, const struct PointerRNA *assign_ptr);
-#endif /* RNA_INTERNAL_H */
+#endif /* __RNA_INTERNAL_H__ */
diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h
index 40157d390bc..997f9d084c5 100644
--- a/source/blender/makesrna/intern/rna_internal_types.h
+++ b/source/blender/makesrna/intern/rna_internal_types.h
@@ -25,8 +25,8 @@
*/
-#ifndef RNA_INTERNAL_TYPES_H
-#define RNA_INTERNAL_TYPES_H
+#ifndef __RNA_INTERNAL_TYPES_H__
+#define __RNA_INTERNAL_TYPES_H__
#include "DNA_listBase.h"
@@ -358,4 +358,4 @@ struct BlenderRNA {
#define CONTAINER_RNA_ID(cont) (*(const char **)(((ContainerRNA *)(cont))+1))
-#endif /* RNA_INTERNAL_TYPES_H */
+#endif /* __RNA_INTERNAL_TYPES_H__ */
diff --git a/source/blender/makesrna/intern/rna_nodetree_types.h b/source/blender/makesrna/intern/rna_nodetree_types.h
index 2284b09e941..745a956d831 100644
--- a/source/blender/makesrna/intern/rna_nodetree_types.h
+++ b/source/blender/makesrna/intern/rna_nodetree_types.h
@@ -24,6 +24,7 @@
* \ingroup RNA
*/
+/* intentionally no include guard */
/* Empty definitions for undefined macros to avoid warnings */
#ifndef DefNode
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c
index 8e3178a6298..1bfed372626 100644
--- a/source/blender/makesrna/intern/rna_ui.c
+++ b/source/blender/makesrna/intern/rna_ui.c
@@ -698,7 +698,10 @@ static void rna_def_panel(BlenderRNA *brna)
"name of the class used to define the panel. For example, if the "
"class name is \"OBJECT_PT_hello\", and bl_idname is not set by the "
"script, then bl_idname = \"OBJECT_PT_hello\"");
-
+
+ /* panel's label indeed doesn't need PROP_TRANSLATE flag: translation of label happens in runtime
+ * when drawing panel and having this flag set will make runtime switching of language much more tricky
+ * because label will be stored translated */
prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->label");
RNA_def_property_flag(prop, PROP_REGISTER);
@@ -823,7 +826,10 @@ static void rna_def_menu(BlenderRNA *brna)
"class name is \"OBJECT_MT_hello\", and bl_idname is not set by the "
"script, then bl_idname = \"OBJECT_MT_hello\")");
- prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_TRANSLATE);
+ /* menu's label indeed doesn't need PROP_TRANSLATE flag: translation of label happens in runtime
+ * when drawing panel and having this flag set will make runtime switching of language much more tricky
+ * because label will be stored translated */
+ prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->label");
RNA_def_property_flag(prop, PROP_REGISTER);
RNA_def_property_ui_text(prop, "Label", "The menu label");
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index f7c85583150..919ee215f29 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -2827,7 +2827,7 @@ static void rna_def_userdef_system(BlenderRNA *brna)
{24, "KOREAN", 0, "Korean (한국 언어)", "ko_KR"},
{25, "NEPALI", 0, "Nepali (नेपाली)", "ne_NP"},
/* using the utf8 flipped form of Persian (فارسی) */
- {26, "PERSIAN", 0, "Persian (ﯽﺳﺭﺎﻓ)", "fa_PE"},
+ {26, "PERSIAN", 0, "Persian (ﯽﺳﺭﺎﻓ)", "fa_IR"},
{19, "POLISH", 0, "Polish (Polski)", "pl_PL"},
{20, "ROMANIAN", 0, "Romanian (Român)", "ro_RO"},
{17, "SERBIAN", 0, "Serbian (Српски)", "sr_RS"},
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index 4f8f301dcbd..07c8552008a 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -1245,6 +1245,9 @@ static void rna_def_operator(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP);
RNA_def_struct_name_property(srna, prop);
+ /* operator's label indeed doesn't need PROP_TRANSLATE flag: translation of label happens in runtime
+ * when drawing panel and having this flag set will make runtime switching of language much more tricky
+ * because label will be stored translated */
prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->name");
RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */
@@ -1306,7 +1309,10 @@ static void rna_def_macro_operator(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_REGISTER|PROP_NEVER_CLAMP);
RNA_def_struct_name_property(srna, prop);
- prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_TRANSLATE);
+ /* menu's label indeed doesn't need PROP_TRANSLATE flag: translation of label happens in runtime
+ * when drawing panel and having this flag set will make runtime switching of language much more tricky
+ * because label will be stored translated */
+ prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->name");
RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Operator_bl_label_set");
diff --git a/source/blender/modifiers/MOD_modifiertypes.h b/source/blender/modifiers/MOD_modifiertypes.h
index fec6545678a..ea5574a378e 100644
--- a/source/blender/modifiers/MOD_modifiertypes.h
+++ b/source/blender/modifiers/MOD_modifiertypes.h
@@ -24,8 +24,8 @@
* \ingroup modifiers
*/
-#ifndef MOD_MODIFIERTYPES_H
-#define MOD_MODIFIERTYPES_H
+#ifndef __MOD_MODIFIERTYPES_H__
+#define __MOD_MODIFIERTYPES_H__
#include "BKE_modifier.h"
@@ -78,4 +78,4 @@ extern ModifierTypeInfo modifierType_Remesh;
/* MOD_util.c */
void modifier_type_init(ModifierTypeInfo *types[]);
-#endif //MOD_MODIFIERTYPES_H
+#endif //__MOD_MODIFIERTYPES_H__
diff --git a/source/blender/modifiers/intern/MOD_boolean_util.h b/source/blender/modifiers/intern/MOD_boolean_util.h
index dcd5460c7c3..8e3617cf74e 100644
--- a/source/blender/modifiers/intern/MOD_boolean_util.h
+++ b/source/blender/modifiers/intern/MOD_boolean_util.h
@@ -30,8 +30,8 @@
*/
-#ifndef MOD_BOOLEAN_UTILS_H
-#define MOD_BOOLEAN_UTILS_H
+#ifndef __MOD_BOOLEAN_UTIL_H__
+#define __MOD_BOOLEAN_UTIL_H__
struct Scene;
struct Object;
diff --git a/source/blender/modifiers/intern/MOD_fluidsim_util.h b/source/blender/modifiers/intern/MOD_fluidsim_util.h
index 2c22f37bcbe..334826e618b 100644
--- a/source/blender/modifiers/intern/MOD_fluidsim_util.h
+++ b/source/blender/modifiers/intern/MOD_fluidsim_util.h
@@ -30,8 +30,8 @@
*/
-#ifndef MOD_FLUIDSIM_UTIL_H
-#define MOD_FLUIDSIM_UTIL_H
+#ifndef __MOD_FLUIDSIM_UTIL_H__
+#define __MOD_FLUIDSIM_UTIL_H__
struct Object;
struct Scene;
diff --git a/source/blender/modifiers/intern/MOD_util.h b/source/blender/modifiers/intern/MOD_util.h
index 86909efb96c..ad62e073ea2 100644
--- a/source/blender/modifiers/intern/MOD_util.h
+++ b/source/blender/modifiers/intern/MOD_util.h
@@ -25,8 +25,8 @@
*/
-#ifndef MOD_UTIL_H
-#define MOD_UTIL_H
+#ifndef __MOD_UTIL_H__
+#define __MOD_UTIL_H__
/* so modifier types match their defines */
#include "MOD_modifiertypes.h"
@@ -48,4 +48,4 @@ struct DerivedMesh *get_cddm(struct Object *ob, struct EditMesh *em, struct Deri
struct DerivedMesh *get_dm(struct Object *ob, struct EditMesh *em, struct DerivedMesh *dm, float (*vertexCos)[3], int orco);
void modifier_get_vgroup(struct Object *ob, struct DerivedMesh *dm, const char *name, struct MDeformVert **dvert, int *defgrp_index);
-#endif /* MOD_UTIL_H */
+#endif /* __MOD_UTIL_H__ */
diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.h b/source/blender/modifiers/intern/MOD_weightvg_util.h
index 5ae1e991073..5572628fd3f 100644
--- a/source/blender/modifiers/intern/MOD_weightvg_util.h
+++ b/source/blender/modifiers/intern/MOD_weightvg_util.h
@@ -29,8 +29,8 @@
*/
-#ifndef MOD_WEIGHTVG_UTIL_H
-#define MOD_WEIGHTVG_UTIL_H
+#ifndef __MOD_WEIGHTVG_UTIL_H__
+#define __MOD_WEIGHTVG_UTIL_H__
/* so modifier types match their defines */
#include "MOD_modifiertypes.h"
@@ -85,4 +85,4 @@ void weightvg_update_vg(MDeformVert *dvert, int defgrp_idx, MDeformWeight **dws,
const int *indices, const float *weights, int do_add,
float add_thresh, int do_rem, float rem_thresh);
-#endif /* MOD_WEIGHTVG_UTIL_H */
+#endif /* __MOD_WEIGHTVG_UTIL_H__ */
diff --git a/source/blender/nodes/NOD_composite.h b/source/blender/nodes/NOD_composite.h
index 77745a19934..284b89bc095 100644
--- a/source/blender/nodes/NOD_composite.h
+++ b/source/blender/nodes/NOD_composite.h
@@ -29,8 +29,8 @@
* \ingroup nodes
*/
-#ifndef NOD_composite_H
-#define NOD_composite_H
+#ifndef __NOD_COMPOSITE_H__
+#define __NOD_COMPOSITE_H__
#include "BKE_node.h"
diff --git a/source/blender/nodes/NOD_shader.h b/source/blender/nodes/NOD_shader.h
index 63fc0f4232c..d2b3a61971b 100644
--- a/source/blender/nodes/NOD_shader.h
+++ b/source/blender/nodes/NOD_shader.h
@@ -29,8 +29,8 @@
* \ingroup nodes
*/
-#ifndef NOD_SHADER_H
-#define NOD_SHADER_H
+#ifndef __NOD_SHADER_H__
+#define __NOD_SHADER_H__
#include "BKE_node.h"
diff --git a/source/blender/nodes/NOD_socket.h b/source/blender/nodes/NOD_socket.h
index fb3946bae6c..f41be2bb7d9 100644
--- a/source/blender/nodes/NOD_socket.h
+++ b/source/blender/nodes/NOD_socket.h
@@ -30,8 +30,8 @@
*/
-#ifndef NOD_SOCKET_H_
-#define NOD_SOCKET_H_
+#ifndef __NOD_SOCKET_H__
+#define __NOD_SOCKET_H__
#include "DNA_listBase.h"
diff --git a/source/blender/nodes/NOD_texture.h b/source/blender/nodes/NOD_texture.h
index cb727ef071a..7722580d136 100644
--- a/source/blender/nodes/NOD_texture.h
+++ b/source/blender/nodes/NOD_texture.h
@@ -29,8 +29,8 @@
* \ingroup nodes
*/
-#ifndef NOD_TEXTURE_H
-#define NOD_TEXTURE_H
+#ifndef __NOD_TEXTURE_H__
+#define __NOD_TEXTURE_H__
#include "BKE_node.h"
diff --git a/source/blender/nodes/composite/node_composite_util.h b/source/blender/nodes/composite/node_composite_util.h
index 02487933849..5e63750e131 100644
--- a/source/blender/nodes/composite/node_composite_util.h
+++ b/source/blender/nodes/composite/node_composite_util.h
@@ -30,8 +30,8 @@
*/
-#ifndef NODE_COMPOSITE_UTIL_H_
-#define NODE_COMPOSITE_UTIL_H_
+#ifndef __NODE_COMPOSITE_UTIL_H__
+#define __NODE_COMPOSITE_UTIL_H__
#include <stdlib.h>
#include <string.h>
diff --git a/source/blender/nodes/intern/node_common.h b/source/blender/nodes/intern/node_common.h
index ee523120d02..616221d6658 100644
--- a/source/blender/nodes/intern/node_common.h
+++ b/source/blender/nodes/intern/node_common.h
@@ -30,8 +30,8 @@
*/
-#ifndef NODE_COMMON_H_
-#define NODE_COMMON_H_
+#ifndef __NODE_COMMON_H__
+#define __NODE_COMMON_H__
#include "DNA_listBase.h"
diff --git a/source/blender/nodes/intern/node_exec.h b/source/blender/nodes/intern/node_exec.h
index fe1bb0b6eb6..1003206e96a 100644
--- a/source/blender/nodes/intern/node_exec.h
+++ b/source/blender/nodes/intern/node_exec.h
@@ -30,8 +30,8 @@
*/
-#ifndef NODE_EXEC_H_
-#define NODE_EXEC_H_
+#ifndef __NODE_EXEC_H__
+#define __NODE_EXEC_H__
#include "DNA_listBase.h"
diff --git a/source/blender/nodes/intern/node_util.h b/source/blender/nodes/intern/node_util.h
index 7ca090394c3..4a5e8765ba2 100644
--- a/source/blender/nodes/intern/node_util.h
+++ b/source/blender/nodes/intern/node_util.h
@@ -30,8 +30,8 @@
*/
-#ifndef NODE_UTIL_H_
-#define NODE_UTIL_H_
+#ifndef __NODE_UTIL_H__
+#define __NODE_UTIL_H__
#include "DNA_listBase.h"
diff --git a/source/blender/nodes/shader/node_shader_util.h b/source/blender/nodes/shader/node_shader_util.h
index d345f3fb310..76d3d933fdb 100644
--- a/source/blender/nodes/shader/node_shader_util.h
+++ b/source/blender/nodes/shader/node_shader_util.h
@@ -30,8 +30,8 @@
*/
-#ifndef NODE_SHADER_UTIL_H_
-#define NODE_SHADER_UTIL_H_
+#ifndef __NODE_SHADER_UTIL_H__
+#define __NODE_SHADER_UTIL_H__
#include <math.h>
#include <float.h>
diff --git a/source/blender/nodes/texture/node_texture_util.h b/source/blender/nodes/texture/node_texture_util.h
index 5095a9799e4..a0b219804b9 100644
--- a/source/blender/nodes/texture/node_texture_util.h
+++ b/source/blender/nodes/texture/node_texture_util.h
@@ -30,8 +30,8 @@
*/
-#ifndef NODE_TEXTURE_UTIL_H_
-#define NODE_TEXTURE_UTIL_H_
+#ifndef __NODE_TEXTURE_UTIL_H__
+#define __NODE_TEXTURE_UTIL_H__
#include <math.h>
#include <string.h>
diff --git a/source/blender/python/BPY_extern.h b/source/blender/python/BPY_extern.h
index 51f9063c289..33ea139b474 100644
--- a/source/blender/python/BPY_extern.h
+++ b/source/blender/python/BPY_extern.h
@@ -34,8 +34,8 @@
-#ifndef BPY_EXTERN_H
-#define BPY_EXTERN_H
+#ifndef __BPY_EXTERN_H__
+#define __BPY_EXTERN_H__
struct Text; /* defined in DNA_text_types.h */
struct ID; /* DNA_ID.h */
@@ -89,4 +89,4 @@ void BPY_id_release(struct ID *id);
} /* extern "C" */
#endif
-#endif /* BPY_EXTERN_H */
+#endif /* __BPY_EXTERN_H__ */
diff --git a/source/blender/python/generic/bgl.h b/source/blender/python/generic/bgl.h
index 2e02900d69f..e23f4c2e86d 100644
--- a/source/blender/python/generic/bgl.h
+++ b/source/blender/python/generic/bgl.h
@@ -36,8 +36,8 @@
* writers to make OpenGL calls in their Python scripts for Blender. The
* more important original comments are marked with an @ symbol. */
-#ifndef BGL_H
-#define BGL_H
+#ifndef __BGL_H__
+#define __BGL_H__
PyObject *BPyInit_bgl(void);
@@ -339,4 +339,4 @@ extern PyTypeObject BGL_bufferType;
return NULL; \
} \
-#endif /* BGL_H */
+#endif /* __BGL_H__ */
diff --git a/source/blender/python/generic/bpy_internal_import.h b/source/blender/python/generic/bpy_internal_import.h
index 2ce644715e9..8b41a575d96 100644
--- a/source/blender/python/generic/bpy_internal_import.h
+++ b/source/blender/python/generic/bpy_internal_import.h
@@ -32,8 +32,8 @@
/* Note, the BGE needs to use this too, keep it minimal */
-#ifndef BPY_INTERNAL_IMPORT_H
-#define BPY_INTERNAL_IMPORT_H
+#ifndef __BPY_INTERNAL_IMPORT_H__
+#define __BPY_INTERNAL_IMPORT_H__
/* python redefines :/ */
#ifdef _POSIX_C_SOURCE
@@ -62,4 +62,4 @@ extern PyMethodDef bpy_reload_meth;
struct Main *bpy_import_main_get(void);
void bpy_import_main_set(struct Main *maggie);
-#endif /* BPY_INTERNAL_IMPORT_H */
+#endif /* __BPY_INTERNAL_IMPORT_H__ */
diff --git a/source/blender/python/generic/idprop_py_api.h b/source/blender/python/generic/idprop_py_api.h
index 599ba8e1db6..f053f212a23 100644
--- a/source/blender/python/generic/idprop_py_api.h
+++ b/source/blender/python/generic/idprop_py_api.h
@@ -25,8 +25,8 @@
*/
-#ifndef PY_IDPROP_API_H
-#define PY_IDPROP_API_H
+#ifndef __IDPROP_PY_API_H__
+#define __IDPROP_PY_API_H__
struct ID;
struct IDProperty;
@@ -67,4 +67,4 @@ void IDProp_Init_Types(void);
#define IDPROP_ITER_KEYS 0
#define IDPROP_ITER_ITEMS 1
-#endif /* PY_IDPROP_API_H */
+#endif /* __IDPROP_PY_API_H__ */
diff --git a/source/blender/python/generic/py_capi_utils.h b/source/blender/python/generic/py_capi_utils.h
index 2cab464a9d7..a71a2821c9a 100644
--- a/source/blender/python/generic/py_capi_utils.h
+++ b/source/blender/python/generic/py_capi_utils.h
@@ -25,8 +25,8 @@
*/
-#ifndef PY_CAPI_UTILS_H
-#define PY_CAPI_UTILS_H
+#ifndef __PY_CAPI_UTILS_H__
+#define __PY_CAPI_UTILS_H__
void PyC_ObSpit(const char *name, PyObject *var);
void PyC_LineSpit(void);
@@ -54,4 +54,4 @@ void PyC_SetHomePath(const char *py_path_bundle);
#define PYC_INTERPRETER_ACTIVE (((PyThreadState*)_Py_atomic_load_relaxed(&_PyThreadState_Current)) != NULL)
-#endif // PY_CAPI_UTILS_H
+#endif // __PY_CAPI_UTILS_H__
diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c
index ea95c4ebd85..0641c220001 100644
--- a/source/blender/python/intern/bpy_app.c
+++ b/source/blender/python/intern/bpy_app.c
@@ -94,9 +94,6 @@ static PyStructSequence_Desc app_info_desc = {
(sizeof(app_info_fields) / sizeof(PyStructSequence_Field)) - 1
};
-#define DO_EXPAND(VAL) VAL ## 1
-#define EXPAND(VAL) DO_EXPAND(VAL)
-
static PyObject *make_app_info(void)
{
PyObject *app_info;
@@ -119,11 +116,7 @@ static PyObject *make_app_info(void)
SetObjItem(PyUnicode_FromFormat("%d.%02d (sub %d)",
BLENDER_VERSION / 100, BLENDER_VERSION % 100, BLENDER_SUBVERSION));
-#if defined(BLENDER_VERSION_CHAR) && EXPAND(BLENDER_VERSION_CHAR) != 1
SetStrItem(STRINGIFY(BLENDER_VERSION_CHAR));
-#else
- SetStrItem("");
-#endif
SetStrItem(STRINGIFY(BLENDER_VERSION_CYCLE));
SetStrItem(BLI_program_path());
SetObjItem(PyBool_FromLong(G.background));
diff --git a/source/blender/python/intern/bpy_app.h b/source/blender/python/intern/bpy_app.h
index 0aa3b1f4e42..5bf36f04ba0 100644
--- a/source/blender/python/intern/bpy_app.h
+++ b/source/blender/python/intern/bpy_app.h
@@ -24,9 +24,9 @@
* \ingroup pythonintern
*/
-#ifndef BPY_APP_H
-#define BPY_APP_H
+#ifndef __BPY_APP_H__
+#define __BPY_APP_H__
PyObject *BPY_app_struct(void);
-#endif // BPY_APP_H
+#endif // __BPY_APP_H__
diff --git a/source/blender/python/intern/bpy_app_ffmpeg.h b/source/blender/python/intern/bpy_app_ffmpeg.h
index 4ed89cd7902..cadbb021d31 100644
--- a/source/blender/python/intern/bpy_app_ffmpeg.h
+++ b/source/blender/python/intern/bpy_app_ffmpeg.h
@@ -24,9 +24,9 @@
* \ingroup pythonintern
*/
-#ifndef BPY_APP_FFMPEG_H
-#define BPY_APP_FFMPEG_H
+#ifndef __BPY_APP_FFMPEG_H__
+#define __BPY_APP_FFMPEG_H__
PyObject *BPY_app_ffmpeg_struct(void);
-#endif // BPY_APP_FFMPEG_H
+#endif // __BPY_APP_FFMPEG_H__
diff --git a/source/blender/python/intern/bpy_app_handlers.h b/source/blender/python/intern/bpy_app_handlers.h
index 873282bde79..6883e05859d 100644
--- a/source/blender/python/intern/bpy_app_handlers.h
+++ b/source/blender/python/intern/bpy_app_handlers.h
@@ -24,10 +24,10 @@
* \ingroup pythonintern
*/
-#ifndef BPY_APP_HANDLERS_H
-#define BPY_APP_HANDLERS_H
+#ifndef __BPY_APP_HANDLERS_H__
+#define __BPY_APP_HANDLERS_H__
PyObject *BPY_app_handlers_struct(void);
void BPY_app_handlers_clear(void);
-#endif // BPY_APP_HANDLERS_H
+#endif // __BPY_APP_HANDLERS_H__
diff --git a/source/blender/python/intern/bpy_driver.h b/source/blender/python/intern/bpy_driver.h
index 802a3649e20..6d1696d6cdc 100644
--- a/source/blender/python/intern/bpy_driver.h
+++ b/source/blender/python/intern/bpy_driver.h
@@ -24,8 +24,8 @@
* \ingroup pythonintern
*/
-#ifndef BPY_DRIVER_H
-#define BPY_DRIVER_H
+#ifndef __BPY_DRIVER_H__
+#define __BPY_DRIVER_H__
struct ChannelDriver;
@@ -36,4 +36,4 @@ extern PyObject *bpy_pydriver_Dict;
float BPY_driver_exec(struct ChannelDriver *driver, const float evaltime);
void BPY_driver_reset(void);
-#endif // BPY_DRIVER_H
+#endif // __BPY_DRIVER_H__
diff --git a/source/blender/python/intern/bpy_operator.h b/source/blender/python/intern/bpy_operator.h
index cf67f2a029d..68ea9423edd 100644
--- a/source/blender/python/intern/bpy_operator.h
+++ b/source/blender/python/intern/bpy_operator.h
@@ -24,8 +24,8 @@
* \ingroup pythonintern
*/
-#ifndef BPY_OPERATOR_H
-#define BPY_OPERATOR_H
+#ifndef __BPY_OPERATOR_H__
+#define __BPY_OPERATOR_H__
extern PyTypeObject pyop_base_Type;
diff --git a/source/blender/python/intern/bpy_operator_wrap.h b/source/blender/python/intern/bpy_operator_wrap.h
index 125d7dba84a..05a566a1485 100644
--- a/source/blender/python/intern/bpy_operator_wrap.h
+++ b/source/blender/python/intern/bpy_operator_wrap.h
@@ -24,8 +24,8 @@
* \ingroup pythonintern
*/
-#ifndef BPY_OPERATOR_WRAP_H
-#define BPY_OPERATOR_WRAP_H
+#ifndef __BPY_OPERATOR_WRAP_H__
+#define __BPY_OPERATOR_WRAP_H__
struct wmOperatorType;
diff --git a/source/blender/python/intern/bpy_props.h b/source/blender/python/intern/bpy_props.h
index f7ec6d555b9..c9934ca0cf3 100644
--- a/source/blender/python/intern/bpy_props.h
+++ b/source/blender/python/intern/bpy_props.h
@@ -25,8 +25,8 @@
*/
-#ifndef BPY_PROPS_H
-#define BPY_PROPS_H
+#ifndef __BPY_PROPS_H__
+#define __BPY_PROPS_H__
PyObject *BPY_rna_props(void);
diff --git a/source/blender/python/intern/bpy_rna.h b/source/blender/python/intern/bpy_rna.h
index 70ae8166b8b..c9ff034716d 100644
--- a/source/blender/python/intern/bpy_rna.h
+++ b/source/blender/python/intern/bpy_rna.h
@@ -24,8 +24,8 @@
* \ingroup pythonintern
*/
-#ifndef BPY_RNA_H
-#define BPY_RNA_H
+#ifndef __BPY_RNA_H__
+#define __BPY_RNA_H__
/* --- bpy build options --- */
#ifdef WITH_PYTHON_SAFETY
diff --git a/source/blender/python/intern/bpy_traceback.h b/source/blender/python/intern/bpy_traceback.h
index ff7312bb16e..575f9824379 100644
--- a/source/blender/python/intern/bpy_traceback.h
+++ b/source/blender/python/intern/bpy_traceback.h
@@ -23,9 +23,9 @@
*/
-#ifndef BPY_TRACEBACK_H
-#define BPY_TRACEBACK_H
+#ifndef __BPY_TRACEBACK_H__
+#define __BPY_TRACEBACK_H__
void python_script_error_jump(const char *filepath, int *lineno, int *offset);
-#endif // BPY_TRACEBACK_H
+#endif // __BPY_TRACEBACK_H__
diff --git a/source/blender/python/intern/bpy_util.h b/source/blender/python/intern/bpy_util.h
index 4c06bd2593b..4bebcb2ed85 100644
--- a/source/blender/python/intern/bpy_util.h
+++ b/source/blender/python/intern/bpy_util.h
@@ -25,8 +25,8 @@
*/
-#ifndef BPY_UTIL_H
-#define BPY_UTIL_H
+#ifndef __BPY_UTIL_H__
+#define __BPY_UTIL_H__
#if PY_VERSION_HEX < 0x03020000
#error "Python 3.2 or greater is required, you'll need to update your python."
diff --git a/source/blender/python/mathutils/mathutils.h b/source/blender/python/mathutils/mathutils.h
index 220ae61f47d..854cb2e962a 100644
--- a/source/blender/python/mathutils/mathutils.h
+++ b/source/blender/python/mathutils/mathutils.h
@@ -32,8 +32,8 @@
//Include this file for access to vector, quat, matrix, euler, etc...
-#ifndef MATHUTILS_H
-#define MATHUTILS_H
+#ifndef __MATHUTILS_H__
+#define __MATHUTILS_H__
/* Can cast different mathutils types to this, use for generic funcs */
@@ -125,4 +125,4 @@ int column_vector_multiplication(float rvec[4], VectorObject *vec, MatrixObject
/* dynstr as python string utility funcions */
PyObject *mathutils_dynstr_to_py(struct DynStr *ds);
-#endif /* MATHUTILS_H */
+#endif /* __MATHUTILS_H__ */
diff --git a/source/blender/python/mathutils/mathutils_Color.h b/source/blender/python/mathutils/mathutils_Color.h
index 7e8a99089ad..786afeed5da 100644
--- a/source/blender/python/mathutils/mathutils_Color.h
+++ b/source/blender/python/mathutils/mathutils_Color.h
@@ -32,8 +32,8 @@
*/
-#ifndef MATHUTILS_COLOR_H
-#define MATHUTILS_COLOR_H
+#ifndef __MATHUTILS_COLOR_H__
+#define __MATHUTILS_COLOR_H__
extern PyTypeObject color_Type;
#define ColorObject_Check(_v) PyObject_TypeCheck((_v), &color_Type)
@@ -51,4 +51,4 @@ blender (stored in blend_data). This is an either/or struct not both*/
PyObject *Color_CreatePyObject( float *col, int type, PyTypeObject *base_type);
PyObject *Color_CreatePyObject_cb(PyObject *cb_user, int cb_type, int cb_subtype);
-#endif /* MATHUTILS_COLOR_H */
+#endif /* __MATHUTILS_COLOR_H__ */
diff --git a/source/blender/python/mathutils/mathutils_Euler.h b/source/blender/python/mathutils/mathutils_Euler.h
index c42b0daffbc..3656aa14461 100644
--- a/source/blender/python/mathutils/mathutils_Euler.h
+++ b/source/blender/python/mathutils/mathutils_Euler.h
@@ -32,8 +32,8 @@
*/
-#ifndef MATHUTILS_EULER_H
-#define MATHUTILS_EULER_H
+#ifndef __MATHUTILS_EULER_H__
+#define __MATHUTILS_EULER_H__
extern PyTypeObject euler_Type;
#define EulerObject_Check(_v) PyObject_TypeCheck((_v), &euler_Type)
@@ -56,4 +56,4 @@ PyObject *Euler_CreatePyObject_cb(PyObject *cb_user, short order, int cb_type, i
short euler_order_from_string(const char *str, const char *error_prefix);
-#endif /* MATHUTILS_EULER_H */
+#endif /* __MATHUTILS_EULER_H__ */
diff --git a/source/blender/python/mathutils/mathutils_Matrix.h b/source/blender/python/mathutils/mathutils_Matrix.h
index 2ecbc55da35..e8719e947ec 100644
--- a/source/blender/python/mathutils/mathutils_Matrix.h
+++ b/source/blender/python/mathutils/mathutils_Matrix.h
@@ -31,8 +31,8 @@
*/
-#ifndef MATHUTILS_MATRIX_H
-#define MATHUTILS_MATRIX_H
+#ifndef __MATHUTILS_MATRIX_H__
+#define __MATHUTILS_MATRIX_H__
extern PyTypeObject matrix_Type;
extern PyTypeObject matrix_access_Type;
@@ -83,4 +83,4 @@ extern struct Mathutils_Callback mathutils_matrix_translation_cb;
void matrix_as_3x3(float mat[3][3], MatrixObject *self);
-#endif /* MATHUTILS_MATRIX_H */
+#endif /* __MATHUTILS_MATRIX_H__ */
diff --git a/source/blender/python/mathutils/mathutils_Quaternion.h b/source/blender/python/mathutils/mathutils_Quaternion.h
index edd5ec55312..8e91f26b08f 100644
--- a/source/blender/python/mathutils/mathutils_Quaternion.h
+++ b/source/blender/python/mathutils/mathutils_Quaternion.h
@@ -32,8 +32,8 @@
*/
-#ifndef MATHUTILS_QUAT_H
-#define MATHUTILS_QUAT_H
+#ifndef __MATHUTILS_QUATERNION_H__
+#define __MATHUTILS_QUATERNION_H__
extern PyTypeObject quaternion_Type;
#define QuaternionObject_Check(_v) PyObject_TypeCheck((_v), &quaternion_Type)
@@ -51,4 +51,4 @@ blender (stored in blend_data). This is an either/or struct not both*/
PyObject *Quaternion_CreatePyObject( float *quat, int type, PyTypeObject *base_type);
PyObject *Quaternion_CreatePyObject_cb(PyObject *cb_user, int cb_type, int cb_subtype);
-#endif /* MATHUTILS_QUAT_H */
+#endif /* __MATHUTILS_QUATERNION_H__ */
diff --git a/source/blender/python/mathutils/mathutils_Vector.h b/source/blender/python/mathutils/mathutils_Vector.h
index 4e10e795602..88de991ba43 100644
--- a/source/blender/python/mathutils/mathutils_Vector.h
+++ b/source/blender/python/mathutils/mathutils_Vector.h
@@ -32,8 +32,8 @@
*/
-#ifndef MATHUTILS_VECTOR_H
-#define MATHUTILS_VECTOR_H
+#ifndef __MATHUTILS_VECTOR_H__
+#define __MATHUTILS_VECTOR_H__
extern PyTypeObject vector_Type;
#define VectorObject_Check(_v) PyObject_TypeCheck((_v), &vector_Type)
@@ -49,4 +49,4 @@ PyObject *Vector_CreatePyObject(float *vec, const int size, const int type, PyTy
PyObject *Vector_CreatePyObject_cb(PyObject *user, int size, int callback_type, int subtype);
PyObject *Vector_CreatePyObject_alloc(float *vec, const int size, PyTypeObject *base_type);
-#endif /* MATHUTILS_VECTOR_H */
+#endif /* __MATHUTILS_VECTOR_H__ */
diff --git a/source/blender/python/mathutils/mathutils_geometry.h b/source/blender/python/mathutils/mathutils_geometry.h
index 1b339bdaf00..ac89698c12e 100644
--- a/source/blender/python/mathutils/mathutils_geometry.h
+++ b/source/blender/python/mathutils/mathutils_geometry.h
@@ -32,11 +32,11 @@
/*Include this file for access to vector, quat, matrix, euler, etc...*/
-#ifndef MATHUTILS_GEOMETRY_H
-#define MATHUTILS_GEOMETRY_H
+#ifndef __MATHUTILS_GEOMETRY_H__
+#define __MATHUTILS_GEOMETRY_H__
#include "mathutils.h"
PyMODINIT_FUNC PyInit_mathutils_geometry(void);
-#endif /* MATHUTILS_GEOMETRY_H */
+#endif /* __MATHUTILS_GEOMETRY_H__ */
diff --git a/source/blender/python/mathutils/mathutils_noise.h b/source/blender/python/mathutils/mathutils_noise.h
index 6a6527588ef..f4bec88e59a 100644
--- a/source/blender/python/mathutils/mathutils_noise.h
+++ b/source/blender/python/mathutils/mathutils_noise.h
@@ -24,8 +24,8 @@
* \ingroup mathutils
*/
-#ifndef MATHUTILS_NOISE_H
-#define MATHUTILS_NOISE_H
+#ifndef __MATHUTILS_NOISE_H__
+#define __MATHUTILS_NOISE_H__
#include "mathutils.h"
@@ -33,4 +33,4 @@ PyMODINIT_FUNC PyInit_mathutils_noise(void);
PyMODINIT_FUNC PyInit_mathutils_noise_types(void);
PyMODINIT_FUNC PyInit_mathutils_noise_metrics(void);
-#endif // MATHUTILS_NOISE_H
+#endif // __MATHUTILS_NOISE_H__
diff --git a/source/blender/quicktime/quicktime_import.h b/source/blender/quicktime/quicktime_import.h
index d095b8353ca..e6f3c821b85 100644
--- a/source/blender/quicktime/quicktime_import.h
+++ b/source/blender/quicktime/quicktime_import.h
@@ -34,8 +34,8 @@
-#ifndef __QUICKTIME_IMP_H__
-#define __QUICKTIME_IMP_H__
+#ifndef __QUICKTIME_IMPORT_H__
+#define __QUICKTIME_IMPORT_H__
#define __AIFF__
@@ -76,4 +76,4 @@ ImBuf *qtime_fetchibuf (struct anim *anim, int position);
int imb_is_a_quicktime (char *name);
ImBuf *imb_quicktime_decode(unsigned char *mem, int size, int flags);
-#endif // __QUICKTIME_IMP_H__
+#endif // __QUICKTIME_IMPORT_H__
diff --git a/source/blender/render/extern/include/RE_engine.h b/source/blender/render/extern/include/RE_engine.h
index 02a94e56462..5e4a5e05a56 100644
--- a/source/blender/render/extern/include/RE_engine.h
+++ b/source/blender/render/extern/include/RE_engine.h
@@ -29,8 +29,8 @@
* \ingroup render
*/
-#ifndef RE_ENGINE_H
-#define RE_ENGINE_H
+#ifndef __RE_ENGINE_H__
+#define __RE_ENGINE_H__
#include "DNA_listBase.h"
#include "RNA_types.h"
@@ -116,5 +116,5 @@ void RE_engines_exit(void);
RenderEngineType *RE_engines_find(const char *idname);
-#endif /* RE_ENGINE_H */
+#endif /* __RE_ENGINE_H__ */
diff --git a/source/blender/render/extern/include/RE_pipeline.h b/source/blender/render/extern/include/RE_pipeline.h
index cc4136fcccc..a670446189e 100644
--- a/source/blender/render/extern/include/RE_pipeline.h
+++ b/source/blender/render/extern/include/RE_pipeline.h
@@ -29,8 +29,8 @@
* \ingroup render
*/
-#ifndef RE_PIPELINE_H
-#define RE_PIPELINE_H
+#ifndef __RE_PIPELINE_H__
+#define __RE_PIPELINE_H__
#include "DNA_listBase.h"
#include "DNA_vec_types.h"
@@ -272,5 +272,5 @@ struct Scene *RE_GetScene(struct Render *re);
int RE_is_rendering_allowed(struct Scene *scene, struct Object *camera_override, struct ReportList *reports);
-#endif /* RE_PIPELINE_H */
+#endif /* __RE_PIPELINE_H__ */
diff --git a/source/blender/render/extern/include/RE_render_ext.h b/source/blender/render/extern/include/RE_render_ext.h
index f93e3c9fd20..054aaccb177 100644
--- a/source/blender/render/extern/include/RE_render_ext.h
+++ b/source/blender/render/extern/include/RE_render_ext.h
@@ -29,8 +29,8 @@
*/
-#ifndef RE_RENDER_EXT_H
-#define RE_RENDER_EXT_H
+#ifndef __RE_RENDER_EXT_H__
+#define __RE_RENDER_EXT_H__
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* this include is for non-render pipeline exports (still old cruft here) */
@@ -70,5 +70,5 @@ void RE_free_sample_material(struct Material *mat);
void RE_sample_material_color(struct Material *mat, float color[3], float *alpha, const float volume_co[3], const float surface_co[3],
int face_index, short hit_quad, struct DerivedMesh *orcoDm, struct Object *ob);
-#endif /* RE_RENDER_EXT_H */
+#endif /* __RE_RENDER_EXT_H__ */
diff --git a/source/blender/render/extern/include/RE_shader_ext.h b/source/blender/render/extern/include/RE_shader_ext.h
index 2f585f91d44..cf9e6f7966f 100644
--- a/source/blender/render/extern/include/RE_shader_ext.h
+++ b/source/blender/render/extern/include/RE_shader_ext.h
@@ -29,8 +29,8 @@
*/
-#ifndef RE_SHADER_EXT_H
-#define RE_SHADER_EXT_H
+#ifndef __RE_SHADER_EXT_H__
+#define __RE_SHADER_EXT_H__
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* this include is for shading and texture exports */
@@ -214,4 +214,4 @@ void RE_bake_ibuf_filter(struct ImBuf *ibuf, char *mask, const int filter);
#define BAKE_RESULT_NO_OBJECTS 1
#define BAKE_RESULT_FEEDBACK_LOOP 2
-#endif /* RE_SHADER_EXT_H */
+#endif /* __RE_SHADER_EXT_H__ */
diff --git a/source/blender/render/intern/include/envmap.h b/source/blender/render/intern/include/envmap.h
index 0133c08a6a7..24138884cd2 100644
--- a/source/blender/render/intern/include/envmap.h
+++ b/source/blender/render/intern/include/envmap.h
@@ -33,8 +33,8 @@
*/
-#ifndef ENVMAP_EXT_H
-#define ENVMAP_EXT_H
+#ifndef __ENVMAP_H__
+#define __ENVMAP_H__
/**
* Make environment maps for all objects in the scene that have an
@@ -48,5 +48,5 @@ struct TexResult;
void make_envmaps(struct Render *re);
int envmaptex(struct Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, struct TexResult *texres);
-#endif /* ENVMAP_EXT_H */
+#endif /* __ENVMAP_H__ */
diff --git a/source/blender/render/intern/include/gammaCorrectionTables.h b/source/blender/render/intern/include/gammaCorrectionTables.h
index 29ceef82c09..b41fc01eaaf 100644
--- a/source/blender/render/intern/include/gammaCorrectionTables.h
+++ b/source/blender/render/intern/include/gammaCorrectionTables.h
@@ -33,8 +33,8 @@
*/
-#ifndef GAMMACORRECTIONTABLES_H
-#define GAMMACORRECTIONTABLES_H
+#ifndef __GAMMACORRECTIONTABLES_H__
+#define __GAMMACORRECTIONTABLES_H__
/**
* Initialise the gamma lookup tables
diff --git a/source/blender/render/intern/include/initrender.h b/source/blender/render/intern/include/initrender.h
index 17fa312a6cd..e4fb338771e 100644
--- a/source/blender/render/intern/include/initrender.h
+++ b/source/blender/render/intern/include/initrender.h
@@ -33,8 +33,8 @@
*/
-#ifndef INITRENDER_H
-#define INITRENDER_H
+#ifndef __INITRENDER_H__
+#define __INITRENDER_H__
struct Object;
@@ -49,5 +49,5 @@ void initparts(Render *re);
void freeparts(Render *re);
-#endif /* INITRENDER_H */
+#endif /* __INITRENDER_H__ */
diff --git a/source/blender/render/intern/include/occlusion.h b/source/blender/render/intern/include/occlusion.h
index 15581c8d7d4..78a1f8a1175 100644
--- a/source/blender/render/intern/include/occlusion.h
+++ b/source/blender/render/intern/include/occlusion.h
@@ -31,8 +31,8 @@
*/
-#ifndef OCCLUSION_H
-#define OCCLUSION_H
+#ifndef __OCCLUSION_H__
+#define __OCCLUSION_H__
struct Render;
struct ShadeInput;
diff --git a/source/blender/render/intern/include/pixelblending.h b/source/blender/render/intern/include/pixelblending.h
index 87a5ed07747..aa2698716e9 100644
--- a/source/blender/render/intern/include/pixelblending.h
+++ b/source/blender/render/intern/include/pixelblending.h
@@ -28,8 +28,8 @@
*/
-#ifndef PIXELBLENDING_EXT_H
-#define PIXELBLENDING_EXT_H
+#ifndef __PIXELBLENDING_H__
+#define __PIXELBLENDING_H__
/**
@@ -69,5 +69,5 @@ void addalphaUnderGammaFloat(float *doel, float *bron);
-#endif /* PIXELBLENDING_EXT_H */
+#endif /* __PIXELBLENDING_H__ */
diff --git a/source/blender/render/intern/include/pixelshading.h b/source/blender/render/intern/include/pixelshading.h
index 6f4b373f8d4..17032283540 100644
--- a/source/blender/render/intern/include/pixelshading.h
+++ b/source/blender/render/intern/include/pixelshading.h
@@ -34,8 +34,8 @@
*/
-#ifndef PIXELSHADING_H
-#define PIXELSHADING_H
+#ifndef __PIXELSHADING_H__
+#define __PIXELSHADING_H__
/**
* Render the pixel at (x,y) for object ap. Apply the jitter mask.
diff --git a/source/blender/render/intern/include/pointdensity.h b/source/blender/render/intern/include/pointdensity.h
index 7ceb24e9ece..cc8fabda49c 100644
--- a/source/blender/render/intern/include/pointdensity.h
+++ b/source/blender/render/intern/include/pointdensity.h
@@ -30,8 +30,8 @@
*/
-#ifndef POINTDENSITY_H
-#define POINTDENSITY_H
+#ifndef __POINTDENSITY_H__
+#define __POINTDENSITY_H__
/**
* Make point density kd-trees for all point density textures in the scene
@@ -45,5 +45,5 @@ void make_pointdensities(struct Render *re);
void free_pointdensities(struct Render *re);
int pointdensitytex(struct Tex *tex, float *texvec, struct TexResult *texres);
-#endif /* POINTDENSITY_H */
+#endif /* __POINTDENSITY_H__ */
diff --git a/source/blender/render/intern/include/raycounter.h b/source/blender/render/intern/include/raycounter.h
index 20348f8d418..075a6337435 100644
--- a/source/blender/render/intern/include/raycounter.h
+++ b/source/blender/render/intern/include/raycounter.h
@@ -30,8 +30,8 @@
*/
-#ifndef RE_RAYCOUNTER_H
-#define RE_RAYCOUNTER_H
+#ifndef __RAYCOUNTER_H__
+#define __RAYCOUNTER_H__
//#define RE_RAYCOUNTER /* enable counters per ray, useful for measuring raytrace structures performance */
diff --git a/source/blender/render/intern/include/rayintersection.h b/source/blender/render/intern/include/rayintersection.h
index 2c68421a8ee..934bf92db8f 100644
--- a/source/blender/render/intern/include/rayintersection.h
+++ b/source/blender/render/intern/include/rayintersection.h
@@ -31,8 +31,8 @@
*/
-#ifndef __RENDER_RAYINTERSECTION_H__
-#define __RENDER_RAYINTERSECTION_H__
+#ifndef __RAYINTERSECTION_H__
+#define __RAYINTERSECTION_H__
#ifdef __cplusplus
extern "C" {
@@ -123,5 +123,5 @@ typedef struct Isect {
}
#endif
-#endif /* __RENDER_RAYINTERSECTION_H__ */
+#endif /* __RAYINTERSECTION_H__ */
diff --git a/source/blender/render/intern/include/rayobject.h b/source/blender/render/intern/include/rayobject.h
index 3ca3bd63428..c93c4e1da63 100644
--- a/source/blender/render/intern/include/rayobject.h
+++ b/source/blender/render/intern/include/rayobject.h
@@ -30,8 +30,8 @@
*/
-#ifndef RE_RAYOBJECT_H
-#define RE_RAYOBJECT_H
+#ifndef __RAYOBJECT_H__
+#define __RAYOBJECT_H__
#ifdef __cplusplus
extern "C" {
diff --git a/source/blender/render/intern/include/render_result.h b/source/blender/render/intern/include/render_result.h
index 93cbc6fe9c9..3d73ee1e912 100644
--- a/source/blender/render/intern/include/render_result.h
+++ b/source/blender/render/intern/include/render_result.h
@@ -29,8 +29,8 @@
* \ingroup render
*/
-#ifndef RENDER_RESULT_H
-#define RENDER_RESULT_H
+#ifndef __RENDER_RESULT_H__
+#define __RENDER_RESULT_H__
#define PASS_VECTOR_MAX 10000.0f
@@ -90,5 +90,5 @@ void render_result_rect_fill_zero(struct RenderResult *rr);
void render_result_rect_get_pixels(struct RenderResult *rr, struct RenderData *rd,
unsigned int *rect, int rectx, int recty);
-#endif /* RENDER_RESULT_H */
+#endif /* __RENDER_RESULT_H__ */
diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h
index f414be60b0a..886a6ce74f2 100644
--- a/source/blender/render/intern/include/render_types.h
+++ b/source/blender/render/intern/include/render_types.h
@@ -28,8 +28,8 @@
*/
-#ifndef RENDER_TYPES_H
-#define RENDER_TYPES_H
+#ifndef __RENDER_TYPES_H__
+#define __RENDER_TYPES_H__
/* ------------------------------------------------------------------------- */
/* exposed internal in render module only! */
@@ -628,5 +628,5 @@ typedef struct LampRen {
#define R_ENV_TRANSFORMED 2
#define R_TRANSFORMED (1|2)
-#endif /* RENDER_TYPES_H */
+#endif /* __RENDER_TYPES_H__ */
diff --git a/source/blender/render/intern/include/rendercore.h b/source/blender/render/intern/include/rendercore.h
index 08f73ccbe0d..496e2bb50a9 100644
--- a/source/blender/render/intern/include/rendercore.h
+++ b/source/blender/render/intern/include/rendercore.h
@@ -33,8 +33,8 @@
*/
-#ifndef RENDERCORE_H
-#define RENDERCORE_H
+#ifndef __RENDERCORE_H__
+#define __RENDERCORE_H__
#include "render_types.h"
diff --git a/source/blender/render/intern/include/renderdatabase.h b/source/blender/render/intern/include/renderdatabase.h
index ebbbfb03f55..d11732f7da1 100644
--- a/source/blender/render/intern/include/renderdatabase.h
+++ b/source/blender/render/intern/include/renderdatabase.h
@@ -30,8 +30,8 @@
*/
-#ifndef RENDERDATABASE_H
-#define RENDERDATABASE_H
+#ifndef __RENDERDATABASE_H__
+#define __RENDERDATABASE_H__
struct Object;
struct VlakRen;
@@ -144,5 +144,5 @@ void init_render_world(Render *re);
void RE_Database_FromScene_Vectors(Render *re, struct Main *bmain, struct Scene *sce, unsigned int lay);
-#endif /* RENDERDATABASE_H */
+#endif /* __RENDERDATABASE_H__ */
diff --git a/source/blender/render/intern/include/renderpipeline.h b/source/blender/render/intern/include/renderpipeline.h
index 9a87cf84012..e713d4880d6 100644
--- a/source/blender/render/intern/include/renderpipeline.h
+++ b/source/blender/render/intern/include/renderpipeline.h
@@ -30,8 +30,8 @@
*/
-#ifndef PIPELINE_H
-#define PIPELINE_H
+#ifndef __RENDERPIPELINE_H__
+#define __RENDERPIPELINE_H__
struct Render;
struct RenderLayer;
@@ -40,5 +40,5 @@ struct RenderResult;
struct RenderLayer *render_get_active_layer(struct Render *re, struct RenderResult *rr);
float panorama_pixel_rot(struct Render *re);
-#endif /* PIPELINE_H */
+#endif /* __RENDERPIPELINE_H__ */
diff --git a/source/blender/render/intern/include/shadbuf.h b/source/blender/render/intern/include/shadbuf.h
index a37af5abb4a..ddcfc555f7a 100644
--- a/source/blender/render/intern/include/shadbuf.h
+++ b/source/blender/render/intern/include/shadbuf.h
@@ -33,8 +33,8 @@
*/
-#ifndef SHADBUF_EXT_H
-#define SHADBUF_EXT_H
+#ifndef __SHADBUF_H__
+#define __SHADBUF_H__
#include "render_types.h"
@@ -114,5 +114,5 @@ typedef struct ISBData {
int minx, miny, rectx, recty; /* copy from part disprect */
} ISBData;
-#endif /* SHADBUF_EXT_H */
+#endif /* __SHADBUF_H__ */
diff --git a/source/blender/render/intern/include/sss.h b/source/blender/render/intern/include/sss.h
index 4e110da25dd..6a179d2f428 100644
--- a/source/blender/render/intern/include/sss.h
+++ b/source/blender/render/intern/include/sss.h
@@ -30,8 +30,8 @@
*/
-#ifndef SSS_H
-#define SSS_H
+#ifndef __SSS_H__
+#define __SSS_H__
/* Generic multiple scattering API */
@@ -64,5 +64,5 @@ void free_sss(struct Render *re);
int sample_sss(struct Render *re, struct Material *mat, float *co, float *col);
int sss_pass_done(struct Render *re, struct Material *mat);
-#endif /*SSS_H*/
+#endif /*__SSS_H__*/
diff --git a/source/blender/render/intern/include/strand.h b/source/blender/render/intern/include/strand.h
index 1cf34c7ad50..4403f68c982 100644
--- a/source/blender/render/intern/include/strand.h
+++ b/source/blender/render/intern/include/strand.h
@@ -30,8 +30,8 @@
*/
-#ifndef STRAND_H
-#define STRAND_H
+#ifndef __STRAND_H__
+#define __STRAND_H__
struct StrandVert;
struct StrandRen;
diff --git a/source/blender/render/intern/include/sunsky.h b/source/blender/render/intern/include/sunsky.h
index 8c0cbfd18e7..5076a1541af 100644
--- a/source/blender/render/intern/include/sunsky.h
+++ b/source/blender/render/intern/include/sunsky.h
@@ -29,8 +29,8 @@
* and example code from Brian Smits, another author of that paper in
* http://www.cs.utah.edu/vissim/papers/sunsky/code/
* */
-#ifndef SUNSKY_H_
-#define SUNSKY_H_
+#ifndef __SUNSKY_H__
+#define __SUNSKY_H__
#define SPECTRUM_MAX_COMPONENTS 100
#define SPECTRUM_START 350.0
@@ -146,4 +146,4 @@ void AtmospherePixleShader( struct SunSky* sunSky, float view[3], float s, float
* */
void ClipColor(float c[3]);
-#endif /*SUNSKY_H_*/
+#endif /*__SUNSKY_H__*/
diff --git a/source/blender/render/intern/include/texture.h b/source/blender/render/intern/include/texture.h
index a8d13077680..e5013ace1f0 100644
--- a/source/blender/render/intern/include/texture.h
+++ b/source/blender/render/intern/include/texture.h
@@ -33,8 +33,8 @@
*/
-#ifndef TEXTURE_EXT_H
-#define TEXTURE_EXT_H
+#ifndef __TEXTURE_H__
+#define __TEXTURE_H__
#define BRICONT \
texres->tin= (texres->tin-0.5f) * tex->contrast+tex->bright-0.5f; \
@@ -85,5 +85,5 @@ int imagewraposa(struct Tex *tex, struct Image *ima, struct ImBuf *ibuf, const f
int imagewrap(struct Tex *tex, struct Image *ima, struct ImBuf *ibuf, const float texvec[3], struct TexResult *texres);
void image_sample(struct Image *ima, float fx, float fy, float dx, float dy, float *result);
-#endif /* TEXTURE_EXT_H */
+#endif /* __TEXTURE_H__ */
diff --git a/source/blender/render/intern/include/voxeldata.h b/source/blender/render/intern/include/voxeldata.h
index aa4a9fdb845..3d6280c5c28 100644
--- a/source/blender/render/intern/include/voxeldata.h
+++ b/source/blender/render/intern/include/voxeldata.h
@@ -30,8 +30,8 @@
*/
-#ifndef VOXELDATA_H
-#define VOXELDATA_H
+#ifndef __VOXELDATA_H__
+#define __VOXELDATA_H__
struct Render;
struct TexResult;
@@ -47,4 +47,4 @@ void make_voxeldata(struct Render *re);
void free_voxeldata(struct Render *re);
int voxeldatatex(struct Tex *tex, const float texvec[3], struct TexResult *texres);
-#endif /* VOXELDATA_H */
+#endif /* __VOXELDATA_H__ */
diff --git a/source/blender/render/intern/include/zbuf.h b/source/blender/render/intern/include/zbuf.h
index c467c31b5a6..518b2f846d3 100644
--- a/source/blender/render/intern/include/zbuf.h
+++ b/source/blender/render/intern/include/zbuf.h
@@ -30,8 +30,8 @@
*/
-#ifndef ZBUF_H
-#define ZBUF_H
+#ifndef __ZBUF_H__
+#define __ZBUF_H__
struct RenderPart;
struct RenderLayer;
diff --git a/source/blender/render/intern/raytrace/bvh.h b/source/blender/render/intern/raytrace/bvh.h
index cdc905fbf04..b2ec1552f04 100644
--- a/source/blender/render/intern/raytrace/bvh.h
+++ b/source/blender/render/intern/raytrace/bvh.h
@@ -46,8 +46,8 @@
#include <xmmintrin.h>
#endif
-#ifndef RE_RAYTRACE_BVH_H
-#define RE_RAYTRACE_BVH_H
+#ifndef __BVH_H__
+#define __BVH_H__
#ifdef __SSE__
inline int test_bb_group4(__m128 *bb_group, const Isect *isec)
diff --git a/source/blender/render/intern/raytrace/rayobject_hint.h b/source/blender/render/intern/raytrace/rayobject_hint.h
index e13a8e68b27..9e505b68101 100644
--- a/source/blender/render/intern/raytrace/rayobject_hint.h
+++ b/source/blender/render/intern/raytrace/rayobject_hint.h
@@ -30,8 +30,8 @@
*/
-#ifndef RE_RAYTRACE_RAYOBJECT_HINT_H
-#define RE_RAYTRACE_RAYOBJECT_HINT_H
+#ifndef __RAYOBJECT_HINT_H__
+#define __RAYOBJECT_HINT_H__
#define HINT_RECURSE 1
#define HINT_ACCEPT 0
diff --git a/source/blender/render/intern/raytrace/rayobject_internal.h b/source/blender/render/intern/raytrace/rayobject_internal.h
index 458c892d410..8e39b687b34 100644
--- a/source/blender/render/intern/raytrace/rayobject_internal.h
+++ b/source/blender/render/intern/raytrace/rayobject_internal.h
@@ -2,8 +2,8 @@
* \ingroup render
*/
-#ifndef RE_RAYOBJECT_INTERNAL_H
-#define RE_RAYOBJECT_INTERNAL_H
+#ifndef __RAYOBJECT_INTERNAL_H__
+#define __RAYOBJECT_INTERNAL_H__
#ifdef __cplusplus
extern "C" {
diff --git a/source/blender/render/intern/raytrace/rayobject_rtbuild.h b/source/blender/render/intern/raytrace/rayobject_rtbuild.h
index c4088981d92..f6e9aabf43d 100644
--- a/source/blender/render/intern/raytrace/rayobject_rtbuild.h
+++ b/source/blender/render/intern/raytrace/rayobject_rtbuild.h
@@ -29,8 +29,8 @@
* \ingroup render
*/
-#ifndef RE_RAYOBJECT_RTBUILD_H
-#define RE_RAYOBJECT_RTBUILD_H
+#ifndef __RAYOBJECT_RTBUILD_H__
+#define __RAYOBJECT_RTBUILD_H__
#ifdef __cplusplus
extern "C" {
diff --git a/source/blender/render/intern/raytrace/svbvh.h b/source/blender/render/intern/raytrace/svbvh.h
index 2f49531ff34..8fb2db63df6 100644
--- a/source/blender/render/intern/raytrace/svbvh.h
+++ b/source/blender/render/intern/raytrace/svbvh.h
@@ -32,8 +32,8 @@
#ifdef __SSE__
-#ifndef RE_RAYTRACE_SVBVH_H
-#define RE_RAYTRACE_SVBVH_H
+#ifndef __SVBVH_H__
+#define __SVBVH_H__
#include "bvh.h"
#include "BLI_memarena.h"
diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c
index 9aac7aae53e..2f620bb96d4 100644
--- a/source/blender/render/intern/source/shadeoutput.c
+++ b/source/blender/render/intern/source/shadeoutput.c
@@ -206,7 +206,7 @@ static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens)
maxz*= lar->sh_zfac;
maxy= lar->imat[0][1]*p1[0]+lar->imat[1][1]*p1[1]+lar->imat[2][1]*p1[2];
- if( fabsf(nray[2]) < FLT_EPSILON ) use_yco= 1;
+ if( fabs(nray[2]) < FLT_EPSILON ) use_yco= 1;
}
/* scale z to make sure volume is normalized */
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index 132b57696e1..1be94d9c634 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -23,8 +23,8 @@
*
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef WM_API_H
-#define WM_API_H
+#ifndef __WM_API_H__
+#define __WM_API_H__
/** \file WM_api.h
* \ingroup wm
@@ -344,5 +344,5 @@ int write_crash_blend(void);
}
#endif
-#endif /* WM_API_H */
+#endif /* __WM_API_H__ */
diff --git a/source/blender/windowmanager/WM_keymap.h b/source/blender/windowmanager/WM_keymap.h
index f254358e3cf..db448397065 100644
--- a/source/blender/windowmanager/WM_keymap.h
+++ b/source/blender/windowmanager/WM_keymap.h
@@ -23,8 +23,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-#ifndef WM_KEYMAP_H
-#define WM_KEYMAP_H
+#ifndef __WM_KEYMAP_H__
+#define __WM_KEYMAP_H__
/** \file WM_keymap.h
* \ingroup wm
@@ -98,5 +98,5 @@ char *WM_key_event_operator_string(const struct bContext *C, const char *opname
}
#endif
-#endif /* WM_KEYMAP_H */
+#endif /* __WM_KEYMAP_H__ */
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h
index 357eaf2633b..3a62faeab8a 100644
--- a/source/blender/windowmanager/WM_types.h
+++ b/source/blender/windowmanager/WM_types.h
@@ -28,8 +28,8 @@
* \ingroup wm
*/
-#ifndef WM_TYPES_H
-#define WM_TYPES_H
+#ifndef __WM_TYPES_H__
+#define __WM_TYPES_H__
#ifdef __cplusplus
extern "C" {
@@ -569,5 +569,5 @@ typedef struct RecentFile {
}
#endif
-#endif /* WM_TYPES_H */
+#endif /* __WM_TYPES_H__ */
diff --git a/source/blender/windowmanager/wm.h b/source/blender/windowmanager/wm.h
index d9dcb9ea10c..d1081f5450c 100644
--- a/source/blender/windowmanager/wm.h
+++ b/source/blender/windowmanager/wm.h
@@ -28,8 +28,8 @@
* \ingroup wm
*/
-#ifndef WM_H
-#define WM_H
+#ifndef __WM_H__
+#define __WM_H__
struct wmWindow;
struct ReportList;
@@ -85,5 +85,5 @@ void wm_autosave_location(char *filepath);
extern int circle_select_size;
#endif
-#endif /* WM_H */
+#endif /* __WM_H__ */
diff --git a/source/blender/windowmanager/wm_cursors.h b/source/blender/windowmanager/wm_cursors.h
index c179483eff3..f41b15aadcf 100644
--- a/source/blender/windowmanager/wm_cursors.h
+++ b/source/blender/windowmanager/wm_cursors.h
@@ -32,8 +32,8 @@
-#ifndef WM_CURSORS_H
-#define WM_CURSORS_H
+#ifndef __WM_CURSORS_H__
+#define __WM_CURSORS_H__
void wm_init_cursor_data(void);
@@ -120,5 +120,5 @@ struct wmEvent;
int wm_cursor_arrow_move(struct wmWindow *win, struct wmEvent *event);
-#endif /* WM_CURSORS_H */
+#endif /* __WM_CURSORS_H__ */
diff --git a/source/blender/windowmanager/wm_draw.h b/source/blender/windowmanager/wm_draw.h
index 9e22fc8c412..3d72fe17c79 100644
--- a/source/blender/windowmanager/wm_draw.h
+++ b/source/blender/windowmanager/wm_draw.h
@@ -29,8 +29,8 @@
*/
-#ifndef WM_DRAW_H
-#define WM_DRAW_H
+#ifndef __WM_DRAW_H__
+#define __WM_DRAW_H__
struct bContext;
struct wmWindow;
@@ -43,5 +43,5 @@ void wm_draw_region_clear (struct wmWindow *win, struct ARegion *ar);
void wm_tag_redraw_overlay (struct wmWindow *win, struct ARegion *ar);
-#endif /* WM_DRAW_H */
+#endif /* __WM_DRAW_H__ */
diff --git a/source/blender/windowmanager/wm_event_system.h b/source/blender/windowmanager/wm_event_system.h
index 9c0d2ae3eff..a33d37ac50e 100644
--- a/source/blender/windowmanager/wm_event_system.h
+++ b/source/blender/windowmanager/wm_event_system.h
@@ -28,8 +28,8 @@
* \ingroup wm
*/
-#ifndef WM_EVENT_SYSTEM_H
-#define WM_EVENT_SYSTEM_H
+#ifndef __WM_EVENT_SYSTEM_H__
+#define __WM_EVENT_SYSTEM_H__
/* return value of handler-operator call */
#define WM_HANDLER_CONTINUE 0
@@ -107,5 +107,5 @@ void wm_dropbox_free(void);
void wm_drags_check_ops(bContext *C, wmEvent *event);
void wm_drags_draw(bContext *C, wmWindow *win, rcti *rect);
-#endif /* WM_EVENT_SYSTEM_H */
+#endif /* __WM_EVENT_SYSTEM_H__ */
diff --git a/source/blender/windowmanager/wm_event_types.h b/source/blender/windowmanager/wm_event_types.h
index 47081b6a6a1..170413c13b0 100644
--- a/source/blender/windowmanager/wm_event_types.h
+++ b/source/blender/windowmanager/wm_event_types.h
@@ -35,8 +35,8 @@
*/
-#ifndef WM_EVENT_TYPES_H
-#define WM_EVENT_TYPES_H
+#ifndef __WM_EVENT_TYPES_H__
+#define __WM_EVENT_TYPES_H__
/* customdata type */
#define EVT_DATA_TABLET 1
@@ -365,5 +365,5 @@ enum {
#define GESTURE_MODAL_OUT 10
-#endif /* WM_EVENT_TYPES_H */
+#endif /* __WM_EVENT_TYPES_H__ */
diff --git a/source/blender/windowmanager/wm_files.h b/source/blender/windowmanager/wm_files.h
index 64f05e7c581..f373530b5e6 100644
--- a/source/blender/windowmanager/wm_files.h
+++ b/source/blender/windowmanager/wm_files.h
@@ -28,10 +28,10 @@
* \ingroup wm
*/
-#ifndef WM_FILES_H
-#define WM_FILES_H
+#ifndef __WM_FILES_H__
+#define __WM_FILES_H__
void WM_read_history(void);
-#endif /* WM_FILES_H */
+#endif /* __WM_FILES_H__ */
diff --git a/source/blender/windowmanager/wm_subwindow.h b/source/blender/windowmanager/wm_subwindow.h
index 6fecefe5479..5017977952b 100644
--- a/source/blender/windowmanager/wm_subwindow.h
+++ b/source/blender/windowmanager/wm_subwindow.h
@@ -29,8 +29,8 @@
*/
-#ifndef WM_SUBWINDOW_H
-#define WM_SUBWINDOW_H
+#ifndef __WM_SUBWINDOW_H__
+#define __WM_SUBWINDOW_H__
/* *************** internal api ************** */
@@ -50,5 +50,5 @@ void wm_subwindow_getmatrix(wmWindow *win, int swinid, float mat[][4]);
unsigned int index_to_framebuffer(int index);
-#endif /* WM_SUBWINDOW_H */
+#endif /* __WM_SUBWINDOW_H__ */
diff --git a/source/blender/windowmanager/wm_window.h b/source/blender/windowmanager/wm_window.h
index ec6d815cfc2..27eb4542877 100644
--- a/source/blender/windowmanager/wm_window.h
+++ b/source/blender/windowmanager/wm_window.h
@@ -29,8 +29,8 @@
*/
-#ifndef WM_WINDOW_H
-#define WM_WINDOW_H
+#ifndef __WM_WINDOW_H__
+#define __WM_WINDOW_H__
struct bScreen;
struct wmOperator;
@@ -70,5 +70,5 @@ void wm_window_testbreak (void);
int wm_window_duplicate_exec(bContext *C, struct wmOperator *op);
int wm_window_fullscreen_toggle_exec(bContext *C, struct wmOperator *op);
-#endif /* WM_WINDOW_H */
+#endif /* __WM_WINDOW_H__ */
diff --git a/source/blenderplayer/CMakeLists.txt b/source/blenderplayer/CMakeLists.txt
index 223df9c8b6a..7a63435c215 100644
--- a/source/blenderplayer/CMakeLists.txt
+++ b/source/blenderplayer/CMakeLists.txt
@@ -184,6 +184,10 @@ endif()
list(APPEND BLENDER_SORTED_LIBS extern_carve)
endif()
+ if(WITH_GHOST_XDND)
+ list(APPEND BLENDER_SORTED_LIBS extern_xdnd)
+ endif()
+
if(WITH_CODEC_QUICKTIME)
list(APPEND BLENDER_SORTED_LIBS bf_quicktime)
endif()
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index 1b4d88a6f2e..d9e82048db2 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -558,6 +558,7 @@ elseif(WIN32)
install(
FILES
${LIBDIR}/openal/lib/OpenAL32.dll
+ ${LIBDIR}/openal/lib/wrap_oal.dll
DESTINATION ${TARGETDIR}
)
endif()
@@ -891,6 +892,10 @@ endif()
list(APPEND BLENDER_SORTED_LIBS extern_carve)
endif()
+ if(WITH_GHOST_XDND)
+ list(APPEND BLENDER_SORTED_LIBS extern_xdnd)
+ endif()
+
foreach(SORTLIB ${BLENDER_SORTED_LIBS})
set(REMLIB ${SORTLIB})
foreach(SEARCHLIB ${BLENDER_LINK_LIBS})
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp
index 7e7b3d2e3d4..0abea7fa28e 100644
--- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp
+++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp
@@ -39,6 +39,8 @@ KX_BlenderCanvas::KX_BlenderCanvas(struct wmWindow *win, RAS_Rect &rect, struct
m_win(win),
m_frame_rect(rect)
{
+ // initialize area so that it's available for game logic on frame 1 (ImageViewport)
+ m_area_rect = rect;
// area boundaries needed for mouse coordinates in Letterbox framing mode
m_area_left = ar->winrct.xmin;
m_area_top = ar->winrct.ymax;
diff --git a/source/gameengine/GamePlayer/common/GPC_Canvas.cpp b/source/gameengine/GamePlayer/common/GPC_Canvas.cpp
index df1bf31ec12..82950f571f9 100644
--- a/source/gameengine/GamePlayer/common/GPC_Canvas.cpp
+++ b/source/gameengine/GamePlayer/common/GPC_Canvas.cpp
@@ -52,6 +52,11 @@ GPC_Canvas::GPC_Canvas(
m_height(height),
m_bannersEnabled(false)
{
+ // initialize area so that it's available for game logic on frame 1 (ImageViewport)
+ m_displayarea.m_x1 = 0;
+ m_displayarea.m_y1 = 0;
+ m_displayarea.m_x2 = width;
+ m_displayarea.m_y2 = height;
}