svn merge -r39792:39829 https://svn.blender.org/svnroot/bf-blender/trunk/blender
authorCampbell Barton <ideasman42@gmail.com>
Thu, 1 Sep 2011 00:56:21 +0000 (00:56 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 1 Sep 2011 00:56:21 +0000 (00:56 +0000)
93 files changed:
build_files/scons/config/darwin-config.py
build_files/scons/config/win32-vc-config.py
build_files/scons/tools/Blender.py
build_files/scons/tools/btools.py
doc/python_api/rst/bge.render.rst
doc/python_api/rst/bge.types.rst
doc/python_api/sphinx_doc_gen.py
intern/audaspace/CMakeLists.txt
intern/audaspace/intern/AUD_DefaultMixer.cpp [deleted file]
intern/audaspace/intern/AUD_DefaultMixer.h [deleted file]
intern/audaspace/intern/AUD_JOSResampleReaderCoeff.cpp
intern/audaspace/intern/AUD_SoftwareDevice.cpp
intern/ghost/intern/GHOST_ISystemPaths.cpp
intern/ghost/intern/GHOST_Path-api.cpp
intern/ghost/intern/GHOST_SystemCarbon.cpp
intern/ghost/intern/GHOST_WindowWin32.cpp
release/scripts/modules/bpy_types.py
release/scripts/startup/bl_operators/nla.py
release/scripts/startup/bl_operators/object.py
release/scripts/startup/bl_ui/properties_data_armature.py
release/scripts/startup/bl_ui/properties_data_speaker.py
release/scripts/startup/bl_ui/properties_game.py
release/scripts/startup/bl_ui/properties_object_constraint.py
release/scripts/startup/bl_ui/properties_render.py
release/scripts/startup/bl_ui/properties_scene.py
release/scripts/startup/bl_ui/properties_texture.py
release/scripts/startup/bl_ui/space_dopesheet.py
release/scripts/startup/bl_ui/space_nla.py
release/scripts/startup/bl_ui/space_sequencer.py
release/scripts/startup/bl_ui/space_view3d.py
release/scripts/startup/keyingsets_builtins.py
source/blender/blenfont/intern/blf.c
source/blender/blenfont/intern/blf_font.c
source/blender/blenkernel/BKE_sound.h
source/blender/blenkernel/intern/collision.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/pointcache.c
source/blender/blenkernel/intern/report.c
source/blender/blenkernel/intern/sequencer.c
source/blender/blenkernel/intern/sound.c
source/blender/blenkernel/intern/unit.c
source/blender/blenkernel/intern/writeffmpeg.c
source/blender/blenlib/BLI_callbacks.h
source/blender/blenlib/intern/BLI_kdopbvh.c
source/blender/blenlib/intern/BLI_kdtree.c
source/blender/blenlib/intern/graph.c
source/blender/blenlib/intern/math_matrix.c
source/blender/blenlib/intern/storage.c
source/blender/blenloader/intern/readfile.c
source/blender/blenpluginapi/iff.h
source/blender/collada/AnimationExporter.h
source/blender/collada/ArmatureImporter.cpp
source/blender/collada/ExtraHandler.cpp
source/blender/editors/animation/anim_channels_defines.c
source/blender/editors/animation/anim_channels_edit.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/armature/poseSlide.c
source/blender/editors/armature/poseobject.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_select.c
source/blender/editors/physics/physics_fluid.c
source/blender/editors/space_console/space_console.c
source/blender/editors/space_graph/graph_draw.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_logic/logic_window.c
source/blender/editors/space_nla/nla_draw.c
source/blender/editors/space_nla/nla_edit.c
source/blender/editors/space_outliner/outliner_tools.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/gpu/intern/gpu_codegen.c
source/blender/imbuf/CMakeLists.txt
source/blender/imbuf/IMB_imbuf.h
source/blender/imbuf/intern/indexer_dv.c
source/blender/imbuf/intern/openexr/openexr_api.cpp
source/blender/imbuf/intern/openexr/openexr_multi.h
source/blender/imbuf/intern/rectop.c
source/blender/imbuf/intern/writeimage.c
source/blender/python/intern/bpy_app_handlers.c
source/blender/python/intern/bpy_intern_string.c
source/blender/python/intern/bpy_rna.c
source/blender/render/extern/include/RE_pipeline.h
source/blender/render/intern/source/pipeline.c
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/Converter/KX_ConvertActuators.cpp
source/gameengine/GameLogic/SCA_ISensor.h
source/gameengine/Ketsji/KX_GameObject.cpp
source/gameengine/Ketsji/KX_PythonInit.cpp
source/gameengine/Rasterizer/RAS_IRasterizer.h
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
source/gameengine/VideoTexture/FilterColor.h
source/gameengine/VideoTexture/ImageMix.cpp

index 06abaf468dd8d2a92bf28b840ead7aaad780fb64..102ec73a4e309439232208a9d0f460492c54ae28 100644 (file)
@@ -14,7 +14,7 @@ USE_SDK=True
 ###################     Cocoa & architecture settings      ##################
 #############################################################################
 WITH_GHOST_COCOA=True
-MACOSX_ARCHITECTURE = 'i386' # valid archs: ppc, i386, ppc64, x86_64
+MACOSX_ARCHITECTURE = 'x86_64' # valid archs: ppc, i386, ppc64, x86_64
 
 
 cmd = 'uname -p'
@@ -104,14 +104,26 @@ BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
 BF_FFMPEG_LIB = 'avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore theora theoradec theoraenc vorbis vorbisenc vorbisfile ogg bz2'
 #bz2 is a standard osx dynlib
 
-# python 3.1 uses precompiled libraries in bf svn /lib by default
 BF_PYTHON_VERSION = '3.2'
-BF_PYTHON = LIBDIR + '/python'
-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}'
-# BF_PYTHON_LINKFLAGS = ['-u', '_PyMac_Error', '-framework', 'System']
+WITH_OSX_STATICPYTHON = True
+
+if WITH_OSX_STATICPYTHON:
+       # python 3.2 uses precompiled libraries in bf svn /lib by default
+
+       BF_PYTHON = LIBDIR + '/python'
+       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}'
+       # BF_PYTHON_LINKFLAGS = ['-u', '_PyMac_Error', '-framework', 'System']
+else:
+       # python 3.2 uses Python-framework additionally installed in /Library/Frameworks
+       
+       BF_PYTHON = '/Library/Frameworks/Python.framework/Versions/'
+       BF_PYTHON_INC = '${BF_PYTHON}${BF_PYTHON_VERSION}/include/python${BF_PYTHON_VERSION}m'
+       BF_PYTHON_BINARY = '${BF_PYTHON}${BF_PYTHON_VERSION}/bin/python${BF_PYTHON_VERSION}'
+       #BF_PYTHON_LIB = ''
+       BF_PYTHON_LIBPATH = '${BF_PYTHON}${BF_PYTHON_VERSION}/lib/python${BF_PYTHON_VERSION}/config-3.2m'
        
 WITH_BF_OPENAL = True
 #different lib must be used  following version of gcc
@@ -315,6 +327,10 @@ if WITH_BF_QUICKTIME:
        else:
                PLATFORM_LINKFLAGS = PLATFORM_LINKFLAGS+['-framework','QuickTime']
 
+if not WITH_OSX_STATICPYTHON:
+               PLATFORM_LINKFLAGS = PLATFORM_LINKFLAGS+['-framework','Python']
+
+
 #note to build succesfully on 10.3.9 SDK you need to patch  10.3.9 by adding the SystemStubs.a lib from 10.4
 #for 10.7.sdk, SystemStubs needs to be excluded (lib doesn't exist anymore)
 if MACOSX_DEPLOYMENT_TARGET == '10.7':
index 2f8fa297667d977ce05fec81d001aee5f6d23c66..2950ca9380f60f962965382a1e523f296edc33cc 100644 (file)
@@ -40,7 +40,7 @@ BF_JACK_INC = '${BF_JACK}/include ${BF_FFMPEG}/include/msvc'
 BF_JACK_LIB = 'libjack'
 BF_JACK_LIBPATH = '${BF_JACK}/lib'
 
-WITH_BF_SNDFILE = False
+WITH_BF_SNDFILE = True
 BF_SNDFILE = LIBDIR + '/sndfile'
 BF_SNDFILE_INC = '${BF_SNDFILE}/include'
 BF_SNDFILE_LIB = 'libsndfile-1'
index 94d09732be75f45c165f2c72eba9787fb5a4ed07..c537e435de8c3ae0bd6afd1c1139b1b42b54756b 100644 (file)
@@ -536,7 +536,10 @@ def AppIt(target=None, source=None, env=None):
     print("Installing to %s"%(installdir))
     # TODO, use tar.
     python_zip = 'python_' + osxarch + '.zip' # set specific python_arch.zip
-    print("unzipping to app-bundle: %s"%(python_zip))
+    if env['WITH_OSX_STATICPYTHON']:
+        print("unzipping to app-bundle: %s"%(python_zip))
+    else:
+        print("dynamic build - make sure to have python3.x-framework installed")
     bldroot = env.Dir('.').abspath
     binary = env['BINARYKIND']
      
@@ -569,10 +572,11 @@ def AppIt(target=None, source=None, env=None):
     commands.getoutput(cmd)
     cmd = 'cp %s/release/bin/%s/.Blanguages %s/%s.app/Contents/Resources/'%(bldroot,VERSION,installdir,binary)
     commands.getoutput(cmd)
-    cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/python/'%(installdir,binary, VERSION)
-    commands.getoutput(cmd)
-    cmd = 'unzip -q %s/release/%s -d %s/%s.app/Contents/MacOS/%s/python/'%(libdir,python_zip,installdir,binary,VERSION)
-    commands.getoutput(cmd)
+    if env['WITH_OSX_STATICPYTHON']:
+        cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/python/'%(installdir,binary, VERSION)
+        commands.getoutput(cmd)
+        cmd = 'unzip -q %s/release/%s -d %s/%s.app/Contents/MacOS/%s/python/'%(libdir,python_zip,installdir,binary,VERSION)
+        commands.getoutput(cmd) 
 
     if binary == 'blender':#not copy everything for blenderplayer
         cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
