Merged changes in the trunk up to revision 41225.
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Sat, 29 Oct 2011 15:46:14 +0000 (15:46 +0000)
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Sat, 29 Oct 2011 15:46:14 +0000 (15:46 +0000)
Conflicts resolved:
source/blender/render/intern/source/pipeline.c

340 files changed:
CMakeLists.txt
GNUmakefile
SConstruct
build_files/buildbot/config/user-config-i686.py
build_files/buildbot/config/user-config-player-i686.py
build_files/buildbot/config/user-config-player-x86_64.py
build_files/buildbot/config/user-config-x86_64.py
build_files/scons/config/aix4-config.py [deleted file]
build_files/scons/config/darwin-config.py
build_files/scons/config/freebsd7-config.py
build_files/scons/config/freebsd8-config.py
build_files/scons/config/freebsd9-config.py
build_files/scons/config/irix6-config.py [deleted file]
build_files/scons/config/linux-config.py
build_files/scons/config/linuxcross-config.py
build_files/scons/config/openbsd3-config.py [deleted file]
build_files/scons/config/sunos5-config.py [deleted file]
build_files/scons/config/win32-mingw-config.py
build_files/scons/config/win32-vc-config.py
build_files/scons/config/win64-vc-config.py
build_files/scons/tools/Blender.py
build_files/scons/tools/btools.py
doc/blender_file_format/BlendFileDnaExporter_25.py
doc/blender_file_format/README
doc/python_api/sphinx_doc_gen.py
doc/python_api/sphinx_doc_gen.sh
intern/audaspace/intern/AUD_ChannelMapperReader.cpp
intern/audaspace/intern/AUD_SequencerReader.cpp
intern/ffmpeg/ffmpeg_compat.h
intern/ghost/GHOST_Types.h
intern/ghost/intern/GHOST_EventKey.h
intern/ghost/intern/GHOST_SystemCarbon.cpp
intern/ghost/intern/GHOST_SystemCocoa.mm
intern/ghost/intern/GHOST_SystemSDL.cpp
intern/ghost/intern/GHOST_SystemWin32.cpp
intern/ghost/intern/GHOST_SystemX11.cpp
intern/ghost/intern/GHOST_SystemX11.h
intern/ghost/intern/GHOST_WindowX11.cpp
intern/ghost/intern/GHOST_WindowX11.h
intern/ghost/test/multitest/MultiTest.c
intern/memutil/MEM_SmartPtr.h
po/README.txt
po/update_mo.py
release/bin/.blender/.bfont.ttf [deleted file]
release/datafiles/fonts/droidsans.ttf.gz [moved from release/bin/.blender/fonts/droidsans.ttf.gz with 100% similarity]
release/datafiles/splash.png
release/scripts/modules/bpy_types.py
release/scripts/modules/console_python.py
release/scripts/presets/interaction/blender.py
release/scripts/startup/bl_operators/anim.py
release/scripts/startup/bl_operators/object.py
release/scripts/startup/bl_operators/presets.py
release/scripts/startup/bl_operators/screen_play_rendered_anim.py
release/scripts/startup/bl_operators/vertexpaint_dirt.py
release/scripts/startup/bl_ui/properties_data_mesh.py
release/scripts/startup/bl_ui/properties_data_modifier.py
release/scripts/startup/bl_ui/properties_physics_field.py
release/scripts/startup/bl_ui/properties_scene.py
release/scripts/startup/bl_ui/space_image.py
release/scripts/startup/bl_ui/space_userpref_keymap.py
release/scripts/startup/bl_ui/space_view3d.py
release/scripts/templates/driver_functions.py
source/blender/blenfont/BLF_translation.h
source/blender/blenfont/intern/blf_dir.c
source/blender/blenfont/intern/blf_font.c
source/blender/blenfont/intern/blf_internal.h
source/blender/blenfont/intern/blf_lang.c
source/blender/blenfont/intern/blf_translation.c
source/blender/blenfont/intern/blf_util.c
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/BKE_bvhutils.h
source/blender/blenkernel/BKE_font.h
source/blender/blenkernel/BKE_node.h
source/blender/blenkernel/BKE_packedFile.h
source/blender/blenkernel/SConscript
source/blender/blenkernel/intern/BME_conversions.c
source/blender/blenkernel/intern/BME_eulers.c
source/blender/blenkernel/intern/BME_mesh.c
source/blender/blenkernel/intern/BME_structure.c
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/blender.c
source/blender/blenkernel/intern/brush.c
source/blender/blenkernel/intern/bvhutils.c
source/blender/blenkernel/intern/cloth.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/customdata.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/effect.c
source/blender/blenkernel/intern/fluidsim.c
source/blender/blenkernel/intern/font.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/key.c
source/blender/blenkernel/intern/linestyle.c
source/blender/blenkernel/intern/modifier.c
source/blender/blenkernel/intern/nla.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/packedFile.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/pointcache.c
source/blender/blenkernel/intern/property.c
source/blender/blenkernel/intern/sequencer.c
source/blender/blenkernel/intern/smoke.c
source/blender/blenkernel/intern/softbody.c
source/blender/blenkernel/intern/sound.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/blenkernel/intern/texture.c
source/blender/blenkernel/intern/writeffmpeg.c
source/blender/blenlib/BLI_blenlib.h
source/blender/blenlib/BLI_edgehash.h
source/blender/blenlib/BLI_fileops.h
source/blender/blenlib/BLI_fileops_types.h [moved from source/blender/blenlib/BLI_storage_types.h with 93% similarity]
source/blender/blenlib/BLI_ghash.h
source/blender/blenlib/BLI_mempool.h
source/blender/blenlib/BLI_path_util.h
source/blender/blenlib/BLI_scanfill.h
source/blender/blenlib/BLI_storage.h [deleted file]
source/blender/blenlib/BLI_string.h
source/blender/blenlib/BLI_string_utf8.h [new file with mode: 0644]
source/blender/blenlib/BLI_utildefines.h
source/blender/blenlib/CMakeLists.txt
source/blender/blenlib/PIL_time.h
source/blender/blenlib/intern/BLI_args.c
source/blender/blenlib/intern/BLI_ghash.c
source/blender/blenlib/intern/bpath.c
source/blender/blenlib/intern/fileops.c
source/blender/blenlib/intern/freetypefont.c
source/blender/blenlib/intern/path_util.c
source/blender/blenlib/intern/storage.c
source/blender/blenlib/intern/string_utf8.c
source/blender/blenlib/intern/winstuff.c
source/blender/blenloader/BLO_readfile.h
source/blender/blenloader/BLO_runtime.h
source/blender/blenloader/intern/readblenentry.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/runtime.c
source/blender/blenloader/intern/writefile.c
source/blender/collada/AnimationImporter.cpp
source/blender/collada/DocumentImporter.cpp
source/blender/collada/ImageExporter.cpp
source/blender/collada/collada.cpp
source/blender/editors/animation/anim_ipo_utils.c
source/blender/editors/animation/keyingsets.c
source/blender/editors/armature/editarmature.c
source/blender/editors/armature/poseUtils.c
source/blender/editors/armature/poselib.c
source/blender/editors/armature/poseobject.c
source/blender/editors/curve/editfont.c
source/blender/editors/datafiles/splash.png.c
source/blender/editors/gpencil/drawgpencil.c
source/blender/editors/gpencil/editaction_gpencil.c
source/blender/editors/include/ED_gpencil.h
source/blender/editors/include/ED_keyframing.h
source/blender/editors/include/UI_interface.h
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_anim.c
source/blender/editors/interface/interface_draw.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_icons.c
source/blender/editors/interface/interface_intern.h
source/blender/editors/interface/interface_layout.c
source/blender/editors/interface/interface_ops.c
source/blender/editors/interface/interface_panel.c
source/blender/editors/interface/interface_regions.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/interface_utils.c
source/blender/editors/interface/resources.c
source/blender/editors/mesh/mesh_navmesh.c
source/blender/editors/object/object_constraint.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_hook.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_transform.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/physics/physics_fluid.c
source/blender/editors/render/render_internal.c
source/blender/editors/render/render_preview.c
source/blender/editors/render/render_shading.c
source/blender/editors/screen/area.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/screen/screendump.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/sculpt_undo.c
source/blender/editors/space_buttons/buttons_context.c
source/blender/editors/space_buttons/buttons_header.c
source/blender/editors/space_buttons/buttons_ops.c
source/blender/editors/space_file/file_draw.c
source/blender/editors/space_file/file_ops.c
source/blender/editors/space_file/file_panels.c
source/blender/editors/space_file/filelist.c
source/blender/editors/space_file/filesel.c
source/blender/editors/space_file/fsmenu.c
source/blender/editors/space_file/space_file.c
source/blender/editors/space_graph/graph_buttons.c
source/blender/editors/space_image/image_buttons.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_info/info_report.c
source/blender/editors/space_info/space_info.c
source/blender/editors/space_logic/logic_ops.c
source/blender/editors/space_nla/nla_buttons.c
source/blender/editors/space_node/node_draw.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_node/node_header.c
source/blender/editors/space_node/space_node.c
source/blender/editors/space_outliner/outliner_edit.c
source/blender/editors/space_outliner/outliner_tree.c
source/blender/editors/space_sequencer/sequencer_add.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/editors/space_sequencer/space_sequencer.c
source/blender/editors/space_text/space_text.c
source/blender/editors/space_text/text_ops.c
source/blender/editors/space_view3d/drawarmature.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_fly.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/editors/space_view3d/view3d_snap.c
source/blender/editors/space_view3d/view3d_toolbar.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform.h
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_orientations.c
source/blender/editors/uvedit/uvedit_unwrap_ops.c
source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
source/blender/imbuf/intern/IMB_anim.h
source/blender/imbuf/intern/anim_movie.c
source/blender/imbuf/intern/indexer.c
source/blender/imbuf/intern/openexr/openexr_api.cpp
source/blender/imbuf/intern/readimage.c
source/blender/imbuf/intern/thumbs.c
source/blender/makesdna/DNA_node_types.h
source/blender/makesdna/DNA_space_types.h
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_action.c
source/blender/makesrna/intern/rna_actuator.c
source/blender/makesrna/intern/rna_animation.c
source/blender/makesrna/intern/rna_armature_api.c
source/blender/makesrna/intern/rna_boid.c
source/blender/makesrna/intern/rna_curve.c
source/blender/makesrna/intern/rna_define.c
source/blender/makesrna/intern/rna_fcurve.c
source/blender/makesrna/intern/rna_fcurve_api.c
source/blender/makesrna/intern/rna_fluidsim.c
source/blender/makesrna/intern/rna_gpencil.c
source/blender/makesrna/intern/rna_image.c
source/blender/makesrna/intern/rna_lattice.c
source/blender/makesrna/intern/rna_mesh.c
source/blender/makesrna/intern/rna_modifier.c
source/blender/makesrna/intern/rna_nodetree.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_object_force.c
source/blender/makesrna/intern/rna_particle.c
source/blender/makesrna/intern/rna_pose.c
source/blender/makesrna/intern/rna_render.c
source/blender/makesrna/intern/rna_rna.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_sculpt_paint.c
source/blender/makesrna/intern/rna_sequencer.c
source/blender/makesrna/intern/rna_smoke.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_texture.c
source/blender/makesrna/intern/rna_ui.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/makesrna/intern/rna_wm.c
source/blender/makesrna/intern/rna_world.c
source/blender/makesrna/rna_cleanup/rna_cleaner.py
source/blender/makesrna/rna_cleanup/rna_update.sh
source/blender/modifiers/intern/MOD_bevel.c
source/blender/modifiers/intern/MOD_boolean_util.c
source/blender/modifiers/intern/MOD_edgesplit.c
source/blender/modifiers/intern/MOD_fluidsim_util.c
source/blender/modifiers/intern/MOD_mask.c
source/blender/modifiers/intern/MOD_solidify.c
source/blender/nodes/composite/node_composite_tree.c
source/blender/nodes/composite/node_composite_util.c
source/blender/nodes/composite/nodes/node_composite_directionalblur.c
source/blender/nodes/intern/node_common.c
source/blender/nodes/intern/node_socket.c
source/blender/nodes/shader/node_shader_tree.c
source/blender/nodes/texture/node_texture_tree.c
source/blender/python/BPY_extern.h
source/blender/python/generic/IDProp.c
source/blender/python/generic/py_capi_utils.c
source/blender/python/generic/py_capi_utils.h
source/blender/python/intern/bpy_app.c
source/blender/python/intern/bpy_interface.c
source/blender/python/intern/bpy_operator.c
source/blender/python/intern/bpy_rna.c
source/blender/render/CMakeLists.txt
source/blender/render/SConscript
source/blender/render/extern/include/RE_engine.h [new file with mode: 0644]
source/blender/render/extern/include/RE_pipeline.h
source/blender/render/intern/include/renderpipeline.h
source/blender/render/intern/source/external_engine.c [new file with mode: 0644]
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/rayshade.c
source/blender/render/intern/source/renderdatabase.c
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/WM_types.h
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_files.c
source/blender/windowmanager/intern/wm_init_exit.c
source/blender/windowmanager/intern/wm_keymap.c
source/blender/windowmanager/intern/wm_operators.c
source/blender/windowmanager/intern/wm_window.c
source/blenderplayer/bad_level_call_stubs/stubs.c
source/creator/CMakeLists.txt
source/creator/creator.c
source/darwin/blender.app/Contents/Info.plist
source/darwin/set_simulation_threads.app/Contents/Info.plist
source/darwin/set_simulation_threads.app/Contents/Resources/Scripts/main.scpt
source/darwin/set_simulation_threads.app/Contents/Resources/applet.rsrc
source/darwin/set_simulation_threads_applescript.scpt [deleted file]
source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
source/gameengine/GameLogic/CMakeLists.txt
source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp
source/gameengine/GameLogic/Joystick/SCA_Joystick.h
source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp
source/gameengine/GameLogic/Joystick/SCA_JoystickPrivate.h
source/gameengine/GameLogic/SCA_JoystickManager.cpp
source/gameengine/GameLogic/SCA_KeyboardSensor.h
source/gameengine/GameLogic/SConscript
source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
source/gameengine/Ketsji/BL_Action.cpp
source/gameengine/Ketsji/CMakeLists.txt
source/gameengine/Ketsji/KX_BulletPhysicsController.cpp
source/gameengine/Ketsji/KX_KetsjiEngine.cpp
source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
source/gameengine/Ketsji/KX_PythonInit.cpp
source/gameengine/Ketsji/SConscript
source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
source/gameengine/Physics/common/PHY_IMotionState.h
source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h
source/gameengine/Rasterizer/RAS_FramingManager.cpp
source/gameengine/VideoTexture/VideoFFmpeg.cpp
source/tests/CMakeLists.txt
source/tests/rna_info_dump.py

index 6cfda3a01e643d03177f7908db9fe5b2d2a7c5c7..13be77e90ebb775436f6d1801405d7a4b98a5c05 100644 (file)
@@ -213,6 +213,7 @@ mark_as_advanced(WITH_CXX_GUARDEDALLOC)
 option(WITH_ASSERT_ABORT "Call abort() when raising an assertion through BLI_assert()" OFF)
 mark_as_advanced(WITH_ASSERT_ABORT)
 