index d222c0bcc18a11f4410eb93ca3426a593a848fc6..be059241727a5f13bcf19d2aa0dc67a14cd7393a 100644 (file)
@@ -78,7 +78,7 @@ def print_arguments(args, bc):
 
 def validate_arguments(args, bc):
     opts_list = [
-            'WITH_BF_PYTHON', 'WITH_BF_PYTHON_SAFETY', 'BF_PYTHON', 'BF_PYTHON_VERSION', 'BF_PYTHON_INC', 'BF_PYTHON_BINARY', 'BF_PYTHON_LIB', 'BF_PYTHON_LIBPATH', 'WITH_BF_STATICPYTHON', 'BF_PYTHON_LIB_STATIC', 'BF_PYTHON_DLL', 'BF_PYTHON_ABI_FLAGS', 
+            'WITH_BF_PYTHON', 'WITH_BF_PYTHON_SAFETY', 'BF_PYTHON', 'BF_PYTHON_VERSION', 'BF_PYTHON_INC', 'BF_PYTHON_BINARY', 'BF_PYTHON_LIB', 'BF_PYTHON_LIBPATH', 'WITH_BF_STATICPYTHON', 'WITH_OSX_STATICPYTHON', 'BF_PYTHON_LIB_STATIC', 'BF_PYTHON_DLL', 'BF_PYTHON_ABI_FLAGS', 
             'WITH_BF_OPENAL', 'BF_OPENAL', 'BF_OPENAL_INC', 'BF_OPENAL_LIB', 'BF_OPENAL_LIBPATH', 'WITH_BF_STATICOPENAL', 'BF_OPENAL_LIB_STATIC',
             'WITH_BF_SDL', 'BF_SDL', 'BF_SDL_INC', 'BF_SDL_LIB', 'BF_SDL_LIBPATH',
             'BF_LIBSAMPLERATE', 'BF_LIBSAMPLERATE_INC', 'BF_LIBSAMPLERATE_LIB', 'BF_LIBSAMPLERATE_LIBPATH', 'WITH_BF_STATICLIBSAMPLERATE', 'BF_LIBSAMPLERATE_LIB_STATIC',
@@ -230,6 +230,7 @@ def read_opts(env, cfg, args):
         ('BF_PYTHON_LIBPATH', 'Library path', ''),
         ('BF_PYTHON_LINKFLAGS', 'Python link flags', ''),
         (BoolVariable('WITH_BF_STATICPYTHON', 'Staticly link to python', False)),
+        (BoolVariable('WITH_OSX_STATICPYTHON', 'Staticly link to python', True)),
         ('BF_PYTHON_ABI_FLAGS', 'Python ABI flags (suffix in library version: m, mu, etc)', ''),
 
         (BoolVariable('BF_NO_ELBEEM', 'Disable Fluid Sim', False)),
index 10514049a8a7efecb7f18f4dbcb54c7134c353c2..eeb50a833ffbd2577b8b141146041f3108450e72 100644 (file)
@@ -215,7 +215,19 @@ Functions
    :type setting: string (lights, shaders, shadows, ramps, nodes, extra_textures)
    :rtype: boolean
 
+.. function:: setAnisotropicFiltering(level)
 
+   Set the anisotropic filtering level for textures.
+   
+   :arg level: The new anisotropic filtering level to use
+   :type level: integer (must be one of 1, 2, 4, 8, 16)
+   
+.. function:: getAnisotropicFiltering()
+
+   Get the anisotropic filtering level used for textures.
+   
+   :rtype: integer (one of 1, 2, 4, 8, 16)
+   
 .. function:: drawLine(fromVec,toVec,color)
 
    Draw a line in the 3D scene.
index d1fc8593e42fd53cb529ee5d85fdc2fabf9d87ad..d9a93a945edc81e12627cb10646c77b390b808a9 100644 (file)
@@ -1542,59 +1542,63 @@ Game Types (bge.types)
    .. method:: playAction(name, start_frame, end_frame, layer=0, priority=0 blendin=0, play_mode=ACT_MODE_PLAY, layer_weight=0.0, ipo_flags=0, speed=1.0)
 
       Plays an action.
-         
+      
       :arg name: the name of the action
-         :type name: string
+      :type name: string
       :arg start: the start frame of the action
-         :type start: float
+      :type start: float
       :arg end: the end frame of the action
-         :type end: float
+      :type end: float
       :arg layer: the layer the action will play in (actions in different layers are added/blended together)
-         :type layer: integer
+      :type layer: integer
       :arg priority: only play this action if there isn't an action currently playing in this layer with a higher (lower number) priority
-         :type priority: integer
+      :type priority: integer
       :arg blendin: the amount of blending between this animation and the previous one on this layer
-         :type blendin: float
+      :type blendin: float
       :arg play_mode: the play mode
-         :type play_mode: KX_ACTION_PLAY, KX_ACTION_LOOP, or KX_ACTION_PING_PONG
+      :type play_mode: KX_ACTION_MODE_PLAY, KX_ACTION_MODE_LOOP, or KX_ACTION_MODE_PING_PONG
       :arg layer_weight: how much of the previous layer to use for blending (0 = add)
-         :type layer_weight: float
+      :type layer_weight: float
       :arg ipo_flags: flags for the old IPO behaviors (force, etc)
-         :type ipo_flags: int bitfield
+      :type ipo_flags: int bitfield
       :arg speed: the playback speed of the action as a factor (1.0 = normal speed, 2.0 = 2x speed, etc)
-         :type speed: float
+      :type speed: float
 
    .. method:: stopAction(layer=0)
       
-         Stop playing the action on the given layer.
-         
-         :arg layer: The layer to stop playing.
-         :type layer: integer
-         
+      Stop playing the action on the given layer.
+      
+      :arg layer: The layer to stop playing.
+      :type layer: integer
+      
    .. method:: getActionFrame(layer=0)
    
       Gets the current frame of the action playing in the supplied layer.
-         
-         :arg layer: The layer that you want to get the frame from.
-         :type layer: integer
-         
-         :return: The current frame of the action
-         
+      
+      :arg layer: The layer that you want to get the frame from.
+      :type layer: integer
+      
+      :return: The current frame of the action
+      :rtype: float
+      
    .. method:: setActionFrame(frame, layer=0)
    
       Set the current frame of the action playing in the supplied layer.
-         
-         :arg layer: The layer where you want to set the frame
-         :type layer: integer
-         :arg frame: The frame to set the action to
-         :type frame: float
+      
+      :arg layer: The layer where you want to set the frame
+      :type layer: integer
+      :arg frame: The frame to set the action to
+      :type frame: float
 
    .. method:: isPlayingAction(layer=0)
    
        Checks to see if there is an action playing in the given layer.
-          
-          :arg layer: The layer to check for a playing action.
-          :type layer: integer
+       
+       :arg layer: The layer to check for a playing action.
+       :type layer: integer
+       
+       :return: Whether or not the action is playing
+       :rtype: boolean
 
 .. class:: KX_IpoActuator(SCA_IActuator)
 
index 6d29c57c91f7066d8fb2d2e7958d8b558d59adaf..e378dd19e733d7082397e63a8040c97c21b6459d 100644 (file)
@@ -1222,7 +1222,6 @@ def rna2sphinx(BASEPATH):
 
     shutil.copy2(os.path.join(BASEPATH, "..", "rst", "change_log.rst"), BASEPATH)
 
-
     if not EXCLUDE_INFO_DOCS:
         for info, info_desc in INFO_DOCS:
             shutil.copy2(os.path.join(BASEPATH, "..", "rst", info), BASEPATH)
index 8b7cb1d9e691ab80de64330ddeb101953db5d50c..25510ebd2a5f99a10889c777eff555efd04b6551 100644 (file)
@@ -116,6 +116,7 @@ set(SRC
        intern/AUD_ReadDevice.h
        intern/AUD_Reference.h
        intern/AUD_ReferenceHandler.cpp
+       intern/AUD_ResampleFactory.h
        intern/AUD_ResampleReader.cpp
        intern/AUD_ResampleReader.h
        intern/AUD_SequencerEntry.cpp
diff --git a/intern/audaspace/intern/AUD_DefaultMixer.cpp b/intern/audaspace/intern/AUD_DefaultMixer.cpp
deleted file mode 100644 (file)
index 20471d6..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * Copyright 2009-2011 Jörg Hermann Müller
- *
- * This file is part of AudaSpace.
- *
- * Audaspace 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.
- *
- * AudaSpace 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 Audaspace; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file audaspace/intern/AUD_DefaultMixer.cpp
- *  \ingroup audaspaceintern
- */
-
-
-#include "AUD_DefaultMixer.h"
-#ifdef WITH_SAMPLERATE
-#include "AUD_SRCResampleReader.h"
-#else
-#include "AUD_LinearResampleReader.h"
-#endif
-#include "AUD_ChannelMapperReader.h"
-#include "AUD_ChannelMapperFactory.h"
-
-#include <cstring>
-
-AUD_DefaultMixer::AUD_DefaultMixer(AUD_DeviceSpecs specs) :
-       AUD_Mixer(specs)
-{
-}
-
-AUD_IReader* AUD_DefaultMixer::prepare(AUD_IReader* reader)
-{
-       // hacky for now, until a better channel mapper reader is available
-       AUD_ChannelMapperFactory cmf(NULL, m_specs);
-
-       AUD_Specs specs = reader->getSpecs();
-
-       // if channel count is lower in output, rechannel before resampling
-       if(specs.channels < m_specs.channels)
-       {
-               reader = new AUD_ChannelMapperReader(reader,
-                                                                                        cmf.getMapping(specs.channels));
-               specs.channels = m_specs.channels;
-       }
-
-       // resample
-       if(specs.rate != m_specs.rate)
-#ifdef WITH_SAMPLERATE
-               reader = new AUD_SRCResampleReader(reader, m_specs.specs);
-#else
-               reader = new AUD_LinearResampleReader(reader, m_specs.specs);
-#endif
-       
-       // rechannel
-       if(specs.channels != m_specs.channels)
-               reader = new AUD_ChannelMapperReader(reader,
-                                                                                        cmf.getMapping(specs.channels));
-
-       return reader;
-}
diff --git a/intern/audaspace/intern/AUD_DefaultMixer.h b/intern/audaspace/intern/AUD_DefaultMixer.h
deleted file mode 100644 (file)
index a347141..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * Copyright 2009-2011 Jörg Hermann Müller
- *
- * This file is part of AudaSpace.
- *
- * Audaspace 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.
- *
- * AudaSpace 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 Audaspace; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file audaspace/intern/AUD_DefaultMixer.h
- *  \ingroup audaspaceintern
- */
-
-
-#ifndef AUD_DEFAULTMIXER
-#define AUD_DEFAULTMIXER
-
-#include "AUD_Mixer.h"
-
-/**
- * This class is able to mix audiosignals of different channel count and sample
- * rate and convert it to a specific output format.
- * It uses a default ChannelMapperFactory and a SRCResampleFactory for
- * the perparation.
- */
-class AUD_DefaultMixer : public AUD_Mixer
-{
-public:
-       /**
-        * Creates the mixer.
-        */
-       AUD_DefaultMixer(AUD_DeviceSpecs specs);
-
-       /**
-        * This funuction prepares a reader for playback.
-        * \param reader The reader to prepare.
-        * \return The reader that should be used for playback.
-        */
-       virtual AUD_IReader* prepare(AUD_IReader* reader);
-};
-
-#endif //AUD_DEFAULTMIXER
index 19ebfc00d25959a9fa373d938e19b90d50a56c9f..59c69301a0202931b0eb020549e50a50ed188550 100644 (file)
@@ -1,3 +1,33 @@
+/*
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * Copyright 2009-2011 Jörg Hermann Müller
+ *
+ * This file is part of AudaSpace.
+ *
+ * Audaspace 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.
+ *
+ * AudaSpace 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 Audaspace; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file audaspace/intern/AUD_JOSResampleReaderCoeff.cpp
+ *  \ingroup audaspaceintern
+ */
+
 #include "AUD_JOSResampleReader.h"
 
 // sinc filter coefficients, Nz = 136, L = 2304, freq = 0.963904, Kaiser Window B = 16
index 496ad6992bc4e252da58d6324952ea3a5cfd3cd2..0413c488b5da38bc07a64d47f0b1bd87499143a3 100644 (file)
@@ -516,7 +516,7 @@ bool AUD_SoftwareDevice::AUD_SoftwareHandle::setVolumeMaximum(float volume)
 float AUD_SoftwareDevice::AUD_SoftwareHandle::getVolumeMinimum()
 {
        if(!m_status)
-               return std::numeric_limits<float>::quiet_NaN();;
+               return std::numeric_limits<float>::quiet_NaN();
 
        return m_volume_min;
 }
@@ -634,7 +634,7 @@ bool AUD_SoftwareDevice::AUD_SoftwareHandle::setConeAngleInner(float angle)
 float AUD_SoftwareDevice::AUD_SoftwareHandle::getConeVolumeOuter()
 {
        if(!m_status)
-               return std::numeric_limits<float>::quiet_NaN();;
+               return std::numeric_limits<float>::quiet_NaN();
 
        return m_cone_volume_outer;
 }
index 8873398a320352e1aacc19003dc983936fe0ba22..1aa043ebc8025c77db0bab758e279db23f844bdb 100644 (file)
@@ -70,7 +70,7 @@ GHOST_TSuccess GHOST_ISystemPaths::create()
 #              ifdef GHOST_COCOA
                        m_systemPaths = new GHOST_SystemPathsCocoa ();
 #              else
-                       m_systemPaths = new GHOST_SystemPathsarbon ();
+                       m_systemPaths = new GHOST_SystemPathsCarbon ();
 #              endif
 #      else 
                m_systemPaths = new GHOST_SystemPathsX11 ();
index dee66029d19eb643473ea4141ffad0f9ec7a4b34..053eb7d03e8f8392f4cf0e29808a9009bdcdca71 100644 (file)
@@ -39,7 +39,7 @@
 
 GHOST_TSuccess GHOST_CreateSystemPaths(void)
 {
-       return GHOST_ISystemPaths::create();;
+       return GHOST_ISystemPaths::create();
 }
 
 GHOST_TSuccess GHOST_DisposeSystemPaths(void)
index d5e5fbc7a587d42c0e81e50be29b899c53226198..e02e569cc6e758421ac51a0c17823db456bf8f15 100644 (file)
@@ -48,7 +48,9 @@
 #include "GHOST_EventButton.h"
 #include "GHOST_EventCursor.h"
 #include "GHOST_EventWheel.h"
+#ifdef WITH_INPUT_NDOF
 #include "GHOST_EventNDOF.h"
+#endif
 
 #include "GHOST_TimerManager.h"
 #include "GHOST_TimerTask.h"
@@ -1101,7 +1103,9 @@ OSStatus GHOST_SystemCarbon::sEventHandlerProc(EventHandlerCallRef handler, Even
        GHOST_SystemCarbon* sys = (GHOST_SystemCarbon*) userData;
     OSStatus err = eventNotHandledErr;
        GHOST_IWindow* window;
+#ifdef WITH_INPUT_NDOF
        GHOST_TEventNDOFData data;
+#endif
        UInt32 kind;
        
     switch (::GetEventClass(event))
@@ -1122,6 +1126,7 @@ OSStatus GHOST_SystemCarbon::sEventHandlerProc(EventHandlerCallRef handler, Even
                        err = sys->handleKeyEvent(event);
                        break;
                case kEventClassBlender :
+#ifdef WITH_INPUT_NDOF
                        window = sys->m_windowManager->getActiveWindow();
                        sys->m_ndofManager->GHOST_NDOFGetDatas(data);
                        kind = ::GetEventKind(event);
@@ -1137,6 +1142,7 @@ OSStatus GHOST_SystemCarbon::sEventHandlerProc(EventHandlerCallRef handler, Even
 //                                     printf("button\n");
                                        break;
                        }
+#endif
                        err = noErr;
                        break;
                default : 
index 0c8c0adf0413e46d1cf2737f32e63ca42349bcb8..d9a495ad0f4a817d6f8dc69393ec89b426b088ad 100644 (file)
@@ -866,6 +866,8 @@ GHOST_TSuccess GHOST_WindowWin32::installDrawingContext(GHOST_TDrawingContextTyp
                                {
 
                                        // Make sure we don't screw up the context
+                                       if (m_hGlRc == s_firsthGLRc)
+                                               s_firsthGLRc = NULL;
                                        m_drawingContextType = GHOST_kDrawingContextTypeOpenGL;
                                        removeDrawingContext();
 
index e4a0d30efcf839568233c2f59767a36f930748ca..101416f49430971d8c6fe6fa343c506b42d8aa37 100644 (file)
@@ -413,7 +413,7 @@ TypeMap = {}
 
 class Sound(bpy_types.ID):
     __slots__ = ()
-    
+
     @property
     def factory(self):
         """The aud.Factory object of the sound."""
index 085cd75f9f91796dadc01bb120dff90dcf44560d..c764f7d62f1d73e2da946c6645e0e91cd0847a0a 100644 (file)
@@ -269,10 +269,8 @@ class BakeAction(Operator):
         wm = context.window_manager
         return wm.invoke_props_dialog(self)
 
-#################################
 
-
-class ClearUselessActions(bpy.types.Operator):
+class ClearUselessActions(Operator):
     '''Mark actions with no F-Curves for deletion after save+reload of file preserving "action libraries"'''
     bl_idname = "anim.clear_useless_actions"
     bl_label = "Clear Useless Actions"
index 88f863b8e55e43f6ce5d9c7bfbb86260fb93c8e7..6c9f27afaa58c531fcf44170b54657206c1e4bc0 100644 (file)
@@ -686,26 +686,30 @@ class ClearAllRestrictRender(Operator):
             obj.hide_render = False
         return {'FINISHED'}
 
-class TransformsToDeltasAnim(bpy.types.Operator):
+
+class TransformsToDeltasAnim(Operator):
     '''Convert object animation for normal transforms to delta transforms'''
     bl_idname = "object.anim_transforms_to_deltas"
     bl_label = "Animated Transforms to Deltas"
     bl_options = {'REGISTER', 'UNDO'}
-    
+
     @classmethod
     def poll(cls, context):
         obs = context.selected_editable_objects
         return (obs is not None)
-    
+
     def execute(self, context):
         for obj in context.selected_editable_objects:
             # get animation data
             adt = obj.animation_data
             if (adt is None) or (adt.action is None):
-                self.report({'WARNING'}, "No animation data to convert on object: " + obj.name)
+                self.report({'WARNING'},
+                            "No animation data to convert on object: %r" %
+                            obj.name)
                 continue
-            
-            # if F-Curve uses standard transform path, just append "delta_" to this path
+
+            # if F-Curve uses standard transform path
+            # just append "delta_" to this path
             for fcu in adt.action.fcurves:
                 if fcu.data_path == "location":
                     fcu.data_path = "delta_location"
@@ -716,13 +720,14 @@ class TransformsToDeltasAnim(bpy.types.Operator):
                 elif fcu.data_path == "rotation_quaternion":
                     fcu.data_path = "delta_rotation_quaternion"
                     obj.rotation_quaternion.identity()
-                #elif fcu.data_path == "rotation_axis_angle":  # XXX: currently not implemented 
-                #   fcu.data_path = "delta_rotation_axis_angle"
+                # XXX: currently not implemented
+                # elif fcu.data_path == "rotation_axis_angle":
+                #    fcu.data_path = "delta_rotation_axis_angle"
                 elif fcu.data_path == "scale":
                     fcu.data_path = "delta_scale"
-                    obj.scale = (1, 1, 1)
-        
+                    obj.scale = 1.0, 1.0, 1.0
+
         # hack: force animsys flush by changing frame, so that deltas get run
         context.scene.frame_set(context.scene.frame_current)
-        
+
         return {'FINISHED'}
index 9a76ed81530e33308976a50314fec84b7ece9d8e..e17064178b8645aa744f5016c8ad7db29be5ca34 100644 (file)
@@ -72,8 +72,7 @@ class DATA_PT_skeleton(ArmatureButtonsPanel, Panel):
         flow.prop(arm, "use_deform_preserve_volume", text="Quaternion")
 
         if context.scene.render.engine == "BLENDER_GAME":
-            col = layout.column()
-            col.prop(arm, "vert_deformer")
+            layout.row().prop(arm, "vert_deformer", expand=True)
 
 class DATA_PT_display(ArmatureButtonsPanel, Panel):
     bl_label = "Display"
index fe9f798af0c0e078c6a569381c5fe8dc7835631c..657c0fe652a43784a6a470c49c36fc3656c66958 100644 (file)
@@ -66,10 +66,7 @@ class DATA_PT_speaker(DataButtonsPanel, bpy.types.Panel):
         split.template_ID(speaker, "sound", open="sound.open_mono")
         split.prop(speaker, "muted")
 
-        split = layout.split()
-
-        row = split.row()
-
+        row = layout.row()
         row.prop(speaker, "volume")
         row.prop(speaker, "pitch")
 
@@ -84,15 +81,14 @@ class DATA_PT_distance(DataButtonsPanel, bpy.types.Panel):
         speaker = context.speaker
 
         split = layout.split()
+        
         col = split.column()
-
         col.label("Volume:")
         col.prop(speaker, "volume_min", text="Minimum")
         col.prop(speaker, "volume_max", text="Maximum")
         col.prop(speaker, "attenuation")
 
         col = split.column()
-
         col.label("Distance:")
         col.prop(speaker, "distance_max", text="Maximum")
         col.prop(speaker, "distance_reference", text="Reference")
index e3c576e70934be24c9fa7df26aceef3c9d969c07..161e4b10cff86ca8e186a078fb2a0bb9c39c9c21 100644 (file)
@@ -340,10 +340,12 @@ class RENDER_PT_game_performance(RenderButtonsPanel, Panel):
         layout = self.layout
 
         gs = context.scene.game_settings
-        row = layout.row()
+        col = layout.column()
+        row = col.row()
         row.prop(gs, "use_frame_rate")
         row.prop(gs, "use_display_lists")
-        row.prop(gs, "restrict_animation_updates")
+        
+        col.prop(gs, "restrict_animation_updates")
 
 
 class RENDER_PT_game_display(RenderButtonsPanel, Panel):
index c74a00004991317671f25bf42a7cd0c6962aa98e..05fac2026a0da5de3e6b5db58d3324fb5aced20a 100644 (file)
@@ -235,7 +235,6 @@ class ConstraintButtonsPanel():
         row.label()
 
     def LIMIT_ROTATION(self, context, layout, con):
-
         split = layout.split()
 
         col = split.column(align=True)
@@ -259,9 +258,7 @@ class ConstraintButtonsPanel():
         sub.prop(con, "min_z", text="Min")
         sub.prop(con, "max_z", text="Max")
 
-        row = layout.row()
-        row.prop(con, "use_transform_limit")
-        row.label()
+        layout.prop(con, "use_transform_limit")
 
         row = layout.row()
         row.label(text="Convert:")
@@ -481,7 +478,6 @@ class ConstraintButtonsPanel():
         row.prop(con, "use_transform_limit")
         row.label()
 
-
     def STRETCH_TO(self, context, layout, con):
         self.target_template(layout, con)
 
index c906013e094ef65123b9580bbd2b3b549778df20..395cfc6934e5037299d541609984ca7b22a40091 100644 (file)
@@ -592,12 +592,9 @@ class RENDER_PT_encoding(RenderButtonsPanel, Panel):
         if rd.ffmpeg_format not in {'MP3'}:
             layout.prop(rd, "ffmpeg_audio_codec", text="Audio Codec")
 
-        split = layout.split()
-
-        col = split.column()
-        col.prop(rd, "ffmpeg_audio_bitrate")
-        col = split.column()
-        col.prop(rd, "ffmpeg_audio_volume", slider=True)
+        row = layout.row()
+        row.prop(rd, "ffmpeg_audio_bitrate")
+        row.prop(rd, "ffmpeg_audio_volume", slider=True)
 
 
 class RENDER_PT_bake(RenderButtonsPanel, Panel):
index fd7fc8ed462036f23d218daf38ca8fbe0d153b57..66f967bb6e1d63ed01b5c4832dff43db6f75cfcb 100644 (file)
@@ -59,14 +59,12 @@ class SCENE_PT_audio(SceneButtonsPanel, Panel):
         split = layout.split()
 
         col = split.column()
-
         col.label("Listener:")
         col.prop(scene, "audio_distance_model", text="")
         col.prop(scene, "audio_doppler_speed", text="Speed")
         col.prop(scene, "audio_doppler_factor", text="Doppler")
 
         col = split.column()
-
         col.label("Format:")
         col.prop(rd, "ffmpeg_audio_channels", text="")
         col.prop(rd, "ffmpeg_audio_mixrate", text="Rate")
index 0172fbcbadd678fc5ddc6c0d391ed25384694d5a..34f5a948ee7fa2b559ef1a2180a612518e3529e2 100644 (file)
@@ -414,7 +414,7 @@ class TEXTURE_PT_image_sampling(TextureTypePanel, Panel):
             row = col.row()
             row.active = tex.use_normal_map
             row.prop(slot, "normal_map_space", text="")
-            
+
             row = col.row()
             row.active = not tex.use_normal_map
             row.prop(tex, "use_derivative_map")
@@ -1029,14 +1029,14 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel):
 
             # only show bump settings if activated but not for normalmap images
             row = layout.row()
-            
+
             sub = row.row()
             sub.active = (tex.use_map_normal or tex.use_map_warp) and not (tex.texture.type == 'IMAGE' and (tex.texture.use_normal_map or tex.texture.use_derivative_map))
             sub.prop(tex, "bump_method", text="Method")
 
-                       # the space setting is supported for: derivmaps + bumpmaps (DEFAULT,BEST_QUALITY), not for normalmaps
+            # the space setting is supported for: derivmaps + bumpmaps (DEFAULT,BEST_QUALITY), not for normalmaps
             sub = row.row()
-            sub.active = (tex.use_map_normal or tex.use_map_warp) and not (tex.texture.type == 'IMAGE' and tex.texture.use_normal_map) and ((tex.bump_method in {'BUMP_DEFAULT', 'BUMP_BEST_QUALITY'}) or (tex.texture.type == 'IMAGE' and tex.texture.use_derivative_map)) 
+            sub.active = (tex.use_map_normal or tex.use_map_warp) and not (tex.texture.type == 'IMAGE' and tex.texture.use_normal_map) and ((tex.bump_method in {'BUMP_DEFAULT', 'BUMP_BEST_QUALITY'}) or (tex.texture.type == 'IMAGE' and tex.texture.use_derivative_map))
             sub.prop(tex, "bump_objectspace", text="Space")
 
 
index 5ed79f45fbc122974ce3d7d2d915043cbe235e4e..90dcc99e6d74859f58fcf2f57748543e44a11b8d 100644 (file)
@@ -36,7 +36,7 @@ def dopesheet_filter(layout, context, genericFiltersOnly=False):
 
     if is_nla:
         row.prop(dopesheet, "show_missing_nla", text="")
-    
+
     if not genericFiltersOnly:
         if bpy.data.groups:
             row = layout.row(align=True)
index 1d4b7c6828f9eeabf15018dcde4ce3c37099e383..ffead81c5070f8ea4635a9d58e349fb42a325fb4 100644 (file)
@@ -69,11 +69,11 @@ class NLA_MT_view(Menu):
         layout.separator()
         layout.operator("anim.previewrange_set")
         layout.operator("anim.previewrange_clear")
-        
+
         layout.separator()
         layout.operator("nla.view_all")
         layout.operator("nla.view_selected")
-        
+
         layout.separator()
         layout.operator("screen.area_dupli")
         layout.operator("screen.screen_full_area")
index 8592cc2fcc0d6cb00dcb1875db0e3b1b4e7a2f25..36f606da63530c69949a252bdea424b9a4715dbf 100644 (file)
@@ -804,7 +804,6 @@ class SEQUENCER_PT_proxy(SequencerButtonsPanel, Panel):
                 col.prop(strip.proxy, "timecode")
 
 
-
 class SEQUENCER_PT_preview(SequencerButtonsPanel_Output, Panel):
     bl_label = "Scene Preview/Render"
     bl_space_type = 'SEQUENCE_EDITOR'
index 05ef8c1680467111668aec82fa7339a2de560e95..3a88ed6519a24541ca8c87d1e2cf791f2e76adda 100644 (file)
@@ -179,9 +179,9 @@ class VIEW3D_MT_transform(Menu):
 
         layout.operator("object.randomize_transform")
         layout.operator("object.align")
-        
+
         layout.separator()
-        
+
         layout.operator("object.anim_transforms_to_deltas")
 
 
@@ -1272,6 +1272,7 @@ class VIEW3D_MT_pose_transform(Menu):
 
         layout.operator("pose.user_transforms_clear", text="Reset unkeyed")
 
+
 class VIEW3D_MT_pose_slide(Menu):
     bl_label = "In-Betweens"
 
index dcc1afed74bbae6bce47325f281c01b9585ceac7..6b12c95e07222970b36dfe6b34b1e45ba5f58bcb 100644 (file)
@@ -32,13 +32,14 @@ in lost (i.e. unkeyed) animation.
 
 import bpy
 import keyingsets_utils
+from bpy.types import KeyingSetInfo
 
 ###############################
 # Built-In KeyingSets
 
 
 # Location
-class BUILTIN_KSI_Location(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_Location(KeyingSetInfo):
     bl_label = "Location"
 
     # poll - use predefined callback for selected bones/objects
@@ -52,7 +53,7 @@ class BUILTIN_KSI_Location(bpy.types.KeyingSetInfo):
 
 
 # Rotation
-class BUILTIN_KSI_Rotation(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_Rotation(KeyingSetInfo):
     bl_label = "Rotation"
 
     # poll - use predefined callback for selected bones/objects
@@ -66,7 +67,7 @@ class BUILTIN_KSI_Rotation(bpy.types.KeyingSetInfo):
 
 
 # Scale
-class BUILTIN_KSI_Scaling(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_Scaling(KeyingSetInfo):
     bl_label = "Scaling"
 
     # poll - use predefined callback for selected bones/objects
@@ -82,7 +83,7 @@ class BUILTIN_KSI_Scaling(bpy.types.KeyingSetInfo):
 
 
 # LocRot
-class BUILTIN_KSI_LocRot(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_LocRot(KeyingSetInfo):
     bl_label = "LocRot"
 
     # poll - use predefined callback for selected bones/objects
@@ -100,7 +101,7 @@ class BUILTIN_KSI_LocRot(bpy.types.KeyingSetInfo):
 
 
 # LocScale
-class BUILTIN_KSI_LocScale(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_LocScale(KeyingSetInfo):
     bl_label = "LocScale"
 
     # poll - use predefined callback for selected bones/objects
@@ -118,7 +119,7 @@ class BUILTIN_KSI_LocScale(bpy.types.KeyingSetInfo):
 
 
 # LocRotScale
-class BUILTIN_KSI_LocRotScale(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_LocRotScale(KeyingSetInfo):
     bl_label = "LocRotScale"
 
     # poll - use predefined callback for selected bones/objects
@@ -138,7 +139,7 @@ class BUILTIN_KSI_LocRotScale(bpy.types.KeyingSetInfo):
 
 
 # RotScale
-class BUILTIN_KSI_RotScale(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_RotScale(KeyingSetInfo):
     bl_label = "RotScale"
 
     # poll - use predefined callback for selected bones/objects
@@ -158,7 +159,7 @@ class BUILTIN_KSI_RotScale(bpy.types.KeyingSetInfo):
 
 
 # Location
-class BUILTIN_KSI_VisualLoc(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_VisualLoc(KeyingSetInfo):
     bl_label = "Visual Location"
 
     bl_options = {'INSERTKEY_VISUAL'}
@@ -174,7 +175,7 @@ class BUILTIN_KSI_VisualLoc(bpy.types.KeyingSetInfo):
 
 
 # Rotation
-class BUILTIN_KSI_VisualRot(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_VisualRot(KeyingSetInfo):
     bl_label = "Visual Rotation"
 
     bl_options = {'INSERTKEY_VISUAL'}
@@ -190,7 +191,7 @@ class BUILTIN_KSI_VisualRot(bpy.types.KeyingSetInfo):
 
 
 # VisualLocRot
-class BUILTIN_KSI_VisualLocRot(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_VisualLocRot(KeyingSetInfo):
     bl_label = "Visual LocRot"
 
     bl_options = {'INSERTKEY_VISUAL'}
@@ -212,7 +213,7 @@ class BUILTIN_KSI_VisualLocRot(bpy.types.KeyingSetInfo):
 
 
 # Available
-class BUILTIN_KSI_Available(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_Available(KeyingSetInfo):
     bl_label = "Available"
 
     # poll - selected objects or selected object with animation data
@@ -234,7 +235,7 @@ class BUILTIN_KSI_Available(bpy.types.KeyingSetInfo):
 
 
 # All properties that are likely to get animated in a character rig
-class BUILTIN_KSI_WholeCharacter(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_WholeCharacter(KeyingSetInfo):
     bl_label = "Whole Character"
 
     # these prefixes should be avoided, as they are not really bones
@@ -265,7 +266,7 @@ class BUILTIN_KSI_WholeCharacter(bpy.types.KeyingSetInfo):
         # loc, rot, scale - only include unlocked ones
         ksi.doLoc(ks, bone)
 
-        if bone.rotation_mode in ('QUATERNION', 'AXIS_ANGLE'):
+        if bone.rotation_mode in {'QUATERNION', 'AXIS_ANGLE'}:
             ksi.doRot4d(ks, bone)
         else:
             ksi.doRot3d(ks, bone)
@@ -365,7 +366,7 @@ class BUILTIN_KSI_WholeCharacter(bpy.types.KeyingSetInfo):
 
 
 # Delta Location
-class BUILTIN_KSI_DeltaLocation(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_DeltaLocation(KeyingSetInfo):
     bl_label = "Delta Location"
 
     # poll - selected objects only (and only if active object in object mode)
@@ -390,7 +391,7 @@ class BUILTIN_KSI_DeltaLocation(bpy.types.KeyingSetInfo):
 
 
 # Delta Rotation
-class BUILTIN_KSI_DeltaRotation(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_DeltaRotation(KeyingSetInfo):
     bl_label = "Delta Rotation"
 
     # poll - selected objects only (and only if active object in object mode)
@@ -423,7 +424,7 @@ class BUILTIN_KSI_DeltaRotation(bpy.types.KeyingSetInfo):
 
 
 # Delta Scale
-class BUILTIN_KSI_DeltaScale(bpy.types.KeyingSetInfo):
+class BUILTIN_KSI_DeltaScale(KeyingSetInfo):
     bl_label = "Delta Scale"
 
     # poll - selected objects only (and only if active object in object mode)
index c0e62b1c0c70340d72bcf2b58efbebc2ecc8c33d..fc812d652b3da257f890fdb76cccdcb4935aa47d 100644 (file)
@@ -369,28 +369,28 @@ void BLF_position(int fontid, float x, float y, float z)
                        za= 1.0f;
                }
 
-               remainder= x - floor(x);
-               if (remainder > 0.4 && remainder < 0.6) {
-                       if (remainder < 0.5)
-                               x -= 0.1 * xa;
+               remainder= x - floorf(x);
+               if (remainder > 0.4f && remainder < 0.6f) {
+                       if (remainder < 0.5f)
+                               x -= 0.1f * xa;
                        else
-                               x += 0.1 * xa;
+                               x += 0.1f * xa;
                }
 
-               remainder= y - floor(y);
-               if (remainder > 0.4 && remainder < 0.6) {
-                       if (remainder < 0.5)
-                               y -= 0.1 * ya;
+               remainder= y - floorf(y);
+               if (remainder > 0.4f && remainder < 0.6f) {
+                       if (remainder < 0.5f)
+                               y -= 0.1f * ya;
                        else
-                               y += 0.1 * ya;
+                               y += 0.1f * ya;
                }
 
-               remainder= z - floor(z);
-               if (remainder > 0.4 && remainder < 0.6) {
-                       if (remainder < 0.5)
-                               z -= 0.1 * za;
+               remainder= z - floorf(z);
+               if (remainder > 0.4f && remainder < 0.6f) {
+                       if (remainder < 0.5f)
+                               z -= 0.1f * za;
                        else
-                               z += 0.1 * za;
+                               z += 0.1f * za;
                }
 
                font->pos[0]= x;
index 708b3708ab7fbcd12b20779324098d98f95cd3f9..fb6505fe935f28112a62159e54c79587e427c13d 100644 (file)
@@ -213,7 +213,7 @@ void blf_font_buffer(FontBLF *font, const char *str)
 {
        unsigned char *cbuf;
        unsigned int c;
-       unsigned char b_col_char[3];
+       unsigned char b_col_char[4];
        GlyphBLF *g, *g_prev;
        FT_Vector delta;
        FT_UInt glyph_index;
@@ -232,6 +232,7 @@ void blf_font_buffer(FontBLF *font, const char *str)
        b_col_char[0]= font->b_col[0] * 255;
        b_col_char[1]= font->b_col[1] * 255;
        b_col_char[2]= font->b_col[2] * 255;
+       b_col_char[3]= font->b_col[3] * 255;
 
        while (str[i]) {
                int pen_y;
@@ -296,16 +297,19 @@ void blf_font_buffer(FontBLF *font, const char *str)
                                                a= *(g->bitmap + x + (yb * g->pitch)) / 255.0f;
 
                                                if(a > 0.0f) {
+                                                       float alphatest;
                                                        fbuf= font->b_fbuf + font->bch * ((chx + x) + ((pen_y + y)*font->bw));
                                                        if (a >= 1.0f) {
                                                                fbuf[0]= font->b_col[0];
                                                                fbuf[1]= font->b_col[1];
                                                                fbuf[2]= font->b_col[2];
+                                                               fbuf[3]= (alphatest= (fbuf[3] + (font->b_col[3]))) < 1.0f ? alphatest : 1.0f;
                                                        }
                                                        else {
                                                                fbuf[0]= (font->b_col[0]*a) + (fbuf[0] * (1-a));
                                                                fbuf[1]= (font->b_col[1]*a) + (fbuf[1] * (1-a));
                                                                fbuf[2]= (font->b_col[2]*a) + (fbuf[2] * (1-a));
+                                                               fbuf[3]= (alphatest= (fbuf[3] + (font->b_col[3]*a))) < 1.0f ? alphatest : 1.0f;
                                                        }
                                                }
                                        }
@@ -324,16 +328,19 @@ void blf_font_buffer(FontBLF *font, const char *str)
                                                a= *(g->bitmap + x + (yb * g->pitch)) / 255.0f;
 
                                                if(a > 0.0f) {
+                                                       int alphatest;
                                                        cbuf= font->b_cbuf + font->bch * ((chx + x) + ((pen_y + y)*font->bw));
                                                        if (a >= 1.0f) {
                                                                cbuf[0]= b_col_char[0];
                                                                cbuf[1]= b_col_char[1];
                                                                cbuf[2]= b_col_char[2];
+                                                               cbuf[3]= (alphatest= ((int)cbuf[3] + (int)b_col_char[3])) < 255 ? alphatest : 255;
                                                        }
                                                        else {
                                                                cbuf[0]= (b_col_char[0]*a) + (cbuf[0] * (1-a));
                                                                cbuf[1]= (b_col_char[1]*a) + (cbuf[1] * (1-a));
                                                                cbuf[2]= (b_col_char[2]*a) + (cbuf[2] * (1-a));
+                                                               cbuf[3]= (alphatest= ((int)cbuf[3] + (int)((font->b_col[3]*a)*255.0f))) < 255 ? alphatest : 255;
                                                        }
                                                }
                                        }
index e1b6ff02bc4f017ca546296890817d0baf986374..fac5bf1cfd2848ad42a1a57b9a0349bc7291e858 100644 (file)
@@ -134,8 +134,6 @@ void sound_free_waveform(struct bSound* sound);
 
 void sound_read_waveform(struct bSound* sound);
 
-int sound_get_channels(struct bSound* sound);
-
 void sound_update_scene(struct Scene* scene);
 
 void* sound_get_factory(void* sound);
index 1fec977851e5202903d18b15ed709e3b5a7a78af..04c5caf138a3e5fa323f6188cb69e59050a21385 100644 (file)
@@ -1092,7 +1092,7 @@ static int cloth_collision_response_moving ( ClothModifierData *clmd, CollisionM
                                
                                VECADDMUL(cloth1->verts[collpair->ap1].impulse, pimpulse, w1*2.0);
                                VECADDMUL(cloth1->verts[collpair->ap2].impulse, pimpulse, w2*2.0);
-                               VECADDMUL(cloth1->verts[collpair->ap3].impulse, pimpulse, w3*2.0);;
+                               VECADDMUL(cloth1->verts[collpair->ap3].impulse, pimpulse, w3*2.0);
                                cloth1->verts[collpair->ap1].impulse_count++;
                                cloth1->verts[collpair->ap2].impulse_count++;
                                cloth1->verts[collpair->ap3].impulse_count++;
index 62f269d775e7f35b987d8fdd18024d1d265d1605..8bb783abb807dda26d79f80f087f603967853bed 100644 (file)
@@ -68,6 +68,7 @@
 #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_edgehash.h"
 
 #include <zlib.h>
 #include <string.h>
 
-#ifdef WIN32
-#ifndef snprintf
-#define snprintf _snprintf
-#endif
-#endif
-
 #endif // DISABLE_ELBEEM
 
 /************************************************/
@@ -3876,7 +3871,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra))
 
                        gzf = gzopen(filename, "rb");
                        if (!gzf) {
-                               snprintf(debugStrBuffer,256,"readFsPartData::error - Unable to open file for reading '%s' \n", filename); 
+                               BLI_snprintf(debugStrBuffer, sizeof(debugStrBuffer),"readFsPartData::error - Unable to open file for reading '%s' \n", filename); 
                                // XXX bad level call elbeemDebugOut(debugStrBuffer);
                                return;
                        }
@@ -3937,7 +3932,7 @@ static void particles_fluid_step(ParticleSimulationData *sim, int UNUSED(cfra))
                        gzclose( gzf );
        
                        totpart = psys->totpart = activeParts;
-                       snprintf(debugStrBuffer,256,"readFsPartData::done - particles:%d, active:%d, file:%d, mask:%d  \n", psys->totpart,activeParts,fileParts,readMask);
+                       BLI_snprintf(debugStrBuffer,sizeof(debugStrBuffer),"readFsPartData::done - particles:%d, active:%d, file:%d, mask:%d  \n", psys->totpart,activeParts,fileParts,readMask);
                        // bad level call
                        // XXX elbeemDebugOut(debugStrBuffer);
                        
index 0f0afe3039229cc06c86eff1087ad51dc6887509..a56010a5ccfb95f2a527c90dc9ae3e58a9c305e1 100644 (file)
@@ -917,14 +917,14 @@ static int ptcache_path(PTCacheID *pid, char *filename)
                if (i > 6)
                        file[i-6] = '\0';
                
-               snprintf(filename, MAX_PTCACHE_PATH, "//"PTCACHE_PATH"%s", file); /* add blend file name to pointcache dir */
+               BLI_snprintf(filename, MAX_PTCACHE_PATH, "//"PTCACHE_PATH"%s", file); /* add blend file name to pointcache dir */
                BLI_path_abs(filename, blendfilename);
                return BLI_add_slash(filename); /* new strlen() */
        }
        
        /* 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 */
-       snprintf(filename, MAX_PTCACHE_PATH, "%s"PTCACHE_PATH"%d", btempdir, abs(getpid()));
+       BLI_snprintf(filename, MAX_PTCACHE_PATH, "%s"PTCACHE_PATH"%d", btempdir, abs(getpid()));
        
        return BLI_add_slash(filename); /* new strlen() */
 }
@@ -948,7 +948,7 @@ static int ptcache_filename(PTCacheID *pid, char *filename, int cfra, short do_p
                idname = (pid->ob->id.name+2);
                /* convert chars to hex so they are always a valid filename */
                while('\0' != *idname) {
-                       snprintf(newname, MAX_PTCACHE_FILE, "%02X", (char)(*idname++));
+                       BLI_snprintf(newname, MAX_PTCACHE_FILE, "%02X", (char)(*idname++));
                        newname+=2;
                        len += 2;
                }
@@ -967,12 +967,12 @@ static int ptcache_filename(PTCacheID *pid, char *filename, int cfra, short do_p
 
                if(pid->cache->flag & PTCACHE_EXTERNAL) {
                        if(pid->cache->index >= 0)
-                               snprintf(newname, MAX_PTCACHE_FILE, "_%06d_%02u"PTCACHE_EXT, cfra, pid->stack_index); /* always 6 chars */
+                               BLI_snprintf(newname, MAX_PTCACHE_FILE, "_%06d_%02u"PTCACHE_EXT, cfra, pid->stack_index); /* always 6 chars */
                        else
-                               snprintf(newname, MAX_PTCACHE_FILE, "_%06d"PTCACHE_EXT, cfra); /* always 6 chars */
+                               BLI_snprintf(newname, MAX_PTCACHE_FILE, "_%06d"PTCACHE_EXT, cfra); /* always 6 chars */
                }
                else {
-                       snprintf(newname, MAX_PTCACHE_FILE, "_%06d_%02u"PTCACHE_EXT, cfra, pid->stack_index); /* always 6 chars */
+                       BLI_snprintf(newname, MAX_PTCACHE_FILE, "_%06d_%02u"PTCACHE_EXT, cfra, pid->stack_index); /* always 6 chars */
                }
                len += 16;
        }
@@ -2002,7 +2002,7 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
                        if (dir==NULL)
                                return;
 
-                       snprintf(ext, sizeof(ext), "_%02u"PTCACHE_EXT, pid->stack_index);
+                       BLI_snprintf(ext, sizeof(ext), "_%02u"PTCACHE_EXT, pid->stack_index);
                        
                        while ((de = readdir(dir)) != NULL) {
                                if (strstr(de->d_name, ext)) { /* do we have the right extension?*/
@@ -2204,7 +2204,7 @@ void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startfra
                        if (dir==NULL)
                                return;
 
-                       snprintf(ext, sizeof(ext), "_%02u"PTCACHE_EXT, pid->stack_index);
+                       BLI_snprintf(ext, sizeof(ext), "_%02u"PTCACHE_EXT, pid->stack_index);
                        
                        while ((de = readdir(dir)) != NULL) {
                                if (strstr(de->d_name, ext)) { /* do we have the right extension?*/
@@ -2904,7 +2904,7 @@ void BKE_ptcache_disk_cache_rename(PTCacheID *pid, char *from, char *to)
                return;
        }
 
-       snprintf(ext, sizeof(ext), "_%02u"PTCACHE_EXT, pid->stack_index);
+       BLI_snprintf(ext, sizeof(ext), "_%02u"PTCACHE_EXT, pid->stack_index);
 
        /* put new name into cache */
        strcpy(pid->cache->name, to);
@@ -2960,7 +2960,7 @@ void BKE_ptcache_load_external(PTCacheID *pid)
                return;
 
        if(cache->index >= 0)
-               snprintf(ext, sizeof(ext), "_%02d"PTCACHE_EXT, cache->index);
+               BLI_snprintf(ext, sizeof(ext), "_%02d"PTCACHE_EXT, cache->index);
        else
                strcpy(ext, PTCACHE_EXT);
        
index f84d98a31b47d59bdf99dc3fef032d2c371ff56b..4926edaeec2b27c717b327ced68cb51e2b0223c6 100644 (file)
 #include <stdio.h>
 #include <string.h>
 
-#ifdef _WIN32
-#ifndef vsnprintf
-#define vsnprintf _vsnprintf
-#endif
-#endif
-
 static const char *report_type_str(int type)
 {
        switch(type) {
index 40e02d65323081426a162caf78695126ce00ba73..9ef30bdd49bdde5b7545548be6b7c050a61cd83f 100644 (file)
 #  include "AUD_C-API.h"
 #endif
 
-#ifdef WIN32
-#define snprintf _snprintf
-#endif
-
-
 static ImBuf* seq_render_strip_stack( 
        SeqRenderData context, ListBase *seqbasep, float cfra, int chanshown);
 
@@ -1193,7 +1188,7 @@ static void seq_open_anim_file(Sequence * seq)
 static int seq_proxy_get_fname(SeqRenderData context, Sequence * seq, int cfra, char * name)
 {
        int frameno;
-       char dir[FILE_MAXDIR];
+       char dir[PROXY_MAXFILE];
        int render_size = context.preview_render_size;
 
        if (!seq->strip->proxy) {
@@ -1211,7 +1206,7 @@ static int seq_proxy_get_fname(SeqRenderData context, Sequence * seq, int cfra,
        if (seq->flag & (SEQ_USE_PROXY_CUSTOM_DIR|SEQ_USE_PROXY_CUSTOM_FILE)) {
                strcpy(dir, seq->strip->proxy->dir);
        } else if (seq->type == SEQ_IMAGE) {
-               snprintf(dir, PROXY_MAXFILE, "%s/BL_proxy", seq->strip->dir);
+               BLI_snprintf(dir, PROXY_MAXFILE, "%s/BL_proxy", seq->strip->dir);
        } else {
                return FALSE;
        }
@@ -1232,14 +1227,14 @@ static int seq_proxy_get_fname(SeqRenderData context, Sequence * seq, int cfra,
        /* generate a separate proxy directory for each preview size */
 
        if (seq->type == SEQ_IMAGE) {
-               snprintf(name, PROXY_MAXFILE, "%s/images/%d/%s_proxy", dir,
+               BLI_snprintf(name, PROXY_MAXFILE, "%s/images/%d/%s_proxy", dir,
                         context.preview_render_size, 
                         give_stripelem(seq, cfra)->name);
                frameno = 1;
        } else {
                frameno = (int) give_stripelem_index(seq, cfra) 
                        + seq->anim_startofs;
-               snprintf(name, PROXY_MAXFILE, "%s/proxy_misc/%d/####", dir, 
+               BLI_snprintf(name, PROXY_MAXFILE, "%s/proxy_misc/%d/####", dir, 
                         context.preview_render_size);
        }
 
index 985fef974d376db7f2d2e03dd94bc7bda2676f04..cdb509ab8e121075e4553e19f282011643fd14ab 100644 (file)
@@ -641,15 +641,6 @@ void sound_read_waveform(struct bSound* sound)
        }
 }
 
-int sound_get_channels(struct bSound* sound)
-{
-       AUD_SoundInfo info;
-
-       info = AUD_getInfo(sound->playback_handle);
-
-       return info.specs.channels;
-}
-
 void sound_update_scene(struct Scene* scene)
 {
        Object* ob;
@@ -769,6 +760,5 @@ void sound_seek_scene(struct bContext *UNUSED(C)) {}
 float sound_sync_scene(struct Scene *UNUSED(scene)) { return 0.0f; }
 int sound_scene_playing(struct Scene *UNUSED(scene)) { return -1; }
 int sound_read_sound_buffer(struct bSound* UNUSED(sound), float* UNUSED(buffer), int UNUSED(length), float UNUSED(start), float UNUSED(end)) { return 0; }
-int sound_get_channels(struct bSound* UNUSED(sound)) { return 1; }
 
 #endif // WITH_AUDASPACE
index a9792bc44fac1d041d0d44222904670ffea1a6ab..72fe1c19884e82e2dd52ae8ae5b845cbbcd283da 100644 (file)
@@ -34,6 +34,7 @@
 #include "BKE_unit.h"
 
 #include "BLI_math.h"
+#include "BLI_string.h"
 #include "BLI_winstuff.h"
 
 
@@ -344,7 +345,7 @@ static int unit_as_string(char *str, int len_max, double value, int prec, bUnitC
 
        /* Convert to a string */
        {
-               len= snprintf(str, len_max, "%.*lf", prec, value_conv);
+               len= BLI_snprintf(str, len_max, "%.*lf", prec, value_conv);
 
                if(len >= len_max)
                        len= len_max;
@@ -495,7 +496,7 @@ static int unit_scale_str(char *str, int len_max, char *str_tmp, double scale_pr
 
                len_name = strlen(replace_str);
                len_move= (len - (found_ofs+len_name)) + 1; /* 1+ to copy the string terminator */
-               len_num= snprintf(str_tmp, TEMP_STR_SIZE, "*%lg"SEP_STR, unit->scalar/scale_pref); /* # removed later */
+               len_num= BLI_snprintf(str_tmp, TEMP_STR_SIZE, "*%lg"SEP_STR, unit->scalar/scale_pref); /* # removed later */
 
                if(len_num > len_max)
                        len_num= len_max;
@@ -629,12 +630,12 @@ int bUnit_ReplaceString(char *str, int len_max, char *str_prev, double scale_pre
 
 
                /* add the unit prefix and re-run, use brackets incase there was an expression given */
-               if(snprintf(str_tmp, sizeof(str_tmp), "(%s)%s", str, unit->name) < sizeof(str_tmp)) {
+               if(BLI_snprintf(str_tmp, sizeof(str_tmp), "(%s)%s", str, unit->name) < sizeof(str_tmp)) {
                        strncpy(str, str_tmp, len_max);
                        return bUnit_ReplaceString(str, len_max, NULL, scale_pref, system, type);
                }
                else {
-                       /* snprintf would not fit into str_tmp, cant do much in this case
+                       /* BLI_snprintf would not fit into str_tmp, cant do much in this case
                         * check for this because otherwise bUnit_ReplaceString could call its self forever */
                        return 0;
                }
@@ -705,7 +706,7 @@ void bUnit_ToUnitAltName(char *str, int len_max, char *orig_str, int system, int
 
                                /* print the alt_name */
                                if(unit->name_alt)
-                                       len_name= snprintf(str, len_max, "%s", unit->name_alt);
+                                       len_name= BLI_snprintf(str, len_max, "%s", unit->name_alt);
                                else
                                        len_name= 0;
 
index 24e0fe95a1f5850c627062e8779fb852987a1ac1..13875ff19f7bc6a8cf20ce7bf4f838d7ac7d6462 100644 (file)
 #include <libswscale/swscale.h>
 #include <libavcodec/opt.h>
 
-#if defined(WIN32) && (!(defined snprintf))
-#define snprintf _snprintf
-#endif
-
 #include "MEM_guardedalloc.h"
 
 #include "DNA_scene_types.h"
@@ -652,7 +648,7 @@ static int start_ffmpeg_impl(struct RenderData *rd, int rectx, int recty, Report
 
        fmt->audio_codec = ffmpeg_audio_codec;
 
-       snprintf(of->filename, sizeof(of->filename), "%s", name);
+       BLI_snprintf(of->filename, sizeof(of->filename), "%s", name);
        /* set the codec to the user's selection */
        switch(ffmpeg_type) {
        case FFMPEG_AVI:
index fc5c5a80131a158c18861eb18861ffceb1d4cefa..5c3180ba9c5e28ce7e042e523e67ca91b5f8a0c7 100644 (file)
@@ -42,6 +42,7 @@ struct ID;
 typedef enum {
        BLI_CB_EVT_RENDER_PRE,
        BLI_CB_EVT_RENDER_POST,
+       BLI_CB_EVT_RENDER_STATS,
        BLI_CB_EVT_LOAD_PRE,
        BLI_CB_EVT_LOAD_POST,
        BLI_CB_EVT_SAVE_PRE,
index 527692348e76add5f22d9d6f0bebdebb9b54af17..dcbe043f0d0644facb28547f0ef29602e6bb34b9 100644 (file)
@@ -1494,7 +1494,7 @@ static float fast_ray_nearest_hit(const BVHRayCastData *data, const BVHNode *nod
        float t2z = (bv[data->index[5]] - data->ray.origin[2]) * data->idot_axis[2];
 
        if(t1x > t2y || t2x < t1y || t1x > t2z || t2x < t1z || t1y > t2z || t2y < t1z) return FLT_MAX;
-       if(t2x < 0.0 || t2y < 0.0 || t2z < 0.0) return FLT_MAX;
+       if(t2x < 0.0f || t2y < 0.0f || t2z < 0.0f) return FLT_MAX;
        if(t1x > data->hit.dist || t1y > data->hit.dist || t1z > data->hit.dist) return FLT_MAX;
 
        dist = t1x;
@@ -1599,11 +1599,11 @@ int BLI_bvhtree_ray_cast(BVHTree *tree, const float *co, const float *dir, float
                data.ray_dot_axis[i] = INPR( data.ray.direction, KDOP_AXES[i]);
                data.idot_axis[i] = 1.0f / data.ray_dot_axis[i];
 
-               if(fabs(data.ray_dot_axis[i]) < FLT_EPSILON)
+               if(fabsf(data.ray_dot_axis[i]) < FLT_EPSILON)
                {
                        data.ray_dot_axis[i] = 0.0;
                }
-               data.index[2*i] = data.idot_axis[i] < 0.0 ? 1 : 0;
+               data.index[2*i] = data.idot_axis[i] < 0.0f ? 1 : 0;
                data.index[2*i+1] = 1 - data.index[2*i];
                data.index[2*i]   += 2*i;
                data.index[2*i+1] += 2*i;
@@ -1654,7 +1654,7 @@ float BLI_bvhtree_bb_raycast(float *bv, float *light_start, float *light_end, fl
        
        dist = ray_nearest_hit(&data, bv);
        
-       if(dist > 0.0)
+       if(dist > 0.0f)
        {
                VECADDFAC(pos, light_start, data.ray.direction, dist);
        }
index 713bfde341735f7a43cdcf448ae298b3253d554c..c885e8c8a9c4ae5cf3828d9ebb8a82df1b829188 100644 (file)
@@ -187,7 +187,7 @@ int BLI_kdtree_find_nearest(KDTree *tree, float *co, float *nor, KDTreeNearest *
 
                cur_dist = node->co[node->d] - co[node->d];
 
-               if(cur_dist<0.0){
+               if(cur_dist<0.0f){
                        cur_dist= -cur_dist*cur_dist;
 
                        if(-cur_dist<min_dist){
@@ -294,7 +294,7 @@ int BLI_kdtree_find_n_nearest(KDTree *tree, int n, float *co, float *nor, KDTree
 
                cur_dist = node->co[node->d] - co[node->d];
 
-               if(cur_dist<0.0){
+               if(cur_dist<0.0f){
                        cur_dist= -cur_dist*cur_dist;
 
                        if(found<n || -cur_dist<nearest[found-1].dist){
index 51e639d1c757664747f87762fdbde73e10c802c5..2e26f4bd9c9978dd47ca97044e8657261894f96c 100644 (file)
@@ -714,7 +714,7 @@ static void handleRadialSymmetry(BGraph *graph, BNode *root_node, int depth, flo
                int dispatch = 0;
                int last = i - 1;
                
-               if (fabs(ring[first].arc->length - ring[i].arc->length) > limit)
+               if (fabsf(ring[first].arc->length - ring[i].arc->length) > limit)
                {
                        dispatch = 1;
                }
index 5edf6e28d4c50d03614cd7041202d07ec8e1b0a8..3c79a77707ae67992becb9bfe555024b9f9dbbb3 100644 (file)
@@ -820,7 +820,7 @@ void normalize_m4_m4(float rmat[][4], float mat[][4])
        len= normalize_v3_v3(rmat[1], mat[1]);
        if(len!=0.0f) rmat[1][3]= mat[1][3] / len;
        len= normalize_v3_v3(rmat[2], mat[2]);
-       if(len!=0.0f) rmat[2][3]= mat[2][3] / len;;
+       if(len!=0.0f) rmat[2][3]= mat[2][3] / len;
 }
 
 void adjoint_m3_m3(float m1[][3], float m[][3])
index 41eedef8835e9bfb748b8a09baac41f8bf6f3c75..67e27063fd0a5b19f5145021bb21622070057d66 100644 (file)
@@ -338,7 +338,7 @@ void BLI_adddirstrings(void)
                        if ( pwuser ) {
                                BLI_strncpy(file->owner, pwuser->pw_name, sizeof(file->owner));
                        } else {
-                               snprintf(file->owner, sizeof(file->owner), "%d", file->s.st_uid);
+                               BLI_snprintf(file->owner, sizeof(file->owner), "%d", file->s.st_uid);
                        }
                }
 #endif
index 3eafa79a19a7559b8fdb342d1c764a67025b0226..54b3bca11112cf87b4c2888a92e60dafad53af78 100644 (file)
@@ -10147,7 +10147,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                                           !(seq->flag & SEQ_USE_PROXY_CUSTOM_DIR))
                                        {
                                                
-                                               snprintf(seq->strip->proxy->dir, 
+                                               BLI_snprintf(seq->strip->proxy->dir, 
                                                         FILE_MAXDIR, "%s/BL_proxy", 
                                                         seq->strip->dir);
                                        }
index 77cdf889ea55159443bc0de57ada7863b258083b..d29853f7d157abe4c3f3ee5c7817d0e65e26618b 100644 (file)
@@ -115,7 +115,7 @@ LIBIMPORT void IMB_rectcpy(struct ImBuf *dbuf, struct ImBuf *sbuf,
 
 LIBIMPORT void IMB_rectfill(struct ImBuf *drect, const float col[4]);
 LIBIMPORT void IMB_rectfill_area(struct ImBuf *ibuf, float *col, int x1, int y1, int x2, int y2);
-LIBIMPORT void buf_rectfill_area(unsigned char *rect, float *rectf, int width, int height, float *col, int x1, int y1, int x2, int y2);
+LIBIMPORT void buf_rectfill_area(unsigned char *rect, float *rectf, int width, int height, const float col[4], int x1, int y1, int x2, int y2);
 LIBIMPORT void IMB_rectfill_alpha(struct ImBuf *drect, const float value);
 
 #endif /* IFF_H */
index 267ad4be8875b4dd53bc1d022c7643d5f4db92f5..d277dad8e8cda2585dde70bb20c2a5f1952ca0ab 100644 (file)
@@ -160,4 +160,4 @@ protected:
        char* extract_transform_name(char *rna_path);
 
        std::string getObjectBoneName ( Object *ob,const FCurve * fcu);
-};
\ No newline at end of file
+};
index 1e7879b352ff055a5dd32d104cfe3e753507d92d..2ec8ae540d2ffba916af272b2931cc710f199c0e 100644 (file)
@@ -310,9 +310,10 @@ void ArmatureImporter::fix_leaf_bones( )
                LeafBone& leaf = *it;
 
                // pointing up
-               float vec[3] = {0.0f, 0.0f, 1.0f};
+               float vec[3] = {0.0f, 0.0f, 0.1f};
                
-               //mul_v3_fl(vec, leaf_bone_length);
+               // if parent: take parent length and direction
+               if(leaf.bone->parent) sub_v3_v3v3(vec, leaf.bone->parent->tail, leaf.bone->parent->head);
 
                copy_v3_v3(leaf.bone->tail, leaf.bone->head);
                add_v3_v3v3(leaf.bone->tail, leaf.bone->head, vec);
index a60ef8b2ea5cc23865b03e5dbb922781ef6d5547..820665ad7571b4c7edb4da757507854047405360 100644 (file)
@@ -56,7 +56,7 @@ bool ExtraHandler::textData(const char* text, size_t textLength)
 {
        char buf[1024];
        
-       if(currentElement.length() == 0) return false;
+       if(currentElement.length() == 0 || currentExtraTags == 0) return false;
        
        BLI_snprintf(buf, textLength+1, "%s", text);
        currentExtraTags->addTag(currentElement, std::string(buf));
index 806af4c0ef5bcbc3963759a5f5edddb6e806c03f..bdc654ff25a1fb19a9bb8a1eaea7061a6c0eb764 100644 (file)
@@ -1273,7 +1273,7 @@ static int acf_dstex_icon(bAnimListElem *UNUSED(ale))
 
 /* offset for texture expanders */
 // FIXME: soon to be obsolete?
-static short acf_dstex_offset(bAnimContext *UNUSED(ac), bAnimListElem *ale)
+static short acf_dstex_offset(bAnimContext *UNUSED(ac), bAnimListElem *UNUSED(ale))
 {
        return 14; // XXX: simply include this in indention instead?
 }
index c9d6f9a6420235e7ba316ca3338f9734bdf9fece..d58d51c8e08b65bcf7874f1f885acc4d4b21fb39 100644 (file)
@@ -2018,7 +2018,7 @@ static void rename_anim_channels (bAnimContext *ac, int channel_index)
        ED_region_tag_redraw(ac->ar);
 }
 
-static int animchannels_rename_invoke (bContext *C, wmOperator *op, wmEvent *evt)
+static int animchannels_rename_invoke (bContext *C, wmOperator *UNUSED(op), wmEvent *evt)
 {
        bAnimContext ac;
        ARegion *ar;
index 0472731dd6d2e19c9409536e6376becf1ec37496..8010a41ccb334c87e1bd58cf9ef0312a7258f514 100644 (file)
@@ -990,7 +990,7 @@ static size_t animfilter_fcurves (ListBase *anim_data, bDopeSheet *ads, FCurve *
        return items;
 }
 
-static size_t animfilter_act_group (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, bAction *act, bActionGroup *agrp, int filter_mode, ID *owner_id)
+static size_t animfilter_act_group (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, bAction *UNUSED(act), bActionGroup *agrp, int filter_mode, ID *owner_id)
 {
        ListBase tmp_data = {NULL, NULL};
        size_t tmp_items = 0;
index 3c15ff52a3067ff466bc1759eeaea6af9eaad7b9..b0ff60455cf020a1ee44aa2696e19b43d6de2c9e 100644 (file)
@@ -520,7 +520,7 @@ static void pose_slide_reset (tPoseSlideOp *pso)
 /* ------------------------------------ */
 
 /* draw percentage indicator in header */
-static void pose_slide_draw_status (bContext *C, tPoseSlideOp *pso)
+static void pose_slide_draw_status (tPoseSlideOp *pso)
 {
        char statusStr[32];
        char mode[32];
@@ -615,7 +615,7 @@ static int pose_slide_invoke_common (bContext *C, wmOperator *op, tPoseSlideOp *
        WM_cursor_modal(win, BC_EW_SCROLLCURSOR);
        
        /* header print */
-       pose_slide_draw_status(C, pso);
+       pose_slide_draw_status(pso);
        
        /* add a modal handler for this operator */
        WM_event_add_modal_handler(C, op);
@@ -672,7 +672,7 @@ static int pose_slide_modal (bContext *C, wmOperator *op, wmEvent *evt)
                        RNA_float_set(op->ptr, "percentage", pso->percentage);
                        
                        /* update percentage indicator in header */
-                       pose_slide_draw_status(C, pso);
+                       pose_slide_draw_status(pso);
                        
                        /* reset transforms (to avoid accumulation errors) */
                        pose_slide_reset(pso);
index d2f32837d6dabd9bcfc62a66ecd409541895ae59..3911be02fe72d9d3951230e2e5b58e933cf261ad 100644 (file)
@@ -1611,7 +1611,7 @@ static int compare_agroup(const void *sgrp_a_ptr, const void *sgrp_b_ptr)
        return strcmp(sgrp_a->agrp->name, sgrp_b->agrp->name);
 }
 
-static int group_sort_exec(bContext *C, wmOperator *op)
+static int group_sort_exec(bContext *C, wmOperator *UNUSED(op))
 {
        Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data;
        bPose *pose= (ob) ? ob->pose : NULL;
@@ -2275,7 +2275,7 @@ void POSE_OT_quaternions_flip (wmOperatorType *ot)
 /* ********************************************** */
 /* Clear User Transforms */
 
-static int pose_clear_user_transforms_exec (bContext *C, wmOperator *op)
+static int pose_clear_user_transforms_exec (bContext *C, wmOperator *UNUSED(op))
 {
        Scene *scene = CTX_data_scene(C);
        Object *ob = CTX_data_active_object(C);
index 838523599c5718741ebf31609f61f802148132a3..45888b1486b5bec96f009d110e29c5bc0a048617 100644 (file)
@@ -277,8 +277,10 @@ int ED_object_add_generic_get_opts(bContext *C, wmOperator *op, float *loc,
                RNA_boolean_set(op->ptr, "view_align", view_align);
        }
        
-       if (view_align)
+       if (view_align) {
                ED_object_rotation_from_view(C, rot);
+               RNA_float_set_array(op->ptr, "rotation", rot);
+       }
        else
                RNA_float_get_array(op->ptr, "rotation", rot);
        
index b3c4ffc0ac93f3d2c4c00b3cfb30b21180e2825a..cb1fc7541d03052be1bc08d812910a810a5fb723 100644 (file)
@@ -600,7 +600,7 @@ static short select_grouped_keyingset(bContext *C, Object *UNUSED(ob))
                         */
                        for (ksp = ks->paths.first; ksp; ksp = ksp->next) {
                                /* if id matches, select then stop looping (match found) */
-                               if (ksp->id == base->object) {
+                               if (ksp->id == (ID *)base->object) {
                                        ED_base_object_select(base, BA_SELECT);
                                        changed = 1;
                                        break;
index 37309f1e07c7f5ec659dd7c81dd09081484bc659..bd53de20871062a3bb5df132d931c5186603d504 100644 (file)
 #include <string.h>
 #include <sys/stat.h>
 
-#ifdef WIN32   /* Windos */
-#ifndef snprintf
-#define snprintf _snprintf
-#endif
-#endif
-
 #include "MEM_guardedalloc.h"
 
 /* types */
@@ -155,8 +149,8 @@ static int fluid_is_animated_mesh(FluidsimSettings *fss)
 #if 0
 /* helper function */
 void fluidsimGetGeometryObjFilename(Object *ob, char *dst) { //, char *srcname) {
-       //snprintf(dst,FILE_MAXFILE, "%s_cfgdata_%s.bobj.gz", srcname, ob->id.name);
-       snprintf(dst,FILE_MAXFILE, "fluidcfgdata_%s.bobj.gz", ob->id.name);
+       //BLI_snprintf(dst,FILE_MAXFILE, "%s_cfgdata_%s.bobj.gz", srcname, ob->id.name);
+       BLI_snprintf(dst,FILE_MAXFILE, "fluidcfgdata_%s.bobj.gz", ob->id.name);
 }
 #endif
 
@@ -888,7 +882,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain)
        if(getenv(strEnvName)) {
                int dlevel = atoi(getenv(strEnvName));
                elbeemSetDebugLevel(dlevel);
-               snprintf(debugStrBuffer,256,"fluidsimBake::msg: Debug messages activated due to envvar '%s'\n",strEnvName); 
+               BLI_snprintf(debugStrBuffer,256,"fluidsimBake::msg: Debug messages activated due to envvar '%s'\n",strEnvName); 
                elbeemDebugOut(debugStrBuffer);
        }
        
@@ -925,7 +919,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain)
        
        /* rough check of settings... */
        if(domainSettings->previewresxyz > domainSettings->resolutionxyz) {
-               snprintf(debugStrBuffer,256,"fluidsimBake::warning - Preview (%d) >= Resolution (%d)... setting equal.\n", domainSettings->previewresxyz ,  domainSettings->resolutionxyz); 
+               BLI_snprintf(debugStrBuffer,256,"fluidsimBake::warning - Preview (%d) >= Resolution (%d)... setting equal.\n", domainSettings->previewresxyz ,  domainSettings->resolutionxyz); 
                elbeemDebugOut(debugStrBuffer);
                domainSettings->previewresxyz = domainSettings->resolutionxyz;
        }
@@ -945,7 +939,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain)
        } else {
                gridlevels = domainSettings->maxRefine;
        }
-       snprintf(debugStrBuffer,256,"fluidsimBake::msg: Baking %s, refine: %d\n", fsDomain->id.name , gridlevels ); 
+       BLI_snprintf(debugStrBuffer,256,"fluidsimBake::msg: Baking %s, refine: %d\n", fsDomain->id.name , gridlevels ); 
        elbeemDebugOut(debugStrBuffer);
        
        
@@ -997,7 +991,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain)
        /* ******** init domain object's matrix ******** */
        copy_m4_m4(domainMat, fsDomain->obmat);
        if(!invert_m4_m4(invDomMat, domainMat)) {
-               snprintf(debugStrBuffer,256,"fluidsimBake::error - Invalid obj matrix?\n"); 
+               BLI_snprintf(debugStrBuffer,256,"fluidsimBake::error - Invalid obj matrix?\n"); 
                elbeemDebugOut(debugStrBuffer);
                BKE_report(reports, RPT_ERROR, "Invalid object matrix."); 
 
index 52c5100900db0eb599d36dd138f46dc6dd86cf16..c8fa049f5eb09320872f64382f5f055f603511ad 100644 (file)
@@ -169,7 +169,7 @@ static void id_drop_copy(wmDrag *drag, wmDropBox *drop)
 
        BLI_strescape(id_esc, id->name+2, sizeof(id_esc));
 
-       snprintf(text, sizeof(text), "bpy.data.%s[\"%s\"]", BKE_idcode_to_name_plural(GS(id->name)), id_esc);
+       BLI_snprintf(text, sizeof(text), "bpy.data.%s[\"%s\"]", BKE_idcode_to_name_plural(GS(id->name)), id_esc);
 
        /* copy drag path to properties */
        RNA_string_set(drop->ptr, "text", text);
@@ -186,7 +186,7 @@ static int path_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(eve
 static void path_drop_copy(wmDrag *drag, wmDropBox *drop)
 {
        char pathname[FILE_MAXDIR+FILE_MAXFILE+2];
-       snprintf(pathname, sizeof(pathname), "\"%s\"", drag->path);
+       BLI_snprintf(pathname, sizeof(pathname), "\"%s\"", drag->path);
        RNA_string_set(drop->ptr, "text", pathname);
 }
 
index d65297e068d664d61e87db4dbb859223f18d87de..dc5e71f0406fb96a89fe9d82c917907f2ef2d003 100644 (file)
@@ -706,7 +706,7 @@ static void draw_fcurve_curve_bezts (bAnimContext *ac, ID *id, FCurve *fcu, View
                        if (fcu->driver) 
                                resol= 32;
                        else 
-                               resol= (int)(5.0*len_v2v2(bezt->vec[1], prevbezt->vec[1]));
+                               resol= (int)(5.0f*len_v2v2(bezt->vec[1], prevbezt->vec[1]));
                        
                        if (resol < 2) {
                                /* only draw one */
index d58b78ff6a7db0e160045b01afb6a8c071951ba6..68f9e4d033e704b1003eec4e7feab18d81005302 100644 (file)
@@ -960,20 +960,19 @@ static int save_image_options_init(SaveImageOptions *simopts, SpaceImage *sima,
 
        if(ibuf) {
                Image *ima= sima->image;
-               RenderResult *rr= BKE_image_acquire_renderresult(scene, ima);
 
                simopts->planes= ibuf->depth;
 
-               /* cant save multilayer sequence, ima->rr isn't valid for a specific frame */
-               if(rr && !(ima->source==IMA_SRC_SEQUENCE && ima->type==IMA_TYPE_MULTILAYER))
-                       simopts->imtype= R_MULTILAYER;
-               else if(ima->type==IMA_TYPE_R_RESULT)
+               if(ELEM(ima->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE)) {
                        simopts->imtype= scene->r.imtype;
-               else if (ima->source == IMA_SRC_GENERATED)
+                       simopts->planes= scene->r.planes;
+               }
+               else if (ima->source == IMA_SRC_GENERATED) {
                        simopts->imtype= R_PNG;
-               else
+               }
+               else {
                        simopts->imtype= BKE_ftype_to_imtype(ibuf->ftype);
-
+               }
                simopts->subimtype= scene->r.subimtype; /* XXX - this is lame, we need to make these available too! */
                simopts->quality= ibuf->ftype & 0xff;
 
@@ -1000,8 +999,6 @@ static int save_image_options_init(SaveImageOptions *simopts, SpaceImage *sima,
                        }
                        BLI_path_abs(simopts->filepath, G.main->name);
                }
-               /* cleanup */
-               BKE_image_release_renderresult(scene, ima);
        }
 
        ED_space_image_release_buffer(sima, lock);
@@ -1016,7 +1013,10 @@ static void save_image_options_from_op(SaveImageOptions *simopts, wmOperator *op
        // if (RNA_property_is_set(op->ptr, "subimtype")) simopts->subimtype= RNA_enum_get(op->ptr, "subimtype"); // XXX
        if (RNA_property_is_set(op->ptr, "file_quality")) simopts->quality= RNA_int_get(op->ptr, "file_quality");
 
-       if (RNA_property_is_set(op->ptr, "filepath")) RNA_string_get(op->ptr, "filepath", simopts->filepath);
+       if (RNA_property_is_set(op->ptr, "filepath")) {
+               RNA_string_get(op->ptr, "filepath", simopts->filepath);
+               BLI_path_abs(simopts->filepath, G.main->name);
+       }
 }
 
 static void save_image_options_to_op(SaveImageOptions *simopts, wmOperator *op)
@@ -1069,7 +1069,7 @@ static void save_image_doit(bContext *C, SpaceImage *sima, wmOperator *op, SaveI
                        Scene *scene= CTX_data_scene(C);
                        RenderResult *rr= BKE_image_acquire_renderresult(scene, ima);
                        if(rr) {
-                               RE_WriteRenderResult(rr, simopts->filepath, simopts->quality);
+                               RE_WriteRenderResult(op->reports, rr, simopts->filepath, simopts->quality);
                                ok= TRUE;
                        }
                        else {
index 882d89fcd33c975c950e825603321a4b095a07c4..920e93cc0fc1bc8d413b99a09e1ce65d0351e1df 100644 (file)
@@ -3677,7 +3677,7 @@ static void draw_actuator_action(uiLayout *layout, PointerRNA *ptr)
 {
        Object *ob = (Object *)ptr->id.data;
        PointerRNA settings_ptr;
-       uiLayout *row, *subrow, *col;;
+       uiLayout *row, *subrow, *col;
 
        RNA_pointer_create((ID *)ob, &RNA_GameObjectSettings, ob, &settings_ptr);
 
index 0583f328371209a1e1e0dfd360f19cb81999466f..0c9c7877ddcea4dde3e6fe636a4558ea8fb7178e 100644 (file)
@@ -468,10 +468,10 @@ static void nla_draw_strip_text (AnimData *adt, NlaTrack *nlt, NlaStrip *strip,
        
        /* just print the name and the range */
        if (strip->flag & NLASTRIP_FLAG_TEMP_META) {
-               sprintf(str, "%d) Temp-Meta", index);
+               BLI_snprintf(str, sizeof(str), "%d) Temp-Meta", index);
        }
        else {
-               sprintf(str, strip->name);
+               BLI_strncpy(str, strip->name, sizeof(str));
        }
        
        /* set text color - if colors (see above) are light, draw black text, otherwise draw white */
@@ -514,7 +514,7 @@ static void nla_draw_strip_frames_text(NlaTrack *UNUSED(nlt), NlaStrip *strip, V
 {
        const float ytol = 1.0f; /* small offset to vertical positioning of text, for legibility */
        const char col[4] = {220, 220, 220, 255}; /* light grey */
-       char str[16] = "";
+       char str[32] = "";
        
        
        /* Always draw times above the strip, whereas sequencer drew below + above.
@@ -524,11 +524,11 @@ static void nla_draw_strip_frames_text(NlaTrack *UNUSED(nlt), NlaStrip *strip, V
         *        while also preserving some accuracy, since we do use floats
         */
                /* start frame */
-       sprintf(str, "%.1f", strip->start);
+       BLI_snprintf(str, sizeof(str), "%.1f", strip->start);
        UI_view2d_text_cache_add(v2d, strip->start-1.0f, ymaxc+ytol, str, col);
        
                /* end frame */
-       sprintf(str, "%.1f", strip->end);
+       BLI_snprintf(str, sizeof(str), "%.1f", strip->end);
        UI_view2d_text_cache_add(v2d, strip->end, ymaxc+ytol, str, col);
 }
 
@@ -730,9 +730,9 @@ static void draw_nla_channel_list_gl (bAnimContext *ac, ListBase *anim_data, Vie
                                        special = ICON_ACTION;
                                        
                                        if (act)
-                                               sprintf(name, "%s", act->id.name+2);
+                                               BLI_snprintf(name, sizeof(name), "%s", act->id.name+2);
                                        else
-                                               sprintf(name, "<No Action>");
+                                               BLI_strncpy(name, "<No Action>", sizeof(name));
                                                
                                        // draw manually still
                                        doDraw= 1;
index 0f87be0f807ab47fa54828e0b78084414a6cee4e..08026e8a1d2ea1b527e32693aa0783c8f5e6646a 100644 (file)
@@ -533,7 +533,7 @@ static int nlaedit_add_transition_exec (bContext *C, wmOperator *op)
                        if ELEM(0, (s1->flag & NLASTRIP_FLAG_SELECT), (s2->flag & NLASTRIP_FLAG_SELECT))
                                continue;
                        /* check if there's space between the two */
-                       if (IS_EQ(s1->end, s2->start))
+                       if (IS_EQF(s1->end, s2->start))
                                continue;
                        /* make sure neither one is a transition 
                         *      - although this is impossible to create with the standard tools, 
@@ -613,7 +613,7 @@ void NLA_OT_transition_add (wmOperatorType *ot)
 /* ******************** Add Sound Clip Operator ***************************** */
 /* Add a new sound clip */
 
-static int nlaedit_add_sound_exec (bContext *C, wmOperator *op)
+static int nlaedit_add_sound_exec (bContext *C, wmOperator *UNUSED(op))
 {
        bAnimContext ac;
        
@@ -1013,14 +1013,14 @@ static void nlaedit_split_strip_actclip (AnimData *adt, NlaTrack *nlt, NlaStrip
                        
                        /* strip extents */
                len= strip->end - strip->start;
-               if (IS_EQ(len, 0.0f)) 
+               if (IS_EQF(len, 0.0f))
                        return;
                else
                        splitframe= strip->start + (len / 2.0f);
                        
                        /* action range */
                len= strip->actend - strip->actstart;
-               if (IS_EQ(len, 0.0f))
+               if (IS_EQF(len, 0.0f))
                        splitaframe= strip->actend;
                else
                        splitaframe= strip->actstart + (len / 2.0f);
@@ -1858,10 +1858,10 @@ static int nlaedit_snap_exec (bContext *C, wmOperator *op)
                                                strip->start= (float)CFRA;
                                                break;
                                        case NLAEDIT_SNAP_NEAREST_FRAME: /* to nearest frame */
-                                               strip->start= (float)(floor(start+0.5));
+                                               strip->start= floorf(start+0.5f);
                                                break;
                                        case NLAEDIT_SNAP_NEAREST_SECOND: /* to nearest second */
-                                               strip->start= ((float)floor(start/secf + 0.5f) * secf);
+                                               strip->start= floorf(start/secf + 0.5f) * secf;
                                                break;
                                        case NLAEDIT_SNAP_NEAREST_MARKER: /* to nearest marker */
                                                strip->start= (float)ED_markers_find_nearest_marker_time(ac.markers, start);
index 4525ea9c8d9ace1ea44d7c15b972af57d9d5cbe7..3ae158bd275aa41485e17443a520d127956658a3 100644 (file)
@@ -822,7 +822,7 @@ static void outliner_do_id_set_operation(SpaceOops *soops, int type, ListBase *l
 
 /* ------------------------------------------ */
 
-static void actionset_id_cb(TreeElement *te, TreeStoreElem *tselem, TreeStoreElem *tsep, ID *actId)
+static void actionset_id_cb(TreeElement *UNUSED(te), TreeStoreElem *tselem, TreeStoreElem *tsep, ID *actId)
 {
        bAction *act = (bAction *)actId;
        
index fbb3aac43fe2d0b3bf9a7f0401b53101ce0543a4..2b994a2d0d273dd77905d0397faedd81d4e316d8 100644 (file)
@@ -1496,7 +1496,7 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob
 }
 
 /* flag similar to draw_object() */
-static void drawspeaker(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, int flag)
+static void drawspeaker(Scene *UNUSED(scene), View3D *UNUSED(v3d), RegionView3D *UNUSED(rv3d), Object *UNUSED(ob), int UNUSED(flag))
 {
        //Speaker *spk = ob->data;
 
@@ -1505,34 +1505,29 @@ static void drawspeaker(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *o
 
        glEnable(GL_BLEND);
 
-       for(j = 0; j < 3; j++)
-       {
-               vec[2] = .25f * j -.125f;
+       for(j = 0; j < 3; j++) {
+               vec[2] = 0.25f * j -0.125f;
 
                glBegin(GL_LINE_LOOP);
-               for(i = 0; i < 16; i++)
-               {
-                       vec[0] = cos(M_PI * i / 8.0f) * (j == 0 ? .5f : .25f);
-                       vec[1] = sin(M_PI * i / 8.0f) * (j == 0 ? .5f : .25f);
+               for(i = 0; i < 16; i++) {
+                       vec[0] = cosf(M_PI * i / 8.0f) * (j == 0 ? 0.5f : 0.25f);
+                       vec[1] = sinf(M_PI * i / 8.0f) * (j == 0 ? 0.5f : 0.25f);
                        glVertex3fv(vec);
                }
                glEnd();
        }
 
-       for(j = 0; j < 4; j++)
-       {
-               vec[0] = (((j + 1) % 2) * (j - 1)) * .5f;
-               vec[1] = ((j % 2) * (j - 2)) * .5f;
+       for(j = 0; j < 4; j++) {
+               vec[0] = (((j + 1) % 2) * (j - 1)) * 0.5f;
+               vec[1] = ((j % 2) * (j - 2)) * 0.5f;
                glBegin(GL_LINE_STRIP);
-               for(i = 0; i < 3; i++)
-               {
-                       if(i == 1)
-                       {
-                               vec[0] *= .5f;
-                               vec[1] *= .5f;
+               for(i = 0; i < 3; i++) {
+                       if(i == 1) {
+                               vec[0] *= 0.5f;
+                               vec[1] *= 0.5f;
                        }
 
-                       vec[2] = .25f * i -.125f;
+                       vec[2] = 0.25f * i -0.125f;
                        glVertex3fv(vec);
                }
                glEnd();
index e9ed5dac3de009ddded51b2381f9df7a773f3a96..19e8d42db2d6ea94c8625e81c4c970c155cc7ce7 100644 (file)
@@ -3475,7 +3475,7 @@ void ED_view3d_from_m4(float mat[][4], float ofs[3], float quat[4], float *dist)
                copy_m3_m4(nmat, mat);
                normalize_m3(nmat);
 
-               mul_m3_v3(nmat, vec);;
+               mul_m3_v3(nmat, vec);
                sub_v3_v3(ofs, vec);
        }
 }
index 77498835d57b6c916f87669cd1af7731b0349b08..360f3dbf63fec0d163e9aae712fdade00ef004c6 100644 (file)
 #include <string.h>
 #include <stdarg.h>
 
-#ifdef _WIN32
-#ifndef vsnprintf
-#define vsnprintf _vsnprintf
-#endif
-#ifndef snprintf
-#define snprintf _snprintf
-#endif
-#endif
-
 extern char datatoc_gpu_shader_material_glsl[];
 extern char datatoc_gpu_shader_vertex_glsl[];
 
@@ -168,24 +159,6 @@ struct GPUPass {
        struct GPUShader *shader;
 };
 
-/* Strings utility */
-
-static void BLI_dynstr_printf(DynStr *dynstr, const char *format, ...)
-{
-       va_list args;
-       int retval;
-       char str[2048];
-
-       va_start(args, format);
-       retval = vsnprintf(str, sizeof(str), format, args);
-       va_end(args);
-
-       if (retval >= sizeof(str))
-               fprintf(stderr, "BLI_dynstr_printf: limit exceeded\n");
-       else
-               BLI_dynstr_append(dynstr, str);
-}
-
 /* GLSL code parsing for finding function definitions.
  * These are stored in a hash for lookup when creating a material. */
 
@@ -318,7 +291,7 @@ static char *gpu_generate_function_prototyps(GHash *hash)
                name = BLI_ghashIterator_getValue(ghi);
                function = BLI_ghashIterator_getValue(ghi);
 
-               BLI_dynstr_printf(ds, "void %s(", name);
+               BLI_dynstr_appendf(ds, "void %s(", name);
                for(a=0; a<function->totparam; a++) {
                        if(function->paramqual[a] == FUNCTION_QUAL_OUT)
                                BLI_dynstr_append(ds, "out ");
@@ -334,7 +307,7 @@ static char *gpu_generate_function_prototyps(GHash *hash)
                        else
                                BLI_dynstr_append(ds, GPU_DATATYPE_STR[function->paramtype[a]]);
                                
-                       //BLI_dynstr_printf(ds, " param%d", a);
+                       //BLI_dynstr_appendf(ds, " param%d", a);
                        
                        if(a != function->totparam-1)
                                BLI_dynstr_append(ds, ", ");
@@ -390,42 +363,42 @@ static void codegen_convert_datatype(DynStr *ds, int from, int to, const char *t
 {
        char name[1024];
 
-       snprintf(name, sizeof(name), "%s%d", tmp, id);
+       BLI_snprintf(name, sizeof(name), "%s%d", tmp, id);
 
        if (from == to) {
                BLI_dynstr_append(ds, name);
        }
        else if (to == GPU_FLOAT) {
                if (from == GPU_VEC4)
-                       BLI_dynstr_printf(ds, "dot(%s.rgb, vec3(0.35, 0.45, 0.2))", name);
+                       BLI_dynstr_appendf(ds, "dot(%s.rgb, vec3(0.35, 0.45, 0.2))", name);
                else if (from == GPU_VEC3)
-                       BLI_dynstr_printf(ds, "dot(%s, vec3(0.33))", name);
+                       BLI_dynstr_appendf(ds, "dot(%s, vec3(0.33))", name);
                else if (from == GPU_VEC2)
-                       BLI_dynstr_printf(ds, "%s.r", name);
+                       BLI_dynstr_appendf(ds, "%s.r", name);
        }
        else if (to == GPU_VEC2) {
                if (from == GPU_VEC4)
-                       BLI_dynstr_printf(ds, "vec2(dot(%s.rgb, vec3(0.35, 0.45, 0.2)), %s.a)", name, name);
+                       BLI_dynstr_appendf(ds, "vec2(dot(%s.rgb, vec3(0.35, 0.45, 0.2)), %s.a)", name, name);
                else if (from == GPU_VEC3)
-                       BLI_dynstr_printf(ds, "vec2(dot(%s.rgb, vec3(0.33)), 1.0)", name);
+                       BLI_dynstr_appendf(ds, "vec2(dot(%s.rgb, vec3(0.33)), 1.0)", name);
                else if (from == GPU_FLOAT)
-                       BLI_dynstr_printf(ds, "vec2(%s, 1.0)", name);
+                       BLI_dynstr_appendf(ds, "vec2(%s, 1.0)", name);
        }
        else if (to == GPU_VEC3) {
                if (from == GPU_VEC4)
-                       BLI_dynstr_printf(ds, "%s.rgb", name);
+                       BLI_dynstr_appendf(ds, "%s.rgb", name);
                else if (from == GPU_VEC2)
-                       BLI_dynstr_printf(ds, "vec3(%s.r, %s.r, %s.r)", name, name, name);
+                       BLI_dynstr_appendf(ds, "vec3(%s.r, %s.r, %s.r)", name, name, name);
                else if (from == GPU_FLOAT)
-                       BLI_dynstr_printf(ds, "vec3(%s, %s, %s)", name, name, name);
+                       BLI_dynstr_appendf(ds, "vec3(%s, %s, %s)", name, name, name);
        }
        else {
                if (from == GPU_VEC3)
-                       BLI_dynstr_printf(ds, "vec4(%s, 1.0)", name);
+                       BLI_dynstr_appendf(ds, "vec4(%s, 1.0)", name);
                else if (from == GPU_VEC2)
-                       BLI_dynstr_printf(ds, "vec4(%s.r, %s.r, %s.r, %s.g)", name, name, name, name);
+                       BLI_dynstr_appendf(ds, "vec4(%s.r, %s.r, %s.r, %s.g)", name, name, name, name);
                else if (from == GPU_FLOAT)
-                       BLI_dynstr_printf(ds, "vec4(%s, %s, %s, 1.0)", name, name, name);
+                       BLI_dynstr_appendf(ds, "vec4(%s, %s, %s, 1.0)", name, name, name);
        }
 }
 
@@ -433,10 +406,10 @@ static void codegen_print_datatype(DynStr *ds, int type, float *data)
 {
        int i;
 
-       BLI_dynstr_printf(ds, "%s(", GPU_DATATYPE_STR[type]);
+       BLI_dynstr_appendf(ds, "%s(", GPU_DATATYPE_STR[type]);
 
        for(i=0; i<type; i++) {
-               BLI_dynstr_printf(ds, "%f", data[i]);
+               BLI_dynstr_appendf(ds, "%f", data[i]);
                if(i == type-1)
                        BLI_dynstr_append(ds, ")");
                else
@@ -568,7 +541,7 @@ static void codegen_print_uniforms_functions(DynStr *ds, ListBase *nodes)
                        if ((input->source == GPU_SOURCE_TEX) || (input->source == GPU_SOURCE_TEX_PIXEL)) {
                                /* create exactly one sampler for each texture */
                                if (codegen_input_has_texture(input) && input->bindtex)
-                                       BLI_dynstr_printf(ds, "uniform %s samp%d;\n",
+                                       BLI_dynstr_appendf(ds, "uniform %s samp%d;\n",
                                                (input->textype == GPU_TEX1D)? "sampler1D":
                                                (input->textype == GPU_TEX2D)? "sampler2D": "sampler2DShadow",
                                                input->texid);
@@ -580,11 +553,11 @@ static void codegen_print_uniforms_functions(DynStr *ds, ListBase *nodes)
                                        name = GPU_builtin_name(input->builtin);
 
                                        if(gpu_str_prefix(name, "unf")) {
-                                               BLI_dynstr_printf(ds, "uniform %s %s;\n",
+                                               BLI_dynstr_appendf(ds, "uniform %s %s;\n",
                                                        GPU_DATATYPE_STR[input->type], name);
                                        }
                                        else {
-                                               BLI_dynstr_printf(ds, "varying %s %s;\n",
+                                               BLI_dynstr_appendf(ds, "varying %s %s;\n",
                                                        GPU_DATATYPE_STR[input->type], name);
                                        }
                                }
@@ -592,19 +565,19 @@ static void codegen_print_uniforms_functions(DynStr *ds, ListBase *nodes)
                        else if (input->source == GPU_SOURCE_VEC_UNIFORM) {
                                if(input->dynamicvec) {
                                        /* only create uniforms for dynamic vectors */
-                                       BLI_dynstr_printf(ds, "uniform %s unf%d;\n",
+                                       BLI_dynstr_appendf(ds, "uniform %s unf%d;\n",
                                                GPU_DATATYPE_STR[input->type], input->id);
                                }
                                else {
                                        /* for others use const so the compiler can do folding */
-                                       BLI_dynstr_printf(ds, "const %s cons%d = ",
+                                       BLI_dynstr_appendf(ds, "const %s cons%d = ",
                                                GPU_DATATYPE_STR[input->type], input->id);
                                        codegen_print_datatype(ds, input->type, input->vec);
                                        BLI_dynstr_append(ds, ";\n");
                                }
                        }
                        else if (input->source == GPU_SOURCE_ATTRIB && input->attribfirst) {
-                               BLI_dynstr_printf(ds, "varying %s var%d;\n",
+                               BLI_dynstr_appendf(ds, "varying %s var%d;\n",
                                        GPU_DATATYPE_STR[input->type], input->attribid);
                        }
                }
@@ -624,8 +597,8 @@ static void codegen_declare_tmps(DynStr *ds, ListBase *nodes)
                for (input=node->inputs.first; input; input=input->next) {
                        if (input->source == GPU_SOURCE_TEX_PIXEL) {
                                if (codegen_input_has_texture(input) && input->definetex) {
-                                       BLI_dynstr_printf(ds, "\tvec4 tex%d = texture2D(", input->texid);
-                                       BLI_dynstr_printf(ds, "samp%d, gl_TexCoord[%d].st);\n",
+                                       BLI_dynstr_appendf(ds, "\tvec4 tex%d = texture2D(", input->texid);
+                                       BLI_dynstr_appendf(ds, "samp%d, gl_TexCoord[%d].st);\n",
                                                input->texid, input->texid);
                                }
                        }
@@ -633,7 +606,7 @@ static void codegen_declare_tmps(DynStr *ds, ListBase *nodes)
 
                /* declare temporary variables for node output storage */
                for (output=node->outputs.first; output; output=output->next)
-                       BLI_dynstr_printf(ds, "\t%s tmp%d;\n",
+                       BLI_dynstr_appendf(ds, "\t%s tmp%d;\n",
                                GPU_DATATYPE_STR[output->type], output->id);
        }
 
@@ -647,13 +620,13 @@ static void codegen_call_functions(DynStr *ds, ListBase *nodes, GPUOutput *final
        GPUOutput *output;
 
        for (node=nodes->first; node; node=node->next) {
-               BLI_dynstr_printf(ds, "\t%s(", node->name);
+               BLI_dynstr_appendf(ds, "\t%s(", node->name);
                
                for (input=node->inputs.first; input; input=input->next) {
                        if (input->source == GPU_SOURCE_TEX) {
-                               BLI_dynstr_printf(ds, "samp%d", input->texid);
+                               BLI_dynstr_appendf(ds, "samp%d", input->texid);
                                if (input->link)
-                                       BLI_dynstr_printf(ds, ", gl_TexCoord[%d].st", input->texid);
+                                       BLI_dynstr_appendf(ds, ", gl_TexCoord[%d].st", input->texid);
                        }
                        else if (input->source == GPU_SOURCE_TEX_PIXEL) {
                                if (input->link && input->link->output)
@@ -664,21 +637,21 @@ static void codegen_call_functions(DynStr *ds, ListBase *nodes, GPUOutput *final
                                                "tex", input->texid);
                        }
                        else if(input->source == GPU_SOURCE_BUILTIN)
-                               BLI_dynstr_printf(ds, "%s", GPU_builtin_name(input->builtin));
+                               BLI_dynstr_appendf(ds, "%s", GPU_builtin_name(input->builtin));
                        else if(input->source == GPU_SOURCE_VEC_UNIFORM) {
                                if(input->dynamicvec)
-                                       BLI_dynstr_printf(ds, "unf%d", input->id);
+                                       BLI_dynstr_appendf(ds, "unf%d", input->id);
                                else
-                                       BLI_dynstr_printf(ds, "cons%d", input->id);
+                                       BLI_dynstr_appendf(ds, "cons%d", input->id);
                        }
                        else if (input->source == GPU_SOURCE_ATTRIB)
-                               BLI_dynstr_printf(ds, "var%d", input->attribid);
+                               BLI_dynstr_appendf(ds, "var%d", input->attribid);
 
                        BLI_dynstr_append(ds, ", ");
                }
 
                for (output=node->outputs.first; output; output=output->next) {
-                       BLI_dynstr_printf(ds, "tmp%d", output->id);
+                       BLI_dynstr_appendf(ds, "tmp%d", output->id);
                        if (output->next)
                                BLI_dynstr_append(ds, ", ");
                }
@@ -702,7 +675,7 @@ static char *code_generate_fragment(ListBase *nodes, GPUOutput *output, const ch
        codegen_print_uniforms_functions(ds, nodes);
 
        //if(G.f & G_DEBUG)
-       //      BLI_dynstr_printf(ds, "/* %s */\n", name);
+       //      BLI_dynstr_appendf(ds, "/* %s */\n", name);
 
        BLI_dynstr_append(ds, "void main(void)\n");
        BLI_dynstr_append(ds, "{\n");
@@ -731,9 +704,9 @@ static char *code_generate_vertex(ListBase *nodes)
        for (node=nodes->first; node; node=node->next) {
                for (input=node->inputs.first; input; input=input->next) {
                        if (input->source == GPU_SOURCE_ATTRIB && input->attribfirst) {
-                               BLI_dynstr_printf(ds, "attribute %s att%d;\n",
+                               BLI_dynstr_appendf(ds, "attribute %s att%d;\n",
                                        GPU_DATATYPE_STR[input->type], input->attribid);
-                               BLI_dynstr_printf(ds, "varying %s var%d;\n",
+                               BLI_dynstr_appendf(ds, "varying %s var%d;\n",
                                        GPU_DATATYPE_STR[input->type], input->attribid);
                        }
                }
@@ -747,11 +720,11 @@ static char *code_generate_vertex(ListBase *nodes)
                        if (input->source == GPU_SOURCE_ATTRIB && input->attribfirst) {
                                if(input->attribtype == CD_TANGENT) /* silly exception */
                                {
-                                       BLI_dynstr_printf(ds, "\tvar%d.xyz = normalize((gl_ModelViewMatrix * vec4(att%d.xyz, 0)).xyz);\n", input->attribid, input->attribid);
-                                       BLI_dynstr_printf(ds, "\tvar%d.w = att%d.w;\n", input->attribid, input->attribid);
+                                       BLI_dynstr_appendf(ds, "\tvar%d.xyz = normalize((gl_ModelViewMatrix * vec4(att%d.xyz, 0)).xyz);\n", input->attribid, input->attribid);
+                                       BLI_dynstr_appendf(ds, "\tvar%d.w = att%d.w;\n", input->attribid, input->attribid);
                                }
                                else
-                                       BLI_dynstr_printf(ds, "\tvar%d = att%d;\n", input->attribid, input->attribid);
+                                       BLI_dynstr_appendf(ds, "\tvar%d = att%d;\n", input->attribid, input->attribid);
                        }
 
        BLI_dynstr_append(ds, "}\n\n");
@@ -799,9 +772,9 @@ static void GPU_nodes_extract_dynamic_inputs(GPUPass *pass, ListBase *nodes)
                                continue;
 
                        if (input->ima || input->tex)
-                               snprintf(input->shadername, sizeof(input->shadername), "samp%d", input->texid);
+                               BLI_snprintf(input->shadername, sizeof(input->shadername), "samp%d", input->texid);
                        else
-                               snprintf(input->shadername, sizeof(input->shadername), "unf%d", input->id);
+                               BLI_snprintf(input->shadername, sizeof(input->shadername), "unf%d", input->id);
 
                        /* pass non-dynamic uniforms to opengl */
                        extract = 0;
index ff13be20d4e10c5d590ea9bee30b6a754d9ea94f..1547d2ee9ce0222dae4c61a4bb5b05e8956e0464 100644 (file)
@@ -55,6 +55,8 @@ set(SRC
        intern/filetype.c
        intern/filter.c
        intern/imageprocess.c
+       intern/indexer.c
+       intern/indexer_dv.c
        intern/iris.c
        intern/jp2.c
        intern/jpeg.c
@@ -73,7 +75,6 @@ set(SRC
        intern/tiff.c
        intern/util.c
        intern/writeimage.c
-       intern/indexer.c
 
        IMB_imbuf.h
        IMB_imbuf_types.h
@@ -82,6 +83,7 @@ set(SRC
        intern/IMB_anim.h
        intern/IMB_filetype.h
        intern/IMB_filter.h
+       intern/IMB_indexer.h
        intern/IMB_metadata.h
        intern/cineon/cin_debug_stuff.h
        intern/cineon/cineonfile.h
index 1fbe8e01fd4137d5128e05132c8076585947531c..2c926f2d94b1c0f12286f03c40a70e79d9f89bca 100644 (file)
@@ -499,7 +499,7 @@ void IMB_rectfill_area(struct ImBuf *ibuf, float *col, int x1, int y1, int x2, i
 void IMB_rectfill_alpha(struct ImBuf *ibuf, const float value);
 
 /* this should not be here, really, we needed it for operating on render data, IMB_rectfill_area calls it */
-void buf_rectfill_area(unsigned char *rect, float *rectf, int width, int height, float *col, int x1, int y1, int x2, int y2);
+void buf_rectfill_area(unsigned char *rect, float *rectf, int width, int height, const float col[4], int x1, int y1, int x2, int y2);
 
 /* defined in metadata.c */
 int IMB_metadata_change_field(struct ImBuf *img, const char *key, const char *field);
index 0961af10f69b818c1b997df1bff28568974d539e..2def0d042b762905b5e1e68f5fa746a45441e976 100644 (file)
@@ -26,6 +26,7 @@
 
 #include "IMB_indexer.h"
 #include "MEM_guardedalloc.h"
+#include "BLI_utildefines.h"
 #include <time.h>
 
 typedef struct indexer_dv_bitstream {
@@ -279,7 +280,7 @@ static void fill_gap(indexer_dv_context * This, int isPAL)
 }
 
 static void proc_frame(indexer_dv_context * This,
-                      unsigned char* framebuffer, int isPAL)
+                      unsigned char* UNUSED(framebuffer), int isPAL)
 {
        struct tm recDate;
        time_t t;
@@ -329,7 +330,7 @@ static void proc_frame(indexer_dv_context * This,
 
 static void indexer_dv_proc_frame(anim_index_builder * idx, 
                                  unsigned char * buffer,
-                                 int data_size, 
+                                 int UNUSED(data_size),
                                  struct anim_index_entry * entry)
 {
        int isPAL;
index 7b528ed962452c176260399755e603e620211957..88f6508d356ff36f11276c284c7be99fb5b3cb8d 100644 (file)
@@ -487,7 +487,7 @@ void IMB_exr_add_channel(void *handle, const char *layname, const char *passname
 }
 
 /* only used for writing temp. render results (not image files) */
-void IMB_exr_begin_write(void *handle, const char *filename, int width, int height, int compress)
+int IMB_exr_begin_write(void *handle, const char *filename, int width, int height, int compress)
 {
        ExrHandle *data= (ExrHandle *)handle;
        Header header (width, height);
@@ -504,8 +504,17 @@ void IMB_exr_begin_write(void *handle, const char *filename, int width, int heig
        /* header.lineOrder() = DECREASING_Y; this crashes in windows for file read! */
        
        header.insert ("BlenderMultiChannel", StringAttribute ("Blender V2.55.1 and newer"));
-       
-       data->ofile = new OutputFile(filename, header);
+
+       /* avoid crash/abort when we dont have permission to write here */
+       try {
+               data->ofile = new OutputFile(filename, header);
+       }
+       catch (const std::exception &exc) {
+               std::cerr << "IMB_exr_begin_write: ERROR: " << exc.what() << std::endl;
+               data->ofile = NULL;
+       }
+
+       return (data->ofile != NULL);
 }
 
 void IMB_exrtile_begin_write(void *handle, const char *filename, int mipmap, int width, int height, int tilex, int tiley)
index 3d95bb7c3067ae50e078df263273bc492a2ffd1a..58c5e0f2a3e54301bd90df81ab2a089f6c74f91c 100644 (file)
@@ -50,7 +50,7 @@ void *        IMB_exr_get_handle                      (void);
 void   IMB_exr_add_channel                     (void *handle, const char *layname, const char *passname, int xstride, int ystride, float *rect);
 
 int            IMB_exr_begin_read                      (void *handle, const char *filename, int *width, int *height);
-void   IMB_exr_begin_write                     (void *handle, const char *filename, int width, int height, int compress);
+int            IMB_exr_begin_write                     (void *handle, const char *filename, int width, int height, int compress);
 void   IMB_exrtile_begin_write         (void *handle, const char *filename, int mipmap, int width, int height, int tilex, int tiley);
 
 void   IMB_exr_set_channel                     (void *handle, const char *layname, const char *passname, int xstride, int ystride, float *rect);
@@ -75,7 +75,7 @@ void *        IMB_exr_get_handle                      (void) {return NULL;}
 void   IMB_exr_add_channel                     (void *handle, const char *layname, const char *channame, int xstride, int ystride, float *rect) {  (void)handle; (void)layname; (void)channame; (void)xstride; (void)ystride; (void)rect; }
 
 int            IMB_exr_begin_read                      (void *handle, const char *filename, int *width, int *height) { (void)handle; (void)filename; (void)width; (void)height; return 0;}
-void   IMB_exr_begin_write                     (void *handle, const char *filename, int width, int height, int compress) { (void)handle; (void)filename; (void)width; (void)height; (void)compress; }
+int            IMB_exr_begin_write                     (void *handle, const char *filename, int width, int height, int compress) { (void)handle; (void)filename; (void)width; (void)height; (void)compress; return 0;}
 void   IMB_exrtile_begin_write         (void *handle, const char *filename, int mipmap, int width, int height, int tilex, int tiley) { (void)handle; (void)filename; (void)mipmap; (void)width; (void)height; (void)tilex; (void)tiley; }
 
 void   IMB_exr_set_channel                     (void *handle, char *layname, const char *channame, int xstride, int ystride, float *rect) { (void)handle; (void)layname; (void)channame; (void)xstride; (void)ystride; (void)rect; }
index 844478e03cb659c29761cc40cf56cc3562319b6e..db2ae3a5114edb27087e9bad814cb014e3bb77b4 100644 (file)
@@ -482,7 +482,7 @@ void IMB_rectfill(struct ImBuf *drect, const float col[4])
 }
 
 
-void buf_rectfill_area(unsigned char *rect, float *rectf, int width, int height, float *col, int x1, int y1, int x2, int y2)
+void buf_rectfill_area(unsigned char *rect, float *rectf, int width, int height, const float col[4], int x1, int y1, int x2, int y2)
 {
        int i, j;
        float a; /* alpha */
@@ -509,6 +509,8 @@ void buf_rectfill_area(unsigned char *rect, float *rectf, int width, int height,
                unsigned char *pixel; 
                unsigned char chr=0, chg=0, chb=0;
                float fr=0, fg=0, fb=0;
+
+               const int alphaint= FTOCHAR(a);
                
                if (a == 1.0f) {
                        chr = FTOCHAR(col[0]);
@@ -527,10 +529,13 @@ void buf_rectfill_area(unsigned char *rect, float *rectf, int width, int height,
                                                pixel[0] = chr;
                                                pixel[1] = chg;
                                                pixel[2] = chb;
+                                               pixel[3] = 255;
                                        } else {
+                                               int alphatest;
                                                pixel[0] = (char)((fr + ((float)pixel[0]*aich))*255.0f);
                                                pixel[1] = (char)((fg + ((float)pixel[1]*aich))*255.0f);
                                                pixel[2] = (char)((fb + ((float)pixel[2]*aich))*255.0f);
+                                               pixel[3] = (char)((alphatest= ((int)pixel[3] + alphaint)) < 255 ? alphatest : 255);
                                        }
                                }
                        }
@@ -546,10 +551,13 @@ void buf_rectfill_area(unsigned char *rect, float *rectf, int width, int height,
                                        pixel[0] = col[0];
                                        pixel[1] = col[1];
                                        pixel[2] = col[2];
+                                       pixel[3] = 1.0f;
                                } else {
+                                       float alphatest;
                                        pixel[0] = (col[0]*a) + (pixel[0]*ai);
                                        pixel[1] = (col[1]*a) + (pixel[1]*ai);
                                        pixel[2] = (col[2]*a) + (pixel[2]*ai);
+                                       pixel[3] = (alphatest= (pixel[3] + a)) < 1.0f ? alphatest : 1.0f;
                                }
                        }
                }
index cd660e11f26329dbb1d013c5ce7db9a130aa6268..b933e6d93ee3d1581ade495a7801322451d40472 100644 (file)
@@ -55,7 +55,6 @@ short IMB_saveiff(struct ImBuf *ibuf, const char *name, int flags)
                                if(ibuf->rect==NULL && ibuf->rect_float)
                                        IMB_rect_from_float(ibuf);
                        }
-                       /* TODO. have const char for image write funcs */
                        return type->save(ibuf, name, flags);
                }
        }
index 77ba6031da5cf8936cf940596b8d1da4be345bb5..eeb2adb3cf25774101be32ca9743b85a7a7d224c 100644 (file)
@@ -42,9 +42,10 @@ static PyTypeObject BlenderAppCbType;
 static PyStructSequence_Field app_cb_info_fields[]= {
        {(char *)"render_pre", NULL},
        {(char *)"render_post", NULL},
-    {(char *)"load_pre", NULL},
+       {(char *)"render_stats", NULL},
+       {(char *)"load_pre", NULL},
        {(char *)"load_post", NULL},
-    {(char *)"save_pre", NULL},
+       {(char *)"save_pre", NULL},
        {(char *)"save_post", NULL},
        {NULL}
 };
index 6fc861b2a0df5d0bfdfc34027fc7d18d1d5536e4..7c80653496f035d250c09a50a6c1ab7d3055d89c 100644 (file)
@@ -40,7 +40,7 @@ PyObject *bpy_intern_str___slots__;
 void bpy_intern_string_init(void)
 {
        bpy_intern_str_register= PyUnicode_FromString("register");
-       bpy_intern_str_unregister= PyUnicode_FromString("unregister");;
+       bpy_intern_str_unregister= PyUnicode_FromString("unregister");
        bpy_intern_str_bl_rna= PyUnicode_FromString("bl_rna");
        bpy_intern_str_order= PyUnicode_FromString("order");
        bpy_intern_str_attr= PyUnicode_FromString("attr");
index 4abcbc684e2487528f55fc98cf45fd801d77fe58..e1c38a82142f580c0b9b903bff3e7283792c055e 100644 (file)
@@ -1251,7 +1251,7 @@ static PyObject *pyrna_enum_to_py(PointerRNA *ptr, PropertyRNA *prop, int val)
 
 #if 0                  // gives python decoding errors while generating docs :(
                                char error_str[256];
-                               snprintf(error_str, sizeof(error_str), "RNA Warning: Current value \"%d\" matches no enum in '%s', '%s', '%s'", val, RNA_struct_identifier(ptr->type), ptr_name, RNA_property_identifier(prop));
+                               BLI_snprintf(error_str, sizeof(error_str), "RNA Warning: Current value \"%d\" matches no enum in '%s', '%s', '%s'", val, RNA_struct_identifier(ptr->type), ptr_name, RNA_property_identifier(prop));
                                PyErr_Warn(PyExc_RuntimeWarning, error_str);
 #endif
 
index 0736bed4faf81dbbe1b136c6763e57cf8cdcd5c1..97ffcd954738e36a7fedc68258d721283fc00901 100644 (file)
@@ -227,8 +227,8 @@ void RE_SetReports(struct Render *re, struct ReportList *reports);
 /* main preview render call */
 void RE_PreviewRender(struct Render *re, struct Main *bmain, struct Scene *scene);
 
-void RE_ReadRenderResult(struct Scene *scene, struct Scene *scenode);
-void RE_WriteRenderResult(RenderResult *rr, const char *filename, int compress);
+int RE_ReadRenderResult(struct Scene *scene, struct Scene *scenode);
+int RE_WriteRenderResult(struct ReportList *reports, RenderResult *rr, const char *filename, int compress);
 struct RenderResult *RE_MultilayerConvert(void *exrhandle, int rectx, int recty);
 
 extern const float default_envmap_layout[];
index 0d5f8c77f6b6dfd55ef6a1380ef2bc5d55573eb4..24c55332bff788d8fa1fa82cbb62ed1445f97e3c 100644 (file)
@@ -173,6 +173,9 @@ static void stats_background(void *UNUSED(arg), RenderStats *rs)
                else
                        fprintf(stdout, "Sce: %s Ve:%d Fa:%d La:%d", rs->scenename, rs->totvert, rs->totface, rs->totlamp);
        }
+
+       BLI_exec_cb(rs, (ID *)rs, BLI_CB_EVT_RENDER_STATS);
+
        fputc('\n', stdout);
        fflush(stdout);
 }
@@ -824,11 +827,12 @@ static char *make_pass_name(RenderPass *rpass, int chan)
 
 /* filename already made absolute */
 /* called from within UI, saves both rendered result as a file-read result */
-void RE_WriteRenderResult(RenderResult *rr, const char *filename, int compress)
+int RE_WriteRenderResult(ReportList *reports, RenderResult *rr, const char *filename, int compress)
 {
        RenderLayer *rl;
        RenderPass *rpass;
        void *exrhandle= IMB_exr_get_handle();
+       int success;
 
        BLI_make_existing_file(filename);
        
@@ -864,11 +868,20 @@ void RE_WriteRenderResult(RenderResult *rr, const char *filename, int compress)
                        }
                }
        }
-       
-       IMB_exr_begin_write(exrhandle, filename, rr->rectx, rr->recty, compress);
-       
-       IMB_exr_write_channels(exrhandle);
+
+       /* when the filename has no permissions, this can fail */
+       if(IMB_exr_begin_write(exrhandle, filename, rr->rectx, rr->recty, compress)) {
+               IMB_exr_write_channels(exrhandle);
+               success= TRUE;
+       }
+       else {
+               /* TODO, get the error from openexr's exception */
+               BKE_report(reports, RPT_ERROR, "Error Writing Render Result, see console");
+               success= FALSE;
+       }
        IMB_exr_close(exrhandle);
+
+       return success;
 }
 
 /* callbacks for RE_MultilayerConvert */
@@ -992,9 +1005,10 @@ static int read_render_result_from_file(const char *filename, RenderResult *rr)
 }
 
 /* only for temp buffer files, makes exact copy of render result */
-static void read_render_result(Render *re, int sample)
+static int read_render_result(Render *re, int sample)
 {
        char str[FILE_MAX];
+       int success;
 
        BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
 
@@ -1004,10 +1018,18 @@ static void read_render_result(Render *re, int sample)
        render_unique_exr_name(re, str, sample);
        printf("read exr tmp file: %s\n", str);
 
-       if(!read_render_result_from_file(str, re->result))
+       if(read_render_result_from_file(str, re->result)) {
+               success= TRUE;
+       }
+       else {
                printf("cannot read: %s\n", str);
+               success= FALSE;
+
+       }
 
        BLI_rw_mutex_unlock(&re->resultmutex);
+
+       return success;
 }
 
 /* *************************************************** */
@@ -2981,7 +3003,7 @@ static int do_write_image_or_movie(Render *re, Scene *scene, bMovieHandle *mh, c
                
                if(re->r.imtype==R_MULTILAYER) {
                        if(re->result) {
-                               RE_WriteRenderResult(re->result, name, scene->r.quality);
+                               RE_WriteRenderResult(re->reports, re->result, name, scene->r.quality);
                                printf("Saved: %s", name);
                        }
                }
@@ -3198,7 +3220,7 @@ void RE_PreviewRender(Render *re, Main *bmain, Scene *sce)
 /* note; repeated win/disprect calc... solve that nicer, also in compo */
 
 /* only the temp file! */
-void RE_ReadRenderResult(Scene *scene, Scene *scenode)
+int RE_ReadRenderResult(Scene *scene, Scene *scenode)
 {
        Render *re;
        int winx, winy;
@@ -3232,7 +3254,7 @@ void RE_ReadRenderResult(Scene *scene, Scene *scenode)
        RE_InitState(re, NULL, &scene->r, NULL, winx, winy, &disprect);
        re->scene= scene;
        
-       read_render_result(re, 0);
+       return read_render_result(re, 0);
 }
 
 void RE_set_max_threads(int threads)
index 38d4e79ca91e47f19761fa045fb164eab8c94313..b8e53c87fa9b4e104af9e49a67cc45f8a668b712 100644 (file)
@@ -1483,7 +1483,7 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj,
                {
                        objprop.m_gamesoftFlag = OB_BSB_BENDING_CONSTRAINTS | OB_BSB_SHAPE_MATCHING | OB_BSB_AERO_VPOINT;
                        
-                       objprop.m_soft_linStiff = 0.5;;
+                       objprop.m_soft_linStiff = 0.5;
                        objprop.m_soft_angStiff = 1.f;          /* angular stiffness 0..1 */
                        objprop.m_soft_volume= 1.f;                     /* volume preservation 0..1 */
 
index 7b9cba7770bfed02da3660820c908dcf770f5fd5..9621d05b5cc6fb15b8534c216a04d935ff2065b2 100644 (file)
@@ -46,6 +46,7 @@
 
 #ifdef WITH_AUDASPACE
 #  include "AUD_C-API.h"
+#  include "AUD_ChannelMapperFactory.h"
 #endif
 
 // Actuators
@@ -406,7 +407,23 @@ void BL_ConvertActuators(char* maggiename,
                                                                                "\" has no sound datablock." << std::endl;
                                        }
                                        else
+                                       {
                                                snd_sound = *reinterpret_cast<AUD_Reference<AUD_IFactory>*>(sound->playback_handle);
+
+                                               // if sound shall be 3D but isn't mono, we have to make it mono!
+                                               if(is3d)
+                                               {
+                                                       AUD_Reference<AUD_IReader> reader = snd_sound->createReader();
+                                                       if(reader->getSpecs().channels != AUD_CHANNELS_MONO)
+                                                       {
+                                                               AUD_DeviceSpecs specs;
+                                                               specs.channels = AUD_CHANNELS_MONO;
+                                                               specs.rate = AUD_RATE_INVALID;
+                                                               specs.format = AUD_FORMAT_INVALID;
+                                                               snd_sound = new AUD_ChannelMapperFactory(snd_sound, specs);
+                                                       }
+                                               }
+                                       }
                                        KX_SoundActuator* tmpsoundact =
                                                new KX_SoundActuator(gameobj,
                                                snd_sound,
index 741448b10961727b3ba2805d9877ae48bbbacac8..f90f1e19a67915f2dfef3301877d479fd240f708 100644 (file)
@@ -105,7 +105,7 @@ public:
        };
 
        SCA_ISensor(SCA_IObject* gameobj,
-                               class SCA_EventManager* eventmgr);;
+                               class SCA_EventManager* eventmgr);
        ~SCA_ISensor();
        virtual void    ReParent(SCA_IObject* parent);
 
index d51e2aa538608c240ebc2735537f594fa02b714f..7ced0c0c4d79d338e1593befa3e670b4cf04712d 100644 (file)
@@ -3124,7 +3124,7 @@ KX_PYMETHODDEF_DOC(KX_GameObject, getActionFrame,
 
        layer_check(layer, "getActionFrame");
 
-       return PyLong_FromLong(GetActionFrame(layer));
+       return PyFloat_FromDouble(GetActionFrame(layer));
 }
 
 KX_PYMETHODDEF_DOC(KX_GameObject, setActionFrame,
index 06db84feb238373a7bf17c633ac58ab24c97d84c..8557ebab0a9b3a4d6aa89a8c1ec2147b82cd6c2c 100644 (file)
@@ -1208,6 +1208,28 @@ static PyObject* gPyGetMaterialType(PyObject*)
        return PyLong_FromSsize_t(flag);
 }
 
+static PyObject* gPySetAnisotropicFiltering(PyObject*, PyObject* args)
+{
+       short level;
+
+       if (!PyArg_ParseTuple(args, "h:setAnisotropicFiltering", &level))
+               return NULL;
+
+       if (level != 1 && level != 2 && level != 4 && level != 8 && level != 16) {
+               PyErr_SetString(PyExc_ValueError, "Rasterizer.setAnisotropicFiltering(level): Expected value of 1, 2, 4, 8, or 16 for value");
+               return NULL;
+       }
+
+       gp_Rasterizer->SetAnisotropicFiltering(level);
+
+       Py_RETURN_NONE;
+}
+
+static PyObject* gPyGetAnisotropicFiltering(PyObject*, PyObject* args)
+{
+       return PyLong_FromLong(gp_Rasterizer->GetAnisotropicFiltering());
+}
+
 static PyObject* gPyDrawLine(PyObject*, PyObject* args)
 {
        PyObject* ob_from;
@@ -1272,6 +1294,10 @@ static struct PyMethodDef rasterizer_methods[] = {
    METH_VARARGS, "set the state of a GLSL material setting"},
   {"getGLSLMaterialSetting",(PyCFunction) gPyGetGLSLMaterialSetting,
    METH_VARARGS, "get the state of a GLSL material setting"},
+  {"setAnisotropicFiltering", (PyCFunction) gPySetAnisotropicFiltering,
+  METH_VARARGS, "set the anisotropic filtering level (must be one of 1, 2, 4, 8, 16)"},
+  {"getAnisotropicFiltering", (PyCFunction) gPyGetAnisotropicFiltering,
+  METH_VARARGS, "get the anisotropic filtering level"},
   {"drawLine", (PyCFunction) gPyDrawLine,
    METH_VARARGS, "draw a line on the screen"},
   { NULL, (PyCFunction) NULL, 0, NULL }
index 305e2bca75616bf55f3d8d2712294b113324ba7e..c46ebf742a0dc4cab97228c787029c66c3ca45c7 100644 (file)
@@ -417,6 +417,9 @@ public:
 
        virtual void    SetBlendingMode(int blendmode)=0;
        virtual void    SetFrontFace(bool ccw)=0;
+
+       virtual void    SetAnisotropicFiltering(short level)=0;
+       virtual short   GetAnisotropicFiltering()=0;
        
        
 #ifdef WITH_CXX_GUARDEDALLOC
index 55f36dcd772484e3020112c96096e2e5c2e00f90..98459bf53af9b2ec99d9a66b1e1c3fb330ffc8c7 100644 (file)
@@ -99,12 +99,16 @@ RAS_OpenGLRasterizer::RAS_OpenGLRasterizer(RAS_ICanvas* canvas)
                hinterlace_mask[i] = (i&1)*0xFFFFFFFF;
        }
        hinterlace_mask[32] = 0;
+
+       m_prevafvalue = GPU_get_anisotropic();
 }
 
 
 
 RAS_OpenGLRasterizer::~RAS_OpenGLRasterizer()
 {
+       // Restore the previous AF value
+       GPU_set_anisotropic(m_prevafvalue);
 }
 
 bool RAS_OpenGLRasterizer::Init()
@@ -1204,3 +1208,12 @@ void RAS_OpenGLRasterizer::SetFrontFace(bool ccw)
        m_last_frontface = ccw;
 }
 
+void RAS_OpenGLRasterizer::SetAnisotropicFiltering(short level)
+{
+       GPU_set_anisotropic((float)level);
+}
+
+short RAS_OpenGLRasterizer::GetAnisotropicFiltering()
+{
+       return (short)GPU_get_anisotropic();
+}
index 54fab906049360d6d3dc54d28347cfc672c2c0ac..61568df91ebf336c3f52fc10211156dea4176f1d 100644 (file)
@@ -94,6 +94,8 @@ class RAS_OpenGLRasterizer : public RAS_IRasterizer
        bool                    m_setfocallength;
        int                             m_noOfScanlines;
 
+       short                   m_prevafvalue;
+
        //motion blur
        int     m_motionblur;
        float   m_motionblurvalue;
@@ -294,6 +296,9 @@ public:
        virtual void    SetBlendingMode(int blendmode);
        virtual void    SetFrontFace(bool ccw);
        
+       virtual void    SetAnisotropicFiltering(short level);
+       virtual short   GetAnisotropicFiltering();
+       
        
 #ifdef WITH_CXX_GUARDEDALLOC
 public:
index 2478727a6be350a6d2e0b43937d8fc31d4a4959c..d0536ed2801bf026a5d070b4b2e68ed4ec0b79db 100644 (file)
@@ -141,7 +141,7 @@ protected:
        /// calculate one color component
        unsigned int calcColor (unsigned int val, short idx)
        {
-               unsigned int col = VT_C(val,idx);;
+               unsigned int col = VT_C(val,idx);
                if (col <= levels[idx][0]) col = 0;
                else if (col >= levels[idx][1]) col = 0xFF;
                else col = (((col - levels[idx][0]) << 8) / levels[idx][2]) & 0xFF;
index 7a8226aab037f1417d3f07006bfba5925e4baee5..aeef5d1694f65f8e9a921be48b22fb45c0b05b95 100644 (file)
@@ -135,7 +135,7 @@ PyObject * setWeight (PyImage * self, PyObject * args)
                if (!getImageMix(self)->setWeight(id, weight))
                {
                        // if not set, report error
-                       PyErr_SetString(PyExc_RuntimeError, "Invalid id of source");;
+                       PyErr_SetString(PyExc_RuntimeError, "Invalid id of source");
                        return NULL;
                }
        // return none