+
 if(APPLE)
        if(NOT CMAKE_OSX_ARCHITECTURES)
                set(CMAKE_OSX_ARCHITECTURES x86_64 CACHE STRING
index af953143b82d3e7e0873143e51c12a539ff3d1a3..c68c8684687259ce83f0f75985eb2dfb461a2693 100644 (file)
@@ -174,7 +174,7 @@ package_archive:
 # Other Targets
 #
 translations:
-       $(BUILD_DIR)/bin/blender --background --factory-startup --python po/update_msg.py
+       $(BUILD_DIR)/bin/blender --background -noaudio --factory-startup --python po/update_msg.py
        python3 po/update_pot.py
        python3 po/update_po.py
        python3 po/update_mo.py
@@ -238,12 +238,12 @@ check_sparse:
 
 # Simple version of ./doc/python_api/sphinx_doc_gen.sh with no PDF generation.
 doc_py:
-       $(BUILD_DIR)/bin/blender --background --factory-startup --python doc/python_api/sphinx_doc_gen.py
+       $(BUILD_DIR)/bin/blender --background -noaudio --factory-startup --python doc/python_api/sphinx_doc_gen.py
        cd doc/python_api ; sphinx-build -n -b html sphinx-in sphinx-out
        @echo "docs written into: '$(BLENDER_DIR)/doc/python_api/sphinx-out/contents.html'"
 
 doc_dna:
-       $(BUILD_DIR)/bin/blender --background --factory-startup --python doc/blender_file_format/BlendFileDnaExporter_25.py
+       $(BUILD_DIR)/bin/blender --background -noaudio --factory-startup --python doc/blender_file_format/BlendFileDnaExporter_25.py
        @echo "docs written into: '$(BLENDER_DIR)/doc/blender_file_format/dna.html'"
 
 doc_man:
index 738466d389e3f774ca7f600d3fb5aa6fa6ca3a43..aeaef581145ce60bae54f87f81d31b77872a2c94 100644 (file)
@@ -30,7 +30,6 @@
 # Then read all SConscripts and build
 #
 # TODO: fix /FORCE:MULTIPLE on windows to get proper debug builds.
-# TODO: cleanup CCFLAGS / CPPFLAGS use, often both are set when we only need one.
 
 import platform as pltfrm
 
@@ -210,7 +209,7 @@ opts.Update(env)
 
 if sys.platform=='win32':
     if bitness==64:
-        env.Append(CFLAGS=['-DWIN64']) # -DWIN32 needed too, as it's used all over to target Windows generally
+        env.Append(CPPFLAGS=['-DWIN64']) # -DWIN32 needed too, as it's used all over to target Windows generally
 
 if not env['BF_FANCY']:
     B.bc.disable()
@@ -283,22 +282,17 @@ if env['OURPLATFORM']=='darwin':
 if env['WITH_BF_OPENMP'] == 1:
         if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
                 env['CCFLAGS'].append('/openmp')
-                env['CPPFLAGS'].append('/openmp')
         else:
             if env['CC'].endswith('icc'): # to be able to handle CC=/opt/bla/icc case
                 env.Append(LINKFLAGS=['-openmp', '-static-intel'])
                 env['CCFLAGS'].append('-openmp')
-                env['CPPFLAGS'].append('-openmp')
             else:
                 env.Append(CCFLAGS=['-fopenmp']) 
-                env.Append(CPPFLAGS=['-fopenmp'])
 
 if env['WITH_GHOST_COCOA'] == True:
-    env.Append(CFLAGS=['-DGHOST_COCOA']) 
-    env.Append(CPPFLAGS=['-DGHOST_COCOA'])
+    env.Append(CPPFLAGS=['-DGHOST_COCOA']) 
     
 if env['USE_QTKIT'] == True:
-    env.Append(CFLAGS=['-DUSE_QTKIT'])
     env.Append(CPPFLAGS=['-DUSE_QTKIT'])
 
 #check for additional debug libnames
@@ -330,20 +324,15 @@ if 'blendernogame' in B.targets:
 # disable elbeem (fluidsim) compilation?
 if env['BF_NO_ELBEEM'] == 1:
     env['CPPFLAGS'].append('-DDISABLE_ELBEEM')
-    env['CCFLAGS'].append('-DDISABLE_ELBEEM')
 
 
 if btools.ENDIAN == "big":
     env['CPPFLAGS'].append('-D__BIG_ENDIAN__')
-    env['CCFLAGS'].append('-D__BIG_ENDIAN__')
 else:
     env['CPPFLAGS'].append('-D__LITTLE_ENDIAN__')
-    env['CCFLAGS'].append('-D__LITTLE_ENDIAN__')       
-
 
 # TODO, make optional
 env['CPPFLAGS'].append('-DWITH_AUDASPACE')
-env['CCFLAGS'].append('-DWITH_AUDASPACE')
 
 # lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir
 B.root_build_dir = env['BF_BUILDDIR']
@@ -505,64 +494,62 @@ dottargetlist = []
 scriptinstall = []
 
 if env['OURPLATFORM']!='darwin':
-        for dp, dn, df in os.walk('release/bin/.blender'):
-            dp = os.path.normpath(dp)
-
-            if '.svn' in dn:
-                dn.remove('.svn')
-            if '_svn' in dn:
-                dn.remove('_svn')
-            
-            for f in df:
-                # This files aren't used anymore
-                if f in (".bfont.ttf", ):
+    dotblenderinstall = []
+    for targetdir,srcfile in zip(dottargetlist, dotblendlist):
+        td, tf = os.path.split(targetdir)
+        dotblenderinstall.append(env.Install(dir=td, source=srcfile))
+    for targetdir,srcfile in zip(datafilestargetlist, datafileslist):
+        td, tf = os.path.split(targetdir)
+        dotblenderinstall.append(env.Install(dir=td, source=srcfile))
+    
+    if env['WITH_BF_PYTHON']:
+        #-- local/VERSION/scripts
+        scriptpaths=['release/scripts']
+        for scriptpath in scriptpaths:
+            for dp, dn, df in os.walk(scriptpath):
+                if '.svn' in dn:
+                    dn.remove('.svn')
+                if '_svn' in dn:
+                    dn.remove('_svn')
+                if '__pycache__' in dn:  # py3.2 cache dir
+                    dn.remove('__pycache__')
+
+                dir = os.path.join(env['BF_INSTALLDIR'], VERSION)
+                dir += os.sep + os.path.basename(scriptpath) + dp[len(scriptpath):]
+
+                source=[os.path.join(dp, f) for f in df if not f.endswith(".pyc")]
+                # To ensure empty dirs are created too
+                if len(source)==0:
+                    env.Execute(Mkdir(dir))
+                scriptinstall.append(env.Install(dir=dir,source=source))
+    
+    if env['WITH_BF_INTERNATIONAL']:
+        internationalpaths=['release' + os.sep + 'datafiles']
+        
+        def check_path(path, member):
+            return (member in path.split(os.sep))
+        
+        for intpath in internationalpaths:
+            for dp, dn, df in os.walk(intpath):
+                if '.svn' in dn:
+                    dn.remove('.svn')
+                if '_svn' in dn:
+                    dn.remove('_svn')
+
+                # we only care about release/datafiles/fonts, release/datafiles/locales
+                if check_path(dp, "fonts") or check_path(dp, "locale"):
+                    pass
+                else:
                     continue
-
-                if not env['WITH_BF_INTERNATIONAL']:
-                    if 'locale' in dp:
-                        continue
-                if not env['WITH_BF_FREETYPE']:
-                    if f.endswith('.ttf'):
-                        continue
                 
-                if 'locale' in dp or 'fonts' in dp:
-                    datafileslist.append(os.path.join(dp,f))
-                    dir= os.path.join(*([env['BF_INSTALLDIR']] + [VERSION] + ['datafiles'] + dp.split(os.sep)[3:]))    # skip bin
-                    datafilestargetlist.append(dir + os.sep + f)
-
-                else:
-                    dotblendlist.append(os.path.join(dp, f))
-                    dir= os.path.join(*([env['BF_INSTALLDIR']] + [VERSION] + ['config'] + dp.split(os.sep)[3:]))    # skip bin
-                    dottargetlist.append(dir + os.sep + f)
-                    
-        dotblenderinstall = []
-        for targetdir,srcfile in zip(dottargetlist, dotblendlist):
-            td, tf = os.path.split(targetdir)
-            dotblenderinstall.append(env.Install(dir=td, source=srcfile))
-        for targetdir,srcfile in zip(datafilestargetlist, datafileslist):
-            td, tf = os.path.split(targetdir)
-            dotblenderinstall.append(env.Install(dir=td, source=srcfile))
-        
-        if env['WITH_BF_PYTHON']:
-            #-- local/VERSION/scripts
-            scriptpaths=['release/scripts']
-            for scriptpath in scriptpaths:
-                for dp, dn, df in os.walk(scriptpath):
-                    if '.svn' in dn:
-                        dn.remove('.svn')
-                    if '_svn' in dn:
-                        dn.remove('_svn')
-                    if '__pycache__' in dn:  # py3.2 cache dir
-                        dn.remove('__pycache__')
-
-                    dir = os.path.join(env['BF_INSTALLDIR'], VERSION)
-                    dir += os.sep + os.path.basename(scriptpath) + dp[len(scriptpath):]
-
-                    source=[os.path.join(dp, f) for f in df if not f.endswith(".pyc")]
-                    # To ensure empty dirs are created too
-                    if len(source)==0:
-                        env.Execute(Mkdir(dir))
-                    scriptinstall.append(env.Install(dir=dir,source=source))
+                dir = os.path.join(env['BF_INSTALLDIR'], VERSION)
+                dir += os.sep + os.path.basename(intpath) + dp[len(intpath):]
+
+                source=[os.path.join(dp, f) for f in df if not f.endswith(".pyc")]
+                # To ensure empty dirs are created too
+                if len(source)==0:
+                    env.Execute(Mkdir(dir))
+                scriptinstall.append(env.Install(dir=dir,source=source))
 
 #-- icons
 if env['OURPLATFORM']=='linux':
index f2197a05501d7cb0f44b7ebb7b534beac445600b..080fd8d61236b79e1d9d592aaf8cd4e198a84e19 100644 (file)
@@ -94,6 +94,7 @@ WITH_BF_JACK = True
 
 # Compilation and optimization
 BF_DEBUG = False
-REL_CFLAGS = ['-O2']
-REL_CCFLAGS = ['-O2']
+REL_CFLAGS = []
+REL_CXXFLAGS = []
+REL_CCFLAGS = ['-O2']  # C & C++
 PLATFORM_LINKFLAGS = ['-L/home/sources/staticlibs/lib32']
index 99671ecc07229ec0914adaddb100a2307a0a418c..204732376fac4432a78196d474d68bb3fa07782d 100644 (file)
@@ -85,6 +85,7 @@ WITH_BF_JACK = True
 
 # Compilation and optimization
 BF_DEBUG = False
-REL_CFLAGS = ['-O2']
-REL_CCFLAGS = ['-O2']
+REL_CFLAGS = []
+REL_CXXFLAGS = []
+REL_CCFLAGS = ['-O2']  # C & C++
 PLATFORM_LINKFLAGS = ['-L/home/sources/staticlibs/lib32']
index a1ca38880eb89fbbdcb0f12948c0447e6164fb54..cc0ba209a44877dd900689ac2b840c7b9d757cc5 100644 (file)
@@ -85,6 +85,7 @@ WITH_BF_JACK = True
 
 # Compilation and optimization
 BF_DEBUG = False
-REL_CFLAGS = ['-O2']
-REL_CCFLAGS = ['-O2']
+REL_CFLAGS = []
+REL_CXXFLAGS = []
+REL_CCFLAGS = ['-O2']  # C & C++
 PLATFORM_LINKFLAGS = ['-L/home/sources/staticlibs/lib64']
index 93fe3ca2e5bd240ef9b529b8a0a75d967fa10eb9..4698ffdce158b18b54f9c443065e62668f1e1395 100644 (file)
@@ -94,6 +94,7 @@ WITH_BF_JACK = True
 
 # Compilation and optimization
 BF_DEBUG = False
-REL_CFLAGS = ['-O2']
-REL_CCFLAGS = ['-O2']
+REL_CFLAGS = []
+REL_CXXFLAGS = []
+REL_CCFLAGS = ['-O2']  # C & C++
 PLATFORM_LINKFLAGS = ['-L/home/sources/staticlibs/lib64']
diff --git a/build_files/scons/config/aix4-config.py b/build_files/scons/config/aix4-config.py
deleted file mode 100644 (file)
index f8b3e75..0000000
+++ /dev/null
@@ -1,209 +0,0 @@
-import os
-
-LCGDIR = os.getcwd()+"/../lib/aix-4.3-ppc"
-LIBDIR = LCGDIR
-print LCGDIR
-
-WITH_BF_VERSE = 'false'
-BF_VERSE_INCLUDE = "#extern/verse/dist"
-
-BF_PYTHON = LCGDIR+'/python'
-BF_PYTHON_VERSION = '3.2'
-WITH_BF_STATICPYTHON = 'true'
-BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
-BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
-BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}' #BF_PYTHON+'/lib/python'+BF_PYTHON_VERSION+'/config/libpython'+BF_PYTHON_VERSION+'.a'
-BF_PYTHON_LINKFLAGS = ['-Xlinker', '-export-dynamic']
-BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/python${BF_PYTHON_VERSION}/config/libpython${BF_PYTHON_VERSION}.a'
-
-WITH_BF_OPENAL = 'false'
-WITH_BF_STATICOPENAL = 'false'
-BF_OPENAL = LCGDIR+'/openal'
-BF_OPENAL_INC = '${BF_OPENAL}/include'
-BF_OPENAL_LIB = 'openal'
-BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
-BF_OPENAL_LIBPATH = LIBDIR + '/lib'
-
-BF_CXX = '/usr'
-WITH_BF_STATICCXX = 'false'
-BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
-
-WITH_BF_SDL = 'false'
-BF_SDL = LCGDIR+'/sdl' #$(shell sdl-config --prefix)
-BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
-BF_SDL_LIB = 'SDL audio iconv charset' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
-BF_SDL_LIBPATH = '${BF_SDL}/lib'
-
-WITH_BF_OPENEXR = 'false'
-WITH_BF_STATICOPENEXR = 'false'
-BF_OPENEXR = '/usr'
-# when compiling with your own openexr lib you might need to set...
-# BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR ${BF_OPENEXR}/include'
-
-BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR'
-BF_OPENEXR_LIB = 'Half IlmImf Iex Imath '
-BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
-# BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
-
-
-WITH_BF_DDS = 'false'
-
-WITH_BF_JPEG = 'false'
-BF_JPEG = LCGDIR+'/jpeg'
-BF_JPEG_INC = '${BF_JPEG}/include'
-BF_JPEG_LIB = 'jpeg'
-BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
-
-WITH_BF_PNG = 'false'
-BF_PNG = LCGDIR+"/png"
-BF_PNG_INC = '${BF_PNG}/include'
-BF_PNG_LIB = 'png'
-BF_PNG_LIBPATH = '${BF_PNG}/lib'
-
-BF_TIFF = '/usr/nekoware'
-BF_TIFF_INC = '${BF_TIFF}/include'
-
-WITH_BF_ZLIB = 'true'
-BF_ZLIB = LCGDIR+"/zlib"
-BF_ZLIB_INC = '${BF_ZLIB}/include'
-BF_ZLIB_LIB = 'z'
-BF_ZLIB_LIBPATH = '${BF_ZLIB}/lib'
-
-WITH_BF_INTERNATIONAL = 'false'
-
-BF_GETTEXT = LCGDIR+'/gettext'
-BF_GETTEXT_INC = '${BF_GETTEXT}/include'
-BF_GETTEXT_LIB = 'gettextpo intl'
-BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
-
-WITH_BF_GAMEENGINE='false'
-
-WITH_BF_BULLET = 'true'
-BF_BULLET = '#extern/bullet2/src'
-BF_BULLET_INC = '${BF_BULLET}'
-BF_BULLET_LIB = 'extern_bullet'
-
-#WITH_BF_NSPR = 'true'
-#BF_NSPR = $(LIBDIR)/nspr
-#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
-#BF_NSPR_LIB = 
-
-# Uncomment the following line to use Mozilla inplace of netscape
-#CPPFLAGS += -DMOZ_NOT_NET
-# Location of MOZILLA/Netscape header files...
-#BF_MOZILLA = $(LIBDIR)/mozilla
-#BF_MOZILLA_INC = -I$(BF_MOZILLA)/include/mozilla/nspr -I$(BF_MOZILLA)/include/mozilla -I$(BF_MOZILLA)/include/mozilla/xpcom -I$(BF_MOZILLA)/include/mozilla/idl
-#BF_MOZILLA_LIB =
-# Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB
-# if this is not set.
-#
-# Be paranoid regarding library creation (do not update archives)
-#BF_PARANOID = 'true'
-
-# enable freetype2 support for text objects
-BF_FREETYPE = LCGDIR+'/freetype'
-BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
-BF_FREETYPE_LIB = 'freetype'
-BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
-
-WITH_BF_QUICKTIME = 'false' # -DWITH_QUICKTIME
-BF_QUICKTIME = '/usr/local'
-BF_QUICKTIME_INC = '${BF_QUICKTIME}/include'
-
-WITH_BF_ICONV = 'false'
-BF_ICONV = LIBDIR + "/iconv"
-BF_ICONV_INC = '${BF_ICONV}/include'
-BF_ICONV_LIB = 'iconv charset'
-BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
-
-WITH_BF_BINRELOC = 'false'
-
-# enable ffmpeg  support
-WITH_BF_FFMPEG = 'false'  # -DWITH_FFMPEG
-# Uncomment the following two lines to use system's ffmpeg
-BF_FFMPEG = LCGDIR+'/ffmpeg'
-BF_FFMPEG_LIB = 'avformat avcodec swscale avutil avdevice faad faac vorbis x264 ogg mp3lame z'
-BF_FFMPEG_INC = '${BF_FFMPEG}/include'
-BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
-
-# enable ogg, vorbis and theora in ffmpeg
-WITH_BF_OGG = 'false'  # -DWITH_OGG 
-BF_OGG = '/usr'
-BF_OGG_INC = '${BF_OGG}/include'
-BF_OGG_LIB = 'ogg vorbis theoraenc theoradec'
-
-WITH_BF_OPENJPEG = 'false' 
-BF_OPENJPEG = '#extern/libopenjpeg'
-BF_OPENJPEG_LIB = ''
-BF_OPENJPEG_INC = '${BF_OPENJPEG}'
-BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
-
-WITH_BF_REDCODE = 'false'  
-BF_REDCODE = '#extern/libredcode'
-BF_REDCODE_LIB = ''
-BF_REDCODE_INC = '${BF_REDCODE}/include'
-BF_REDCODE_LIBPATH='${BF_REDCODE}/lib'
-
-# Mesa Libs should go here if your using them as well....
-WITH_BF_STATICOPENGL = 'false'
-BF_OPENGL = '/usr'
-BF_OPENGL_INC = '${BF_OPENGL}/include'
-BF_OPENGL_LIB = 'GL GLU X11 Xi Xext'
-BF_OPENGL_LIBPATH = '/usr/X11R6/lib'
-BF_OPENGL_LIB_STATIC = '${BF_OPENGL}/libGL.a ${BF_OPENGL}/libGLU.a ${BF_OPENGL}/libXxf86vm.a ${BF_OPENGL}/libX11.a ${BF_OPENGL}/libXi.a ${BF_OPENGL}/libXext.a ${BF_OPENGL}/libXxf86vm.a'
-
-
-CC = 'gcc'
-CXX = 'g++'
-
-CCFLAGS = [ '-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
-
-CPPFLAGS = [ '-DXP_UNIX', '-DWIN32', '-DFREE_WINDOWS' ]
-CXXFLAGS = ['-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
-REL_CFLAGS = ['-DNDEBUG', '-O2' ]
-REL_CCFLAGS = ['-DNDEBUG', '-O2' ]
-C_WARN = [ '-Wall' , '-Wno-char-subscripts', '-Wdeclaration-after-statement' ]
-
-CC_WARN = [ '-Wall' ]
-
-
-
-##BF_DEPEND = 'true'
-##
-##AR = ar
-##ARFLAGS = ruv
-##ARFLAGSQUIET = ru
-##
-
-##FIX_STUBS_WARNINGS = -Wno-unused
-
-LLIBS = 'c m dl pthread dmedia movie'
-##LOPTS = --dynamic
-##DYNLDFLAGS = -shared $(LDFLAGS)
-
-BF_PROFILE_FLAGS = ['-pg','-g']
-BF_PROFILE = 'false'
-
-BF_DEBUG = 'false'
-BF_DEBUG_CCFLAGS = ['-g']
-
-BF_BUILDDIR = '../build/aix4'
-BF_INSTALLDIR='../install/aix4'
-BF_DOCDIR='../install/doc'
-
-#Link against pthread
-LDIRS = []
-LDIRS.append(BF_FREETYPE_LIBPATH)
-LDIRS.append(BF_PNG_LIBPATH)
-LDIRS.append(BF_ZLIB_LIBPATH)
-LDIRS.append(BF_SDL_LIBPATH)
-LDIRS.append(BF_OPENAL_LIBPATH)
-LDIRS.append(BF_ICONV_LIBPATH)
-
-PLATFORM_LINKFLAGS = []
-for x in LDIRS:
-    PLATFORM_LINKFLAGS.append("-L"+x)
-    
-PLATFORM_LINKFLAGS += ['-L${LCGDIR}/jpeg/lib' , '-L/usr/lib32',  '-n32', '-v', '-no_prelink']
-print PLATFORM_LINKFLAGS
-LINKFLAGS= PLATFORM_LINKFLAGS
index 0c132041d82768820b4b2d131ed4f41e127032d1..deb3d01febd852b68561ba392441db64ba26c249 100644 (file)
@@ -306,11 +306,11 @@ if MACOSX_ARCHITECTURE == 'x86_64' or MACOSX_ARCHITECTURE == 'ppc64':
 else:
        ARCH_FLAGS = ['-m32']
 
-CFLAGS = ['-pipe','-funsigned-char']+ARCH_FLAGS
+CFLAGS = []
+CXXFLAGS = []
+CCFLAGS = ['-pipe','-funsigned-char']
 
-CPPFLAGS = []+ARCH_FLAGS
-CCFLAGS = ['-pipe','-funsigned-char']+ARCH_FLAGS
-CXXFLAGS = ['-pipe','-funsigned-char']+ARCH_FLAGS
+CPPFLAGS = list(ARCH_FLAGS)
 
 if WITH_GHOST_COCOA:
        PLATFORM_LINKFLAGS = ['-fexceptions','-framework','CoreServices','-framework','Foundation','-framework','IOKit','-framework','AppKit','-framework','Cocoa','-framework','Carbon','-framework','AudioUnit','-framework','AudioToolbox','-framework','CoreAudio','-framework','OpenAL']+ARCH_FLAGS
@@ -336,9 +336,8 @@ else:
 
 # some flags shuffling for different OS versions
 if MAC_MIN_VERS == '10.3':
-       CFLAGS = ['-fuse-cxa-atexit']+CFLAGS
-       CXXFLAGS = ['-fuse-cxa-atexit']+CXXFLAGS
-       PLATFORM_LINKFLAGS = ['-fuse-cxa-atexit']+PLATFORM_LINKFLAGS
+       CCFLAGS = ['-fuse-cxa-atexit'] + CFLAGS
+       PLATFORM_LINKFLAGS = ['-fuse-cxa-atexit'] + PLATFORM_LINKFLAGS
        LLIBS.append('crt3.o')
        
 if USE_SDK:
@@ -349,19 +348,18 @@ if USE_SDK:
 
 #Intel Macs are CoreDuo and Up 
 if MACOSX_ARCHITECTURE == 'i386' or MACOSX_ARCHITECTURE == 'x86_64':
-       REL_CFLAGS = ['-DNDEBUG', '-O2','-ftree-vectorize','-msse','-msse2','-msse3','-mfpmath=sse']
+       REL_CFLAGS = []
+       REL_CXXFLAGS = []
        REL_CCFLAGS = ['-DNDEBUG', '-O2','-ftree-vectorize','-msse','-msse2','-msse3','-mfpmath=sse']
 else:
-       CFLAGS = CFLAGS+['-fno-strict-aliasing']
-       CCFLAGS =  CCFLAGS+['-fno-strict-aliasing']
-       CXXFLAGS = CXXFLAGS+['-fno-strict-aliasing']
-       REL_CFLAGS = ['-DNDEBUG', '-O2']
+       CCFLAGS += ['-fno-strict-aliasing']
+       REL_CFLAGS = []
+       REL_CXXFLAGS = []
        REL_CCFLAGS = ['-DNDEBUG', '-O2']
 
 # Intel 64bit Macs are Core2Duo and up
 if MACOSX_ARCHITECTURE == 'x86_64':
-       REL_CFLAGS = REL_CFLAGS+['-march=core2','-mssse3','-with-tune=core2','-enable-threads']
-       REL_CCFLAGS = REL_CCFLAGS+['-march=core2','-mssse3','-with-tune=core2','-enable-threads']
+       REL_CCFLAGS += ['-march=core2','-mssse3','-with-tune=core2','-enable-threads']
 
 CC_WARN = ['-Wall']
 C_WARN = ['-Wno-char-subscripts', '-Wpointer-arith', '-Wcast-align', '-Wdeclaration-after-statement', '-Wno-unknown-pragmas', '-Wstrict-prototypes']
index fec7531b3c7e28ee3ed05821688c7465f00336f8..eb7d7c9de57b9bf92b0f10f3c4478a39ecd50186 100644 (file)
@@ -172,11 +172,12 @@ BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']
 CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE','-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
 
 CPPFLAGS = []
-CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE','-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
+CXXFLAGS = []
 if WITH_BF_FFMPEG:
   # libavutil needs UINT64_C()
   CXXFLAGS += ['-D__STDC_CONSTANT_MACROS', ]
-REL_CFLAGS = ['-DNDEBUG', '-O2']
+REL_CFLAGS = []
+REL_CXXFLAGS = []
 REL_CCFLAGS = ['-DNDEBUG', '-O2']
 ##BF_DEPEND = True
 ##
index eea89bf24ff60f78e7e9416065e34d0ba489421d..451d22455e0f08c4445e3ef3b4796c7de09087ed 100644 (file)
@@ -172,11 +172,12 @@ BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']
 CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE','-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
 
 CPPFLAGS = []
-CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE','-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
+CXXFLAGS = []
 if WITH_BF_FFMPEG:
   # libavutil needs UINT64_C()
   CXXFLAGS += ['-D__STDC_CONSTANT_MACROS', ]
-REL_CFLAGS = ['-DNDEBUG', '-O2']
+REL_CFLAGS = []
+REL_CXXFLAGS = []
 REL_CCFLAGS = ['-DNDEBUG', '-O2']
 ##BF_DEPEND = True
 ##
index a63da6e35f9dcf7a21a44f30839c5360ffcbdb4c..2ce6ec7ce33b441e7fd52c036d1ec25e4e6eb5c4 100644 (file)
@@ -170,13 +170,14 @@ WITH_BF_RAYOPTIMIZATION = True
 BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']
 
 CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE','-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
+CXXFLAGS = []
 
 CPPFLAGS = []
-CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE','-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
 if WITH_BF_FFMPEG:
   # libavutil needs UINT64_C()
   CXXFLAGS += ['-D__STDC_CONSTANT_MACROS', ]
-REL_CFLAGS = ['-DNDEBUG', '-O2']
+REL_CFLAGS = []
+REL_CXXFLAGS = []
 REL_CCFLAGS = ['-DNDEBUG', '-O2']
 ##BF_DEPEND = True
 ##
diff --git a/build_files/scons/config/irix6-config.py b/build_files/scons/config/irix6-config.py
deleted file mode 100644 (file)
index e69de29..0000000
index a26748cd8dc0914df9b87729fd9976f7d64e779e..91f86ae7e806e3e37eda63f3835e756b0e7334f2 100644 (file)
@@ -97,7 +97,6 @@ BF_BULLET_LIB = 'extern_bullet'
 BF_FREETYPE = '/usr'
 BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
 BF_FREETYPE_LIB = 'freetype'
-#WITH_BF_FREETYPE_STATIC = True
 #BF_FREETYPE_LIB_STATIC = '${BF_FREETYPE}/lib/libfreetype.a'
 
 WITH_BF_QUICKTIME = False # -DWITH_QUICKTIME
@@ -200,15 +199,16 @@ CXX = 'g++'
 ##   CFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -mieee
 
 CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
+CXXFLAGS = []
 
 CPPFLAGS = []
-CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
 # g++ 4.6, only needed for bullet
 CXXFLAGS += ['-fpermissive']
 if WITH_BF_FFMPEG:
   # libavutil needs UINT64_C()
   CXXFLAGS += ['-D__STDC_CONSTANT_MACROS', ]
-REL_CFLAGS = ['-DNDEBUG', '-O2']
+REL_CFLAGS = []
+REL_CXXFLAGS = []
 REL_CCFLAGS = ['-DNDEBUG', '-O2']
 ##BF_DEPEND = True
 ##
index 070e18a5af0a83a063a892b88f97ae4337cfb467..f6f72cd32d57b7a004e72d7c57a957b006648d4b 100644 (file)
@@ -170,10 +170,11 @@ WITH_BF_RAYOPTIMIZATION = True
 BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse']
 
 CCFLAGS = [ '-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
+CXXFLAGS = []
 
 CPPFLAGS = ['-DWIN32', '-DFREE_WINDOWS', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE64_SOURCE']
-CXXFLAGS = ['-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
-REL_CFLAGS = ['-DNDEBUG',  '-O2']
+REL_CFLAGS = []
+REL_CXXFLAGS = []
 REL_CCFLAGS = ['-DNDEBUG',  '-O2']
 C_WARN = ['-Wall', '-Wstrict-prototypes', '-Wno-char-subscripts', '-Wdeclaration-after-statement']
 
diff --git a/build_files/scons/config/openbsd3-config.py b/build_files/scons/config/openbsd3-config.py
deleted file mode 100644 (file)
index 83c515d..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-LCGDIR = '../lib/openbsd3'
-LIBDIR = '${LCGDIR}'
-
-BF_PYTHON = '/usr/local'
-BF_PYTHON_VERSION = '3.2'
-BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
-BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
-BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}'
-BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib/python${BF_PYTHON_VERSION}/config'
-
-WITH_BF_OPENAL = False
-# WITH_BF_STATICOPENAL = False
-#BF_OPENAL = LIBDIR + '/openal'
-#BF_OPENAL_INC = '${BF_OPENAL}/include'
-#BF_OPENAL_LIB = 'openal'
-#BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
-#BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
-
-WITH_BF_SDL = True
-BF_SDL = '/usr/local' #$(shell sdl-config --prefix)
-BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
-BF_SDL_LIB = 'SDL' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
-BF_SDL_LIBPATH = '${BF_SDL}/lib'
-
-WITH_BF_OPENEXR = False
-WITH_BF_STATICOPENEXR = False
-BF_OPENEXR = '/usr/local'
-BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR'
-BF_OPENEXR_LIB = 'Half IlmImf Iex Imath '
-# Warning, this static lib configuration is untested! users of this OS please confirm.
-BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
-
-WITH_BF_DDS = True
-
-WITH_BF_JPEG = True
-BF_JPEG = '/usr/local'
-BF_JPEG_INC = '${BF_JPEG}/include'
-BF_JPEG_LIB = 'jpeg'
-BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
-
-WITH_BF_PNG = True
-BF_PNG = '/usr/local'
-BF_PNG_INC = '${BF_PNG}/include/libpng'
-BF_PNG_LIB = 'png'
-BF_PNG_LIBPATH = '${BF_PNG}/lib'
-
-BF_TIFF = '/usr/local'
-BF_TIFF_INC = '${BF_TIFF}/include'
-
-WITH_BF_ZLIB = True
-BF_ZLIB = '/usr/local'
-BF_ZLIB_INC = '${BF_ZLIB}/include'
-BF_ZLIB_LIB = 'z'
-
-WITH_BF_INTERNATIONAL = True
-
-BF_GETTEXT = '/usr/local'
-BF_GETTEXT_INC = '${BF_GETTEXT}/include'
-BF_GETTEXT_LIB = 'intl iconv'
-BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
-
-WITH_BF_GAMEENGINE=False
-WITH_BF_PLAYER = False
-
-WITH_BF_BULLET = True
-BF_BULLET = '#extern/bullet2/src'
-BF_BULLET_INC = '${BF_BULLET}'
-BF_BULLET_LIB = 'extern_bullet'
-
-#WITH_BF_NSPR = True
-#BF_NSPR = $(LIBDIR)/nspr
-#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
-#BF_NSPR_LIB = 
-
-# Uncomment the following line to use Mozilla inplace of netscape
-#CPPFLAGS += -DMOZ_NOT_NET
-# Location of MOZILLA/Netscape header files...
-#BF_MOZILLA = $(LIBDIR)/mozilla
-#BF_MOZILLA_INC = -I$(BF_MOZILLA)/include/mozilla/nspr -I$(BF_MOZILLA)/include/mozilla -I$(BF_MOZILLA)/include/mozilla/xpcom -I$(BF_MOZILLA)/include/mozilla/idl
-#BF_MOZILLA_LIB =
-# Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB
-# if this is not set.
-#
-# Be paranoid regarding library creation (do not update archives)
-#BF_PARANOID = True
-
-# enable freetype2 support for text objects
-BF_FREETYPE = '/usr/X11R6'
-BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
-BF_FREETYPE_LIB = 'freetype'
-BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
-
-WITH_BF_QUICKTIME = False # -DWITH_QUICKTIME
-
-WITH_BF_ICONV = False
-BF_ICONV = LIBDIR + "/iconv"
-BF_ICONV_INC = '${BF_ICONV}/include'
-BF_ICONV_LIB = 'iconv'
-BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
-
-# Mesa Libs should go here if your using them as well....
-WITH_BF_STATICOPENGL = True
-BF_OPENGL = '/usr/X11R6'
-BF_OPENGL_INC = '${BF_OPENGL}/include'
-BF_OPENGL_LIB = 'GL GLU X11 Xi'
-BF_OPENGL_LIBPATH = '${BF_OPENGL}/lib'
-BF_OPENGL_LIB_STATIC = '${BF_OPENGL_LIBPATH}/libGL.a ${BF_OPENGL_LIBPATH}/libGLU.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a ${BF_OPENGL_LIBPATH}/libX11.a ${BF_OPENGL_LIBPATH}/libXi.a ${BF_OPENGL_LIBPATH}/libXext.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a'
-
-##
-##CC = gcc
-##CCC = g++
-##ifeq ($CPU),alpha)
-##   CFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -mieee
-
-CFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing']
-
-CPPFLAGS = []
-CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing']
-CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing']
-REL_CFLAGS = ['-DNDEBUG', '-O2']
-REL_CCFLAGS = ['-DNDEBUG', '-O2']
-##BF_DEPEND = True
-##
-##AR = ar
-##ARFLAGS = ruv
-##ARFLAGSQUIET = ru
-##
-CC = 'gcc'
-CXX = 'g++'
-C_WARN = ['-Wdeclaration-after-statement', '-Wstrict-prototypes']
-
-CC_WARN = ['-Wall']
-
-##FIX_STUBS_WARNINGS = -Wno-unused
-
-LLIBS = ['m', 'stdc++', 'pthread', 'util']
-##LOPTS = --dynamic
-##DYNLDFLAGS = -shared $(LDFLAGS)
-
-BF_PROFILE = False
-BF_PROFILE_CCFLAGS = ['-pg','-g']
-BF_PROFILE_LINKFLAGS = ['-pg']
-
-BF_DEBUG = False
-BF_DEBUG_CCFLAGS = ['-g', '-D_DEBUG']
-
-BF_BUILDDIR='../build/openbsd3'
-BF_INSTALLDIR='../install/openbsd3'
diff --git a/build_files/scons/config/sunos5-config.py b/build_files/scons/config/sunos5-config.py
deleted file mode 100644 (file)
index 0cf78c9..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-LCGDIR = '../lib/sunos5'
-LIBDIR = '${LCGDIR}'
-
-BF_PYTHON = '/usr/local'
-BF_PYTHON_VERSION = '3.2'
-BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
-BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
-BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}' #BF_PYTHON+'/lib/python'+BF_PYTHON_VERSION+'/config/libpython'+BF_PYTHON_VERSION+'.a'
-BF_PYTHON_LINKFLAGS = ['-Xlinker', '-export-dynamic']
-
-WITH_BF_OPENAL = True
-WITH_BF_STATICOPENAL = False
-BF_OPENAL = '/usr/local'
-BF_OPENAL_INC = '${BF_OPENAL}/include'
-BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
-BF_OPENAL_LIB = 'openal'
-# Warning, this static lib configuration is untested! users of this OS please confirm.
-BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
-
-# Warning, this static lib configuration is untested! users of this OS please confirm.
-BF_CXX = '/usr'
-WITH_BF_STATICCXX = False
-BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
-
-WITH_BF_SDL = True
-BF_SDL = '/usr/local' #$(shell sdl-config --prefix)
-BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
-BF_SDL_LIBPATH = '${BF_SDL}/lib'
-BF_SDL_LIB = 'SDL' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
-
-WITH_BF_OPENEXR = True
-WITH_BF_STATICOPENEXR = False
-BF_OPENEXR = '/usr/local'
-BF_OPENEXR_INC = ['${BF_OPENEXR}/include', '${BF_OPENEXR}/include/OpenEXR' ]
-BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
-BF_OPENEXR_LIB = 'Half IlmImf Iex Imath '
-# Warning, this static lib configuration is untested! users of this OS please confirm.
-BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
-
-WITH_BF_DDS = True
-
-WITH_BF_JPEG = True
-BF_JPEG = '/usr/local'
-BF_JPEG_INC = '${BF_JPEG}/include'
-BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
-BF_JPEG_LIB = 'jpeg'
-
-WITH_BF_PNG = True
-BF_PNG = '/usr/local'
-BF_PNG_INC = '${BF_PNG}/include'
-BF_PNG_LIBPATH = '${BF_PNG}/lib'
-BF_PNG_LIB = 'png'
-
-BF_TIFF = '/usr/local'
-BF_TIFF_INC = '${BF_TIFF}/include'
-
-WITH_BF_ZLIB = True
-BF_ZLIB = '/usr'
-BF_ZLIB_INC = '${BF_ZLIB}/include'
-BF_ZLIB_LIBPATH = '${BF_ZLIB}/lib'
-BF_ZLIB_LIB = 'z'
-
-WITH_BF_INTERNATIONAL = True
-
-BF_GETTEXT = '/usr/local'
-BF_GETTEXT_INC = '${BF_GETTEXT}/include'
-BF_GETTEXT_LIB = 'gettextlib'
-BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
-
-WITH_BF_GAMEENGINE=False
-WITH_BF_PLAYER = False
-
-WITH_BF_BULLET = True
-BF_BULLET = '#extern/bullet2/src'
-BF_BULLET_INC = '${BF_BULLET}'
-BF_BULLET_LIB = 'extern_bullet'
-
-#WITH_BF_NSPR = True
-#BF_NSPR = $(LIBDIR)/nspr
-#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
-#BF_NSPR_LIB = 
-
-# Uncomment the following line to use Mozilla inplace of netscape
-#CPPFLAGS += -DMOZ_NOT_NET
-# Location of MOZILLA/Netscape header files...
-#BF_MOZILLA = $(LIBDIR)/mozilla
-#BF_MOZILLA_INC = -I$(BF_MOZILLA)/include/mozilla/nspr -I$(BF_MOZILLA)/include/mozilla -I$(BF_MOZILLA)/include/mozilla/xpcom -I$(BF_MOZILLA)/include/mozilla/idl
-#BF_MOZILLA_LIB =
-# Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB
-# if this is not set.
-#
-# Be paranoid regarding library creation (do not update archives)
-#BF_PARANOID = True
-
-# enable freetype2 support for text objects
-BF_FREETYPE = '/usr/local'
-BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
-BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
-BF_FREETYPE_LIB = 'freetype'
-
-WITH_BF_QUICKTIME = False # -DWITH_QUICKTIME
-BF_QUICKTIME = '/usr/local'
-BF_QUICKTIME_INC = '${BF_QUICKTIME}/include'
-
-WITH_BF_ICONV = True
-BF_ICONV = "/usr"
-BF_ICONV_INC = '${BF_ICONV}/include'
-BF_ICONV_LIB = 'iconv'
-BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
-
-# enable ffmpeg  support
-WITH_BF_FFMPEG = True # -DWITH_FFMPEG
-BF_FFMPEG = '/usr/local'
-BF_FFMPEG_INC = '${BF_FFMPEG}/include'
-BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
-BF_FFMPEG_LIB = 'avformat avcodec avutil avdevice'
-
-# Mesa Libs should go here if your using them as well....
-WITH_BF_STATICOPENGL = False
-BF_OPENGL = '/usr/openwin'
-BF_OPENGL_INC = '${BF_OPENGL}/include'
-BF_OPENGL_LIB = 'GL GLU X11 Xi'
-BF_OPENGL_LIBPATH = '${BF_OPENGL}/lib'
-BF_OPENGL_LIB_STATIC = '${BF_OPENGL_LIBPATH}/libGL.a ${BF_OPENGL_LIBPATH}/libGLU.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a ${BF_OPENGL_LIBPATH}/libX11.a ${BF_OPENGL_LIBPATH}/libXi.a ${BF_OPENGL_LIBPATH}/libXext.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a'
-
-##
-CC = 'gcc'
-CXX = 'g++'
-##ifeq ($CPU),alpha)
-##   CFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -mieee
-
-CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing']
-
-CPPFLAGS = ['-DSUN_OGL_NO_VERTEX_MACROS']
-CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing']
-REL_CFLAGS = ['-DNDEBUG', '-O2']
-REL_CCFLAGS = ['-DNDEBUG', '-O2']
-##BF_DEPEND = True
-##
-##AR = ar
-##ARFLAGS = ruv
-##ARFLAGSQUIET = ru
-##
-C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement']
-
-CC_WARN = ['-Wall']
-
-##FIX_STUBS_WARNINGS = -Wno-unused
-
-LLIBS = ['c', 'm', 'dl', 'pthread', 'stdc++']
-##LOPTS = --dynamic
-##DYNLDFLAGS = -shared $(LDFLAGS)
-
-BF_PROFILE_CCFLAGS = ['-pg', '-g ']
-BF_PROFILE_LINKFLAGS = ['-pg']
-BF_PROFILE = False
-
-BF_DEBUG = False
-BF_DEBUG_CCFLAGS = ['-D_DEBUG']
-
-BF_BUILDDIR = '../build/sunos5'
-BF_INSTALLDIR='../install/sunos5'
-
-
-PLATFORM_LINKFLAGS = []
index 167ed502bf6c3a00068fa08bb31d2e97169a1377..f210ab436b5a349a09918fc972b9dd1a029bf06f 100644 (file)
@@ -159,10 +159,11 @@ CC = 'gcc'
 CXX = 'g++'
 
 CCFLAGS = [ '-pipe', '-funsigned-char', '-fno-strict-aliasing' ]
+CXXFLAGS = []
 
 CPPFLAGS = ['-DWIN32', '-DFREE_WINDOWS', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE64_SOURCE']
-CXXFLAGS = ['-pipe',  '-funsigned-char', '-fno-strict-aliasing' ]
-REL_CFLAGS = ['-DNDEBUG',  '-O2']
+REL_CFLAGS = []
+REL_CXXFLAGS = []
 REL_CCFLAGS = ['-DNDEBUG',  '-O2']
 
 C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-prototypes']
index 9604eb5d320d482dcd0df6dee337c50fca5a325e..ec37b3046c8345b8444e1ccde7467eb01ede9302 100644 (file)
@@ -171,9 +171,9 @@ BGE_CXXFLAGS = ['/O2', '/EHsc', '/GR', '/fp:fast', '/arch:SSE']
 BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr']
 
 CPPFLAGS = ['-DWIN32','-D_CONSOLE', '-D_LIB', '-D_CRT_SECURE_NO_DEPRECATE']
-REL_CFLAGS = ['-O2', '-DNDEBUG']
+REL_CFLAGS = []
+REL_CXXFLAGS = []
 REL_CCFLAGS = ['-O2', '-DNDEBUG']
-REL_CXXFLAGS = ['-O2', '-DNDEBUG']
 
 C_WARN = []
 CC_WARN = []
index 049b7eb5d402dfd4fa8c8a2592bea29ed5ea2f1c..afa64e03e80dd05cf020fb455116e9dc9a062464 100644 (file)
@@ -175,9 +175,9 @@ BGE_CXXFLAGS = ['/O2', '/EHsc', '/GR', '/fp:fast']
 BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr', '/Od']
 
 CPPFLAGS = ['-DWIN32', '-D_CONSOLE', '-D_LIB', '-D_CRT_SECURE_NO_DEPRECATE']
-REL_CFLAGS = ['-O2', '-DNDEBUG']
+REL_CFLAGS = []
+REL_CXXFLAGS = []
 REL_CCFLAGS = ['-O2', '-DNDEBUG']
-REL_CXXFLAGS = ['-O2', '-DNDEBUG']
 
 C_WARN = []
 CC_WARN = []
index 2f5d708cc46fd1784e9de2b3b8f0c7071f3b69c2..596ab574005849dd13ef72b2a4cbcc7fa8d073e0 100644 (file)
@@ -316,8 +316,8 @@ def creator(env):
     if env['WITH_BF_TIFF']:
         defs.append('WITH_TIFF')
 
-    if not env['WITH_BF_SDL']:
-        defs.append('DISABLE_SDL')
+    if env['WITH_BF_SDL']:
+        defs.append('WITH_SDL')
 
     if env['WITH_BF_PYTHON']:
         incs.append('#/source/blender/python')
@@ -561,9 +561,9 @@ def AppIt(target=None, source=None, env=None):
     if binary == 'blender':
         cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/datafiles'%(installdir, binary, VERSION)
         commands.getoutput(cmd)
-        cmd = 'cp -R %s/release/bin/.blender/locale %s/%s.app/Contents/MacOS/%s/datafiles/'%(bldroot,installdir,binary,VERSION)
+        cmd = 'cp -R %s/release/datafiles/locale %s/%s.app/Contents/MacOS/%s/datafiles/'%(bldroot,installdir,binary,VERSION)
         commands.getoutput(cmd)
-        cmd = 'cp -R %s/release/bin/.blender/fonts %s/%s.app/Contents/MacOS/%s/datafiles/'%(bldroot,installdir,binary,VERSION)
+        cmd = 'cp -R %s/release/datafiles/fonts %s/%s.app/Contents/MacOS/%s/datafiles/'%(bldroot,installdir,binary,VERSION)
         commands.getoutput(cmd)
         cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
         commands.getoutput(cmd)
index fe56d40ea56099d96e1b0470dca1d9887205aa23..49efa598ed8686d2d627f8582a97966f825610af 100644 (file)
@@ -118,7 +118,7 @@ def validate_arguments(args, bc):
             'WITH_BF_ICONV', 'BF_ICONV', 'BF_ICONV_INC', 'BF_ICONV_LIB', 'BF_ICONV_LIBPATH',
             'WITH_BF_GAMEENGINE', 'WITH_BF_BULLET', 'WITH_BF_ELTOPO', 'BF_BULLET', 'BF_BULLET_INC', 'BF_BULLET_LIB',
             'BF_WINTAB', 'BF_WINTAB_INC',
-            'WITH_BF_FREETYPE', 'BF_FREETYPE', 'BF_FREETYPE_INC', 'BF_FREETYPE_LIB', 'BF_FREETYPE_LIBPATH', 'BF_FREETYPE_LIB_STATIC', 'WITH_BF_FREETYPE_STATIC',
+            'BF_FREETYPE', 'BF_FREETYPE_INC', 'BF_FREETYPE_LIB', 'BF_FREETYPE_LIBPATH', 'BF_FREETYPE_LIB_STATIC', 'WITH_BF_FREETYPE_STATIC',
             'WITH_BF_QUICKTIME', 'BF_QUICKTIME', 'BF_QUICKTIME_INC', 'BF_QUICKTIME_LIB', 'BF_QUICKTIME_LIBPATH',
             'WITH_BF_FFTW3', 'BF_FFTW3', 'BF_FFTW3_INC', 'BF_FFTW3_LIB', 'BF_FFTW3_LIBPATH', 'WITH_BF_STATICFFTW3', 'BF_FFTW3_LIB_STATIC',
             'WITH_BF_STATICOPENGL', 'BF_OPENGL', 'BF_OPENGL_INC', 'BF_OPENGL_LIB', 'BF_OPENGL_LIBPATH', 'BF_OPENGL_LIB_STATIC',
@@ -385,7 +385,6 @@ def read_opts(env, cfg, args):
         (BoolVariable('WITH_BF_STATICCXX', 'static link to stdc++', False)),
         ('BF_CXX_LIB_STATIC', 'static library path for stdc++', ''),
 
-        (BoolVariable('WITH_BF_FREETYPE', 'Use FreeType2 if true', True)),
         ('BF_FREETYPE', 'Freetype base path', ''),
         ('BF_FREETYPE_INC', 'Freetype include path', ''),
         ('BF_FREETYPE_LIB', 'Freetype library', ''),
index 988c992fd78d1f0ea40e2f3b64878a2775ba55ba..bc5b2e73c7e8681e0938c532de4c9f002f971e29 100755 (executable)
@@ -379,15 +379,15 @@ class DNACatalogHTML:
 
 
 def usage():
-    print("\nUsage: \n\tblender2.5 -b -P BlendFileDnaExporter_25.py [-- [options]]")
+    print("\nUsage: \n\tblender2.5 --background -noaudio --python BlendFileDnaExporter_25.py [-- [options]]")
     print("Options:")
     print("\t--dna-keep-blend:      doesn't delete the produced blend file DNA export to html")
     print("\t--dna-debug:           sets the logging level to DEBUG (lots of additional info)")
     print("\t--dna-versioned        saves version informations in the html and blend filenames")
     print("\t--dna-overwrite-css    overwrite dna.css, useful when modifying css in the script")
     print("Examples:")
-    print("\tdefault:       % blender2.5 -b -P BlendFileDnaExporter_25.py")
-    print("\twith options:  % blender2.5 -b -P BlendFileDnaExporter_25.py -- --dna-keep-blend --dna-debug\n")
+    print("\tdefault:       % blender2.5 --background -noaudio --python BlendFileDnaExporter_25.py")
+    print("\twith options:  % blender2.5 --background -noaudio --python BlendFileDnaExporter_25.py -- --dna-keep-blend --dna-debug\n")
 
     
 ######################################################
index 55dc3b83e4969e71506f88bac0276aff6eeedc3b..f28d4b3f6b6c8af20909a9ba331672fd92f429e0 100644 (file)
@@ -16,14 +16,14 @@ Below you have the help message with a list of options you can use.
 
 
 Usage:
-        blender2.5 -b -P BlendFileDnaExporter_25.py [-- [options]]
+        blender2.5 --background -noaudio --python BlendFileDnaExporter_25.py [-- [options]]
 Options:
         --dna-keep-blend:      doesn't delete the produced blend file DNA export to html
         --dna-debug:           sets the logging level to DEBUG (lots of additional info)
         --dna-versioned        saves version informations in the html and blend filenames
         --dna-overwrite-css    overwrite dna.css, useful when modifying css in the script
 Examples:
-        default:       % blender2.5 -b -P BlendFileDnaExporter_25.py
-        with options:  % blender2.5 -b -P BlendFileDnaExporter_25.py -- --dna-keep-blend --dna-debug
+        default:       % blender2.5 --background -noaudio --python BlendFileDnaExporter_25.py
+        with options:  % blender2.5 --background -noaudio --python BlendFileDnaExporter_25.py -- --dna-keep-blend --dna-debug
 
 
index eb19b232b2bf5db3eec8e408efe0ae9f3cadf50e..1e0b3c2da0a8fc610a338a20bb50ca9ed2623fbd 100644 (file)
@@ -27,7 +27,7 @@ For HTML generation
 -------------------
 - Run this script from blenders root path once you have compiled blender
 
-    ./blender.bin --background --python doc/python_api/sphinx_doc_gen.py
+    ./blender.bin --background -noaudio --python doc/python_api/sphinx_doc_gen.py
 
   This will generate python files in doc/python_api/sphinx-in/
   providing ./blender.bin is or links to the blender executable
@@ -95,7 +95,7 @@ else:
     # for quick rebuilds
     """
 rm -rf /b/doc/python_api/sphinx-* && \
-./blender.bin --background --factory-startup --python  doc/python_api/sphinx_doc_gen.py && \
+./blender.bin --background -noaudio --factory-startup --python  doc/python_api/sphinx_doc_gen.py && \
 sphinx-build doc/python_api/sphinx-in doc/python_api/sphinx-out
 
     """
index 307476d9a924be0a53dc71676eb0e82343a4bb81..fad9bfbbf902a5627c4feccf5815fde2be8135c0 100755 (executable)
@@ -48,7 +48,7 @@ SPHINXBASE=doc/python_api
 
 if $DO_EXE_BLENDER ; then
        # dont delete existing docs, now partial updates are used for quick builds.
-       $BLENDER --background --factory-startup --python $SPHINXBASE/sphinx_doc_gen.py
+       $BLENDER --background -noaudio --factory-startup --python $SPHINXBASE/sphinx_doc_gen.py
 fi
 
 
index 27d10ce6dc8663181cad0ffc15564158b5da8155..7764164a9b026127e968a523b40ff81e8c88f734 100644 (file)
@@ -352,7 +352,7 @@ const float AUD_ChannelMapperReader::SURROUND71_ANGLES[] =
           0.0f * M_PI / 180.0f,
           0.0f * M_PI / 180.0f,
        -110.0f * M_PI / 180.0f,
-        110.0f * M_PI / 180.0f
+        110.0f * M_PI / 180.0f,
        -150.0f * M_PI / 180.0f,
         150.0f * M_PI / 180.0f
 };
index c8af1161530cbe0f9b2d39e5ed2bd9cf67c701ba..23d50c785089d5cb9e6fec834fca1d0538f959a7 100644 (file)
@@ -107,8 +107,14 @@ void AUD_SequencerReader::read(int& length, bool& eos, sample_t* buffer)
 
                        if(result < 0)
                        {
-                               handle = new AUD_SequencerHandle(entry, m_device);
-                               handles.push_front(handle);
+                               try
+                               {
+                                       handle = new AUD_SequencerHandle(entry, m_device);
+                                       handles.push_front(handle);
+                               }
+                               catch(AUD_Exception&)
+                               {
+                               }
                                eit++;
                        }
                        else if(result == 0)
index a23dd22f932331e17af05ae16c264c1b5363211e..05299525d67c564f1f16eb144c3846f3269bb1a4 100644 (file)
@@ -29,7 +29,7 @@
 
 /* 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 you're FFmpeg or disable it"
+#  error "FFmpeg 0.7 or newer is needed, Upgrade your FFmpeg or disable it"
 #endif
 /* end sanity check */
 
index dd399a7aa955222c8b3ee89364da489c3c8dac41..2b5e96a1bf79d8713f53f4bc85fcce289a3d0191 100644 (file)
@@ -466,8 +466,20 @@ typedef struct {
 typedef struct {
        /** The key code. */
        GHOST_TKey              key;
+
+       /* ascii / utf8: both should always be set when possible,
+        * - ascii may be '\0' however if the user presses a non ascii key
+        * - unicode may not be set if the system has no unicode support
+        *
+        * These values are intended to be used as follows.
+        * For text input use unicode when available, fallback to ascii.
+        * For areas where unicode is not needed, number input for example, always
+        * use ascii, unicode is ignored - campbell.
+        */
        /** The ascii code for the key event ('\0' if none). */
        char                    ascii;
+       /** The unicode character. if the length is 6, not NULL terminated if all 6 are set */
+       char                    utf8_buf[6];
 } GHOST_TEventKeyData;
 
 typedef struct {
index 3581cd86b200219cc10041bcaf1be244b2ee9fc2..a8fca1e8f2d98999b58a024c22cfc809a8386f5d 100644 (file)
@@ -55,6 +55,7 @@ public:
        {
                m_keyEventData.key = key;
                m_keyEventData.ascii = '\0';
+               m_keyEventData.utf8_buf[0]= '\0';
                m_data = &m_keyEventData;
        }
        
@@ -65,11 +66,13 @@ public:
         * @param key   The key code of the key.
         * @param ascii The ascii code for the key event.
         */
-       GHOST_EventKey(GHOST_TUns64 msec, GHOST_TEventType type, GHOST_IWindow* window, GHOST_TKey key, char ascii)
+       GHOST_EventKey(GHOST_TUns64 msec, GHOST_TEventType type, GHOST_IWindow* window, GHOST_TKey key, char ascii, const char utf8_buf[6])
                : GHOST_Event(msec, type, window)
        {
                m_keyEventData.key = key;
                m_keyEventData.ascii = ascii;
+               if (utf8_buf) memcpy(m_keyEventData.utf8_buf, utf8_buf, sizeof(m_keyEventData.utf8_buf));
+               else                 m_keyEventData.utf8_buf[0]= '\0';
                m_data = &m_keyEventData;
        }
                
index 02ff5c0f5598ab26e36cce10e71cac5c2a6e32d8..762966c9b9e43db3b9ea29e7d430cbee25b0a84d 100644 (file)
@@ -931,7 +931,7 @@ OSStatus GHOST_SystemCarbon::handleKeyEvent(EventRef event)
                                } else {
                                        type = GHOST_kEventKeyUp;
                                }
-                               pushEvent( new GHOST_EventKey( getMilliSeconds(), type, window, key, ascii) );
+                               pushEvent( new GHOST_EventKey( getMilliSeconds(), type, window, key, ascii, NULL) );
 //                     }
                        break;
        
index 303c2b24497df406d08ee3aa47f8d0325af20a80..9ec8dd0abad905a063920d2dca5f874ecc1e3ba9 100644 (file)
@@ -1654,8 +1654,12 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr)
                //printf("\nW failure for event 0x%x",[event type]);
                return GHOST_kFailure;
        }
+
+       char utf8_buf[6]= {'\0'};
+       ascii = 0;
        
        switch ([event type]) {
+
                case NSKeyDown:
                case NSKeyUp:
                        charsIgnoringModifiers = [event charactersIgnoringModifiers];
@@ -1667,28 +1671,30 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr)
                                keyCode = convertKey([event keyCode],0,
                                                                         [event type] == NSKeyDown?kUCKeyActionDown:kUCKeyActionUp);
 
-                               
+                       /* handling both unicode or ascii */
                        characters = [event characters];
-                       if ([characters length]>0) { //Check for dead keys
-                               //Convert characters to iso latin 1 encoding
-                               convertedCharacters = [characters dataUsingEncoding:NSISOLatin1StringEncoding];
-                               if ([convertedCharacters length]>0)
-                                       ascii =((char*)[convertedCharacters bytes])[0];
-                               else
-                                       ascii = 0; //Character not available in iso latin 1 encoding
+                       if ([characters length]>0) {
+                               convertedCharacters = [characters dataUsingEncoding:NSUTF8StringEncoding];
+                               
+                               for (int x = 0; x < [convertedCharacters length]; x++) {
+                                       utf8_buf[x] = ((char*)[convertedCharacters bytes])[x];
+                               }
+
+                               /* ascii is a subset of unicode */
+                               if ([convertedCharacters length] == 1) {
+                                       ascii = utf8_buf[0];
+                               }
                        }
-                       else
-                               ascii= 0;
-                       
+
                        if ((keyCode == GHOST_kKeyQ) && (m_modifierMask & NSCommandKeyMask))
                                break; //Cmd-Q is directly handled by Cocoa
 
                        if ([event type] == NSKeyDown) {
-                               pushEvent( new GHOST_EventKey([event timestamp]*1000, GHOST_kEventKeyDown, window, keyCode, ascii) );
-                               //printf("\nKey down rawCode=0x%x charsIgnoringModifiers=%c keyCode=%u ascii=%i %c",[event keyCode],[charsIgnoringModifiers length]>0?[charsIgnoringModifiers characterAtIndex:0]:' ',keyCode,ascii,ascii);
+                               pushEvent( new GHOST_EventKey([event timestamp]*1000, GHOST_kEventKeyDown, window, keyCode, ascii, utf8_buf) );
+                               //printf("Key down rawCode=0x%x charsIgnoringModifiers=%c keyCode=%u ascii=%i %c utf8=%s\n",[event keyCode],[charsIgnoringModifiers length]>0?[charsIgnoringModifiers characterAtIndex:0]:' ',keyCode,ascii,ascii, utf8_buf);
                        } else {
-                               pushEvent( new GHOST_EventKey([event timestamp]*1000, GHOST_kEventKeyUp, window, keyCode, ascii) );
-                               //printf("\nKey up rawCode=0x%x charsIgnoringModifiers=%c keyCode=%u ascii=%i %c",[event keyCode],[charsIgnoringModifiers length]>0?[charsIgnoringModifiers characterAtIndex:0]:' ',keyCode,ascii,ascii);
+                               pushEvent( new GHOST_EventKey([event timestamp]*1000, GHOST_kEventKeyUp, window, keyCode, 0, '\0') );
+                               //printf("Key up rawCode=0x%x charsIgnoringModifiers=%c keyCode=%u ascii=%i %c utf8=%s\n",[event keyCode],[charsIgnoringModifiers length]>0?[charsIgnoringModifiers characterAtIndex:0]:' ',keyCode,ascii,ascii, utf8_buf);
                        }
                        break;
        
index f2cc45731fa0c5a7b2dbed0910bc9bbf71d07e8c..11bd562f7674537edfa35e93d6857c9ef98d4c78 100644 (file)
@@ -441,7 +441,7 @@ GHOST_SystemSDL::processEvent(SDL_Event *sdl_event)
                                }
                        }
 
-                       g_event= new GHOST_EventKey(getMilliSeconds(), type, window, gkey, sym);
+                       g_event= new GHOST_EventKey(getMilliSeconds(), type, window, gkey, sym, NULL);
                }
                break;
        }
index 38f3985b13931a97e73d2308982f8bb93bb0971d..956a159a4ec0e4b5502937da624a90c42eb94501 100644 (file)
@@ -712,20 +712,23 @@ GHOST_EventKey* GHOST_SystemWin32::processKeyEvent(GHOST_IWindow *window, RAWINP
        GHOST_SystemWin32 * system = (GHOST_SystemWin32 *)getSystem();
        GHOST_TKey key = system->hardKey(window, raw, &keyDown, &vk);
        GHOST_EventKey* event;
+
        if (key != GHOST_kKeyUnknown) {
-               char ascii = '\0';
+               char utf8_char[6] = {0} ;
 
-               unsigned short utf16[2]={0};
+               wchar_t utf16[2]={0};
                BYTE state[256];
-               GetKeyboardState((PBYTE)state);
+               GetKeyboardState((PBYTE)state);  
 
-               if(ToAsciiEx(vk, 0, state, utf16, 0, system->m_keylayout))
-                               WideCharToMultiByte(CP_ACP, 0x00000400, 
+               if(ToUnicodeEx(vk, 0, state, utf16, 2, 0, system->m_keylayout))
+                       WideCharToMultiByte(CP_UTF8, 0, 
                                                                        (wchar_t*)utf16, 1,
-                                                                       (LPSTR) &ascii, 1,
-                                                                       NULL,NULL);
+                                                                       (LPSTR) utf8_char, 5,
+                                                                       NULL,NULL); else *utf8_char = 0;
 
-               event = new GHOST_EventKey(system->getMilliSeconds(), keyDown ? GHOST_kEventKeyDown: GHOST_kEventKeyUp, window, key, ascii);
+               if(!keyDown) utf8_char[0] = '\0';
+               
+               event = new GHOST_EventKey(system->getMilliSeconds(), keyDown ? GHOST_kEventKeyDown: GHOST_kEventKeyUp, window, key, (*utf8_char & 0x80)?'?':*utf8_char, utf8_char);
                
 #ifdef GHOST_DEBUG
                std::cout << ascii << std::endl;
index 27a61cf57fcee2e2d35441880b221ee4af952109..209ffe501f4f29a2f4fcb0c7d6a8f526217473ba 100644 (file)
@@ -89,6 +89,11 @@ GHOST_SystemX11(
                abort(); //was return before, but this would just mean it will crash later
        }
 
+       /* Open a connection to the X input manager */
+#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
+       m_xim = XOpenIM(m_display, NULL, (char *)GHOST_X11_RES_NAME, (char *)GHOST_X11_RES_CLASS);
+#endif
+
        m_delete_window_atom 
          = XInternAtom(m_display, "WM_DELETE_WINDOW", True);
 
@@ -141,6 +146,10 @@ GHOST_SystemX11(
 GHOST_SystemX11::
 ~GHOST_SystemX11()
 {
+#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
+       XCloseIM(m_xim);
+#endif
+
        XCloseDisplay(m_display);
 }
 
@@ -500,9 +509,9 @@ GHOST_SystemX11::processEvent(XEvent *xe)
                case KeyRelease:
                {
                        XKeyEvent *xke = &(xe->xkey);
-               
                        KeySym key_sym = XLookupKeysym(xke,0);
                        char ascii;
+                       char utf8_buf[6]; /* 6 is enough for a utf8 char */
                        
                        GHOST_TKey gkey = convertXKey(key_sym);
                        GHOST_TEventType type = (xke->type == KeyPress) ? 
@@ -512,13 +521,55 @@ GHOST_SystemX11::processEvent(XEvent *xe)
                                ascii = '\0';
                        }
                        
+#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
+                       /* getting unicode on key-up events gives XLookupNone status */
+                       if (xke->type == KeyPress) {
+                               Status status;
+                               int len;
+
+                               /* use utf8 because its not locale depentant, from xorg docs */
+                               if (!(len= Xutf8LookupString(window->getX11_XIC(), xke, utf8_buf, sizeof(utf8_buf), &key_sym, &status))) {
+                                       utf8_buf[0]= '\0';
+                               }
+
+                               if ((status == XLookupChars || status == XLookupBoth)) {
+                                       if ((unsigned char)utf8_buf[0] >= 32) { /* not an ascii control character */
+                                               /* do nothing for now, this is valid utf8 */
+                                       }
+                                       else {
+                                               utf8_buf[0]= '\0';
+                                       }
+                               }
+                               else if (status == XLookupKeySym) {
+                                       /* this key doesn't have a text representation, it is a command
+                                          key of some sort */;
+                               }
+                               else {
+                                       printf("Bad keycode lookup. Keysym 0x%x Status: %s\n",
+                                                         (unsigned int) key_sym,
+                                                         (status == XBufferOverflow ? "BufferOverflow" :
+                                                          status == XLookupNone ? "XLookupNone" :
+                                                          status == XLookupKeySym ? "XLookupKeySym" :
+                                                          "Unknown status"));
+
+                                       printf("'%.*s' %p %p\n", len, utf8_buf, window->getX11_XIC(), m_xim);
+                               }
+                       }
+                       else {
+                               utf8_buf[0]= '\0';
+                       }
+#else
+                       utf8_buf[0]= '\0';
+#endif
+
                        g_event = new
                        GHOST_EventKey(
                                getMilliSeconds(),
                                type,
                                window,
                                gkey,
-                               ascii
+                               ascii,
+                           utf8_buf
                        );
                        
                break;
index b43d955d1568f28f8f9ef4e0615152aabb4fdef1..af45d68450fa26acfc07440b0042d1b234da688c 100644 (file)
 #include "GHOST_System.h"
 #include "../GHOST_Types.h"
 
+#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
+#  define GHOST_X11_RES_NAME  "Blender" /* res_name */
+#  define GHOST_X11_RES_CLASS "Blender" /* res_class */
+#endif
+
+
 class GHOST_WindowX11;
 
 /**
@@ -203,6 +209,14 @@ public:
                return m_display;
        }       
 
+#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
+               XIM
+       getX11_XIM(
+       ) {
+               return m_xim;
+       }
+#endif
+
        /* Helped function for get data from the clipboard. */
        void getClipboard_xcout(XEvent evt, Atom sel, Atom target,
                         unsigned char **txt, unsigned long *len,
@@ -258,6 +272,9 @@ public:
 private :
 
        Display * m_display;
+#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
+       XIM m_xim;
+#endif
 
        /// The vector of windows that need to be updated.
        std::vector<GHOST_WindowX11 *> m_dirty_windows;
index 160980b633168939788cf36567e4962ed80d9ae2..d26224d956ab5884691d91b85d94ab8f106231e5 100644 (file)
@@ -392,6 +392,13 @@ GHOST_WindowX11(
                }
        }
 
+#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
+       m_xic = XCreateIC(m_system->getX11_XIM(), XNClientWindow, m_window, XNFocusWindow, m_window,
+                         XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
+                         XNResourceName, GHOST_X11_RES_NAME, XNResourceClass,
+                         GHOST_X11_RES_CLASS, NULL);
+#endif
+
        // Set the window icon
        XWMHints *xwmhints = XAllocWMHints();
        XImage *x_image, *mask_image;
@@ -1304,6 +1311,13 @@ GHOST_WindowX11::
                XSetSelectionOwner(m_display, Clipboard_atom, None, CurrentTime);
        }
        
+#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
+       if (m_xic) {
+               XDestroyIC(m_xic);
+       }
+#endif
+
+
        XDestroyWindow(m_display, m_window);
        XFree(m_visual);
 }
index 2cb269ea91976cf58a99ce2b2c394f430b35ca01..ee662945eaab4ef532a3d4d502a30c23e5b5c9dd 100644 (file)
@@ -221,6 +221,10 @@ public:
        { return NULL; }
 #endif // WITH_X11_XINPUT
 
+#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
+       XIC getX11_XIC() { return m_xic; }
+#endif
+
        /*
         * Need this in case that we want start the window
         * in FullScree or Maximized state.
@@ -363,6 +367,10 @@ private :
        XTablet m_xtablet;
 #endif
 
+#if defined(WITH_X11_XINPUT) && defined(X_HAVE_UTF8_STRING)
+       XIC m_xic;
+#endif
+
        void icccmSetState(int state);
        int icccmGetState() const;
 
index 00939e907d669dba5ebabacd39263255fe699e03..1ba28d21808704931042f0cf93d0574eda899f3e 100644 (file)
@@ -50,9 +50,8 @@
    extern int datatoc_bfont_ttf_size;
    extern char datatoc_bfont_ttf[];
 
-   // XXX, bad, but BLI uses these
-   char bprogname[160]= "";
-char U[1024]= {0};
+   /* cheat */
+   char U[1024]= {0};
 #endif
 
 #include "Util.h"
index 50d69cfd8dd421701f7710f991fce58509bf452d..ee3c4f2253680d1b550001335f71d999efdbc451 100644 (file)
  * the Standard Template Library but without the painful get()
  * semantics to access the internal c style pointer.
  *
- * It is often useful to explicitely decalre ownership of memory
+ * It is often useful to explicitly declare ownership of memory
  * allocated on the heap within class or function scope. This
  * class helps you to encapsulate this ownership within a value
  * type. When an instance of this class goes out of scope it
  * makes sure that any memory associated with it's internal pointer
  * is deleted. It can help to inform users of an aggregate class
  * that it owns instances of it's members and these instances 
- * should not be shared. This is not reliably enforcable in C++
+ * should not be shared. This is not reliably enforceable in C++
  * but this class attempts to make the 1-1 relationship clear.
  * 
  * @section Example usage
index cadcb7194e81a991fe34a6763373a98248bf5845..6e634ae5ee35ae951dc73257bce7944a17ac1674 100644 (file)
@@ -16,7 +16,7 @@ This means when string "some message id" is used as operator name, tooltip, menu
 and so it'll be displayed on the screen as "translation for this message".
 Pretty simple.
 
-This source files are pre-compiled into ../release/bin/.blender/locale/<language>/LC_MESSAGES/blender.mo,
+This source files are pre-compiled into ../release/datafiles/locale/<language>/LC_MESSAGES/blender.mo,
 so they aren't getting compiled every time Blender is compiling to save some time and prevent
 failure on systems which don't have needed tools for compiling .po files.
 
index 33b7baaed693a2ce26310c8f67724e12d3022e88..a0173b2d0598f008f6b5a1cdfdceb8dc49b733a9 100755 (executable)
@@ -30,7 +30,7 @@ import sys
 GETTEXT_MSGFMT_EXECUTABLE = "msgfmt"
 CURRENT_DIR = os.path.abspath(os.path.dirname(__file__))
 SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.join(CURRENT_DIR, "..")))
-LOCALE_DIR = os.path.join(SOURCE_DIR, "release", "bin", ".blender", "locale")
+LOCALE_DIR = os.path.join(SOURCE_DIR, "release", "datafiles", "locale")
 
 DOMAIN = "blender"
 
diff --git a/release/bin/.blender/.bfont.ttf b/release/bin/.blender/.bfont.ttf
deleted file mode 100644 (file)
index 58cd6b5..0000000
Binary files a/release/bin/.blender/.bfont.ttf and /dev/null differ
index 20f8d0cf16d3901f0ac6809cf903264a8550b6f9..5de3f868d1a2b4198be3231196815908d70abe74 100644 (file)
Binary files a/release/datafiles/splash.png and b/release/datafiles/splash.png differ
index cee0712e814576de36892fb9d58c1df20cf3373f..088e239e9a54d097a7cad66477eebf2a520be085 100644 (file)
@@ -16,7 +16,7 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
-# <pep8 compliant>
+# <pep8-80 compliant>
 
 from _bpy import types as bpy_types
 import _bpy
@@ -34,7 +34,8 @@ class Context(StructRNA):
     def copy(self):
         from types import BuiltinMethodType
         new_context = {}
-        generic_attrs = list(StructRNA.__dict__.keys()) + ["bl_rna", "rna_type", "copy"]
+        generic_attrs = (list(StructRNA.__dict__.keys()) +
+                         ["bl_rna", "rna_type", "copy"])
         for attr in dir(self):
             if not (attr.startswith("_") or attr in generic_attrs):
                 value = getattr(self, attr)
@@ -52,14 +53,19 @@ class Library(bpy_types.ID):
         """ID data blocks which use this library"""
         import bpy
 
-        # See: readblenentry.c, IDTYPE_FLAGS_ISLINKABLE, we could make this an attribute in rna.
-        attr_links = "actions", "armatures", "brushes", "cameras", \
-                "curves", "grease_pencil", "groups", "images", \
-                "lamps", "lattices", "materials", "metaballs", \
-                "meshes", "node_groups", "objects", "scenes", \
-                "sounds", "speakers", "textures", "texts", "fonts", "worlds"
+        # See: readblenentry.c, IDTYPE_FLAGS_ISLINKABLE,
+        # we could make this an attribute in rna.
+        attr_links = ("actions", "armatures", "brushes", "cameras",
+                      "curves", "grease_pencil", "groups", "images",
+                      "lamps", "lattices", "materials", "metaballs",
+                      "meshes", "node_groups", "objects", "scenes",
+                      "sounds", "speakers", "textures", "texts",
+                      "fonts", "worlds")
 
-        return tuple(id_block for attr in attr_links for id_block in getattr(bpy.data, attr) if id_block.library == self)
+        return tuple(id_block
+                     for attr in attr_links
+                     for id_block in getattr(bpy.data, attr)
+                     if id_block.library == self)
 
 
 class Texture(bpy_types.ID):
@@ -69,13 +75,21 @@ class Texture(bpy_types.ID):
     def users_material(self):
         """Materials that use this texture"""
         import bpy
-        return tuple(mat for mat in bpy.data.materials if self in [slot.texture for slot in mat.texture_slots if slot])
+        return tuple(mat for mat in bpy.data.materials
+                     if self in [slot.texture
+                                 for slot in mat.texture_slots
+                                 if slot]
+                     )
 
     @property
     def users_object_modifier(self):
         """Object modifiers that use this texture"""
         import bpy
-        return tuple(obj for obj in bpy.data.objects if self in [mod.texture for mod in obj.modifiers if mod.type == 'DISPLACE'])
+        return tuple(obj for obj in bpy.data.objects if
+                     self in [mod.texture
+                              for mod in obj.modifiers
+                              if mod.type == 'DISPLACE']
+                     )
 
 
 class Group(bpy_types.ID):
@@ -85,7 +99,8 @@ class Group(bpy_types.ID):
     def users_dupli_group(self):
         """The dupli group this group is used in"""
         import bpy
-        return tuple(obj for obj in bpy.data.objects if self == obj.dupli_group)
+        return tuple(obj for obj in bpy.data.objects
+                     if self == obj.dupli_group)
 
 
 class Object(bpy_types.ID):
@@ -95,19 +110,22 @@ class Object(bpy_types.ID):
     def children(self):
         """All the children of this object"""
         import bpy
-        return tuple(child for child in bpy.data.objects if child.parent == self)
+        return tuple(child for child in bpy.data.objects
+                     if child.parent == self)
 
     @property
     def users_group(self):
         """The groups this object is in"""
         import bpy
-        return tuple(group for group in bpy.data.groups if self in group.objects[:])
+        return tuple(group for group in bpy.data.groups
+                     if self in group.objects[:])
 
     @property
     def users_scene(self):
         """The scenes this object is in"""
         import bpy
-        return tuple(scene for scene in bpy.data.scenes if self in scene.objects[:])
+        return tuple(scene for scene in bpy.data.scenes
+                     if self in scene.objects[:])
 
 
 class _GenericBone:
@@ -118,13 +136,14 @@ class _GenericBone:
     __slots__ = ()
 
     def translate(self, vec):
-        """Utility function to add *vec* to the head and tail of this bone."""
+        """Utility function to add *vec* to the head and tail of this bone"""
         self.head += vec
         self.tail += vec
 
     def parent_index(self, parent_test):
         """
-        The same as 'bone in other_bone.parent_recursive' but saved generating a list.
+        The same as 'bone in other_bone.parent_recursive'
+        but saved generating a list.
         """
         # use the name so different types can be tested.
         name = parent_test.name
@@ -187,7 +206,9 @@ class _GenericBone:
 
     @property
     def length(self):
-        """The distance from head to tail, when set the head is moved to fit the length."""
+        """ The distance from head to tail,
+            when set the head is moved to fit the length.
+        """
         return self.vector.length
 
     @length.setter
@@ -196,7 +217,9 @@ class _GenericBone:
 
     @property
     def vector(self):
-        """The direction this bone is pointing. Utility function for (tail - head)"""
+        """ The direction this bone is pointing.
+            Utility function for (tail - head)
+        """
         return (self.tail - self.head)
 
     @property
@@ -222,7 +245,8 @@ class _GenericBone:
         """
         Returns a chain of children with the same base name as this bone.
         Only direct chains are supported, forks caused by multiple children
-        with matching base names will terminate the function and not be returned.
+        with matching base names will terminate the function
+        and not be returned.
         """
         basename = self.basename
         chain = []
@@ -241,7 +265,9 @@ class _GenericBone:
                 chain.append(child)
             else:
                 if len(children_basename):
-                    print("multiple basenames found, this is probably not what you want!", self.name, children_basename)
+                    print("multiple basenames found, "
+                          "this is probably not what you want!",
+                          self.name, children_basename)
 
                 break
 
@@ -284,13 +310,18 @@ class EditBone(StructRNA, _GenericBone, metaclass=StructMetaPropGroup):
 
     def transform(self, matrix, scale=True, roll=True):
         """
-        Transform the the bones head, tail, roll and envelope (when the matrix has a scale component).
+        Transform the the bones head, tail, roll and envelope
+        (when the matrix has a scale component).
 
         :arg matrix: 3x3 or 4x4 transformation matrix.
         :type matrix: :class:`mathutils.Matrix`
         :arg scale: Scale the bone envelope by the matrix.
         :type scale: bool
-        :arg roll: Correct the roll to point in the same relative direction to the head and tail.
+        :arg roll:
+
+           Correct the roll to point in the same relative
+           direction to the head and tail.
+
         :type roll: bool
         """
         from mathutils import Vector
@@ -321,11 +352,23 @@ class Mesh(bpy_types.ID):
         Make a mesh from a list of vertices/edges/faces
         Until we have a nicer way to make geometry, use this.
 
-        :arg vertices: float triplets each representing (X, Y, Z) eg: [(0.0, 1.0, 0.5), ...].
+        :arg vertices:
+
+           float triplets each representing (X, Y, Z)
+           eg: [(0.0, 1.0, 0.5), ...].
+
         :type vertices: iterable object
-        :arg edges: int pairs, each pair contains two indices to the *vertices* argument. eg: [(1, 2), ...]
+        :arg edges:
+
+           int pairs, each pair contains two indices to the
+           *vertices* argument. eg: [(1, 2), ...]
+
         :type edges: iterable object
-        :arg faces: iterator of faces, each faces contains three or four indices to the *vertices* argument. eg: [(5, 6, 8, 9), (1, 2, 3), ...]
+        :arg faces:
+
+           iterator of faces, each faces contains three or four indices to
+           the *vertices* argument. eg: [(5, 6, 8, 9), (1, 2, 3), ...]
+
         :type faces: iterable object
         """
         self.vertices.add(len(vertices))
@@ -419,7 +462,10 @@ class Text(bpy_types.ID):
     def users_logic(self):
         """Logic bricks that use this text"""
         import bpy
-        return tuple(obj for obj in bpy.data.objects if self in [cont.text for cont in obj.game.controllers if cont.type == 'PYTHON'])
+        return tuple(obj for obj in bpy.data.objects
+                     if self in [cont.text for cont in obj.game.controllers
+                                 if cont.type == 'PYTHON']
+                     )
 
 # values are module: [(cls, path, line), ...]
 TypeMap = {}
@@ -510,10 +556,11 @@ class Operator(StructRNA, metaclass=OrderedMeta):
         return super().__delattr__(attr)
 
     def as_keywords(self, ignore=()):
-        """ Return a copy of the properties as a dictionary.
-        """
+        """Return a copy of the properties as a dictionary"""
         ignore = ignore + ("rna_type",)
-        return {attr: getattr(self, attr) for attr in self.properties.rna_type.properties.keys() if attr not in ignore}
+        return {attr: getattr(self, attr)
+                for attr in self.properties.rna_type.properties.keys()
+                if attr not in ignore}
 
 
 class Macro(StructRNA, metaclass=OrderedMeta):
@@ -553,7 +600,8 @@ class _GenericUI:
                 operator_context_default = self.layout.operator_context
 
                 for func in draw_ls._draw_funcs:
-                    # so bad menu functions don't stop the entire menu from drawing
+                    # so bad menu functions don't stop
+                    # the entire menu from drawing
                     try:
                         func(self, context)
                     except:
@@ -569,13 +617,19 @@ class _GenericUI:
 
     @classmethod
     def append(cls, draw_func):
-        """Append a draw function to this menu, takes the same arguments as the menus draw function."""
+        """
+        Append a draw function to this menu,
+        takes the same arguments as the menus draw function
+        """
         draw_funcs = cls._dyn_ui_initialize()
         draw_funcs.append(draw_func)
 
     @classmethod
     def prepend(cls, draw_func):
-        """Prepend a draw function to this menu, takes the same arguments as the menus draw function."""
+        """
+        Prepend a draw function to this menu, takes the same arguments as
+        the menus draw function
+        """
         draw_funcs = cls._dyn_ui_initialize()
         draw_funcs.insert(0, draw_func)
 
@@ -615,7 +669,8 @@ class Menu(StructRNA, _GenericUI, metaclass=RNAMeta):
         # collect paths
         files = []
         for directory in searchpaths:
-            files.extend([(f, os.path.join(directory, f)) for f in os.listdir(directory)])
+            files.extend([(f, os.path.join(directory, f))
+                           for f in os.listdir(directory)])
 
         files.sort()
 
@@ -635,9 +690,11 @@ class Menu(StructRNA, _GenericUI, metaclass=RNAMeta):
                 props.menu_idname = self.bl_idname
 
     def draw_preset(self, context):
-        """Define these on the subclass
-         - preset_operator
-         - preset_subdir
+        """
+        Define these on the subclass
+        - preset_operator
+        - preset_subdir
         """
         import bpy
-        self.path_menu(bpy.utils.preset_paths(self.preset_subdir), self.preset_operator)
+        self.path_menu(bpy.utils.preset_paths(self.preset_subdir),
+                       self.preset_operator)
index f11ccf84f0b2cc40664a8284c2af63eb52699de5..6c49283b3e1a6dfba68f1103954864ba8a80b9e1 100644 (file)
 #
 # ##### END GPL LICENSE BLOCK #####
 
-# <pep8 compliant>
+# <pep8-80 compliant>
 import sys
 import bpy
 
-language_id = 'python'
+language_id = "python"
 
 # store our own __main__ module, not 100% needed
 # but python expects this in some places
@@ -28,8 +28,8 @@ _BPY_MAIN_OWN = True
 
 
 def add_scrollback(text, text_type):
-    for l in text.split('\n'):
-        bpy.ops.console.scrollback_append(text=l.replace('\t', '    '),
+    for l in text.split("\n"):
+        bpy.ops.console.scrollback_append(text=l.replace("\t", "    "),
             type=text_type)
 
 
@@ -81,7 +81,8 @@ def get_console(console_id):
         console, stdout, stderr = console_data
 
         # XXX, bug in python 3.1.2, 3.2 ? (worked in 3.1.1)
-        # seems there is no way to clear StringIO objects for writing, have to make new ones each time.
+        # seems there is no way to clear StringIO objects for writing, have to
+        # make new ones each time.
         import io
         stdout = io.StringIO()
         stderr = io.StringIO()
@@ -99,7 +100,8 @@ def get_console(console_id):
 
         replace_help(namespace)
 
-        console = InteractiveConsole(locals=namespace, filename="<blender_console>")
+        console = InteractiveConsole(locals=namespace,
+                                     filename="<blender_console>")
 
         console.push("from mathutils import *")
         console.push("from math import *")
@@ -265,7 +267,8 @@ def autocomplete(context):
 
     # Separate autocomplete output by command prompts
     if scrollback != '':
-        bpy.ops.console.scrollback_append(text=sc.prompt + current_line.body, type='INPUT')
+        bpy.ops.console.scrollback_append(text=sc.prompt + current_line.body,
+                                          type='INPUT')
 
     # Now we need to copy back the line from blender back into the
     # text editor. This will change when we don't use the text editor
@@ -296,10 +299,15 @@ def banner(context):
     add_scrollback("Execute:             Enter", 'OUTPUT')
     add_scrollback("Autocomplete:        Ctrl+Space", 'OUTPUT')
     add_scrollback("Ctrl +/-  Wheel:     Zoom", 'OUTPUT')
-    add_scrollback("Builtin Modules:     bpy, bpy.data, bpy.ops, bpy.props, bpy.types, bpy.context, bpy.utils, bgl, blf, mathutils", 'OUTPUT')
-    add_scrollback("Convenience Imports: from mathutils import *; from math import *", 'OUTPUT')
+    add_scrollback("Builtin Modules:     bpy, bpy.data, bpy.ops, "
+                   "bpy.props, bpy.types, bpy.context, bpy.utils, "
+                   "bgl, blf, mathutils",
+                   'OUTPUT')
+    add_scrollback("Convenience Imports: from mathutils import *; "
+                   "from math import *", 'OUTPUT')
     add_scrollback("", 'OUTPUT')
-    # add_scrollback("  WARNING!!! Blender 2.5 API is subject to change, see API reference for more info", 'ERROR')
+    # add_scrollback("  WARNING!!! Blender 2.5 API is subject to change, "
+    #                "see API reference for more info", 'ERROR')
     # add_scrollback("", 'OUTPUT')
     sc.prompt = PROMPT
 
index 3b6ce13d7e0b304157d75385eebc2483795ca5c2..c5454e479a30a0924f7e818d5197d3c287df508b 100644 (file)
@@ -9,5 +9,5 @@ bpy.context.user_preferences.edit.use_insertkey_xyz_to_rgb = False
 bpy.context.user_preferences.inputs.select_mouse = 'RIGHT'
 bpy.context.user_preferences.inputs.view_zoom_method = 'DOLLY'
 bpy.context.user_preferences.inputs.view_zoom_axis = 'VERTICAL'
-bpy.context.user_preferences.inputs.view_rotate_method = 'TRACKBALL'
+bpy.context.user_preferences.inputs.view_rotate_method = 'TURNTABLE'
 bpy.context.user_preferences.inputs.invert_mouse_zoom = False
index 3051914cf006dd0590944214a1434aff4581a14c..e1d33198142920943646cc502fc0193b8658e63e 100644 (file)
@@ -228,7 +228,7 @@ class BakeAction(Operator):
 
 class ClearUselessActions(Operator):
     """Mark actions with no F-Curves for deletion after save+reload of """ \
-    """file preserving "action libraries"""
+    """file preserving \"action libraries\""""
     bl_idname = "anim.clear_useless_actions"
     bl_label = "Clear Useless Actions"
     bl_options = {'REGISTER', 'UNDO'}
index 51c530db672a110d1a298976a0fb6ea10c46c6f3..738cc7b24e00047f406e418871c41d5a1f27f89b 100644 (file)
@@ -122,7 +122,7 @@ class SelectCamera(Operator):
 
 
 class SelectHierarchy(Operator):
-    '''Select object relative to the active objects position''' \
+    '''Select object relative to the active object's position''' \
     '''in the hierarchy'''
     bl_idname = "object.select_hierarchy"
     bl_label = "Select Hierarchy"
index 2fd0c4a9e12195a7648a305cc7961d0d0fe47594..2e42105fbf0032f01e5bdb6ea70b2c78d221875a 100644 (file)
@@ -142,7 +142,7 @@ class AddPresetBase():
 
 
 class ExecutePreset(Operator):
-    ''' Executes a preset '''
+    '''Execute a preset'''
     bl_idname = "script.execute_preset"
     bl_label = "Execute a Python Preset"
 
index 3479a3f9e53e4100b6937c532bb1cb96ffc8d5ee..5ee7cf86142bc02c38a3a68a2093133b82ca23ed 100644 (file)
@@ -66,7 +66,7 @@ def guess_player_path(preset):
 
 
 class PlayRenderedAnim(Operator):
-    '''Plays back rendered frames/movies using an external player'''
+    '''Play back rendered frames/movies using an external player'''
     bl_idname = "render.play_rendered_anim"
     bl_label = "Play Rendered Animation"
     bl_options = {'REGISTER'}
index ce4942ae2380c968f1fa21053bc6a188df4130d3..5fb5c7f39cfb31760a76175ce3ddc76f58a0ac58 100644 (file)
@@ -159,7 +159,7 @@ class VertexPaintDirt(Operator):
             )
     blur_iterations = IntProperty(
             name="Blur Iterations",
-            description="Number times to blur the colors. (higher blurs more)",
+            description="Number times to blur the colors (higher blurs more)",
             min=0, max=40,
             default=1,
             )
index ff19ece8f94a773a9047c931e0c889e09d0bf2e9..425b7a601c8190bf02876e8d22612d6ebb48b299 100644 (file)
@@ -51,8 +51,7 @@ class MESH_MT_shape_key_specials(Menu):
         layout.operator("object.shape_key_transfer", icon='COPY_ID')  # icon is not ideal
         layout.operator("object.join_shapes", icon='COPY_ID')  # icon is not ideal
         layout.operator("object.shape_key_mirror", icon='ARROW_LEFTRIGHT')
-        op = layout.operator("object.shape_key_add", icon='ZOOMIN', text="New Shape From Mix")
-        op.from_mix = True
+        layout.operator("object.shape_key_add", icon='ZOOMIN', text="New Shape From Mix").from_mix = True
 
 
 class MeshButtonsPanel():
@@ -207,8 +206,7 @@ class DATA_PT_shape_keys(MeshButtonsPanel, Panel):
         col = row.column()
 
         sub = col.column(align=True)
-        op = sub.operator("object.shape_key_add", icon='ZOOMIN', text="")
-        op.from_mix = False
+        sub.operator("object.shape_key_add", icon='ZOOMIN', text="").from_mix = False
         sub.operator("object.shape_key_remove", icon='ZOOMOUT', text="")
         sub.menu("MESH_MT_shape_key_specials", icon='DOWNARROW_HLT', text="")
 
index 62261af729f81be0807ac8738a301574c5c5eddd..e4b152834fc809de7a2296a9d13df985788db690 100644 (file)
@@ -665,7 +665,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
         split = layout.split()
         col = split.column()
         col.label(text="Texture:")
-        col.prop(md, "texture", text="")
+        col.template_ID(md, "texture", new="texture.new")
 
         col = split.column()
         col.label(text="Texture Coordinates:")
index f07559625804bddc3f4cd8dd0d56c4833bcfcae4..2229b9dc3dab244bc5f8ec0656eebb8d99541724 100644 (file)
@@ -61,6 +61,10 @@ class PHYSICS_PT_field(PhysicButtonsPanel, Panel):
             split = layout.split(percentage=0.2)
             split.label(text="Shape:")
             split.prop(field, "shape", text="")
+        elif field.type == 'TEXTURE':
+            split = layout.split(percentage=0.2)
+            split.label(text="Texture:")
+            split.row().template_ID(field, "texture", new="texture.new")
 
         split = layout.split()
 
@@ -103,7 +107,6 @@ class PHYSICS_PT_field(PhysicButtonsPanel, Panel):
         elif field.type == 'TEXTURE':
             col = split.column()
             col.prop(field, "strength")
-            col.prop(field, "texture", text="")
             col.prop(field, "texture_mode", text="")
             col.prop(field, "texture_nabla")
 
index 167cead9a3bb5912ab76dab56d49bff7887e4967..d3859a78bea35c00ee4e291681f0b6927a051c75 100644 (file)
@@ -115,8 +115,7 @@ class SCENE_PT_keying_sets(SceneButtonsPanel, Panel):
 
             subcol = col.column()
             subcol.operator_context = 'INVOKE_DEFAULT'
-            op = subcol.operator("anim.keying_set_export", text="Export to File")
-            op.filepath = "keyingset.py"
+            subcol.operator("anim.keying_set_export", text="Export to File").filepath = "keyingset.py"
 
             col = row.column()
             col.label(text="Keyframing Settings:")
index 051854a28f1f8c4dc33df5be15634740c3f3cbd9..50db989a2e20fd6f9a0d538b7a9e52f96c8291d7 100644 (file)
@@ -157,24 +157,24 @@ class IMAGE_MT_image_invert(Menu):
     def draw(self, context):
         layout = self.layout
 
-        op = layout.operator("image.invert", text="Invert Image Colors")
-        op.invert_r = True
-        op.invert_g = True
-        op.invert_b = True
+        props = layout.operator("image.invert", text="Invert Image Colors")
+        props.invert_r = True
+        props.invert_g = True
+        props.invert_b = True
 
         layout.separator()
 
-        op = layout.operator("image.invert", text="Invert Red Channel")
-        op.invert_r = True
+        props = layout.operator("image.invert", text="Invert Red Channel")
+        props.invert_r = True
 
-        op = layout.operator("image.invert", text="Invert Green Channel")
-        op.invert_g = True
+        props = layout.operator("image.invert", text="Invert Green Channel")
+        props.invert_g = True
 
-        op = layout.operator("image.invert", text="Invert Blue Channel")
-        op.invert_b = True
+        props = layout.operator("image.invert", text="Invert Blue Channel")
+        props.invert_b = True
 
-        op = layout.operator("image.invert", text="Invert Alpha Channel")
-        op.invert_a = True
+        props = layout.operator("image.invert", text="Invert Alpha Channel")
+        props.invert_a = True
 
 
 class IMAGE_MT_uvs_showhide(Menu):
index 2c537efa61bbc4660012c2e557cdd481678be4b6..5e5ce462da9cfcbafa0cef062cc1abda58e6330b 100644 (file)
@@ -164,11 +164,9 @@ class InputKeyMapPanel:
             row.label()
 
         if (not kmi.is_user_defined) and kmi.is_user_modified:
-            op = row.operator("wm.keyitem_restore", text="", icon='BACK')
-            op.item_id = kmi.id
+            row.operator("wm.keyitem_restore", text="", icon='BACK').item_id = kmi.id
         else:
-            op = row.operator("wm.keyitem_remove", text="", icon='X')
-            op.item_id = kmi.id
+            row.operator("wm.keyitem_remove", text="", icon='X').item_id = kmi.id
 
         # Expanded, additional event settings
         if kmi.show_expanded:
index 7b905f9c6fcc1bf3df9d87c5e819a4ef4f9b3909..c0a2e671ab57db4bc27a9b62a006fae88730fe67 100644 (file)
@@ -54,11 +54,10 @@ class VIEW3D_HT_header(Header):
             else:
                 sub.menu("VIEW3D_MT_object")
 
-        
         # Contains buttons like Mode, Pivot, Manipulator, Layer, Mesh Select Mode...
-        layout.template_header_3D()
-        
-        row = layout.row()
+        row = layout.row()  # XXX Narrowed down vert/edge/face selector in edit mode/solid drawmode. -DingTo
+        row.template_header_3D()
+
         if obj:
             # Particle edit
             if obj.mode == 'PARTICLE_EDIT':
index db9d4fb4678ecbb690deb214fe46e62301b6d84a..1c6af0e574ffff717223abc2b036af99554ee7ba 100644 (file)
@@ -16,6 +16,7 @@ def invert(f):
 
 uuid_store = {}
 
+
 def slow_value(value, fac, uuid):
     """ Delay the value by a factor, use a unique string to allow
         use in multiple drivers without conflict:
index 1c36f3e150475e6a598139860bd618b14536df79..707cd17e0b351750adc69048890cd7b05d179a36 100644 (file)
@@ -60,7 +60,8 @@ void BLF_lang_encoding_name(const char *str);
 
 void BLF_lang_encoding(const char *str);
 
-#define _(msgid) BLF_gettext(msgid)
+/*#define _(msgid) BLF_gettext(msgid)*/
+/* The "translation-marker" macro. */
 #define N_(msgid) msgid
 
 #endif /* BLF_TRANSLATION_H */
index 46be49b37e9035441a0d96a57f085f0c06f13470..3fe66118cdab18ff4ef671dea00c36efefded9e5 100644 (file)
@@ -136,7 +136,7 @@ char *blf_dir_search(const char *file)
 
        for(dir=global_font_dir.first; dir; dir= dir->next) {
                BLI_join_dirfile(full_path, sizeof(full_path), dir->path, file);
-               if (BLI_exist(full_path)) {
+               if (BLI_exists(full_path)) {
                        s= BLI_strdup(full_path);
                        break;
                }
@@ -144,7 +144,7 @@ char *blf_dir_search(const char *file)
 
        if (!s) {
                /* check the current directory, why not ? */
-               if (BLI_exist(file))
+               if (BLI_exists(file))
                        s= BLI_strdup(file);
        }
 
@@ -198,13 +198,13 @@ char *blf_dir_metrics_search(const char *filename)
                s[2]= 'm';
 
                /* first check .afm */
-               if (BLI_exist(s))
+               if (BLI_exists(s))
                        return s;
 
                /* and now check .pfm */
                s[0]= 'p';
 
-               if (BLI_exist(s))
+               if (BLI_exists(s))
                        return s;
        }
        MEM_freeN(mfile);
index 5161761cf092bd5fb3bd828f18bbf8f45a019a84..355182fb85f8538ac0aa2b0e5f5761dff8aa389c 100644 (file)
@@ -129,7 +129,7 @@ static void blf_font_ensure_ascii_table(FontBLF *font)
                g= (glyph_ascii_table)[c];                                            \
                i++;                                                                  \
        }                                                                         \
-       else if ((c= blf_utf8_next((unsigned char *)(str), &(i)))) {              \
+       else if ((c= BLI_str_utf8_as_unicode_step((str), &(i))) != BLI_UTF8_ERR) {               \
                if ((g= blf_glyph_search((font)->glyph_cache, c)) == NULL) {          \
                        g= blf_glyph_add(font, FT_Get_Char_Index((font)->face, c), c);    \
                }                                                                     \
@@ -141,15 +141,20 @@ static void blf_font_ensure_ascii_table(FontBLF *font)
        const FT_UInt kern_mode= (has_kerning == 0) ? 0 :                         \
                                 (((_font)->flags & BLF_KERNING_DEFAULT) ?        \
                                  ft_kerning_default : FT_KERNING_UNFITTED)       \
-                                                                                 \
 
 
 #define BLF_KERNING_STEP(_font, kern_mode, g_prev, g, delta, pen_x)           \
 {                                                                             \
        if (g_prev) {                                                             \
                delta.x= delta.y= 0;                                                  \
-               if (FT_Get_Kerning((_font)->face, g_prev->idx, g->idx, kern_mode, &delta) == 0) \
+               if (FT_Get_Kerning((_font)->face,                                     \
+                                  (g_prev)->idx,                                     \
+                                  (g)->idx,                                          \
+                                  kern_mode,                                         \
+                                  &(delta)) == 0)                                    \
+               {                                                                     \
                        pen_x += delta.x >> 6;                                            \
+               }                                                                     \
        }                                                                         \
 }                                                                             \
 
@@ -159,7 +164,7 @@ void blf_font_draw(FontBLF *font, const char *str, unsigned int len)
        GlyphBLF *g, *g_prev= NULL;
        FT_Vector delta;
        int pen_x= 0, pen_y= 0;
-       unsigned int i= 0;
+       size_t i= 0;
        GlyphBLF **glyph_ascii_table= font->glyph_cache->glyph_ascii_table;
 
        BLF_KERNING_VARS(font, has_kerning, kern_mode);
@@ -170,9 +175,9 @@ void blf_font_draw(FontBLF *font, const char *str, unsigned int len)
 
                BLF_UTF8_NEXT_FAST(font, g, str, i, c, glyph_ascii_table);
 
-               if (c == 0)      break;
-               if (g == NULL)   continue;
-               if (has_kerning) BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x);
+               if (c == BLI_UTF8_ERR)  break;
+               if (g == NULL)          continue;
+               if (has_kerning)        BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x);
 
                /* do not return this loop if clipped, we want every character tested */
                blf_glyph_render(font, g, (float)pen_x, (float)pen_y);
@@ -214,7 +219,7 @@ void blf_font_buffer(FontBLF *font, const char *str)
        GlyphBLF *g, *g_prev= NULL;
        FT_Vector delta;
        int pen_x= (int)font->pos[0], pen_y= 0;
-       unsigned int i= 0;
+       size_t i= 0;
        GlyphBLF **glyph_ascii_table= font->glyph_cache->glyph_ascii_table;
 
        /* buffer specific vars*/
@@ -235,9 +240,9 @@ void blf_font_buffer(FontBLF *font, const char *str)
 
                BLF_UTF8_NEXT_FAST(font, g, str, i, c, glyph_ascii_table);
 
-               if (c == 0)      break;
-               if (g == NULL)   continue;
-               if (has_kerning) BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x);
+               if (c == BLI_UTF8_ERR)  break;
+               if (g == NULL)          continue;
+               if (has_kerning)        BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x);
 
                chx= pen_x + ((int)g->pos_x);
                chy= (int)font->pos[1] + g->height;
@@ -340,7 +345,7 @@ void blf_font_boundbox(FontBLF *font, const char *str, rctf *box)
        GlyphBLF *g, *g_prev= NULL;
        FT_Vector delta;
        int pen_x= 0, pen_y= 0;
-       unsigned int i= 0;
+       size_t i= 0;
        GlyphBLF **glyph_ascii_table= font->glyph_cache->glyph_ascii_table;
 
        rctf gbox;
@@ -358,9 +363,9 @@ void blf_font_boundbox(FontBLF *font, const char *str, rctf *box)
 
                BLF_UTF8_NEXT_FAST(font, g, str, i, c, glyph_ascii_table);
 
-               if (c == 0)      break;
-               if (g == NULL)   continue;
-               if (has_kerning) BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x);
+               if (c == BLI_UTF8_ERR)  break;
+               if (g == NULL)          continue;
+               if (has_kerning)        BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x);
 
                gbox.xmin= pen_x;
                gbox.xmax= pen_x + g->advance;
index ba0b9985dd4f6f666915cf1e90d982b3d035957c..df88d0c8feaf81fad8bc24e5f518989e708cd008 100644 (file)
@@ -40,7 +40,6 @@ struct rctf;
 
 unsigned int blf_next_p2(unsigned int x);
 unsigned int blf_hash(unsigned int val);
-int blf_utf8_next(unsigned char *buf, unsigned int *iindex);
 
 char *blf_dir_search(const char *file);
 char *blf_dir_metrics_search(const char *filename);
index ec9501c06a69720e67fe7efa9d703ea1bb0d4195..87fbbc7b3e52c14ab5e819b98af20b8622d0ae1f 100644 (file)
@@ -55,6 +55,7 @@
 
 #include "BLI_linklist.h"      /* linknode */
 #include "BLI_string.h"
+#include "BLI_utildefines.h"
 #include "BLI_path_util.h"
 
 #define DOMAIN_NAME "blender"
@@ -103,10 +104,13 @@ void BLF_lang_init(void)
        
        BLI_strncpy(global_encoding_name, SYSTEM_ENCODING_DEFAULT, sizeof(global_encoding_name));
        
-       if (messagepath)
+       if (messagepath) {
                BLI_strncpy(global_messagepath, messagepath, sizeof(global_messagepath));
-       else
+       }
+       else {
+               printf("%s: 'locale' data path for translations not found, continuing\n", __func__);
                global_messagepath[0]= '\0';
+       }
        
 }
 
index 8c0a26df4c22d73a63a5c34eae4166cbea149bd4..17290c6654430306ba053efc03cb13598430a973 100644 (file)
@@ -38,6 +38,7 @@
 
 #include "MEM_guardedalloc.h"
 
+#include "BLI_utildefines.h"
 #include "BLI_path_util.h"
 #include "BLI_string.h"
 #include "BLI_path_util.h"
@@ -54,11 +55,16 @@ unsigned char *BLF_get_unifont(int *unifont_size_r)
 {
        if(unifont_ttf==NULL) {
                char *fontpath = BLI_get_folder(BLENDER_DATAFILES, "fonts");
-               char unifont_path[1024];
+               if (fontpath) {
+                       char unifont_path[1024];
 
-               BLI_snprintf(unifont_path, sizeof(unifont_path), "%s/%s", fontpath, unifont_filename);
+                       BLI_snprintf(unifont_path, sizeof(unifont_path), "%s/%s", fontpath, unifont_filename);
 
-               unifont_ttf= (unsigned char*)BLI_ungzip_to_mem(unifont_path, &unifont_size);
+                       unifont_ttf= (unsigned char*)BLI_file_ungzip_to_mem(unifont_path, &unifont_size);
+               }
+               else {
+                       printf("%s: 'fonts' data path not found for international font, continuing\n", __func__);
+               }
        }
 
        *unifont_size_r= unifont_size;
index cfe77887674a4ba00700681ed91f57e8fd588e32..d51f9b8af6bc7037d8383c5f4a6640744ef5bc0b 100644 (file)
@@ -37,6 +37,8 @@
 
 #include "blf_internal.h"
 
+#include "BLI_string_utf8.h"
+
 unsigned int blf_next_p2(unsigned int x)
 {
        x -= 1;
@@ -62,67 +64,3 @@ unsigned int blf_hash(unsigned int val)
        key ^= (key >> 17);
        return key % 257;
 }
-
-/*
- * This function is from Imlib2 library (font_main.c), a
- * library that does image file loading and saving as well
- * as rendering, manipulation, arbitrary polygon support, etc.
- *
- * Copyright (C) 2000 Carsten Haitzler and various contributors
- * The original name: imlib_font_utf8_get_next
- * more info here: http://docs.enlightenment.org/api/imlib2/html/
- */
-int blf_utf8_next(unsigned char *buf, unsigned int *iindex)
-{
-       /* Reads UTF8 bytes from 'buf', starting at 'index' and
-        * returns the code point of the next valid code point.
-        * 'index' is updated ready for the next call.
-        *
-        * Returns 0 to indicate an error (e.g. invalid UTF8)
-        */
-       int index= *iindex, len, r;
-       unsigned char d, d2, d3, d4;
-
-       d= buf[index++];
-       if (!d)
-               return 0;
-
-       while (buf[index] && ((buf[index] & 0xc0) == 0x80))
-               index++;
-
-       len= index - *iindex;
-       if (len == 1)
-               r= d;
-       else if (len == 2) {
-               /* 2 byte */
-               d2= buf[*iindex + 1];
-               r= d & 0x1f; /* copy lower 5 */
-               r <<= 6;
-               r |= (d2 & 0x3f); /* copy lower 6 */
-       }
-       else if (len == 3) {
-               /* 3 byte */
-               d2= buf[*iindex + 1];
-               d3= buf[*iindex + 2];
-               r= d & 0x0f; /* copy lower 4 */
-               r <<= 6;
-               r |= (d2 & 0x3f);
-               r <<= 6;
-               r |= (d3 & 0x3f);
-       }
-       else {
-               /* 4 byte */
-               d2= buf[*iindex + 1];
-               d3= buf[*iindex + 2];
-               d4= buf[*iindex + 3];
-               r= d & 0x0f; /* copy lower 4 */
-               r <<= 6;
-               r |= (d2 & 0x3f);
-               r <<= 6;
-               r |= (d3 & 0x3f);
-               r <<= 6;
-               r |= (d4 & 0x3f);
-       }
-       *iindex= index;
-       return r;
-}
index e01586cb7d072647fc4fa6e4fe61eb0131140622..f5684810e149f48443dc1210e02c58341a6d3f64 100644 (file)
@@ -51,9 +51,9 @@ extern "C" {
 
 /* used by packaging tools */
                /* can be left blank, otherwise a,b,c... etc with no quotes */
-#define BLENDER_VERSION_CHAR
+#define BLENDER_VERSION_CHAR   a
                /* alpha/beta/rc/release, docs use this */
-#define BLENDER_VERSION_CYCLE  release
+#define BLENDER_VERSION_CYCLE  alpha
 
 struct ListBase;
 struct MemFile;
index 29487713ad4c4291e1a1c81df1147a20ab4e7fbd..b497698f660fa058f7b76be44c9532cd671dbab5 100644 (file)
@@ -34,7 +34,6 @@
  */
 
 #include "BLI_kdopbvh.h"
-#include "BLI_linklist.h"
 
 /*
  * This header encapsulates necessary code to buld a BVH
@@ -118,7 +117,7 @@ void free_bvhtree_from_mesh(struct BVHTreeFromMesh *data);
 #define BVHTREE_FROM_VERTICES  1
 #define BVHTREE_FROM_EDGES             2
 
-typedef LinkNode* BVHCache;
+typedef struct LinkNode* BVHCache;
 
 
 /*
index e4e8805164aa0982405c83d1efbcb60e8f6af953..214ae03b453d6ff5f124b0fb2da111c1791f136c 100644 (file)
@@ -85,11 +85,6 @@ struct chartrans *BKE_text_to_curve(struct Main *bmain, struct Scene *scene, str
 
 int BKE_font_getselection(struct Object *ob, int *start, int *end);
 
-size_t chtoutf8(const unsigned long c, char o[4]);
-void wcs2utf8s(char *dst, const wchar_t *src);
-size_t wcsleninu8(wchar_t *src);
-size_t utf8towchar(wchar_t *w, const char *c);
-
 #ifdef __cplusplus
 }
 #endif
index 1de3c295f4da30af5b3640a50f245890960a40a5..b75a8cb29ecfce620d92337023fff9d198c19d7d 100644 (file)
@@ -346,9 +346,8 @@ struct bNode        *nodeGetActiveID(struct bNodeTree *ntree, short idtype);
 int                            nodeSetActiveID(struct bNodeTree *ntree, short idtype, struct ID *id);
 void                   nodeClearActiveID(struct bNodeTree *ntree, short idtype);
 
-void                   NodeTagChanged(struct bNodeTree *ntree, struct bNode *node);
-int                            NodeTagIDChanged(struct bNodeTree *ntree, struct ID *id);
-void                   ntreeClearTags(struct bNodeTree *ntree);
+void                   nodeUpdate(struct bNodeTree *ntree, struct bNode *node);
+int                            nodeUpdateID(struct bNodeTree *ntree, struct ID *id);
 
 void                   nodeFreePreview(struct bNode *node);
 
@@ -601,7 +600,7 @@ void ntreeCompositTagRender(struct Scene *sce);
 int ntreeCompositTagAnimated(struct bNodeTree *ntree);
 void ntreeCompositTagGenerators(struct bNodeTree *ntree);
 void ntreeCompositForceHidden(struct bNodeTree *ntree, struct Scene *scene);
-
+void ntreeCompositClearTags(struct bNodeTree *ntree);
 
 
 /* ************** TEXTURE NODES *************** */
index 556ff26e62102063cb5116de4099cc49f6724bb1..f1c7356e6b0b11a6f5ce1ffbd9910df43d1fac20 100644 (file)
@@ -51,7 +51,7 @@ struct PackedFile *newPackedFileMemory(void *mem, int memlen);
 void packAll(struct Main *bmain, struct ReportList *reports);
 
 /* unpack */
-char *unpackFile(struct ReportList *reports, char *abs_name, char *local_name, struct PackedFile *pf, int how);
+char *unpackFile(struct ReportList *reports, const char *abs_name, const char *local_name, struct PackedFile *pf, int how);
 int unpackVFont(struct ReportList *reports, struct VFont *vfont, int how);
 int unpackSound(struct Main *bmain, struct ReportList *reports, struct bSound *sound, int how);
 int unpackImage(struct ReportList *reports, struct Image *ima, int how);
index 66d51810413276ed6fb0e96cbd86902919b2f059..34da243042d256d8f51192b090d8ed1a4be77962 100644 (file)
@@ -41,8 +41,7 @@ if env['WITH_BF_QUICKTIME']:
 
 if env['WITH_BF_SDL']:
     incs += ' ' + env['BF_SDL_INC']
-else:
-    defs.append('DISABLE_SDL')
+    defs.append('WITH_SDL')
 
 if env['WITH_BF_OPENEXR']:
     defs.append('WITH_OPENEXR')
index 4016cf00ae4468c09c974275fbc5449bc337534c..cd0af6d58f0fe5e83a2338bbdb9023b651e636d7 100644 (file)
@@ -44,6 +44,7 @@
 #include "DNA_scene_types.h"
 
 #include "BLI_edgehash.h"
+#include "BLI_listbase.h"
 #include "BLI_utildefines.h"
 
 #include "BKE_mesh.h"
index 593f50a65e713cdaed27d25d9d60c08431648fd4..bbd439dcb930d3746a66ac2c49c169c7fc3a79d2 100644 (file)
@@ -38,6 +38,7 @@
 
 
 #include "MEM_guardedalloc.h"
+#include "BLI_listbase.h"
 #include "BLI_utildefines.h"
 
 #include "bmesh_private.h"
index 62a9601da13683b12622c0f673d41dbaf0558e58..e34f2ee1e50d641116284cf657b61deca0fb522d 100644 (file)
@@ -37,7 +37,7 @@
  */
 
 
-
+#include "BLI_listbase.h"
 #include "MEM_guardedalloc.h"
 #include "BKE_bmesh.h"
 #include "bmesh_private.h"
index bd5241adb6b87386661301528317274e575646e2..c385ad4fcdafcdce9d5198d3b2b8c3d634e5546e 100644 (file)
@@ -40,6 +40,7 @@
 #include <limits.h>
 
 #include "MEM_guardedalloc.h"
+#include "BLI_listbase.h"
 #include "BLI_utildefines.h"
 #include "BKE_bmesh.h"
 /**
index b3742d43176cb5c1ee2be34b4bc89a7e4b7b77f7..06d7838c2bc50c93269c929cb0b59db3a1c584c0 100644 (file)
@@ -50,6 +50,7 @@
 #include "BLI_memarena.h"
 #include "BLI_pbvh.h"
 #include "BLI_utildefines.h"
+#include "BLI_linklist.h"
 
 #include "BKE_cdderivedmesh.h"
 #include "BKE_displist.h"
index 5358a26e660e36d79860ae78e406cd432390edf0..b2bcd9aa6aa70b2cafc52144576b5673c49cbc9c 100644 (file)
@@ -59,7 +59,6 @@
 #include "BLI_blenlib.h"
 #include "BLI_bpath.h"
 #include "BLI_dynstr.h"
-#include "BLI_path_util.h"
 #include "BLI_utildefines.h"
 #include "BLI_callbacks.h"
 
@@ -549,7 +548,7 @@ void BKE_write_undo(bContext *C, const char *name)
                counter= counter % U.undosteps; 
        
                BLI_snprintf(numstr, sizeof(numstr), "%d.blend", counter);
-               BLI_make_file_string("/", filepath, btempdir, numstr);
+               BLI_make_file_string("/", filepath, BLI_temporary_dir(), numstr);
        
                /* success= */ /* UNUSED */ BLO_write_file(CTX_data_main(C), filepath, fileflags, NULL, NULL);
                
@@ -719,7 +718,7 @@ void BKE_undo_save_quit(void)
        /* no undo state to save */
        if(undobase.first==undobase.last) return;
                
-       BLI_make_file_string("/", str, btempdir, "quit.blend");
+       BLI_make_file_string("/", str, BLI_temporary_dir(), "quit.blend");
 
        file = open(str,O_BINARY+O_WRONLY+O_CREAT+O_TRUNC, 0666);
        if(file == -1) {
index c84a3cfc73026f118aa5de182e4e55d6bf879d4e..4ab9d085de3157d13dc571f25ca54dc0e22ea0e3 100644 (file)
@@ -930,7 +930,7 @@ void brush_jitter_pos(Brush *brush, float pos[2], float jitterpos[2])
 {
        int use_jitter= brush->jitter != 0;
 
-       /* jitter-ed brush gives wierd and unpredictable result for this
+       /* jitter-ed brush gives weird and unpredictable result for this
           kinds of stroke, so manyally disable jitter usage (sergey) */
        use_jitter&= (brush->flag & (BRUSH_RESTORE_MESH|BRUSH_ANCHORED)) == 0;
 
index 2ce6b92922d9a682844020cdea4b5d7b920b43b9..79229c49b4d9fb48b5e0bfa333436c3ebf7c91f1 100644 (file)
@@ -40,6 +40,7 @@
 
 #include "BLI_editVert.h"
 #include "BLI_utildefines.h"
+#include "BLI_linklist.h"
 
 #include "BKE_DerivedMesh.h"
 
index 260b51bc3210b963a48ec3bf96e4996c308745e7..d30476d44f804ede20eebb1ee8d834eafa59a478 100644 (file)
@@ -40,6 +40,7 @@
 #include "BLI_math.h"
 #include "BLI_edgehash.h"
 #include "BLI_utildefines.h"
+#include "BLI_linklist.h"
 
 #include "BKE_cdderivedmesh.h"
 #include "BKE_cloth.h"
index 6dbea2c9ab66c723c1a8fc02dbef193eb021fa3d..8eff86d846eaac3593e2b25dacad8beef69dc513 100644 (file)
@@ -41,7 +41,6 @@
 #include "MEM_guardedalloc.h"
 
 #include "BLI_blenlib.h"
-#include "BLI_listbase.h"
 #include "BLI_math.h"
 #include "BLI_editVert.h"
 #include "BLI_utildefines.h"
index 7d98119610b6655b2d827f165ad6d63ff1ca7b99..d59a9eed3639358ae2b848abc826a0d084454cf0 100644 (file)
@@ -47,7 +47,6 @@
 #include "DNA_ID.h"
 
 #include "BLI_blenlib.h"
-#include "BLI_path_util.h"
 #include "BLI_linklist.h"
 #include "BLI_math.h"
 #include "BLI_mempool.h"
index 80a40c0a3a3a72cc05804b56c02f43d99ab0e54e..d3c5942b685ff3fe9facf2595132f94d7d68e628 100644 (file)
@@ -38,6 +38,7 @@
 
 #include "BLI_winstuff.h"
 #include "BLI_utildefines.h"
+#include "BLI_listbase.h"
 #include "BLI_ghash.h"
 
 #include "DNA_anim_types.h"
@@ -1962,7 +1963,7 @@ static void dag_tag_renderlayers(Scene *sce, unsigned int lay)
                        if(node->id==(ID *)sce) {
                                SceneRenderLayer *srl= BLI_findlink(&sce->r.layers, node->custom1);
                                if(srl && (srl->lay & lay_changed))
-                                       NodeTagChanged(sce->nodetree, node);
+                                       nodeUpdate(sce->nodetree, node);
                        }
                }
        }
index 5ce7b82a45f6fb007fa9aa681686e30035d45a7a..e3e769253f1c6953e42a172946337e0fd2660a56 100644 (file)
@@ -33,7 +33,6 @@
 
 
 #include <stddef.h>
-#include "BLI_storage.h" /* _LARGEFILE_SOURCE */
 
 #include <math.h>
 #include <stdlib.h>
@@ -59,8 +58,6 @@
 #include "BLI_math.h"
 #include "BLI_blenlib.h"
 #include "BLI_jitter.h"
-#include "BLI_listbase.h"
-#include "BLI_noise.h"
 #include "BLI_rand.h"
 #include "BLI_utildefines.h"
 
index 1c2f1c8487ccadf79891cf5d2ceb1abb208c114d..9247646b927a04e1dd494a8d46ab8ef9d9c66a7e 100644 (file)
@@ -33,7 +33,6 @@
 
 
 #include <stddef.h>
-#include "BLI_storage.h" /* _LARGEFILE_SOURCE */
 
 #include "MEM_guardedalloc.h"
 
index 9c01b35b91ac1079b142089f427b7ee8ca7f1c3a..068e70bbb508bbf8d3337b55fe881b29b398eabc 100644 (file)
 
 static ListBase ttfdata= {NULL, NULL};
 
-/* UTF-8 <-> wchar transformations */
-size_t chtoutf8(const unsigned long c, char o[4])
-{
-       // Variables and initialization
-/*     memset(o, 0, 4);        */
-
-       // Create the utf-8 string
-       if (c < 0x80) {
-               o[0] = (char) c;
-               return 1;
-       }
-       else if (c < 0x800) {
-               o[0] = (0xC0 | (c>>6));
-               o[1] = (0x80 | (c & 0x3f));
-               return 2;
-       }
-       else if (c < 0x10000) {
-               o[0] = (0xe0 | (c >> 12));
-               o[1] = (0x80 | (c >>6 & 0x3f));
-               o[2] = (0x80 | (c & 0x3f));
-               return 3;
-       }
-       else if (c < 0x200000) {
-               o[0] = (0xf0 | (c>>18));
-               o[1] = (0x80 | (c >>12 & 0x3f));
-               o[2] = (0x80 | (c >> 6 & 0x3f));
-               o[3] = (0x80 | (c & 0x3f));
-               return 4;
-       }
-
-       /* should we assert here? */
-       return 0;
-}
-
-void wcs2utf8s(char *dst, const wchar_t *src)
-{
-       while(*src) {
-               dst += chtoutf8(*src++, dst);
-       }
-
-       *dst= '\0';
-}
-
-size_t wcsleninu8(wchar_t *src)
-{
-       char ch_dummy[4];
-       size_t len = 0;
-
-       while(*src) {
-               len += chtoutf8(*src++, ch_dummy);
-       }
-
-       return len;
-}
-
-static size_t utf8slen(const char *strc)
-{
-       int len=0;
-
-       while(*strc) {
-               if ((*strc & 0xe0) == 0xc0) {
-                       if((strc[1] & 0x80) && (strc[1] & 0x40) == 0x00)
-                               strc++;
-               } else if ((*strc & 0xf0) == 0xe0) {
-                       if((strc[1] & strc[2] & 0x80) && ((strc[1] | strc[2]) & 0x40) == 0x00)
-                               strc += 2;
-               } else if ((*strc & 0xf8) == 0xf0) {
-                       if((strc[1] & strc[2] & strc[3] & 0x80) && ((strc[1] | strc[2] | strc[3]) & 0x40) == 0x00)
-                               strc += 3;
-               }
-
-               strc++;
-               len++;
-       }
-
-       return len;
-}
-
-
-/* Converts Unicode to wchar
-
-According to RFC 3629 "UTF-8, a transformation format of ISO 10646"
-(http://tools.ietf.org/html/rfc3629), the valid UTF-8 encoding are:
-
-  Char. number range  |        UTF-8 octet sequence
-         (hexadecimal)    |              (binary)
-   --------------------+---------------------------------------------
-   0000 0000-0000 007F | 0xxxxxxx
-   0000 0080-0000 07FF | 110xxxxx 10xxxxxx
-   0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx
-   0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
-
-If the encoding incidated by the first character is incorrect (because the
-1 to 3 following characters do not match 10xxxxxx), the output is a '?' and
-only a single input character is consumed.
-
-*/
-
-size_t utf8towchar(wchar_t *w, const char *c)
-{
-       int len=0;
-
-       if(w==NULL || c==NULL) return(0);
-
-       while(*c) {
-               if ((*c & 0xe0) == 0xc0) {
-                       if((c[1] & 0x80) && (c[1] & 0x40) == 0x00) {
-                               *w=((c[0] &0x1f)<<6) | (c[1]&0x3f);
-                               c++;
-                       } else {
-                               *w = '?';
-                       }
-               } else if ((*c & 0xf0) == 0xe0) {
-                       if((c[1] & c[2] & 0x80) && ((c[1] | c[2]) & 0x40) == 0x00) {
-                               *w=((c[0] & 0x0f)<<12) | ((c[1]&0x3f)<<6) | (c[2]&0x3f);
-                               c += 2;
-                       } else {
-                               *w = '?';
-                       }
-               } else if ((*c & 0xf8) == 0xf0) {
-                       if((c[1] & c[2] & c[3] & 0x80) && ((c[1] | c[2] | c[3]) & 0x40) == 0x00) {
-                               *w=((c[0] & 0x07)<<18) | ((c[1]&0x1f)<<12) | ((c[2]&0x3f)<<6) | (c[3]&0x3f);
-                               c += 3;
-                       } else {
-                               *w = '?';
-                       }
-               } else
-                       *w=(c[0] & 0x7f);
-
-               c++;
-               w++;
-               len++;
-       }
-       return len;
-}
-
 /* The vfont code */
 void free_vfont(struct VFont *vf)
 {
@@ -691,10 +555,10 @@ struct chartrans *BKE_text_to_curve(Main *bmain, Scene *scene, Object *ob, int m
        if(vfont == NULL) return NULL;
 
        // Create unicode string
-       utf8len = utf8slen(cu->str);
+       utf8len = BLI_strlen_utf8(cu->str);
        mem = MEM_callocN(((utf8len + 1) * sizeof(wchar_t)), "convertedmem");
        
-       utf8towchar(mem, cu->str);
+       BLI_strncpy_wchar_from_utf8(mem, cu->str, utf8len + 1);
 
        // Count the wchar_t string length
        slen = wcslen(mem);
index cf8f96c143a4cbb70c426df28dcca3f32fff2ad3..37982e7fec93afcd08cb85addfc21373464fecc5 100644 (file)
@@ -906,8 +906,8 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d
        
        if (scene->r.stamp & R_STAMP_MARKER) {
                char *name = scene_find_last_marker_name(scene, CFRA);
-       
-               if (name)       strcpy(text, name);
+
+               if (name)       BLI_strncpy(text, name, sizeof(text));
                else            strcpy(text, "<none>");
 
                BLI_snprintf(stamp_data->marker, sizeof(stamp_data->marker), do_prefix ? "Marker %s":"%s", text);
@@ -980,7 +980,7 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d
        if (scene->r.stamp & R_STAMP_SEQSTRIP) {
                Sequence *seq= seq_foreground_frame_get(scene, scene->r.cfra);
        
-               if (seq) strcpy(text, seq->name+2);
+               if (seq)        BLI_strncpy(text, seq->name+2, sizeof(text));
                else            strcpy(text, "<none>");
 
                BLI_snprintf(stamp_data->strip, sizeof(stamp_data->strip), do_prefix ? "Strip %s":"%s", text);
@@ -1514,7 +1514,7 @@ void BKE_image_signal(Image *ima, ImageUser *iuser, int signal)
                Scene *scene;
                for(scene= G.main->scene.first; scene; scene= scene->id.next) {
                        if(scene->nodetree) {
-                               NodeTagIDChanged(scene->nodetree, &ima->id);
+                               nodeUpdateID(scene->nodetree, &ima->id);
                        }
                }
        }
index 9e48e691b87e0f8351eaa190f2be3891d85673e8..3baf8e04b9045de118da46512057da0fc1275f1a 100644 (file)
@@ -1280,9 +1280,9 @@ static void do_latt_key(Scene *scene, Object *ob, Key *key, char *out, const int
                        flag= setkeys(ctime, &key->block, k, t, 0);
 
                        if(flag==0)
-                               do_key(a, a+1, tot, (char *)out, key, actkb, k, t, KEY_MODE_DUMMY);
+                               do_key(a, a+1, tot, out, key, actkb, k, t, KEY_MODE_DUMMY);
                        else
-                               cp_key(a, a+1, tot, (char *)out, key, actkb, k[2], NULL, KEY_MODE_DUMMY);
+                               cp_key(a, a+1, tot, out, key, actkb, k[2], NULL, KEY_MODE_DUMMY);
                }               
        }
        else {
@@ -1292,7 +1292,7 @@ static void do_latt_key(Scene *scene, Object *ob, Key *key, char *out, const int
                        for(kb= key->block.first; kb; kb= kb->next)
                                kb->weights= get_weights_array(ob, kb->vgroup);
                        
-                       do_rel_key(0, tot, tot, (char *)out, key, actkb, KEY_MODE_DUMMY);
+                       do_rel_key(0, tot, tot, out, key, actkb, KEY_MODE_DUMMY);
                        
                        for(kb= key->block.first; kb; kb= kb->next) {
                                if(kb->weights) MEM_freeN(kb->weights);
@@ -1386,7 +1386,7 @@ float *do_ob_key(Scene *scene, Object *ob)
                if(ELEM(ob->type, OB_MESH, OB_LATTICE)) {
                        float *weights= get_weights_array(ob, kb->vgroup);
 
-                       cp_key(0, tot, tot, (char*)out, key, actkb, kb, weights, 0);
+                       cp_key(0, tot, tot, out, key, actkb, kb, weights, 0);
 
                        if(weights) MEM_freeN(weights);
                }
index faf4b11f489d4dc6a43a190f3ac1656576b7938b..177cc64aa40dc84a3fd88bced11529a7290daf73 100644 (file)
@@ -130,7 +130,7 @@ static LineStyleModifier *new_modifier(int type, size_t size)
 static void add_to_modifier_list(ListBase *lb, LineStyleModifier *m)
 {
        BLI_addtail(lb, (void *)m);
-       BLI_uniquename(lb, m, modifier_name[m->type], '.', BLI_STRUCT_OFFSET(LineStyleModifier, name), sizeof(m->name));
+       BLI_uniquename(lb, m, modifier_name[m->type], '.', offsetof(LineStyleModifier, name), sizeof(m->name));
 }
 
 int FRS_add_linestyle_color_modifier(FreestyleLineStyle *linestyle, int type)
index 9de75a499984478ddbd72c1a70092021d8fd47be..2056762e62777c420302daf15b92406e02a2bbe2 100644 (file)
 #include "DNA_meshdata_types.h"
 
 #include "BLI_utildefines.h"
+#include "BLI_path_util.h"
+#include "BLI_listbase.h"
+#include "BLI_linklist.h"
+#include "BLI_string.h"
 
 #include "BKE_bmesh.h"
 #include "BKE_cloth.h"
@@ -86,8 +90,8 @@ ModifierData *modifier_new(int type)
        ModifierTypeInfo *mti = modifierType_getInfo(type);
        ModifierData *md = MEM_callocN(mti->structSize, mti->structName);
        
-       // FIXME: we need to make the name always be unique somehow...
-       strcpy(md->name, mti->name);
+       /* note, this name must be made unique later */
+       BLI_strncpy(md->name, mti->name, sizeof(md->name));
 
        md->type = type;
        md->mode = eModifierMode_Realtime
index 97347d85deb9a5ace5c0ca60324d193287ec40e0..15513675c7a450f3c9491f075f02a7621a3269ca 100644 (file)
@@ -42,6 +42,9 @@
 #include "MEM_guardedalloc.h"
 
 #include "BLI_utildefines.h"
+#include "BLI_path_util.h"
+#include "BLI_listbase.h"
+#include "BLI_string.h"
 #include "BLI_ghash.h"
 
 #include "DNA_anim_types.h"
index f0be3c99f1375b8797bd72f98256ecd5047fe44c..cb1f52a626525f859cf8ab76bc252a989a5a4a36 100644 (file)
@@ -184,7 +184,7 @@ bNodeSocket *nodeAddSocket(bNodeTree *ntree, bNode *node, int in_out, const char
        else if (in_out==SOCK_OUT)
                BLI_addtail(&node->outputs, sock);
        
-       ntree->update |= NTREE_UPDATE_NODES;
+       node->update |= NODE_UPDATE;
        
        return sock;
 }
@@ -197,7 +197,7 @@ bNodeSocket *nodeInsertSocket(bNodeTree *ntree, bNode *node, int in_out, bNodeSo
        else if (in_out==SOCK_OUT)
                BLI_insertlinkbefore(&node->outputs, next_sock, sock);
        
-       ntree->update |= NTREE_UPDATE_NODES;
+       node->update |= NODE_UPDATE;
        
        return sock;
 }
@@ -221,7 +221,7 @@ void nodeRemoveSocket(bNodeTree *ntree, bNode *node, bNodeSocket *sock)
                MEM_freeN(sock->default_value);
        MEM_freeN(sock);
        
-       ntree->update |= NTREE_UPDATE_NODES;
+       node->update |= NODE_UPDATE;
 }
 
 void nodeRemoveAllSockets(bNodeTree *ntree, bNode *node)
@@ -246,7 +246,7 @@ void nodeRemoveAllSockets(bNodeTree *ntree, bNode *node)
        
        BLI_freelistN(&node->outputs);
        
-       ntree->update |= NTREE_UPDATE_NODES;
+       node->update |= NODE_UPDATE;
 }
 
 /* finds a node based on its name */
@@ -374,7 +374,7 @@ void nodeMakeDynamicType(bNode *node)
                /*node->typeinfo= MEM_dupallocN(ntype);*/
                bNodeType *newtype= MEM_callocN(sizeof(bNodeType), "dynamic bNodeType");
                *newtype= *ntype;
-               strcpy(newtype->name, ntype->name);
+               BLI_strncpy(newtype->name, ntype->name, sizeof(newtype->name));
                node->typeinfo= newtype;
        }
 }
@@ -823,7 +823,7 @@ void nodeUnlinkNode(bNodeTree *ntree, bNode *node)
                if(link->fromnode==node) {
                        lb= &node->outputs;
                        if (link->tonode)
-                               NodeTagChanged(ntree, link->tonode);
+                               link->tonode->update |= NODE_UPDATE;
                }
                else if(link->tonode==node)
                        lb= &node->inputs;
@@ -1495,18 +1495,19 @@ void ntreeUpdateTree(bNodeTree *ntree)
                /* update individual nodes */
                for (n=0; n < totnodes; ++n) {
                        node = deplist[n];
-                       if (ntreetype->update_node)
-                               ntreetype->update_node(ntree, node);
-                       else if (node->typeinfo->updatefunc)
-                               node->typeinfo->updatefunc(ntree, node);
+                       
+                       /* node tree update tags override individual node update flags */
+                       if ((node->update & NODE_UPDATE) || (ntree->update & NTREE_UPDATE)) {
+                               if (ntreetype->update_node)
+                                       ntreetype->update_node(ntree, node);
+                               else if (node->typeinfo->updatefunc)
+                                       node->typeinfo->updatefunc(ntree, node);
+                       }
+                       /* clear update flag */
+                       node->update = 0;
                }
                
                MEM_freeN(deplist);
-               
-               /* ensures only a single output node is enabled, texnode allows multiple though */
-               if(ntree->type!=NTREE_TEXTURE)
-                       ntreeSetOutput(ntree);
-               
        }
        
        /* general tree updates */
@@ -1518,6 +1519,9 @@ void ntreeUpdateTree(bNodeTree *ntree)
        if (ntreetype->update)
                ntreetype->update(ntree);
        else {
+               /* Trees can be associated with a specific node type (i.e. group nodes),
+                * in that case a tree update function may be defined by that node type.
+                */
                bNodeType *ntype= node_get_type(ntree, ntree->nodetype);
                if (ntype && ntype->updatetreefunc)
                        ntype->updatetreefunc(ntree);
@@ -1530,24 +1534,24 @@ void ntreeUpdateTree(bNodeTree *ntree)
        ntree->update = 0;
 }
 
-void NodeTagChanged(bNodeTree *ntree, bNode *node)
+void nodeUpdate(bNodeTree *ntree, bNode *node)
 {
-       bNodeTreeType *ntreetype = ntreeGetType(ntree->type);
+       bNodeTreeType *ntreetype= ntreeGetType(ntree->type);
        
-       /* extra null pointer checks here because this is called when unlinking
-          unknown nodes on file load, so typeinfo pointers may not be set */
-       if (ntreetype && ntreetype->update_node)
+       if (ntreetype->update_node)
                ntreetype->update_node(ntree, node);
-       else if (node->typeinfo && node->typeinfo->updatefunc)
+       else if (node->typeinfo->updatefunc)
                node->typeinfo->updatefunc(ntree, node);
+       /* clear update flag */
+       node->update = 0;
 }
 
-int NodeTagIDChanged(bNodeTree *ntree, ID *id)
+int nodeUpdateID(bNodeTree *ntree, ID *id)
 {
        bNodeTreeType *ntreetype;
        bNode *node;
        int change = FALSE;
-
+       
        if(ELEM(NULL, id, ntree))
                return change;
        
@@ -1558,6 +1562,8 @@ int NodeTagIDChanged(bNodeTree *ntree, ID *id)
                        if(node->id==id) {
                                change = TRUE;
                                ntreetype->update_node(ntree, node);
+                               /* clear update flag */
+                               node->update = 0;
                        }
                }
        }
@@ -1567,6 +1573,8 @@ int NodeTagIDChanged(bNodeTree *ntree, ID *id)
                                change = TRUE;
                                if (node->typeinfo->updatefunc)
                                        node->typeinfo->updatefunc(ntree, node);
+                               /* clear update flag */
+                               node->update = 0;
                        }
                }
        }
index 2c8975e9cb4252798abc2047bb7d9321b2840b56..70b0b7727c4ba30ac3fb5207b7350fc1bfd19914 100644 (file)
@@ -182,7 +182,7 @@ PackedFile *newPackedFile(ReportList *reports, const char *filename, const char
        
        // convert relative filenames to absolute filenames
        
-       strcpy(name, filename);
+       BLI_strncpy(name, filename, sizeof(name));
        BLI_path_abs(name, basepath);
        
        // open the file
@@ -192,7 +192,7 @@ PackedFile *newPackedFile(ReportList *reports, const char *filename, const char
        if (file <= 0) {
                BKE_reportf(reports, RPT_ERROR, "Unable to pack file, source path not found: \"%s\"", name);
        } else {
-               filelen = BLI_filesize(file);
+               filelen = BLI_file_descriptor_size(file);
 
                if (filelen == 0) {
                        // MEM_mallocN complains about MEM_mallocN(0, "bla");
@@ -240,7 +240,7 @@ void packAll(Main *bmain, ReportList *reports)
 }
 
 
-/*
+#if 0
 
 // attempt to create a function that generates an unique filename
 // this will work when all funtions in fileops.c understand relative filenames...
@@ -249,6 +249,7 @@ static char *find_new_name(char *name)
 {
        char tempname[FILE_MAXDIR + FILE_MAXFILE];
        char *newname;
+       size_t len;
        
        if (fop_exists(name)) {
                for (number = 1; number <= 999; number++) {
@@ -258,14 +259,12 @@ static char *find_new_name(char *name)
                        }
                }
        }
-       
-       newname = mallocN(strlen(tempname) + 1, "find_new_name");
-       strcpy(newname, tempname);
-       
-       return(newname);
+       len= strlen(tempname) + 1;
+       newname = MEM_mallocN(len, "find_new_name");
+       memcpy(newname, tempname, len * sizeof(char));
+       return newname;
 }
-       
-*/
+#endif
 
 int writePackedFile(ReportList *reports, const char *filename, PackedFile *pf, int guimode)
 {
@@ -277,14 +276,14 @@ int writePackedFile(ReportList *reports, const char *filename, PackedFile *pf, i
        
        if (guimode) {} //XXX  waitcursor(1);
        
-       strcpy(name, filename);
+       BLI_strncpy(name, filename, sizeof(name));
        BLI_path_abs(name, G.main->name);
        
        if (BLI_exists(name)) {
                for (number = 1; number <= 999; number++) {
-                       sprintf(tempname, "%s.%03d_", name, number);
+                       BLI_snprintf(tempname, sizeof(tempname), "%s.%03d_", name, number);
                        if (! BLI_exists(tempname)) {
-                               if (BLI_copy_fileops(name, tempname) == RET_OK) {
+                               if (BLI_copy(name, tempname) == RET_OK) {
                                        remove_tmp = TRUE;
                                }
                                break;
@@ -342,7 +341,7 @@ int checkPackedFile(const char *filename, PackedFile *pf)
        char buf[4096];
        char name[FILE_MAXDIR + FILE_MAXFILE];
        
-       strcpy(name, filename);
+       BLI_strncpy(name, filename, sizeof(name));
        BLI_path_abs(name, G.main->name);
        
        if (stat(name, &st)) {
@@ -392,9 +391,10 @@ there was an error or when the user desides to cancel the operation.
 
 */
 
-char *unpackFile(ReportList *reports, char *abs_name, char *local_name, PackedFile *pf, int how)
+char *unpackFile(ReportList *reports, const char *abs_name, const char *local_name, PackedFile *pf, int how)
 {
-       char *newname = NULL, *temp = NULL;
+       char *newname = NULL;
+       const char *temp = NULL;
        
        // char newabs[FILE_MAXDIR + FILE_MAXFILE];
        // char newlocal[FILE_MAXDIR + FILE_MAXFILE];
@@ -437,12 +437,11 @@ char *unpackFile(ReportList *reports, char *abs_name, char *local_name, PackedFi
                }
                
                if (temp) {
-                       newname = MEM_mallocN(strlen(temp) + 1, "unpack_file newname");
-                       strcpy(newname, temp);
+                       newname= BLI_strdup(temp);
                }
        }
        
-       return (newname);
+       return newname;
 }
 
 
@@ -453,17 +452,17 @@ int unpackVFont(ReportList *reports, VFont *vfont, int how)
        int ret_value = RET_ERROR;
        
        if (vfont != NULL) {
-               strcpy(localname, vfont->name);
+               BLI_strncpy(localname, vfont->name, sizeof(localname));
                BLI_splitdirstring(localname, fi);
                
-               sprintf(localname, "//fonts/%s", fi);
+               BLI_snprintf(localname, sizeof(localname), "//fonts/%s", fi);
                
                newname = unpackFile(reports, vfont->name, localname, vfont->packedfile, how);
                if (newname != NULL) {
                        ret_value = RET_OK;
                        freePackedFile(vfont->packedfile);
                        vfont->packedfile = NULL;
-                       strcpy(vfont->name, newname);
+                       BLI_strncpy(vfont->name, newname, sizeof(vfont->name));
                        MEM_freeN(newname);
                }
        }
@@ -478,13 +477,13 @@ int unpackSound(Main *bmain, ReportList *reports, bSound *sound, int how)
        int ret_value = RET_ERROR;
 
        if (sound != NULL) {
-               strcpy(localname, sound->name);
+               BLI_strncpy(localname, sound->name, sizeof(localname));
                BLI_splitdirstring(localname, fi);
-               sprintf(localname, "//sounds/%s", fi);
+               BLI_snprintf(localname, sizeof(localname), "//sounds/%s", fi);
 
                newname = unpackFile(reports, sound->name, localname, sound->packedfile, how);
                if (newname != NULL) {
-                       strcpy(sound->name, newname);
+                       BLI_strncpy(sound->name, newname, sizeof(sound->name));
                        MEM_freeN(newname);
 
                        freePackedFile(sound->packedfile);
@@ -506,16 +505,16 @@ int unpackImage(ReportList *reports, Image *ima, int how)
        int ret_value = RET_ERROR;
        
        if (ima != NULL) {
-               strcpy(localname, ima->name);
+               BLI_strncpy(localname, ima->name, sizeof(localname));
                BLI_splitdirstring(localname, fi);
-               sprintf(localname, "//textures/%s", fi);
-                       
+               BLI_snprintf(localname, sizeof(localname), "//textures/%s", fi);
+
                newname = unpackFile(reports, ima->name, localname, ima->packedfile, how);
                if (newname != NULL) {
                        ret_value = RET_OK;
                        freePackedFile(ima->packedfile);
                        ima->packedfile = NULL;
-                       strcpy(ima->name, newname);
+                       BLI_strncpy(ima->name, newname, sizeof(ima->name));
                        MEM_freeN(newname);
                        BKE_image_signal(ima, NULL, IMA_SIGNAL_RELOAD);
                }
index 8669c4e0efd916ffd2208f3b899a9235fde16e24..8a83dcac765ce1f0bbffc25f878383cc440aedf7 100644 (file)
@@ -54,6 +54,7 @@
 #include "BLI_kdtree.h"
 #include "BLI_rand.h"
 #include "BLI_threads.h"
+#include "BLI_linklist.h"
 
 #include "BKE_anim.h"
 #include "BKE_animsys.h"
index 7b2d621aff25d2bfdbcfca41f1f888d06de9657e..cebefe814954bab0d21b046b34b1f535316a8348 100644 (file)
@@ -36,7 +36,6 @@
 
 
 #include <stddef.h>
-#include "BLI_storage.h" /* _LARGEFILE_SOURCE */
 
 #include <stdlib.h>
 #include <math.h>
 #include "BLI_blenlib.h"
 #include "BLI_kdtree.h"
 #include "BLI_kdopbvh.h"
-#include "BLI_listbase.h"
 #include "BLI_threads.h"
-#include "BLI_storage.h" /* For _LARGEFILE64_SOURCE;  zlib needs this on some systems */
-#include "BLI_string.h"
 #include "BLI_utildefines.h"
+#include "BLI_linklist.h"
 
 #include "BKE_main.h"
 #include "BKE_animsys.h"
index bc5bc87b1fac43a978144306cb412f82072be45d..d4753f30ef2033d7fc25b151926e452530a1f062 100644 (file)
@@ -910,7 +910,7 @@ static int ptcache_path(PTCacheID *pid, char *filename)
        else if (G.relbase_valid || lib) {
                char file[MAX_PTCACHE_PATH]; /* we dont want the dir, only the file */
 
-               BLI_split_dirfile(blendfilename, NULL, file, 0, sizeof(file));
+               BLI_split_file_part(blendfilename, file, sizeof(file));
                i = strlen(file);
                
                /* remove .blend */
@@ -923,8 +923,8 @@ static int ptcache_path(PTCacheID *pid, char *filename)
        }
        
        /* use the temp path. this is weak but better then not using point cache at all */
-       /* btempdir is assumed to exist and ALWAYS has a trailing slash */
-       BLI_snprintf(filename, MAX_PTCACHE_PATH, "%s"PTCACHE_PATH"%d", btempdir, abs(getpid()));
+       /* temporary directory is assumed to exist and ALWAYS has a trailing slash */
+       BLI_snprintf(filename, MAX_PTCACHE_PATH, "%s"PTCACHE_PATH"%d", BLI_temporary_dir(), abs(getpid()));
        
        return BLI_add_slash(filename); /* new strlen() */
 }
@@ -2363,7 +2363,7 @@ void BKE_ptcache_remove(void)
        
        ptcache_path(NULL, path);
 
-       if (BLI_exist(path)) {
+       if (BLI_exists(path)) {
                /* The pointcache dir exists? - remove all pointcache */
 
                DIR *dir; 
@@ -2891,24 +2891,24 @@ void BKE_ptcache_disk_cache_rename(PTCacheID *pid, char *from, char *to)
        char ext[MAX_PTCACHE_PATH];
 
        /* save old name */
-       strcpy(old_name, pid->cache->name);
+       BLI_strncpy(old_name, pid->cache->name, sizeof(old_name));
 
        /* get "from" filename */
-       strcpy(pid->cache->name, from);
+       BLI_strncpy(pid->cache->name, from, sizeof(pid->cache->name));
 
        len = ptcache_filename(pid, old_filename, 0, 0, 0); /* no path */
 
        ptcache_path(pid, path);
        dir = opendir(path);
        if(dir==NULL) {
-               strcpy(pid->cache->name, old_name);
+               BLI_strncpy(pid->cache->name, old_name, sizeof(pid->cache->name));
                return;
        }
 
        BLI_snprintf(ext, sizeof(ext), "_%02u"PTCACHE_EXT, pid->stack_index);
 
        /* put new name into cache */
-       strcpy(pid->cache->name, to);
+       BLI_strncpy(pid->cache->name, to, sizeof(pid->cache->name));
 
        while ((de = readdir(dir)) != NULL) {
                if (strstr(de->d_name, ext)) { /* do we have the right extension?*/
@@ -2963,7 +2963,7 @@ void BKE_ptcache_load_external(PTCacheID *pid)
        if(cache->index >= 0)
                BLI_snprintf(ext, sizeof(ext), "_%02d"PTCACHE_EXT, cache->index);
        else
-               strcpy(ext, PTCACHE_EXT);
+               BLI_strncpy(ext, PTCACHE_EXT, sizeof(ext));
        
        while ((de = readdir(dir)) != NULL) {
                if (strstr(de->d_name, ext)) { /* do we have the right extension?*/
index cdf2e39a4dd973d78f5356b34ce92c6bc0b7d183..e0e2876f79e11877f3205a98ea7168efaec03c12 100644 (file)
@@ -166,7 +166,7 @@ void unique_property(bProperty *first, bProperty *prop, int force)
                        int i= 0;
 
                        /* strip numbers */
-                       strcpy(base_name, prop->name);
+                       BLI_strncpy(base_name, prop->name, sizeof(base_name));
                        for(i= strlen(base_name)-1; (i>=0 && isdigit(base_name[i])); i--) {
                                base_name[i]= '\0';
                        }
@@ -178,7 +178,7 @@ void unique_property(bProperty *first, bProperty *prop, int force)
                                strcat(new_name, num);
                        } while(get_property__internal(first, prop, new_name));
 
-                       strcpy(prop->name, new_name);
+                       BLI_strncpy(prop->name, new_name, sizeof(prop->name));
                }
        }
 }
@@ -257,7 +257,7 @@ void set_property(bProperty *prop, char *str)
                *((float *)&prop->data)= (float)atof(str);
                break;
        case GPROP_STRING:
-               strcpy(prop->poin, str);
+               strcpy(prop->poin, str); /* TODO - check size? */
                break;
        }
        
index 00534400cf135e28572c1680975aaa8e48b755f7..cf03a8d3f36321e3b6c52566c89c5bdebdf98519 100644 (file)
 #include "BKE_sequencer.h"
 #include "BKE_fcurve.h"
 #include "BKE_scene.h"
-#include "RNA_access.h"
 #include "BKE_utildefines.h"
 
+#include "RNA_access.h"
+
 #include "RE_pipeline.h"
 
 #include <pthread.h>
@@ -866,8 +867,8 @@ void seqbase_unique_name_recursive(ListBase *seqbasep, struct Sequence *seq)
        SeqUniqueInfo sui;
        char *dot;
        sui.seq= seq;
-       strcpy(sui.name_src, seq->name+2);
-       strcpy(sui.name_dest, seq->name+2);
+       BLI_strncpy(sui.name_src, seq->name+2, sizeof(sui.name_src));
+       BLI_strncpy(sui.name_dest, seq->name+2, sizeof(sui.name_dest));
 
        sui.count= 1;
        sui.match= 1; /* assume the worst to start the loop */
@@ -887,7 +888,7 @@ void seqbase_unique_name_recursive(ListBase *seqbasep, struct Sequence *seq)
                seqbase_recursive_apply(seqbasep, seqbase_unique_name_recursive_cb, &sui);
        }
 
-       strcpy(seq->name+2, sui.name_dest);
+       BLI_strncpy(seq->name+2, sui.name_dest, sizeof(seq->name)-2);
 }
 
 static const char *give_seqname_by_type(int type)
@@ -1204,7 +1205,7 @@ static int seq_proxy_get_fname(SeqRenderData context, Sequence * seq, int cfra,
           sorry folks, please rebuild your proxies... */
 
        if (seq->flag & (SEQ_USE_PROXY_CUSTOM_DIR|SEQ_USE_PROXY_CUSTOM_FILE)) {
-               strcpy(dir, seq->strip->proxy->dir);
+               BLI_strncpy(dir, seq->strip->proxy->dir, sizeof(dir));
        } else if (seq->type == SEQ_IMAGE) {
                BLI_snprintf(dir, PROXY_MAXFILE, "%s/BL_proxy", seq->strip->dir);
        } else {
@@ -3360,9 +3361,9 @@ int seq_swap(Sequence *seq_a, Sequence *seq_b, const char **error_str)
        SWAP(Sequence, *seq_a, *seq_b);
 
        /* swap back names so animation fcurves dont get swapped */
-       strcpy(name, seq_a->name+2);
-       strcpy(seq_a->name+2, seq_b->name+2);
-       strcpy(seq_b->name+2, name);
+       BLI_strncpy(name, seq_a->name+2, sizeof(name));
+       BLI_strncpy(seq_a->name+2, seq_b->name+2, sizeof(seq_b->name)-2);
+       BLI_strncpy(seq_b->name+2, name, sizeof(seq_b->name)-2);
 
        /* swap back opacity, and overlay mode */
        SWAP(int, seq_a->blend_mode, seq_b->blend_mode);
index 85140841f1579c9bae2800554063ad7aafcfdd93..c1833b39b8b3dde6486f0e0787162cfbbcd88d0b 100644 (file)
@@ -131,15 +131,15 @@ struct Scene;
 struct DerivedMesh;
 struct SmokeModifierData;
 
-// forward declerations
-static void get_cell(float *p0, int res[3], float dx, float *pos, int *cell, int correct);
-void calcTriangleDivs(Object *ob, MVert *verts, int numverts, MFace *tris, int numfaces, int numtris, int **tridivs, float cell_len);
-static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs);
-
 #define TRI_UVOFFSET (1./4.)
 
+#ifdef WITH_SMOKE
+/* forward declerations */
+static void calcTriangleDivs(Object *ob, MVert *verts, int numverts, MFace *tris, int numfaces, int numtris, int **tridivs, float cell_len);
+static void get_cell(float *p0, int res[3], float dx, float *pos, int *cell, int correct);
+static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs);
+#else /* WITH_SMOKE */
 /* Stubs to use when smoke is disabled */
-#ifndef WITH_SMOKE
 struct WTURBULENCE *smoke_turbulence_init(int *UNUSED(res), int UNUSED(amplify), int UNUSED(noisetype)) { return NULL; }
 struct FLUID_3D *smoke_init(int *UNUSED(res), float *UNUSED(p0)) { return NULL; }
 void smoke_free(struct FLUID_3D *UNUSED(fluid)) {}
@@ -148,9 +148,9 @@ void smoke_initWaveletBlenderRNA(struct WTURBULENCE *UNUSED(wt), float *UNUSED(s
 void smoke_initBlenderRNA(struct FLUID_3D *UNUSED(fluid), float *UNUSED(alpha), float *UNUSED(beta), float *UNUSED(dt_factor), float *UNUSED(vorticity), int *UNUSED(border_colli)) {}
 long long smoke_get_mem_req(int UNUSED(xres), int UNUSED(yres), int UNUSED(zres), int UNUSED(amplify)) { return 0; }
 void smokeModifier_do(SmokeModifierData *UNUSED(smd), Scene *UNUSED(scene), Object *UNUSED(ob), DerivedMesh *UNUSED(dm)) {}
-#endif // WITH_SMOKE
-
+#endif /* WITH_SMOKE */
 
+#ifdef WITH_SMOKE
 static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene, DerivedMesh *dm)
 {
        if((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain && !smd->domain->fluid)
@@ -455,7 +455,7 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs)
 }
 
 /*! init triangle divisions */
-void calcTriangleDivs(Object *ob, MVert *verts, int UNUSED(numverts), MFace *faces, int numfaces, int numtris, int **tridivs, float cell_len) 
+static void calcTriangleDivs(Object *ob, MVert *verts, int UNUSED(numverts), MFace *faces, int numfaces, int numtris, int **tridivs, float cell_len)
 {
        // mTriangleDivs1.resize( faces.size() );
        // mTriangleDivs2.resize( faces.size() );
@@ -554,6 +554,8 @@ void calcTriangleDivs(Object *ob, MVert *verts, int UNUSED(numverts), MFace *fac
        }
 }
 
+#endif /* WITH_SMOKE */
+
 static void smokeModifier_freeDomain(SmokeModifierData *smd)
 {
        if(smd->domain)
@@ -812,13 +814,12 @@ void smokeModifier_copy(struct SmokeModifierData *smd, struct SmokeModifierData
        }
 }
 
+#ifdef WITH_SMOKE
 
 // forward decleration
 static void smoke_calc_transparency(float *result, float *input, float *p0, float *p1, int res[3], float dx, float *light, bresenham_callback cb, float correct);
 static float calc_voxel_transp(float *result, float *input, int res[3], int *pixel, float *tRay, float correct);
 
-#ifdef WITH_SMOKE
-
 static int get_lamp(Scene *scene, float *light)
 {      
        Base *base_tmp = NULL;  
@@ -1660,4 +1661,4 @@ static void smoke_calc_transparency(float *result, float *input, float *p0, floa
        }
 }
 
-#endif // WITH_SMOKE
+#endif /* WITH_SMOKE */
index 65b4a21d0eeaadbf5a2b92dc51663db813bd80a0..cd147f4dbed4c54eb0bdde8015a31e4b6c27840e 100644 (file)
@@ -68,6 +68,7 @@ variables on the UI for now
 
 #include "BLI_math.h"
 #include "BLI_utildefines.h"
+#include "BLI_listbase.h"
 #include "BLI_ghash.h"
 #include "BLI_threads.h"
 
@@ -207,7 +208,7 @@ static float sb_time_scale(Object *ob)
        }
        return (1.0f);
        /*
-       this would be frames/sec independant timing assuming 25 fps is default
+       this would be frames/sec independent timing assuming 25 fps is default
        but does not work very well with NLA
                return (25.0f/scene->r.frs_sec)
        */
index 07df12d546890bfc766721c8bc98df7472fd3b22..02e381fe9b430691f9055ded56eb88feb0d85aff 100644 (file)
@@ -79,9 +79,9 @@ struct bSound* sound_new_file(struct Main *bmain, const char *filename)
        char str[FILE_MAX];
        char *path;
 
-       int len;
+       size_t len;
 
-       strcpy(str, filename);
+       BLI_strncpy(str, filename, sizeof(str));
 
        path = /*bmain ? bmain->name :*/ G.main->name;
 
index 40ac4dc29444fe7a14042d434e6a0b82357a5f74..b111568fcf45777e3750a3ce33f0eec5896d76a5 100644 (file)
@@ -141,7 +141,7 @@ static CCGSubSurf *_getSubSurf(CCGSubSurf *prevSS, int subdivLevels, int useAgin
                ccgSubSurf_setUseAgeCounts(ccgSS, 1, 8, 8, 8);
        }
 
-       ccgSubSurf_setCalcVertexNormals(ccgSS, 1, BLI_STRUCT_OFFSET(DMGridData, no));
+       ccgSubSurf_setCalcVertexNormals(ccgSS, 1, offsetof(DMGridData, no));
 
        return ccgSS;
 }
index d344f79bb6caed1b34d6ac41f715266bd33d3518..7d720aed62caf6b9715aaa836c59391e47178dcf 100644 (file)
@@ -992,7 +992,7 @@ void autotexname(Tex *tex)
                if(tex->type==TEX_IMAGE) {
                        ima= tex->ima;
                        if(ima) {
-                               strcpy(di, ima->name);
+                               BLI_strncpy(di, ima->name, sizeof(di));
                                BLI_splitdirstring(di, fi);
                                strcpy(di, "I.");
                                strcat(di, fi);
index 58a2f45e8762816c800325e0c5380e56a35f8845..7b414f7746a6cea31736ceba29d15e86ff25ecc7 100644 (file)
@@ -407,8 +407,7 @@ static void set_ffmpeg_properties(RenderData *rd, AVCodecContext *c, const char
                return;
        }
        
-       prop = IDP_GetPropertyFromGroup(
-               rd->ffcodecdata.properties, (char*) prop_name);
+       prop = IDP_GetPropertyFromGroup(rd->ffcodecdata.properties, prop_name);
        if (!prop) {
                return;
        }
@@ -1025,8 +1024,7 @@ void ffmpeg_property_del(RenderData *rd, void *type, void *prop_)
                return;
        }
 
-       group = IDP_GetPropertyFromGroup(
-               rd->ffcodecdata.properties, (char*) type);
+       group = IDP_GetPropertyFromGroup(rd->ffcodecdata.properties, type);
        if (group && prop) {
                IDP_RemFromGroup(group, prop);
                IDP_FreeProperty(prop);
@@ -1057,11 +1055,10 @@ IDProperty *ffmpeg_property_add(RenderData *rd, char * type, int opt_index, int
                        = IDP_New(IDP_GROUP, val, "ffmpeg"); 
        }
 
-       group = IDP_GetPropertyFromGroup(
-               rd->ffcodecdata.properties, (char*) type);
+       group = IDP_GetPropertyFromGroup(rd->ffcodecdata.properties, type);
        
        if (!group) {
-               group = IDP_New(IDP_GROUP, val, (char*) type); 
+               group = IDP_New(IDP_GROUP, val, type);
                IDP_AddToGroup(rd->ffcodecdata.properties, group);
        }
 
index ba5d04f3021902ca0bcb3fc17da94fa8804e97d8..356709d5ccd6dada3cd977f18fc4bb2868412d40 100644 (file)
@@ -64,8 +64,6 @@ struct ListBase;
 
 #include <stdlib.h>
 
-extern char btempdir[]; /* creator.c temp dir used instead of U.tempdir, set with BLI_where_is_temp( btempdir, 1 ); */
-
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -74,9 +72,9 @@ extern "C" {
 
 #include "BLI_string.h"
 
-#include "BLI_path_util.h"
+#include "BLI_string_utf8.h"
 
-#include "BLI_storage.h"
+#include "BLI_path_util.h"
 
 #include "BLI_fileops.h"
 
@@ -84,13 +82,6 @@ extern "C" {
 
 #include "BLI_noise.h"
 
-/**
- * @param strct The structure of interest
- * @param member The name of a member field of @a strct
- * @retval The offset in bytes of @a member within @a strct
- */
-#define BLI_STRUCT_OFFSET(strct, member)       ((int)(intptr_t) &((strct*) 0)->member)
-
 #ifdef __cplusplus
 }
 #endif
index fba13035f02d2260eff980aff33c8959c31600c7..23ffdbae59b780158710ec8561b29412fab371f2 100644 (file)
@@ -30,7 +30,7 @@
 #ifndef BLI_EDGEHASH_H
 #define BLI_EDGEHASH_H
 
-/** \file BLI_storage.h
+/** \file BLI_edgehash.h
  *  \ingroup bli
  *  \author Daniel Dunbar
  *  \brief A general unordered 2-int pair hash table ADT.
index 21d28ca31853f32e99b3404fe882db83da38c89d..ebe231e2973a5cfae3fc1a4ff83fc40acdba87d7 100644 (file)
 
 /** \file BLI_fileops.h
  *  \ingroup bli
- *  \author Daniel Dunbar
- *  \brief More low-level fileops from Daniel Dunbar. Two functions were also
- * defined in storage.c. These are the old fop_ prefixes. There is
- * definitely some redundancy here!
+ *  \brief File and directory operations.
  * */
 
 #ifndef BLI_FILEOPS_H
 extern "C" {
 #endif
 
-void  BLI_recurdir_fileops(const char *dirname);
-int BLI_link(const char *file, const char *to);
-int BLI_is_writable(const char *filename);
+#include "BLI_fileops_types.h"
 
-/**
- * @attention Do not confuse with BLI_exist
- */
-int   BLI_exists(const char *file);
-int   BLI_copy_fileops(const char *file, const char *to);
-int   BLI_rename(const char *from, const char *to);
-int   BLI_gzip(const char *from, const char *to);
-char *BLI_ungzip_to_mem(const char *from_file, int *size_r);
-int   BLI_delete(const char *file, int dir, int recursive);
-int   BLI_move(const char *file, const char *to);
-int   BLI_touch(const char *file);
-
-/* only for the sane unix world: direct calls to system functions :( */
-#ifndef WIN32
-void BLI_setCmdCallBack(int (*f)(char*));
-#endif
+/* for size_t (needed on windows) */
+#include <stddef.h>
+
+/* Common */
+
+int    BLI_exists(const char *path);
+int    BLI_copy(const char *path, const char *to);
+int    BLI_rename(const char *from, const char *to);
+int    BLI_delete(const char *path, int dir, int recursive);
+int    BLI_move(const char *path, const char *to);
+int    BLI_create_symlink(const char *path, const char *to);
+
+/* Directories */
+
+struct direntry;
+
+int    BLI_is_dir(const char *path);
+void   BLI_dir_create_recursive(const char *dir);
+double BLI_dir_free_space(const char *dir);
+char  *BLI_current_working_dir(char *dir, const int maxlen);
+
+unsigned int BLI_dir_contents(const char *dir, struct direntry **filelist);
+
+/* Files */
+
+int    BLI_file_is_writable(const char *file);
+int    BLI_file_touch(const char *file);
+
+int    BLI_file_gzip(const char *from, const char *to);
+char  *BLI_file_ungzip_to_mem(const char *from_file, int *size_r);
+
+size_t BLI_file_descriptor_size(int file);
+size_t BLI_file_size(const char *file);
+
+       /* compare if one was last modified before the other */
+int    BLI_file_older(const char *file1, const char *file2);
+
+       /* read ascii file as lines, empty list if reading fails */
+struct LinkNode *BLI_file_read_as_lines(const char *file);
+void   BLI_file_free_lines(struct LinkNode *lines);
 
 #ifdef __cplusplus
 }
similarity index 93%
rename from source/blender/blenlib/BLI_storage_types.h
rename to source/blender/blenlib/BLI_fileops_types.h
index 07c0ceffeb51b65bc027a338e46d1e94ae874c41..58dcf1a54417702a376da25a2e8b1d30cdd8ef77 100644 (file)
  *
  * ***** END GPL LICENSE BLOCK *****
  */
-#ifndef BLI_STORAGE_TYPES_H
-#define BLI_STORAGE_TYPES_H
 
-/** \file BLI_storage_types.h
+#ifndef BLI_FILEOPS_TYPES_H
+#define BLI_FILEOPS_TYPES_H
+
+/** \file BLI_fileops_types.h
  *  \ingroup bli
  *  \brief Some types for dealing with directories.
  */
@@ -75,5 +76,5 @@ struct dirlink
        char *name;
 };
 
-#endif /* BLI_STORAGE_TYPES_H */
+#endif /* BLI_FILEOPS_TYPES_H */
 
index e4afc6ad79b7a753bcf19391787fc40461e90da0..e4ef834822f6ec18a43e809f9ae59f9d78b63b7b 100644 (file)
 extern "C" {
 #endif
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "BLI_mempool.h"
-#include "BLI_blenlib.h"
-
 typedef unsigned int   (*GHashHashFP)          (const void *key);
 typedef int                            (*GHashCmpFP)           (const void *a, const void *b);
 typedef        void                    (*GHashKeyFreeFP)       (void *key);
index 4ea48929efb7225d5b6a24eeaf6ac9eca01461d3..56df71b55823398e64f03dde97017b5ca0227d57 100644 (file)
@@ -29,7 +29,7 @@
 #ifndef BLI_MEMPOOL_H
 #define BLI_MEMPOOL_H
 
-/** \file BLI_storage.h
+/** \file BLI_mempool.h
  *  \ingroup bli
  *  \author Geoffrey Bantle
  *  \brief Simple fast memory allocator.
index 4f7f7b482b5db412d14328569304d9223a203fa1..82794e08fa09442dcae7177b27ed5d5fe1ad6fea 100644 (file)
@@ -65,10 +65,6 @@ char *BLI_get_folder_version(const int id, const int ver, const int do_check);
 #define BLENDER_SYSTEM_PLUGINS         54
 #define BLENDER_SYSTEM_PYTHON          54
 
-#define BLENDER_TEMP                           80
-
-#define BLENDER_USERFOLDER(id) (id >= BLENDER_USER_CONFIG && id <= BLENDER_USER_PLUGINS)
-
 /* for BLI_get_folder_version only */
 #define BLENDER_RESOURCE_PATH_USER             0
 #define BLENDER_RESOURCE_PATH_LOCAL            1
@@ -78,17 +74,6 @@ char *BLI_get_folder_version(const int id, const int ver, const int do_check);
 #define BLENDER_BOOKMARK_FILE  "bookmarks.txt"
 #define BLENDER_HISTORY_FILE   "recent-files.txt"
 
-#ifdef WIN32
-#define BLENDER_USER_FORMAT            "%s\\Blender Foundation\\Blender\\%s"
-#define BLENDER_SYSTEM_FORMAT          "%s\\Blender Foundation\\Blender\\%s"
-#elif defined(__APPLE__)
-#define BLENDER_USER_FORMAT                    "%s/Blender/%s"
-#define BLENDER_SYSTEM_FORMAT                  "%s/Blender/%s"
-#else
-#define BLENDER_USER_FORMAT                    "%s/.blender/%s"
-#define BLENDER_SYSTEM_FORMAT                  "%s/blender/%s"
-#endif
-
 #ifdef WIN32
 #define SEP '\\'
 #define ALTSEP '/'
@@ -104,6 +89,8 @@ void BLI_make_file_string(const char *relabase, char *string,  const char *dir,
 void BLI_make_exist(char *dir);
 void BLI_make_existing_file(const char *name);
 void BLI_split_dirfile(const char *string, char *dir, char *file, const size_t dirlen, const size_t filelen);
+void BLI_split_dir_part(const char *string, char *dir, const size_t dirlen);
+void BLI_split_file_part(const char *string, char *file, const size_t filelen);
 void BLI_join_dirfile(char *string, const size_t maxlen, const char *dir, const char *file);
 char *BLI_path_basename(char *path);
 int BKE_rebase_path(char *abs, size_t abs_len, char *rel, size_t rel_len, const char *base_dir, const char *src_dir, const char *dest_dir);
@@ -179,29 +166,20 @@ void BLI_path_rel(char *file, const char *relfile);
         */
 void BLI_char_switch(char *string, char from, char to);
 
-/**
-        * Checks if name is a fully qualified filename to an executable.
-        * If not it searches $PATH for the file. On Windows it also
-        * adds the correct extension (.com .exe etc) from
-        * $PATHEXT if necessary. Also on Windows it translates
-        * the name to its 8.3 version to prevent problems with
-        * spaces and stuff. Final result is returned in fullname.
-        *
-        * @param fullname The full path and full name of the executable
-        * @param name The name of the executable (usually argv[0]) to be checked
-        */
-void BLI_where_am_i(char *fullname, const size_t maxlen, const char *name);
-
-       /**
-        * Gets the temp directory when blender first runs.
-        * If the default path is not found, use try $TEMP
-        * 
-        * Also make sure the temp dir has a trailing slash
-        *
-        * @param fullname The full path to the temp directory
-        */
-void BLI_where_is_temp(char *fullname, const size_t maxlen, int usertemp);
-
+       /* Initialize path to program executable */
+void BLI_init_program_path(const char *argv0);
+       /* Initialize path to temporary directory.
+        * NOTE: On Window userdir will be set to the temporary directory! */
+void BLI_init_temporary_dir(char *userdir);
+
+       /* Path to executable */
+const char *BLI_program_path(void);
+       /* Path to directory of executable */
+const char *BLI_program_dir(void);
+       /* Path to temporary directory (with trailing slash) */
+const char *BLI_temporary_dir(void);
+       /* Path to the system temporary directory (with trailing slash) */
+void BLI_system_temporary_dir(char *dir);
 
 #ifdef WITH_ICONV
 void BLI_string_to_utf8(char *original, char *utf_8, const char *code);
index c5acf7b7f706787c8a840b05313c1acb68c84030..3cc6ebcc7da041e236491af19ace5021e8e9d7d6 100644 (file)
@@ -30,7 +30,7 @@
 #ifndef BLI_SCANFILL_H
 #define BLI_SCANFILL_H
 
-/** \file BLI_storage.h
+/** \file BLI_scanfill.h
  *  \ingroup bli
  *  \since March 2001
  *  \author nzc
diff --git a/source/blender/blenlib/BLI_storage.h b/source/blender/blenlib/BLI_storage.h
deleted file mode 100644 (file)
index 017f987..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/* $Id$ 
- *
- * ***** 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) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef BLI_STORAGE_H
-#define BLI_STORAGE_H
-
-/** \file BLI_storage.h
- *  \ingroup bli
- */
-
-#ifdef WIN32
-/* for size_t, only needed on win32 for some reason */
-#include <stddef.h>
-#endif
-
-struct direntry;
-
-
-void   BLI_adddirstrings(void);
-void   BLI_builddir(const char *dirname, const char *relname);
-int    BLI_compare(struct direntry *entry1, struct direntry *entry2);
-
-size_t BLI_filesize(int file);
-size_t BLI_filepathsize(const char *path);
-double BLI_diskfree(const char *dir);
-char *BLI_getwdN(char *dir, const int maxncpy);
-
-unsigned int BLI_getdir(const char *dirname, struct direntry **filelist);
-/**
- * @attention Do not confuse with BLI_exists
- */
-int    BLI_exist(const char *name);
-/**
-        * Read a file as ASCII lines. An empty list is
-        * returned if the file cannot be opened or read.
-        * 
-        * @attention The returned list should be free'd with
-        * BLI_free_file_lines.
-        * 
-        * @param name The name of the file to read.
-        * @retval A list of strings representing the file lines.
-        */
-
-int BLI_is_dir(const char *file);
-
-struct LinkNode *BLI_read_file_as_lines(const char *name);
-
-       /**
-        * Free the list returned by BLI_read_file_as_lines.
-        */
-void BLI_free_file_lines(struct LinkNode *lines);
-
-       /* Compare if one was last modified before the other */
-int            BLI_file_older(const char *file1, const char *file2);
-
-#endif /* BLI_STORAGE_H */
-
index 3ac8dba106a1ef74f9b64c804b8311c7a8d4c6da..958f240e3a8fb9ac7ebc1ac36cb1f87e4d17fc49 100644 (file)
@@ -25,9 +25,7 @@
  * Contributor(s): none yet.
  *
  * ***** END GPL LICENSE BLOCK *****
- *
- * $Id$ 
-*/
+ */
 
 #ifndef BLI_STRING_H
 #define BLI_STRING_H
@@ -142,16 +140,6 @@ void BLI_timestr(double _time, char *str); /* time var is global */
 void BLI_ascii_strtolower(char *str, int len);
 void BLI_ascii_strtoupper(char *str, int len);
 
-
-/* string_utf8.c - may move these into their own header some day - campbell */
-char *BLI_strncpy_utf8(char *dst, const char *src, size_t maxncpy);
-int BLI_utf8_invalid_byte(const char *str, int length);
-int BLI_utf8_invalid_strip(char *str, int length);
-      /* copied from glib */
-char *BLI_str_find_prev_char_utf8(const char *str, const char *p);
-char *BLI_str_find_next_char_utf8(const char *p, const char *end);
-char *BLI_str_prev_char_utf8(const char *p);
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/source/blender/blenlib/BLI_string_utf8.h b/source/blender/blenlib/BLI_string_utf8.h
new file mode 100644 (file)
index 0000000..bcb641d
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * $Id$
+ *
+ * ***** 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.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef BLI_STRING_UTF8_H
+#define BLI_STRING_UTF8_H
+
+/** \file BLI_string_utf8.h
+ *  \ingroup bli
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+char        *BLI_strncpy_utf8(char *dst, const char *src, size_t maxncpy);
+int          BLI_utf8_invalid_byte(const char *str, int length);
+int          BLI_utf8_invalid_strip(char *str, int length);
+
+int          BLI_str_utf8_size(const char *p); /* warning, can return -1 on bad chars */
+    /* copied from glib */
+unsigned int BLI_str_utf8_as_unicode(const char *p);
+unsigned int BLI_str_utf8_as_unicode_and_size(const char *p, size_t *index);
+unsigned int BLI_str_utf8_as_unicode_step(const char *p, size_t *index);
+size_t          BLI_str_utf8_from_unicode(unsigned int c, char *outbuf);
+
+char        *BLI_str_find_prev_char_utf8(const char *str, const char *p);
+char        *BLI_str_find_next_char_utf8(const char *p, const char *end);
+char        *BLI_str_prev_char_utf8(const char *p);
+
+    /* wchar_t functions, copied from blenders own font.c originally */
+size_t       BLI_wstrlen_utf8(const wchar_t *src);
+size_t       BLI_strlen_utf8(const char *strc);
+size_t       BLI_strncpy_wchar_as_utf8(char *dst, const wchar_t *src, const size_t maxcpy);
+size_t       BLI_strncpy_wchar_from_utf8(wchar_t *dst, const char *src, const size_t maxcpy);
+
+#define      BLI_UTF8_MAX 6
+#define      BLI_UTF8_ERR ((unsigned int)-1)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
index 456ee72c4e0994ecdccc0f183d24087a2269daa3..c1eed40de74064dcefe7f61f2bf359d1820e68a5 100644 (file)
 #define MAX3(x,y,z)             MAX2( MAX2((x),(y)) , (z) )
 #define MAX4(x,y,z,a)           MAX2( MAX2((x),(y)) , MAX2((z),(a)) )
 
-#define INIT_MINMAX(min, max) { (min)[0]= (min)[1]= (min)[2]= 1.0e30f; (max)[0]= (max)[1]= (max)[2]= -1.0e30f; }
-
-#define INIT_MINMAX2(min, max) { (min)[0]= (min)[1]= 1.0e30f; (max)[0]= (max)[1]= -1.0e30f; }
-
-#define DO_MIN(vec, min) { if( (min)[0]>(vec)[0] ) (min)[0]= (vec)[0];      \
-                                                         if( (min)[1]>(vec)[1] ) (min)[1]= (vec)[1];   \
-                                                         if( (min)[2]>(vec)[2] ) (min)[2]= (vec)[2]; } \
-
-#define DO_MAX(vec, max) { if( (max)[0]<(vec)[0] ) (max)[0]= (vec)[0];         \
-                                                         if( (max)[1]<(vec)[1] ) (max)[1]= (vec)[1];   \
-                                                         if( (max)[2]<(vec)[2] ) (max)[2]= (vec)[2]; } \
-
-#define DO_MINMAX(vec, min, max) { if( (min)[0]>(vec)[0] ) (min)[0]= (vec)[0]; \
-                                                         if( (min)[1]>(vec)[1] ) (min)[1]= (vec)[1]; \
-                                                         if( (min)[2]>(vec)[2] ) (min)[2]= (vec)[2]; \
-                                                         if( (max)[0]<(vec)[0] ) (max)[0]= (vec)[0]; \
-                                                         if( (max)[1]<(vec)[1] ) (max)[1]= (vec)[1]; \
-                                                         if( (max)[2]<(vec)[2] ) (max)[2]= (vec)[2]; } \
-
-#define DO_MINMAX2(vec, min, max) { if( (min)[0]>(vec)[0] ) (min)[0]= (vec)[0]; \
-                                                         if( (min)[1]>(vec)[1] ) (min)[1]= (vec)[1]; \
-                                                         if( (max)[0]<(vec)[0] ) (max)[0]= (vec)[0]; \
-                                                         if( (max)[1]<(vec)[1] ) (max)[1]= (vec)[1]; }
+#define INIT_MINMAX(min, max) {                                               \
+               (min)[0]= (min)[1]= (min)[2]= 1.0e30f;                                \
+               (max)[0]= (max)[1]= (max)[2]= -1.0e30f;                               \
+       }
+#define INIT_MINMAX2(min, max) {                                              \
+               (min)[0]= (min)[1]= 1.0e30f;                                          \
+               (max)[0]= (max)[1]= -1.0e30f;                                         \
+       }
+#define DO_MIN(vec, min) {                                                    \
+               if( (min)[0]>(vec)[0] ) (min)[0]= (vec)[0];                           \
+               if( (min)[1]>(vec)[1] ) (min)[1]= (vec)[1];                           \
+               if( (min)[2]>(vec)[2] ) (min)[2]= (vec)[2];                           \
+       }
+#define DO_MAX(vec, max) {                                                    \
+               if( (max)[0]<(vec)[0] ) (max)[0]= (vec)[0];                           \
+               if( (max)[1]<(vec)[1] ) (max)[1]= (vec)[1];                           \
+               if( (max)[2]<(vec)[2] ) (max)[2]= (vec)[2];                           \
+       }
+#define DO_MINMAX(vec, min, max) {                                            \
+               if( (min)[0]>(vec)[0] ) (min)[0]= (vec)[0];                           \
+               if( (min)[1]>(vec)[1] ) (min)[1]= (vec)[1];                           \
+               if( (min)[2]>(vec)[2] ) (min)[2]= (vec)[2];                           \
+               if( (max)[0]<(vec)[0] ) (max)[0]= (vec)[0];                           \
+               if( (max)[1]<(vec)[1] ) (max)[1]= (vec)[1];                           \
+               if( (max)[2]<(vec)[2] ) (max)[2]= (vec)[2];                           \
+       }
+#define DO_MINMAX2(vec, min, max) {                                           \
+               if( (min)[0]>(vec)[0] ) (min)[0]= (vec)[0];                           \
+               if( (min)[1]>(vec)[1] ) (min)[1]= (vec)[1];                           \
+               if( (max)[0]<(vec)[0] ) (max)[0]= (vec)[0];                           \
+               if( (max)[1]<(vec)[1] ) (max)[1]= (vec)[1];                           \
+       }
 
 /* some math and copy defines */
 
 #ifndef SWAP
-#  define SWAP(type, a, b)        { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; }
+#  define SWAP(type, a, b)       { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; }
 #endif
 
-#define ABS(a)                                 ( (a)<0 ? (-(a)) : (a) )
-
-#define AVG2(x, y)             ( 0.5 * ((x) + (y)) )
+#define ABS(a)          ( (a)<0 ? (-(a)) : (a) )
 
 #define FTOCHAR(val) ((val)<=0.0f)? 0 : (((val)>(1.0f-0.5f/255.0f))? 255 : (char)((255.0f*(val))+0.5f))
 #define FTOUSHORT(val) ((val >= 1.0f-0.5f/65535)? 65535: (val <= 0.0f)? 0: (unsigned short)(val*65535.0f + 0.5f))
-#define F3TOCHAR3(v2,v1) (v1)[0]=FTOCHAR((v2[0])); (v1)[1]=FTOCHAR((v2[1])); (v1)[2]=FTOCHAR((v2[2]))
-#define F3TOCHAR4(v2,v1) { (v1)[0]=FTOCHAR((v2[0])); (v1)[1]=FTOCHAR((v2[1])); (v1)[2]=FTOCHAR((v2[2])); \
-                                               (v1)[3] = 255; }
-#define F4TOCHAR4(v2,v1) { (v1)[0]=FTOCHAR((v2[0])); (v1)[1]=FTOCHAR((v2[1])); (v1)[2]=FTOCHAR((v2[2])); \
-                                               (v1)[3]=FTOCHAR((v2[3])); }
-
-
-#define VECCOPY(v1,v2)          {*(v1)= *(v2); *(v1+1)= *(v2+1); *(v1+2)= *(v2+2);}
-#define VECCOPY2D(v1,v2)          {*(v1)= *(v2); *(v1+1)= *(v2+1);}
-#define QUATCOPY(v1,v2)         {*(v1)= *(v2); *(v1+1)= *(v2+1); *(v1+2)= *(v2+2); *(v1+3)= *(v2+3);}
-#define LONGCOPY(a, b, c)      {int lcpc=c, *lcpa=(int *)a, *lcpb=(int *)b; while(lcpc-->0) *(lcpa++)= *(lcpb++);}
-
-
-#define VECADD(v1,v2,v3)       {*(v1)= *(v2) + *(v3); *(v1+1)= *(v2+1) + *(v3+1); *(v1+2)= *(v2+2) + *(v3+2);}
-#define VECSUB(v1,v2,v3)       {*(v1)= *(v2) - *(v3); *(v1+1)= *(v2+1) - *(v3+1); *(v1+2)= *(v2+2) - *(v3+2);}
-#define VECSUB2D(v1,v2,v3)     {*(v1)= *(v2) - *(v3); *(v1+1)= *(v2+1) - *(v3+1);}
-#define VECADDFAC(v1,v2,v3,fac) {*(v1)= *(v2) + *(v3)*(fac); *(v1+1)= *(v2+1) + *(v3+1)*(fac); *(v1+2)= *(v2+2) + *(v3+2)*(fac);}
-#define VECSUBFAC(v1,v2,v3,fac) {*(v1)= *(v2) - *(v3)*(fac); *(v1+1)= *(v2+1) - *(v3+1)*(fac); *(v1+2)= *(v2+2) - *(v3+2)*(fac);}
-#define QUATADDFAC(v1,v2,v3,fac) {*(v1)= *(v2) + *(v3)*(fac); *(v1+1)= *(v2+1) + *(v3+1)*(fac); *(v1+2)= *(v2+2) + *(v3+2)*(fac); *(v1+3)= *(v2+3) + *(v3+3)*(fac);}
-
-#define INPR(v1, v2)           ( (v1)[0]*(v2)[0] + (v1)[1]*(v2)[1] + (v1)[2]*(v2)[2] )
+#define F3TOCHAR3(v2, v1) {                                                   \
+               (v1)[0]= FTOCHAR((v2[0]));                                            \
+               (v1)[1]= FTOCHAR((v2[1]));                                            \
+               (v1)[2]= FTOCHAR((v2[2]));                                            \
+       }
+#define F3TOCHAR4(v2, v1) {                                                   \
+               (v1)[0]= FTOCHAR((v2[0]));                                            \
+               (v1)[1]= FTOCHAR((v2[1]));                                            \
+               (v1)[2]= FTOCHAR((v2[2]));                                            \
+               (v1)[3]= 255;                                                         \
+       }
+#define F4TOCHAR4(v2, v1) {                                                   \
+               (v1)[0]= FTOCHAR((v2[0]));                                            \
+               (v1)[1]= FTOCHAR((v2[1]));                                            \
+               (v1)[2]= FTOCHAR((v2[2]));                                            \
+               (v1)[3]= FTOCHAR((v2[3]));                                            \
+       }
+#define VECCOPY(v1, v2) {                                                     \
+               *(v1)=   *(v2);                                                       \
+               *(v1+1)= *(v2+1);                                                     \
+               *(v1+2)= *(v2+2);                                                     \
+       }
+#define VECCOPY2D(v1, v2) {                                                   \
+               *(v1)=   *(v2);                                                       \
+               *(v1+1)= *(v2+1);                                                     \
+       }
+#define QUATCOPY(v1, v2) {                                                    \
+               *(v1)=   *(v2);                                                       \
+               *(v1+1)= *(v2+1);                                                     \
+               *(v1+2)= *(v2+2);                                                     \
+               *(v1+3)= *(v2+3);                                                     \
+       }
+#define VECADD(v1,v2,v3) {                                                    \
+               *(v1)=   *(v2)   + *(v3);                                             \
+               *(v1+1)= *(v2+1) + *(v3+1);                                           \
+               *(v1+2)= *(v2+2) + *(v3+2);                                           \
+       }
+#define VECSUB(v1,v2,v3) {                                                    \
+               *(v1)=   *(v2)   - *(v3);                                             \
+               *(v1+1)= *(v2+1) - *(v3+1);                                           \
+               *(v1+2)= *(v2+2) - *(v3+2);                                           \
+       }
+#define VECSUB2D(v1,v2,v3)     {                                              \
+               *(v1)=   *(v2)   - *(v3);                                             \
+               *(v1+1)= *(v2+1) - *(v3+1);                                           \
+       }
+#define VECADDFAC(v1,v2,v3,fac) {                                             \
+               *(v1)=   *(v2)   + *(v3)*(fac);                                       \
+               *(v1+1)= *(v2+1) + *(v3+1)*(fac);                                     \
+               *(v1+2)= *(v2+2) + *(v3+2)*(fac);                                     \
+       }
+#define VECSUBFAC(v1,v2,v3,fac) {                                             \
+               *(v1)=   *(v2)   - *(v3)*(fac);                                       \
+               *(v1+1)= *(v2+1) - *(v3+1)*(fac);                                     \
+               *(v1+2)= *(v2+2) - *(v3+2)*(fac);                                     \
+       }
+#define QUATADDFAC(v1,v2,v3,fac) {                                            \
+               *(v1)=   *(v2)   + *(v3)*(fac);                                       \
+               *(v1+1)= *(v2+1) + *(v3+1)*(fac);                                     \
+               *(v1+2)= *(v2+2) + *(v3+2)*(fac);                                     \
+               *(v1+3)= *(v2+3) + *(v3+3)*(fac);                                     \
+       }
+
+#define INPR(v1, v2) ( (v1)[0]*(v2)[0] + (v1)[1]*(v2)[1] + (v1)[2]*(v2)[2] )
 
 /* some misc stuff.... */
 #define CLAMP(a, b, c)         if((a)<(b)) (a)=(b); else if((a)>(c)) (a)=(c)
 #define IN_RANGE_INCL(a, b, c) ((b < c)? ((b<=a && a<=c)? 1:0) : ((c<=a && a<=b)? 1:0))
 
 /* array helpers */
-#define ARRAY_LAST_ITEM(arr_start, arr_dtype, elem_size, tot)          (arr_dtype *)((char*)arr_start + (elem_size*(tot - 1)))
-#define ARRAY_HAS_ITEM(item, arr_start, arr_dtype, elem_size, tot)     ((item >= arr_start) && (item <= ARRAY_LAST_ITEM(arr_start, arr_dtype, elem_size, tot)))
+#define ARRAY_LAST_ITEM(arr_start, arr_dtype, elem_size, tot)                 \
+               (arr_dtype *)((char*)arr_start + (elem_size*(tot - 1)))
+
+#define ARRAY_HAS_ITEM(item, arr_start, arr_dtype, elem_size, tot) (          \
+               (item >= arr_start) &&                                                \
+               (item <= ARRAY_LAST_ITEM(arr_start, arr_dtype, elem_size, tot))       \
+       )
 
 /* This one rotates the bytes in an int64, int (32) and short (16) */
-#define SWITCH_INT64(a) { \
-       char s_i, *p_i; \
-       p_i= (char *)&(a); \
-       s_i=p_i[0]; p_i[0]=p_i[7]; p_i[7]=s_i; \
-       s_i=p_i[1]; p_i[1]=p_i[6]; p_i[6]=s_i; \
-       s_i=p_i[2]; p_i[2]=p_i[5]; p_i[5]=s_i; \
-       s_i=p_i[3]; p_i[3]=p_i[4]; p_i[4]=s_i; }
-
-               #define SWITCH_INT(a) { \
-       char s_i, *p_i; \
-       p_i= (char *)&(a); \
-       s_i=p_i[0]; p_i[0]=p_i[3]; p_i[3]=s_i; \
-       s_i=p_i[1]; p_i[1]=p_i[2]; p_i[2]=s_i; }
-
-#define SWITCH_SHORT(a)        { \
-       char s_i, *p_i; \
-       p_i= (char *)&(a); \
-       s_i=p_i[0]; p_i[0]=p_i[1]; p_i[1]=s_i; }
+#define SWITCH_INT64(a) {                                                     \
+               char s_i, *p_i;                                                       \
+               p_i= (char *)&(a);                                                    \
+               s_i= p_i[0]; p_i[0]= p_i[7]; p_i[7]= s_i;                             \
+               s_i= p_i[1]; p_i[1]= p_i[6]; p_i[6]= s_i;                             \
+               s_i= p_i[2]; p_i[2]= p_i[5]; p_i[5]= s_i;                             \
+               s_i= p_i[3]; p_i[3]= p_i[4]; p_i[4]= s_i;